From 1c2df9a2458897ff6c2393913b2723457e42a0da Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Mon, 23 Nov 2009 05:48:11 +0000 Subject: Simplified the automake build using configure options instead of environment variables and cleaned up some of the makefile.am files. Adjusted build instructions. Moved directories that don't yet build or work out of the main build dir and obsolete docs to a contrib dir. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@883254 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/AUTHORS | 2 + sca-cpp/trunk/GettingStarted.html | 487 ------- sca-cpp/trunk/INSTALL | 52 +- sca-cpp/trunk/Makefile.am | 32 +- sca-cpp/trunk/NOTICE | 7 +- sca-cpp/trunk/README | 99 +- sca-cpp/trunk/build.sh | 22 - sca-cpp/trunk/builddist.sh | 23 - sca-cpp/trunk/configure.ac | 346 ++--- sca-cpp/trunk/configure.sh | 80 -- sca-cpp/trunk/contrib/doc/Axis2CWSExtension.html | 498 +++++++ sca-cpp/trunk/contrib/doc/CPPGeneratorTool.txt | 362 +++++ sca-cpp/trunk/contrib/doc/CppExtension.html | 430 ++++++ sca-cpp/trunk/contrib/doc/PythonExtension.html | 281 ++++ sca-cpp/trunk/contrib/doc/RESTExtension.html | 291 ++++ sca-cpp/trunk/contrib/doc/RubyExtension.html | 292 +++++ sca-cpp/trunk/contrib/doc/SCAExtension.html | 173 +++ sca-cpp/trunk/contrib/doc/css/maven-base.css | 168 +++ sca-cpp/trunk/contrib/doc/css/maven-theme.css | 173 +++ sca-cpp/trunk/contrib/runtime/Makefile.am | 19 + sca-cpp/trunk/contrib/runtime/core/Makefile.am | 22 + sca-cpp/trunk/contrib/runtime/core/src/Makefile.am | 78 ++ .../core/src/tuscany/sca/core/Exceptions.cpp | 285 ++++ .../runtime/core/src/tuscany/sca/core/Exceptions.h | 346 +++++ .../core/src/tuscany/sca/core/Operation.cpp | 578 ++++++++ .../runtime/core/src/tuscany/sca/core/Operation.h | 251 ++++ .../core/src/tuscany/sca/core/SCARuntime.cpp | 616 +++++++++ .../runtime/core/src/tuscany/sca/core/SCARuntime.h | 295 +++++ .../core/src/tuscany/sca/core/ServiceProxy.cpp | 50 + .../core/src/tuscany/sca/core/ServiceProxy.h | 75 ++ .../core/src/tuscany/sca/core/ServiceWrapper.cpp | 50 + .../core/src/tuscany/sca/core/ServiceWrapper.h | 77 ++ .../contrib/runtime/core/src/tuscany/sca/export.h | 41 + .../sca/extension/ImplementationExtension.cpp | 46 + .../sca/extension/ImplementationExtension.h | 79 ++ .../tuscany/sca/extension/InterfaceExtension.cpp | 47 + .../src/tuscany/sca/extension/InterfaceExtension.h | 78 ++ .../sca/extension/ReferenceBindingExtension.cpp | 46 + .../sca/extension/ReferenceBindingExtension.h | 81 ++ .../sca/extension/ServiceBindingExtension.cpp | 46 + .../sca/extension/ServiceBindingExtension.h | 81 ++ .../runtime/core/src/tuscany/sca/model/Binding.cpp | 49 + .../runtime/core/src/tuscany/sca/model/Binding.h | 83 ++ .../core/src/tuscany/sca/model/Component.cpp | 148 +++ .../runtime/core/src/tuscany/sca/model/Component.h | 183 +++ .../core/src/tuscany/sca/model/ComponentType.cpp | 294 +++++ .../core/src/tuscany/sca/model/ComponentType.h | 186 +++ .../core/src/tuscany/sca/model/Composite.cpp | 427 ++++++ .../runtime/core/src/tuscany/sca/model/Composite.h | 250 ++++ .../src/tuscany/sca/model/CompositeReference.cpp | 68 + .../src/tuscany/sca/model/CompositeReference.h | 93 ++ .../sca/model/CompositeReferenceBinding.cpp | 62 + .../tuscany/sca/model/CompositeReferenceBinding.h | 98 ++ .../src/tuscany/sca/model/CompositeService.cpp | 70 + .../core/src/tuscany/sca/model/CompositeService.h | 83 ++ .../core/src/tuscany/sca/model/Contract.cpp | 49 + .../runtime/core/src/tuscany/sca/model/Contract.h | 85 ++ .../core/src/tuscany/sca/model/Interface.cpp | 49 + .../runtime/core/src/tuscany/sca/model/Interface.h | 90 ++ .../core/src/tuscany/sca/model/ModelLoader.cpp | 939 +++++++++++++ .../core/src/tuscany/sca/model/ModelLoader.h | 122 ++ .../core/src/tuscany/sca/model/Reference.cpp | 77 ++ .../runtime/core/src/tuscany/sca/model/Reference.h | 126 ++ .../src/tuscany/sca/model/ReferenceBinding.cpp | 75 ++ .../core/src/tuscany/sca/model/ReferenceBinding.h | 116 ++ .../core/src/tuscany/sca/model/ReferenceType.cpp | 88 ++ .../core/src/tuscany/sca/model/ReferenceType.h | 138 ++ .../runtime/core/src/tuscany/sca/model/Service.cpp | 58 + .../runtime/core/src/tuscany/sca/model/Service.h | 101 ++ .../core/src/tuscany/sca/model/ServiceBinding.cpp | 51 + .../core/src/tuscany/sca/model/ServiceBinding.h | 89 ++ .../core/src/tuscany/sca/model/ServiceType.cpp | 62 + .../core/src/tuscany/sca/model/ServiceType.h | 108 ++ .../core/src/tuscany/sca/model/WSDLDefinition.cpp | 633 +++++++++ .../core/src/tuscany/sca/model/WSDLDefinition.h | 180 +++ .../core/src/tuscany/sca/model/WSDLInterface.cpp | 107 ++ .../core/src/tuscany/sca/model/WSDLInterface.h | 99 ++ .../core/src/tuscany/sca/model/WSDLMessagePart.cpp | 70 + .../core/src/tuscany/sca/model/WSDLMessagePart.h | 113 ++ .../core/src/tuscany/sca/model/WSDLOperation.cpp | 193 +++ .../core/src/tuscany/sca/model/WSDLOperation.h | 196 +++ .../runtime/core/src/tuscany/sca/model/Wire.cpp | 53 + .../runtime/core/src/tuscany/sca/model/Wire.h | 94 ++ .../core/src/tuscany/sca/util/DefaultLogWriter.cpp | 51 + .../core/src/tuscany/sca/util/DefaultLogWriter.h | 51 + .../runtime/core/src/tuscany/sca/util/File.cpp | 243 ++++ .../runtime/core/src/tuscany/sca/util/File.h | 160 +++ .../core/src/tuscany/sca/util/FileLogWriter.cpp | 57 + .../core/src/tuscany/sca/util/FileLogWriter.h | 58 + .../runtime/core/src/tuscany/sca/util/Library.cpp | 175 +++ .../runtime/core/src/tuscany/sca/util/Library.h | 103 ++ .../core/src/tuscany/sca/util/LogWriter.cpp | 37 + .../runtime/core/src/tuscany/sca/util/LogWriter.h | 53 + .../runtime/core/src/tuscany/sca/util/Logger.cpp | 276 ++++ .../runtime/core/src/tuscany/sca/util/Logger.h | 136 ++ .../runtime/core/src/tuscany/sca/util/Logging.h | 44 + .../runtime/core/src/tuscany/sca/util/Mutex.cpp | 103 ++ .../runtime/core/src/tuscany/sca/util/Mutex.h | 84 ++ .../runtime/core/src/tuscany/sca/util/Queue.cpp | 222 ++++ .../runtime/core/src/tuscany/sca/util/Queue.h | 93 ++ .../runtime/core/src/tuscany/sca/util/SDOUtils.cpp | 438 +++++++ .../runtime/core/src/tuscany/sca/util/SDOUtils.h | 106 ++ .../runtime/core/src/tuscany/sca/util/Thread.cpp | 124 ++ .../runtime/core/src/tuscany/sca/util/Thread.h | 90 ++ .../core/src/tuscany/sca/util/ThreadLocal.cpp | 114 ++ .../core/src/tuscany/sca/util/ThreadLocal.h | 84 ++ .../runtime/core/src/tuscany/sca/util/Utils.cpp | 598 +++++++++ .../runtime/core/src/tuscany/sca/util/Utils.h | 76 ++ .../trunk/contrib/runtime/core/test/Makefile.am | 17 + .../contrib/runtime/core/test/SCATestMacros.h | 84 ++ sca-cpp/trunk/contrib/runtime/core/test/main.cpp | 95 ++ .../trunk/contrib/runtime/core/test/sca_test.bat | 43 + .../trunk/contrib/runtime/core/test/sca_test.sh | 40 + .../runtime/core/test/wsdlTests/BaseWsdlTest.cpp | 127 ++ .../runtime/core/test/wsdlTests/BaseWsdlTest.h | 50 + .../core/test/wsdlTests/WSDLDefinitionTest.cpp | 67 + .../core/test/wsdlTests/WSDLDefinitionTest.h | 40 + .../runtime/core/test/wsdlTests/WSDLErrorsTest.cpp | 545 ++++++++ .../runtime/core/test/wsdlTests/WSDLErrorsTest.h | 34 + .../runtime/core/test/wsdlTests/wsdlTests.h | 34 + .../core/test/wsdlTests/wsdls_correct/simple.wsdl | 74 ++ .../wsdls_erroneous/duplicate_binding_input.wsdl | 67 + .../wsdls_erroneous/duplicate_binding_output.wsdl | 67 + .../wsdls_erroneous/duplicate_bindings.wsdl | 77 ++ .../wsdls_erroneous/duplicate_messages.wsdl | 67 + .../wsdls_erroneous/duplicate_partnames.wsdl | 65 + .../wsdls_erroneous/duplicate_portTypes.wsdl | 72 + .../wsdls_erroneous/duplicate_services.wsdl | 70 + .../wsdls_erroneous/duplicate_soap_address.wsdl | 46 + .../wsdls_erroneous/duplicate_soap_binding.wsdl | 41 + .../wsdls_erroneous/duplicate_soap_body.wsdl | 41 + .../wsdls_erroneous/duplicate_soap_operation.wsdl | 41 + .../wsdls_erroneous/missing_binding_for_port.wsdl | 43 + .../wsdlTests/wsdls_erroneous/missing_message.wsdl | 40 + .../wsdls_erroneous/missing_name_for_part.wsdl | 43 + .../wsdls_erroneous/missing_name_for_port.wsdl | 43 + .../wsdls_erroneous/missing_operation.wsdl | 40 + .../wsdls_erroneous/missing_portType.wsdl | 40 + .../wsdls_erroneous/missing_type_for_part.wsdl | 43 + .../trunk/contrib/runtime/core/xsd/sca-core.xsd | 182 +++ .../core/xsd/sca-implementation-composite.xsd | 38 + .../runtime/core/xsd/sca-implementation-java.xsd | 38 + .../runtime/core/xsd/sca-interface-java.xsd | 39 + .../runtime/core/xsd/sca-interface-wsdl.xsd | 39 + sca-cpp/trunk/contrib/runtime/core/xsd/sca.xsd | 31 + sca-cpp/trunk/contrib/runtime/core/xsd/tuscany.xsd | 50 + sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11.xsd | 307 +++++ .../contrib/runtime/core/xsd/wsdl_11_http.xsd | 74 ++ .../contrib/runtime/core/xsd/wsdl_11_mime.xsd | 71 + .../contrib/runtime/core/xsd/wsdl_11_soap.xsd | 146 +++ .../contrib/runtime/core/xsd/wsdl_11_soap12.xsd | 140 ++ .../trunk/contrib/runtime/extensions/Makefile.am | 45 + .../contrib/runtime/extensions/cpp/Makefile.am | 24 + .../contrib/runtime/extensions/cpp/src/Makefile.am | 55 + .../cpp/src/osoa/sca/ComponentContext.cpp | 150 +++ .../extensions/cpp/src/osoa/sca/ComponentContext.h | 117 ++ .../cpp/src/osoa/sca/CompositeContext.cpp | 127 ++ .../extensions/cpp/src/osoa/sca/CompositeContext.h | 99 ++ .../cpp/src/osoa/sca/ServiceRuntimeException.h | 105 ++ .../runtime/extensions/cpp/src/osoa/sca/export.h | 42 + .../runtime/extensions/cpp/src/osoa/sca/sca.h | 31 + .../cpp/src/tuscany/sca/cpp/CPPExtension.cpp | 72 + .../cpp/src/tuscany/sca/cpp/CPPExtension.h | 57 + .../tuscany/sca/cpp/CPPImplementationExtension.cpp | 101 ++ .../tuscany/sca/cpp/CPPImplementationExtension.h | 74 ++ .../src/tuscany/sca/cpp/CPPInterfaceExtension.cpp | 71 + .../src/tuscany/sca/cpp/CPPInterfaceExtension.h | 74 ++ .../cpp/src/tuscany/sca/cpp/CPPServiceProxy.cpp | 192 +++ .../cpp/src/tuscany/sca/cpp/CPPServiceProxy.h | 117 ++ .../cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp | 194 +++ .../cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h | 155 +++ .../src/tuscany/sca/cpp/ComponentContextImpl.cpp | 208 +++ .../cpp/src/tuscany/sca/cpp/ComponentContextImpl.h | 119 ++ .../src/tuscany/sca/cpp/CompositeContextImpl.cpp | 128 ++ .../cpp/src/tuscany/sca/cpp/CompositeContextImpl.h | 89 ++ .../cpp/src/tuscany/sca/cpp/TuscanyRuntime.cpp | 83 ++ .../cpp/src/tuscany/sca/cpp/TuscanyRuntime.h | 77 ++ .../tuscany/sca/cpp/model/CPPImplementation.cpp | 90 ++ .../src/tuscany/sca/cpp/model/CPPImplementation.h | 163 +++ .../cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp | 63 + .../cpp/src/tuscany/sca/cpp/model/CPPInterface.h | 117 ++ .../tuscany/sca/cpp/model/CPPReferenceBinding.cpp | 61 + .../tuscany/sca/cpp/model/CPPReferenceBinding.h | 87 ++ .../tuscany/sca/cpp/model/CPPServiceBinding.cpp | 54 + .../src/tuscany/sca/cpp/model/CPPServiceBinding.h | 81 ++ .../runtime/extensions/cpp/tools/Makefile.am | 25 + .../extensions/cpp/tools/scagen/META-INF/LICENSE | 177 +++ .../extensions/cpp/tools/scagen/META-INF/NOTICE | 5 + .../extensions/cpp/tools/scagen/META-INF/README | 19 + .../extensions/cpp/tools/scagen/Makefile.am | 35 + .../runtime/extensions/cpp/tools/scagen/build.xml | 151 +++ .../sca/cpp/tools/junit/CalculatorTest.java | 33 + .../sca/cpp/tools/junit/EnvHandlerTest.java | 48 + ...mplClassWithNameSpaceButNotInClassAttrTest.java | 48 + .../tools/junit/ImplClassWithNameSpaceTest.java | 48 + ...ntfClassWithNameSpaceButNotInClassAttrTest.java | 48 + .../tools/junit/IntfClassWithNameSpaceTest.java | 48 + .../junit/MissingCompositeAndFragmentTest.java | 48 + .../junit/SimplePublicPrivateProtectedTest.java | 49 + .../sca/cpp/tools/junit/TestAllCompositesTest.java | 89 ++ .../sca/cpp/tools/junit/TestDeployAssistTool.java | 97 ++ .../sca/cpp/tools/junit/TuscanyTestCase.java | 341 +++++ .../CalculatorCompositeAndComponent/Calculator.h | 36 + .../CalculatorImpl.componentType | 25 + .../CalculatorImpl.h | 37 + .../CalculatorCompositeAndComponent/sca.composite | 28 + .../otherSubFolder/CalculatorBack.h | 36 + .../otherSubFolder/CalculatorForward.h | 35 + .../CalculatorSlashDirectionTest/sca.composite | 31 + .../subFolder/CalculatorBackImpl.componentType | 26 + .../subFolder/CalculatorBackImpl.h | 37 + .../subFolder/CalculatorForwardImpl.componentType | 25 + .../subFolder/CalculatorForwardImpl.h | 37 + .../CustomerInfo.fragment | 39 + .../CustomerInfo.h | 98 ++ .../CustomerInfoImpl.componentType | 33 + .../CustomerInfoImpl.h | 38 + .../CustomerInfo.fragment | 39 + .../CustomerInfo.h | 94 ++ .../CustomerInfoImpl.componentType | 33 + .../CustomerInfoImpl.h | 47 + .../MyValueServiceComposite/CustomerInfo.fragment | 39 + .../MyValueServiceComposite/CustomerInfo.h | 36 + .../CustomerInfoImpl.componentType | 33 + .../MyValueServiceComposite/CustomerInfoImpl.h | 49 + .../composites/MyValueServiceComposite/MyValue.h | 40 + .../MyValueImpl.componentType | 39 + .../MyValueServiceComposite/MyValueImpl.hpp | 43 + .../MyValueImpl_stockQuote_Proxy.h | 38 + .../MyValueServiceComposite/StockQuoteService.h | 37 + .../MyValueServiceComposite/sca.composite | 60 + .../CustomerInfo.fragment | 39 + .../CustomerInfo.h | 41 + .../CustomerInfoImpl.componentType | 33 + .../CustomerInfoImpl.h | 52 + .../MyValue.h | 40 + .../MyValueImpl.componentType | 39 + .../MyValueImpl.hpp | 43 + .../MyValueImpl_stockQuote_Proxy.h | 38 + .../StockQuoteService.h | 37 + .../sca.composite | 60 + .../MyValue.h | 40 + .../MyValueImpl.componentType | 30 + .../MyValueImpl.hpp | 47 + .../sca.composite | 48 + .../MyValue.h | 43 + .../MyValueImpl.componentType | 29 + .../MyValueImpl.hpp | 43 + .../sca.composite | 49 + .../MyValue.h | 41 + .../MyValueImpl.componentType | 29 + .../MyValueImpl.hpp | 43 + .../sca.composite | 49 + .../CustomerInfo.fragmentX | 38 + .../sca.compositeX | 60 + .../CustomerInfo.fragment | 39 + .../CustomerInfo.h | 41 + .../CustomerInfoImpl.componentType | 33 + .../CustomerInfoImpl.h | 49 + .../MyValueServiceCompositeTwoClasses/MyValue.h | 40 + .../MyValueImpl.componentType | 39 + .../MyValueImpl.hpp | 43 + .../MyValueImpl_stockQuote_Proxy.h | 38 + .../StockQuoteService.h | 37 + .../sca.composite | 60 + .../CustomerInfo.fragment | 40 + .../CustomerInfo.h | 45 + .../CustomerInfoImpl.componentType | 33 + .../CustomerInfoImpl.h | 39 + .../CalculatorImpl_CalculatorService_Proxy.cpp | 65 + .../CalculatorImpl_CalculatorService_Proxy.h | 41 + .../CalculatorImpl_CalculatorService_Wrapper.cpp | 84 ++ .../CalculatorImpl_CalculatorService_Wrapper.h | 43 + .../CalculatorBackImpl_CalculatorService_Proxy.cpp | 76 ++ .../CalculatorBackImpl_CalculatorService_Proxy.h | 42 + ...alculatorBackImpl_CalculatorService_Wrapper.cpp | 101 ++ .../CalculatorBackImpl_CalculatorService_Wrapper.h | 43 + ...lculatorForwardImpl_CalculatorService_Proxy.cpp | 76 ++ ...CalculatorForwardImpl_CalculatorService_Proxy.h | 42 + ...ulatorForwardImpl_CalculatorService_Wrapper.cpp | 101 ++ ...lculatorForwardImpl_CalculatorService_Wrapper.h | 43 + .../CustomerInfoImpl_CustomerInfoService_Proxy.cpp | 594 +++++++++ .../CustomerInfoImpl_CustomerInfoService_Proxy.h | 90 ++ ...ustomerInfoImpl_CustomerInfoService_Wrapper.cpp | 872 ++++++++++++ .../CustomerInfoImpl_CustomerInfoService_Wrapper.h | 43 + .../CustomerInfoImpl_CustomerInfoService_Proxy.cpp | 504 +++++++ .../CustomerInfoImpl_CustomerInfoService_Proxy.h | 86 ++ ...ustomerInfoImpl_CustomerInfoService_Wrapper.cpp | 760 +++++++++++ .../CustomerInfoImpl_CustomerInfoService_Wrapper.h | 43 + ...CustomerInfoImpl2_CustomerInfoService_Proxy.cpp | 64 + .../CustomerInfoImpl2_CustomerInfoService_Proxy.h | 41 + ...stomerInfoImpl2_CustomerInfoService_Wrapper.cpp | 83 ++ ...CustomerInfoImpl2_CustomerInfoService_Wrapper.h | 43 + .../MyValueImpl_MyValueService_Proxy.cpp | 92 ++ .../MyValueImpl_MyValueService_Proxy.h | 44 + .../MyValueImpl_MyValueService_Wrapper.cpp | 122 ++ .../MyValueImpl_MyValueService_Wrapper.h | 43 + .../MyValueImpl_customerInfo_Proxy.cpp | 64 + .../MyValueImpl_customerInfo_Proxy.h | 41 + .../MyValueImpl_stockQuote_Proxy.cpp | 64 + .../expected_output/MyValueImpl_stockQuote_Proxy.h | 41 + .../CustomerInfoImpl_CustomerInfoService_Proxy.cpp | 64 + .../CustomerInfoImpl_CustomerInfoService_Proxy.h | 41 + ...ustomerInfoImpl_CustomerInfoService_Wrapper.cpp | 83 ++ .../CustomerInfoImpl_CustomerInfoService_Wrapper.h | 43 + .../MyValueImpl_MyValueService_Proxy.cpp | 92 ++ .../MyValueImpl_MyValueService_Proxy.h | 44 + .../MyValueImpl_MyValueService_Wrapper.cpp | 122 ++ .../MyValueImpl_MyValueService_Wrapper.h | 43 + .../MyValueImpl_customerInfo_Proxy.cpp | 64 + .../MyValueImpl_customerInfo_Proxy.h | 41 + .../MyValueImpl_stockQuote_Proxy.cpp | 64 + .../expected_output/MyValueImpl_stockQuote_Proxy.h | 41 + .../MyValueImpl_MyValueService_Proxy.cpp | 92 ++ .../MyValueImpl_MyValueService_Proxy.h | 44 + .../MyValueImpl_MyValueService_Wrapper.cpp | 122 ++ .../MyValueImpl_MyValueService_Wrapper.h | 43 + .../MyValueImpl_MyValueService_Proxy.cpp | 92 ++ .../MyValueImpl_MyValueService_Proxy.h | 44 + .../MyValueImpl_MyValueService_Wrapper.cpp | 122 ++ .../MyValueImpl_MyValueService_Wrapper.h | 43 + .../MyValueImpl_MyValueService_Proxy.cpp | 92 ++ .../MyValueImpl_MyValueService_Proxy.h | 44 + .../MyValueImpl_MyValueService_Wrapper.cpp | 122 ++ .../MyValueImpl_MyValueService_Wrapper.h | 43 + ...CustomerInfoImpl2_CustomerInfoService_Proxy.cpp | 64 + .../CustomerInfoImpl2_CustomerInfoService_Proxy.h | 41 + ...stomerInfoImpl2_CustomerInfoService_Wrapper.cpp | 83 ++ ...CustomerInfoImpl2_CustomerInfoService_Wrapper.h | 43 + .../MyValueImpl_MyValueService_Proxy.cpp | 92 ++ .../MyValueImpl_MyValueService_Proxy.h | 44 + .../MyValueImpl_MyValueService_Wrapper.cpp | 122 ++ .../MyValueImpl_MyValueService_Wrapper.h | 43 + .../MyValueImpl_customerInfo_Proxy.cpp | 64 + .../MyValueImpl_customerInfo_Proxy.h | 41 + .../MyValueImpl_stockQuote_Proxy.cpp | 64 + .../expected_output/MyValueImpl_stockQuote_Proxy.h | 41 + .../CustomerInfoImpl_CustomerInfoService_Proxy.cpp | 87 ++ .../CustomerInfoImpl_CustomerInfoService_Proxy.h | 43 + ...ustomerInfoImpl_CustomerInfoService_Wrapper.cpp | 118 ++ .../CustomerInfoImpl_CustomerInfoService_Wrapper.h | 43 + .../extensions/cpp/tools/scagen/lib/readme.txt | 4 + .../runtime/extensions/cpp/tools/scagen/scagen.bat | 19 + .../runtime/extensions/cpp/tools/scagen/scagen.sh | 21 + .../tuscany/sca/cpp/tools/common/BodyPart.java | 96 ++ .../tuscany/sca/cpp/tools/common/CParsingTool.java | 124 ++ .../sca/cpp/tools/common/Configuration.java | 132 ++ .../sca/cpp/tools/common/DirectoryTree.java | 105 ++ .../tuscany/sca/cpp/tools/common/FileActor.java | 37 + .../tuscany/sca/cpp/tools/common/FilePart.java | 80 ++ .../tuscany/sca/cpp/tools/common/Headers.java | 167 +++ .../sca/cpp/tools/common/InputCppSourceCode.java | 425 ++++++ .../tuscany/sca/cpp/tools/common/MacroPart.java | 87 ++ .../tuscany/sca/cpp/tools/common/MethodPart.java | 133 ++ .../tuscany/sca/cpp/tools/common/Options.java | 164 +++ .../tuscany/sca/cpp/tools/common/Parameter.java | 216 +++ .../sca/cpp/tools/common/ParsingException.java | 48 + .../sca/cpp/tools/common/PrototypePart.java | 56 + .../tuscany/sca/cpp/tools/common/Signature.java | 506 +++++++ .../apache/tuscany/sca/cpp/tools/common/Utils.java | 556 ++++++++ .../tuscany/sca/cpp/tools/common/package.html | 58 + .../tools/services/ComponentDomNodeHandler.java | 366 ++++++ .../tools/services/ComponentTypeFileHandler.java | 130 ++ .../services/CompositeOrFragmentFileHandler.java | 91 ++ .../sca/cpp/tools/services/DirectoryScanner.java | 93 ++ .../tuscany/sca/cpp/tools/services/DomHandler.java | 83 ++ .../sca/cpp/tools/services/DomNodeHandler.java | 46 + .../cpp/tools/services/GenericDomNodeHandler.java | 220 ++++ .../sca/cpp/tools/services/LittleClass.java | 33 + .../tools/services/ReferenceDomNodeHandler.java | 75 ++ .../tuscany/sca/cpp/tools/services/Scagen.java | 176 +++ .../cpp/tools/services/ServiceDomNodeHandler.java | 71 + .../sca/cpp/tools/services/ServicesGenerator.java | 831 ++++++++++++ .../sca/cpp/tools/services/XMLFileActor.java | 208 +++ .../tuscany/sca/cpp/tools/services/package.html | 159 +++ .../cpp/tools/services/xsl/SCA4CPPIntfProxyCPP.xsl | 278 ++++ .../tools/services/xsl/SCA4CPPIntfProxyHeader.xsl | 228 ++++ .../tools/services/xsl/SCA4CPPIntfWrapperCPP.xsl | 290 ++++ .../services/xsl/SCA4CPPIntfWrapperHeader.xsl | 191 +++ .../extensions/cpp/xsd/sca-implementation-cpp.xsd | 51 + .../extensions/cpp/xsd/sca-interface-cpp.xsd | 45 + .../trunk/contrib/runtime/extensions/php/AUTHORS | 0 .../trunk/contrib/runtime/extensions/php/COPYING | 203 +++ .../trunk/contrib/runtime/extensions/php/ChangeLog | 0 .../trunk/contrib/runtime/extensions/php/INSTALL | 2 + .../trunk/contrib/runtime/extensions/php/LICENSE | 177 +++ .../contrib/runtime/extensions/php/Makefile.am | 24 + sca-cpp/trunk/contrib/runtime/extensions/php/NEWS | 0 .../trunk/contrib/runtime/extensions/php/NOTICE | 5 + .../trunk/contrib/runtime/extensions/php/README | 276 ++++ .../contrib/runtime/extensions/php/autogen.sh | 31 + .../trunk/contrib/runtime/extensions/php/build.sh | 55 + .../contrib/runtime/extensions/php/configure.ac | 79 ++ .../runtime/extensions/php/samples/Makefile.am | 18 + .../php/samples/PHPCalculator/Makefile.am | 21 + .../extensions/php/samples/PHPCalculator/README | 32 + .../PHPCalculator/sample.calculator.app.composite | 28 + .../sample.calculator.client/Makefile.am | 24 + .../sample.calculator.client/calculator_client.py | 50 + .../sample.calculator.client/runclient.sh | 48 + .../sample.calculator/Calculator.componentType | 31 + .../PHPCalculator/sample.calculator/Calculator.php | 89 ++ .../sample.calculator/Divide.componentType | 29 + .../PHPCalculator/sample.calculator/Divide.php | 47 + .../sample.calculator/Log.componentType | 25 + .../PHPCalculator/sample.calculator/Log.php | 36 + .../PHPCalculator/sample.calculator/Makefile.am | 23 + .../PHPCalculator/sample.calculator/Multiply.php | 39 + .../sample.calculator/sample.calculator.composite | 44 + .../contrib/runtime/extensions/php/src/Makefile.am | 57 + .../php/src/tuscany/sca/php/PHPExtension.cpp | 71 + .../php/src/tuscany/sca/php/PHPExtension.h | 57 + .../tuscany/sca/php/PHPImplementationExtension.cpp | 73 ++ .../tuscany/sca/php/PHPImplementationExtension.h | 74 ++ .../src/tuscany/sca/php/PHPInterfaceExtension.cpp | 76 ++ .../src/tuscany/sca/php/PHPInterfaceExtension.h | 74 ++ .../php/src/tuscany/sca/php/PHPServiceProxy.cpp | 81 ++ .../php/src/tuscany/sca/php/PHPServiceProxy.h | 83 ++ .../php/src/tuscany/sca/php/PHPServiceWrapper.cpp | 505 +++++++ .../php/src/tuscany/sca/php/PHPServiceWrapper.h | 112 ++ .../extensions/php/src/tuscany/sca/php/export.h | 41 + .../tuscany/sca/php/model/PHPImplementation.cpp | 85 ++ .../src/tuscany/sca/php/model/PHPImplementation.h | 95 ++ .../php/src/tuscany/sca/php/model/PHPInterface.cpp | 53 + .../php/src/tuscany/sca/php/model/PHPInterface.h | 77 ++ .../tuscany/sca/php/model/PHPReferenceBinding.cpp | 61 + .../tuscany/sca/php/model/PHPReferenceBinding.h | 82 ++ .../tuscany/sca/php/model/PHPServiceBinding.cpp | 58 + .../src/tuscany/sca/php/model/PHPServiceBinding.h | 81 ++ .../extensions/php/src/tuscany/sca/php/php_sca.h | 132 ++ .../extensions/php/src/tuscany/sca/php/sca.cpp | 517 ++++++++ .../extensions/php/src/tuscany/sca/php/sca.h | 49 + .../extensions/php/xsd/sca-implementation-php.xsd | 41 + .../contrib/runtime/extensions/python/Makefile.am | 24 + .../runtime/extensions/python/src/Makefile.am | 63 + .../src/tuscany/sca/python/PythonExtension.cpp | 76 ++ .../src/tuscany/sca/python/PythonExtension.h | 57 + .../sca/python/PythonImplementationExtension.cpp | 86 ++ .../sca/python/PythonImplementationExtension.h | 75 ++ .../sca/python/PythonInterfaceExtension.cpp | 123 ++ .../tuscany/sca/python/PythonInterfaceExtension.h | 74 ++ .../src/tuscany/sca/python/PythonServiceProxy.cpp | 81 ++ .../src/tuscany/sca/python/PythonServiceProxy.h | 83 ++ .../tuscany/sca/python/PythonServiceWrapper.cpp | 1095 ++++++++++++++++ .../src/tuscany/sca/python/PythonServiceWrapper.h | 142 ++ .../python/src/tuscany/sca/python/export.h | 41 + .../sca/python/model/PythonImplementation.cpp | 131 ++ .../sca/python/model/PythonImplementation.h | 145 ++ .../tuscany/sca/python/model/PythonInterface.cpp | 53 + .../src/tuscany/sca/python/model/PythonInterface.h | 77 ++ .../sca/python/model/PythonReferenceBinding.cpp | 61 + .../sca/python/model/PythonReferenceBinding.h | 82 ++ .../sca/python/model/PythonServiceBinding.cpp | 58 + .../sca/python/model/PythonServiceBinding.h | 81 ++ .../python/src/tuscany/sca/python/sca_module.cpp | 540 ++++++++ .../python/src/tuscany/sca/python/sca_proxy.py | 57 + .../python/xsd/sca-implementation-python.xsd | 50 + .../extensions/python/xsd/sca-interface-python.xsd | 64 + .../contrib/runtime/extensions/rest/Makefile.am | 6 + .../runtime/extensions/rest/interface/Makefile.am | 1 + .../extensions/rest/interface/src/Makefile.am | 23 + .../tuscany/sca/rest/RESTInterfaceExtension.cpp | 85 ++ .../src/tuscany/sca/rest/RESTInterfaceExtension.h | 76 ++ .../src/tuscany/sca/rest/exportinterface.h | 38 + .../src/tuscany/sca/rest/model/RESTInterface.cpp | 51 + .../src/tuscany/sca/rest/model/RESTInterface.h | 80 ++ .../runtime/extensions/rest/reference/Makefile.am | 1 + .../extensions/rest/reference/curl/Makefile.am | 1 + .../extensions/rest/reference/curl/src/Makefile.am | 28 + .../sca/rest/RESTServiceBindingExtension.cpp | 89 ++ .../tuscany/sca/rest/RESTServiceBindingExtension.h | 75 ++ .../src/tuscany/sca/rest/RESTServiceWrapper.cpp | 1225 +++++++++++++++++ .../curl/src/tuscany/sca/rest/RESTServiceWrapper.h | 90 ++ .../tuscany/sca/rest/model/RESTServiceBinding.cpp | 59 + .../tuscany/sca/rest/model/RESTServiceBinding.h | 76 ++ .../runtime/extensions/rest/service/Makefile.am | 1 + .../extensions/rest/service/httpd/Makefile.am | 1 + .../extensions/rest/service/httpd/src/Makefile.am | 42 + .../service/httpd/src/tuscany/sca/rest/ModREST.cpp | 1372 +++++++++++++++++++ .../sca/rest/RESTReferenceBindingExtension.cpp | 86 ++ .../sca/rest/RESTReferenceBindingExtension.h | 75 ++ .../src/tuscany/sca/rest/RESTServiceProxy.cpp | 567 ++++++++ .../httpd/src/tuscany/sca/rest/RESTServiceProxy.h | 95 ++ .../service/httpd/src/tuscany/sca/rest/export.h | 38 + .../sca/rest/model/RESTReferenceBinding.cpp | 66 + .../tuscany/sca/rest/model/RESTReferenceBinding.h | 80 ++ .../extensions/rest/xsd/sca-binding-rest.xsd | 36 + .../extensions/rest/xsd/sca-interface-rest.xsd | 40 + .../contrib/runtime/extensions/ruby/Makefile.am | 24 + .../runtime/extensions/ruby/extension/Makefile.am | 34 + .../extensions/ruby/extension/src/Extension.cpp | 56 + .../extensions/ruby/extension/src/extconf.rb | 25 + .../runtime/extensions/ruby/src/Makefile.am | 53 + .../extensions/ruby/src/tuscany/sca/ruby/Ruby.h | 39 + .../src/tuscany/sca/ruby/RubyCompositeContext.cpp | 70 + .../src/tuscany/sca/ruby/RubyCompositeContext.h | 50 + .../ruby/src/tuscany/sca/ruby/RubyExtension.cpp | 72 + .../ruby/src/tuscany/sca/ruby/RubyExtension.h | 58 + .../sca/ruby/RubyImplementationExtension.cpp | 74 ++ .../tuscany/sca/ruby/RubyImplementationExtension.h | 74 ++ .../ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp | 384 ++++++ .../ruby/src/tuscany/sca/ruby/RubyServiceProxy.h | 114 ++ .../src/tuscany/sca/ruby/RubyServiceWrapper.cpp | 794 +++++++++++ .../ruby/src/tuscany/sca/ruby/RubyServiceWrapper.h | 94 ++ .../extensions/ruby/src/tuscany/sca/ruby/export.h | 38 + .../tuscany/sca/ruby/model/RubyImplementation.cpp | 171 +++ .../tuscany/sca/ruby/model/RubyImplementation.h | 136 ++ .../sca/ruby/model/RubyReferenceBinding.cpp | 60 + .../tuscany/sca/ruby/model/RubyReferenceBinding.h | 83 ++ .../tuscany/sca/ruby/model/RubyServiceBinding.cpp | 54 + .../tuscany/sca/ruby/model/RubyServiceBinding.h | 77 ++ .../ruby/xsd/sca-implementation-ruby.xsd | 42 + .../contrib/runtime/extensions/sca/Makefile.am | 23 + .../runtime/extensions/sca/reference/Makefile.am | 18 + .../extensions/sca/reference/src/Makefile.am | 42 + .../sca/binding/SCAServiceBindingExtension.cpp | 103 ++ .../sca/binding/SCAServiceBindingExtension.h | 77 ++ .../sca/binding/model/SCAServiceBinding.cpp | 59 + .../tuscany/sca/binding/model/SCAServiceBinding.h | 76 ++ .../runtime/extensions/sca/service/Makefile.am | 18 + .../runtime/extensions/sca/service/src/Makefile.am | 42 + .../sca/binding/SCAReferenceBindingExtension.cpp | 103 ++ .../sca/binding/SCAReferenceBindingExtension.h | 77 ++ .../sca/binding/model/SCAReferenceBinding.cpp | 66 + .../sca/binding/model/SCAReferenceBinding.h | 85 ++ .../runtime/extensions/sca/xsd/sca-binding-sca.xsd | 39 + .../contrib/runtime/extensions/ws/Makefile.am | 23 + .../runtime/extensions/ws/reference/Makefile.am | 18 + .../extensions/ws/reference/axis2c/Makefile.am | 18 + .../extensions/ws/reference/axis2c/src/Makefile.am | 54 + .../axis2c/src/tuscany/sca/ws/Axis2Client.cpp | 820 ++++++++++++ .../axis2c/src/tuscany/sca/ws/Axis2Client.h | 65 + .../tuscany/sca/ws/WSServiceBindingExtension.cpp | 118 ++ .../src/tuscany/sca/ws/WSServiceBindingExtension.h | 78 ++ .../axis2c/src/tuscany/sca/ws/WSServiceWrapper.cpp | 131 ++ .../axis2c/src/tuscany/sca/ws/WSServiceWrapper.h | 65 + .../reference/axis2c/src/tuscany/sca/ws/export.h | 38 + .../src/tuscany/sca/ws/model/WSServiceBinding.cpp | 144 ++ .../src/tuscany/sca/ws/model/WSServiceBinding.h | 137 ++ .../runtime/extensions/ws/service/Makefile.am | 18 + .../extensions/ws/service/axis2c/Makefile.am | 18 + .../extensions/ws/service/axis2c/src/Makefile.am | 94 ++ .../extensions/ws/service/axis2c/src/axis2.xml | 181 +++ .../extensions/ws/service/axis2c/src/deploy.bat | 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 | 177 +++ .../src/tuscany/sca/ws/Axis2DispatcherModule.cpp | 149 +++ .../axis2c/src/tuscany/sca/ws/Axis2Service.cpp | 553 ++++++++ .../axis2c/src/tuscany/sca/ws/Axis2Utils.cpp | 77 ++ .../service/axis2c/src/tuscany/sca/ws/Axis2Utils.h | 46 + .../tuscany/sca/ws/WSReferenceBindingExtension.cpp | 119 ++ .../tuscany/sca/ws/WSReferenceBindingExtension.h | 76 ++ .../axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp | 579 ++++++++ .../axis2c/src/tuscany/sca/ws/WSServiceProxy.h | 95 ++ .../ws/service/axis2c/src/tuscany/sca/ws/export.h | 38 + .../tuscany/sca/ws/model/WSReferenceBinding.cpp | 151 +++ .../src/tuscany/sca/ws/model/WSReferenceBinding.h | 143 ++ .../extensions/ws/xsd/sca-binding-webservice.xsd | 57 + sca-cpp/trunk/contrib/samples/AUTHORS | 0 .../AlertAggregator/AlertAggregatorSCADiagram.png | Bin 0 -> 29041 bytes .../contrib/samples/AlertAggregator/Makefile.am | 21 + .../trunk/contrib/samples/AlertAggregator/README | 38 + .../contrib/samples/AlertAggregator/README.html | 263 ++++ .../contrib/samples/AlertAggregator/config.xml | 33 + .../samples/AlertAggregator/httpserver.php/README | 33 + .../AlertAggregator/httpserver.php/conf/httpd.conf | 28 + .../AlertAggregator/httpserver.php/conf/mime.types | 607 +++++++++ .../httpserver.php/htdocs/AlertDisplay.php | 204 +++ .../httpserver.php/htdocs/Alerter.xsd | 74 ++ .../httpserver.php/htdocs/Cached_Alerts.xml | 214 +++ .../httpserver.php/htdocs/index.html | 280 ++++ .../AlertAggregator/httpserver.php/htdocs/pop.png | Bin 0 -> 244 bytes .../AlertAggregator/httpserver.php/htdocs/rss.png | Bin 0 -> 689 bytes .../httpserver.php/htdocs/style.css | 166 +++ .../AlertAggregator/httpserver.php/startserver.bat | 76 ++ .../samples/AlertAggregator/httpserver/Makefile.am | 23 + .../AlertAggregator/httpserver/conf/httpd.conf | 43 + .../AlertAggregator/httpserver/conf/mime.types | 607 +++++++++ .../AlertAggregator/httpserver/htdocs/index.html | 290 ++++ .../AlertAggregator/httpserver/htdocs/pop.png | Bin 0 -> 244 bytes .../AlertAggregator/httpserver/htdocs/rss.png | Bin 0 -> 689 bytes .../AlertAggregator/httpserver/htdocs/style.css | 166 +++ .../AlertAggregator/httpserver/startserver.bat | 73 ++ .../AlertAggregator/httpserver/startserver.sh | 78 ++ .../AlertAggregator/httpserver/stopserver.sh | 25 + .../AlertAggregator/sample.alerter.app.composite | 33 + .../sample.alerter/AlertCheckerImpl.py | 116 ++ .../sample.alerter/AlertConfigImpl.py | 175 +++ .../AlertAggregator/sample.alerter/Alerter.xsd | 73 ++ .../AlertAggregator/sample.alerter/Makefile.am | 23 + .../sample.alerter/POPCheckerImpl.py | 104 ++ .../sample.alerter/POPCheckerImpl.rb | 122 ++ .../sample.alerter/RSSCheckerImpl.py | 76 ++ .../sample.alerter/sample.alerter.composite | 49 + .../AlertAggregator/sample.display/Alerter.xsd | 73 ++ .../sample.display/HTMLDisplayImpl.py | 379 ++++++ .../AlertAggregator/sample.display/Makefile.am | 23 + .../sample.display/sample.display.composite | 39 + sca-cpp/trunk/contrib/samples/COPYING | 203 +++ sca-cpp/trunk/contrib/samples/ChangeLog | 0 .../trunk/contrib/samples/CppBigBank/Makefile.am | 21 + sca-cpp/trunk/contrib/samples/CppBigBank/README | 26 + .../trunk/contrib/samples/CppBigBank/README.html | 389 ++++++ .../bigbank.account/AccountDataService.h | 63 + .../AccountDataServiceImpl.componentType | 28 + .../bigbank.account/AccountDataServiceImpl.cpp | 137 ++ .../bigbank.account/AccountDataServiceImpl.h | 61 + .../CppBigBank/bigbank.account/AccountService.h | 51 + .../CppBigBank/bigbank.account/AccountService.wsdl | 126 ++ .../AccountServiceImpl.componentType | 40 + .../bigbank.account/AccountServiceImpl.cpp | 132 ++ .../bigbank.account/AccountServiceImpl.h | 44 + .../samples/CppBigBank/bigbank.account/Makefile.am | 59 + .../CppBigBank/bigbank.account/StockQuoteService.h | 36 + .../StockQuoteServiceImpl.componentType | 29 + .../bigbank.account/StockQuoteServiceImpl.cpp | 73 ++ .../bigbank.account/StockQuoteServiceImpl.h | 36 + .../CppBigBank/bigbank.account/StockQuoteTypes.xsd | 37 + .../bigbank.account/StockQuoteWebService.h | 40 + .../bigbank.account/StockQuoteWebService.wsdl | 165 +++ .../bigbank.account/bigbank.account.composite | 49 + .../CppBigBank/bigbank.account/runwsserver.bat | 50 + .../CppBigBank/bigbank.account/runwsserver.sh | 45 + .../samples/CppBigBank/bigbank.app.composite | 29 + .../CppBigBank/bigbank.client/AccountClient.cpp | 127 ++ .../samples/CppBigBank/bigbank.client/Makefile.am | 35 + .../CppBigBank/bigbank.client/runclient.bat | 50 + .../samples/CppBigBank/bigbank.client/runclient.sh | 46 + .../bigbank.phpwsclient/AccountService.wsdl | 126 ++ .../CppBigBank/bigbank.phpwsclient/Makefile.am | 22 + .../samples/CppBigBank/bigbank.phpwsclient/README | 137 ++ .../CppBigBank/bigbank.phpwsclient/bigaccount.php | 113 ++ .../CppBigBank/bigbank.phpwsclient/bigwelcome.php | 44 + .../contrib/samples/CppCalculator/Makefile.am | 21 + sca-cpp/trunk/contrib/samples/CppCalculator/README | 4 + .../contrib/samples/CppCalculator/README.html | 176 +++ .../CppCalculator/sample.calculator.app.composite | 29 + .../sample.calculator.client/CalculatorClient.cpp | 150 +++ .../sample.calculator.client/Makefile.am | 40 + .../sample.calculator.client/runclient.bat | 42 + .../sample.calculator.client/runclient.sh | 39 + .../CppCalculator/sample.calculator/Calculator.h | 34 + .../sample.calculator/CalculatorImpl.componentType | 31 + .../sample.calculator/CalculatorImpl.cpp | 90 ++ .../sample.calculator/CalculatorImpl.h | 41 + .../CppCalculator/sample.calculator/Divide.h | 34 + .../sample.calculator/DivideImpl.componentType | 27 + .../CppCalculator/sample.calculator/DivideImpl.cpp | 48 + .../CppCalculator/sample.calculator/DivideImpl.h | 39 + .../CppCalculator/sample.calculator/Makefile.am | 53 + .../sample.calculator/sample.calculator.composite | 33 + sca-cpp/trunk/contrib/samples/GettingStarted.html | 513 ++++++++ .../trunk/contrib/samples/HttpdBigBank/Makefile.am | 21 + sca-cpp/trunk/contrib/samples/HttpdBigBank/README | 37 + .../trunk/contrib/samples/HttpdBigBank/README.html | 197 +++ .../bigbank.account/AccountService.wsdl | 126 ++ .../bigbank.account/AccountServiceImpl.rb | 83 ++ .../HttpdBigBank/bigbank.account/Makefile.am | 22 + .../bigbank.account/StockQuoteServiceImpl.rb | 52 + .../bigbank.account/StockQuoteTypes.xsd | 40 + .../bigbank.account/StockQuoteWebService.wsdl | 165 +++ .../bigbank.account/bigbank.account.composite | 51 + .../bigbank.accountdata/AccountData.xsd | 45 + .../bigbank.accountdata/AccountDataServiceImpl.rb | 72 + .../HttpdBigBank/bigbank.accountdata/Makefile.am | 22 + .../bigbank.accountdata.composite | 33 + .../samples/HttpdBigBank/bigbank.app.composite | 39 + .../bigbank.wsclient/AccountService.wsdl | 126 ++ .../bigbank.wsclient/AccountWSClient.rb | 40 + .../HttpdBigBank/bigbank.wsclient/Makefile.am | 6 + .../bigbank.wsclient/bigbank.wsclient.composite | 29 + .../HttpdBigBank/bigbank.wsclient/runwsclient.bat | 51 + .../HttpdBigBank/bigbank.wsclient/runwsclient.sh | 48 + .../samples/HttpdBigBank/httpserver/Makefile.am | 6 + .../HttpdBigBank/httpserver/conf/httpd.conf | 35 + .../HttpdBigBank/httpserver/conf/mime.types | 607 +++++++++ .../HttpdBigBank/httpserver/htdocs/index.html | 21 + .../HttpdBigBank/httpserver/startserver.bat | 89 ++ .../samples/HttpdBigBank/httpserver/startserver.sh | 78 ++ .../samples/HttpdBigBank/httpserver/stopserver.sh | 25 + sca-cpp/trunk/contrib/samples/INSTALL | 2 + sca-cpp/trunk/contrib/samples/LICENSE | 177 +++ sca-cpp/trunk/contrib/samples/Makefile.am | 40 + sca-cpp/trunk/contrib/samples/NEWS | 0 sca-cpp/trunk/contrib/samples/NOTICE | 5 + .../contrib/samples/PHPCalculator/Makefile.am | 22 + sca-cpp/trunk/contrib/samples/PHPCalculator/README | 122 ++ .../samples/PHPCalculator/phpcalculator.png | Bin 0 -> 30001 bytes .../PHPCalculator/sample.calculator.app.composite | 33 + .../sample.calculator.client/CalculatorClient.cpp | 61 + .../sample.calculator.client/CalculatorClient.php | 32 + .../PHPCalculator/sample.calculator.client/env.sh | 48 + .../sample.calculator.client/runclient_cpp.bat | 26 + .../sample.calculator.client/runclient_cpp.sh | 26 + .../sample.calculator.client/runclient_php.bat | 25 + .../sample.calculator.wsclient/Calculator.wsdl | 173 +++ .../CalculatorWSClient.php | 31 + .../sample.calculator.wsclient/runwsclient.bat | 25 + .../sample.calculator/Add.componentType | 29 + .../samples/PHPCalculator/sample.calculator/Add.h | 34 + .../PHPCalculator/sample.calculator/Add.php | 32 + .../sample.calculator/Calculator.componentType | 43 + .../PHPCalculator/sample.calculator/Calculator.h | 34 + .../PHPCalculator/sample.calculator/Calculator.php | 97 ++ .../sample.calculator/Calculator.wsdl | 161 +++ .../sample.calculator/CalculatorImpl.componentType | 31 + .../sample.calculator/CalculatorImpl.cpp | 90 ++ .../sample.calculator/CalculatorImpl.h | 41 + .../CalculatorImpl_CalculatorService_Proxy.cpp | 98 ++ .../CalculatorImpl_CalculatorService_Proxy.h | 44 + .../CalculatorImpl_CalculatorService_Wrapper.cpp | 135 ++ .../CalculatorImpl_CalculatorService_Wrapper.h | 43 + .../CalculatorImpl_divideService_Proxy.cpp | 65 + .../CalculatorImpl_divideService_Proxy.h | 41 + .../sample.calculator/Divide.componentType | 41 + .../PHPCalculator/sample.calculator/Divide.h | 34 + .../PHPCalculator/sample.calculator/Divide.php | 71 + .../sample.calculator/DivideImpl.componentType | 27 + .../PHPCalculator/sample.calculator/DivideImpl.cpp | 48 + .../PHPCalculator/sample.calculator/DivideImpl.h | 39 + .../DivideImpl_DivideService_Proxy.cpp | 65 + .../DivideImpl_DivideService_Proxy.h | 41 + .../DivideImpl_DivideService_Wrapper.cpp | 84 ++ .../DivideImpl_DivideService_Wrapper.h | 43 + .../sample.calculator/Log.componentType | 25 + .../samples/PHPCalculator/sample.calculator/Log.h | 34 + .../PHPCalculator/sample.calculator/Log.php | 36 + .../PHPCalculator/sample.calculator/Makefile.am | 56 + .../sample.calculator/Multiply.componentType | 28 + .../PHPCalculator/sample.calculator/Multiply.h | 34 + .../PHPCalculator/sample.calculator/Multiply.php | 33 + .../sample.calculator/Subtract.componentType | 29 + .../PHPCalculator/sample.calculator/Subtract.h | 34 + .../PHPCalculator/sample.calculator/Subtract.php | 30 + .../PHPCalculator/sample.calculator/runwsserver.sh | 45 + .../sample.calculator/sample.calculator.composite | 81 ++ .../contrib/samples/PythonCalculator/Makefile.am | 21 + .../trunk/contrib/samples/PythonCalculator/README | 20 + .../contrib/samples/PythonCalculator/README.html | 191 +++ .../sample.calculator.app.composite | 28 + .../sample.calculator.client/Makefile.am | 23 + .../sample.calculator.client/calculator_client.py | 50 + .../sample.calculator.client/runclient.bat | 45 + .../sample.calculator.client/runclient.sh | 48 + .../sample.calculator/Calculator.wsdl | 161 +++ .../sample.calculator/CalculatorImpl.py | 56 + .../sample.calculator/DivideImpl.py | 65 + .../PythonCalculator/sample.calculator/Makefile.am | 23 + .../sample.calculator/sample.calculator.composite | 34 + .../samples/PythonWeatherForecast/Makefile.am | 21 + .../contrib/samples/PythonWeatherForecast/README | 20 + .../samples/PythonWeatherForecast/README.html | 200 +++ .../sample.weather.app.composite | 28 + .../sample.weather.client/Makefile.am | 23 + .../sample.weather.client/runclient.bat | 50 + .../sample.weather.client/runclient.sh | 54 + .../weather_forecast_client.py | 49 + .../sample.weather/Makefile.am | 23 + .../sample.weather/WeatherForecast.wsdl | 133 ++ .../sample.weather/WeatherForecastImpl.py | 65 + .../sample.weather/sample.weather.composite | 36 + sca-cpp/trunk/contrib/samples/README | 2 + .../contrib/samples/RestCalculator/Makefile.am | 23 + .../trunk/contrib/samples/RestCalculator/README | 23 + .../contrib/samples/RestCalculator/README.html | 231 ++++ .../samples/RestCalculator/httpserver/Makefile.am | 6 + .../RestCalculator/httpserver/conf/httpd.conf | 34 + .../RestCalculator/httpserver/conf/mime.types | 607 +++++++++ .../RestCalculator/httpserver/htdocs/index.html | 21 + .../RestCalculator/httpserver/startserver.bat | 72 + .../RestCalculator/httpserver/startserver.sh | 66 + .../RestCalculator/httpserver/stopserver.sh | 25 + .../RestCalculator/sample.calculator.app.composite | 33 + .../CalculatorRestClient.rb | 25 + .../sample.calculator.restclient/Makefile.am | 23 + .../sample.calculator.restclient/runrestclient.bat | 50 + .../sample.calculator.restclient/runrestclient.sh | 41 + .../sample.calculator.restclient.composite | 28 + .../sample.calculator/CalculatorImpl.rb | 48 + .../RestCalculator/sample.calculator/DivideImpl.rb | 39 + .../RestCalculator/sample.calculator/Makefile.am | 22 + .../sample.calculator/sample.calculator.composite | 39 + .../trunk/contrib/samples/RestCustomer/Makefile.am | 22 + sca-cpp/trunk/contrib/samples/RestCustomer/README | 25 + .../trunk/contrib/samples/RestCustomer/README.html | 236 ++++ .../samples/RestCustomer/httpserver/Makefile.am | 6 + .../RestCustomer/httpserver/conf/httpd.conf | 34 + .../RestCustomer/httpserver/conf/mime.types | 607 +++++++++ .../RestCustomer/httpserver/htdocs/index.html | 21 + .../RestCustomer/httpserver/startserver.bat | 75 ++ .../samples/RestCustomer/httpserver/startserver.sh | 80 ++ .../samples/RestCustomer/httpserver/stopserver.sh | 25 + .../RestCustomer/sample.customer.app.composite | 34 + .../sample.customer.restclient/Customer.xsd | 33 + .../CustomerRestClient.py | 85 ++ .../sample.customer.restclient/Makefile.am | 23 + .../sample.customer.restclient/runrestclient.bat | 53 + .../sample.customer.restclient/runrestclient.sh | 50 + .../sample.customer.restclient.composite | 33 + .../samples/RestCustomer/sample.customer/2345.xml | 20 + .../RestCustomer/sample.customer/Customer.xsd | 33 + .../sample.customer/CustomerResourceImpl.py | 59 + .../RestCustomer/sample.customer/Makefile.am | 22 + .../sample.customer/sample.customer.composite | 39 + .../trunk/contrib/samples/RestYahoo/Makefile.am | 23 + sca-cpp/trunk/contrib/samples/RestYahoo/README | 19 + .../trunk/contrib/samples/RestYahoo/README.html | 202 +++ .../samples/RestYahoo/sample.yahoo.app.composite | 28 + .../RestYahoo/sample.yahoo.client/Makefile.am | 23 + .../sample.yahoo.client/YahooWebSearchClient.rb | 25 + .../RestYahoo/sample.yahoo.client/runclient.bat | 50 + .../RestYahoo/sample.yahoo.client/runclient.sh | 51 + .../samples/RestYahoo/sample.yahoo/Makefile.am | 22 + .../RestYahoo/sample.yahoo/YahooWebSearchImpl.py | 60 + .../sample.yahoo/YahooWebSearchResponse.xsd | 47 + .../RestYahoo/sample.yahoo/sample.yahoo.composite | 33 + .../trunk/contrib/samples/RubyBigBank/Makefile.am | 21 + sca-cpp/trunk/contrib/samples/RubyBigBank/README | 21 + .../trunk/contrib/samples/RubyBigBank/README.html | 312 +++++ .../bigbank.account/AccountDataServiceImpl.rb | 72 + .../bigbank.account/AccountService.wsdl | 126 ++ .../bigbank.account/AccountServiceImpl.rb | 82 ++ .../RubyBigBank/bigbank.account/Makefile.am | 24 + .../bigbank.account/StockQuoteServiceImpl.rb | 52 + .../bigbank.account/StockQuoteTypes.xsd | 40 + .../bigbank.account/StockQuoteWebService.wsdl | 165 +++ .../bigbank.account/bigbank.account.composite | 53 + .../RubyBigBank/bigbank.account/runwsserver.bat | 51 + .../RubyBigBank/bigbank.account/runwsserver.sh | 46 + .../samples/RubyBigBank/bigbank.app.composite | 33 + .../RubyBigBank/bigbank.client/AccountClient.rb | 40 + .../samples/RubyBigBank/bigbank.client/Makefile.am | 23 + .../RubyBigBank/bigbank.client/runclient.bat | 51 + .../RubyBigBank/bigbank.client/runclient.sh | 48 + .../bigbank.wsclient/AccountService.wsdl | 126 ++ .../bigbank.wsclient/AccountWSClient.rb | 40 + .../RubyBigBank/bigbank.wsclient/Makefile.am | 23 + .../bigbank.wsclient/bigbank.wsclient.composite | 29 + .../RubyBigBank/bigbank.wsclient/runwsclient.bat | 51 + .../RubyBigBank/bigbank.wsclient/runwsclient.sh | 48 + .../contrib/samples/RubyCalculator/Makefile.am | 21 + .../trunk/contrib/samples/RubyCalculator/README | 20 + .../contrib/samples/RubyCalculator/README.html | 187 +++ .../RubyCalculator/sample.calculator.app.composite | 28 + .../sample.calculator.client/CalculatorClient.rb | 25 + .../sample.calculator.client/Makefile.am | 23 + .../sample.calculator.client/runclient.bat | 44 + .../sample.calculator.client/runclient.sh | 42 + .../sample.calculator/Calculator.wsdl | 161 +++ .../sample.calculator/CalculatorImpl.rb | 48 + .../RubyCalculator/sample.calculator/DivideImpl.rb | 39 + .../RubyCalculator/sample.calculator/Makefile.am | 22 + .../sample.calculator/sample.calculator.composite | 34 + .../SupplyChain/supplychain.demo.app.composite | 34 + .../supplychain.demo/DemoClientImpl.componentType | 33 + .../supplychain.demo/supplychain.demo.composite | 41 + .../supplychain.logging/LoggerImpl.componentType | 28 + .../supplychain.logging/LoggingFacility.wsdl | 37 + .../supplychain.logging.composite | 34 + .../supplychain.manufacturer/Manufacturer.wsdl | 39 + .../ManufacturerImpl.componentType | 39 + .../WarehouseCallback.wsdl | 38 + .../supplychain.manufacturer.composite | 50 + .../supplychain.manufacturerA.app.composite | 30 + .../supplychain.manufacturerB.app.composite | 30 + .../supplychain.manufacturerC.app.composite | 30 + .../SupplyChain/supplychain.retailer.app.composite | 66 + .../SupplyChain/supplychain.retailer/Retailer.wsdl | 39 + .../RetailerImpl.componentType | 37 + .../supplychain.retailer.composite | 46 + .../supplychain.warehouse/Warehouse.wsdl | 38 + .../WarehouseCallbackImpl.componentType | 34 + .../WarehouseImpl.componentType | 39 + .../supplychain.warehouse.composite | 62 + sca-cpp/trunk/contrib/samples/autogen.sh | 31 + sca-cpp/trunk/contrib/samples/build.sh | 22 + sca-cpp/trunk/contrib/samples/configure.ac | 206 +++ sca-cpp/trunk/contrib/samples/runtest.sh | 159 +++ sca-cpp/trunk/contrib/samples/scagen.bat | 37 + sca-cpp/trunk/doc/Axis2CWSExtension.html | 498 ------- sca-cpp/trunk/doc/CPPGeneratorTool.txt | 362 ----- sca-cpp/trunk/doc/CppExtension.html | 430 ------ sca-cpp/trunk/doc/Doxyfile.in | 1385 ++++++++++++-------- sca-cpp/trunk/doc/Doxyfile.w32 | 1253 ------------------ sca-cpp/trunk/doc/Makefile.am | 5 - sca-cpp/trunk/doc/PythonExtension.html | 281 ---- sca-cpp/trunk/doc/RESTExtension.html | 291 ---- sca-cpp/trunk/doc/RubyExtension.html | 292 ----- sca-cpp/trunk/doc/SCAExtension.html | 173 --- sca-cpp/trunk/doc/css/maven-base.css | 168 --- sca-cpp/trunk/doc/css/maven-theme.css | 173 --- sca-cpp/trunk/etc/git-exclude | 7 +- sca-cpp/trunk/makebindist.sh | 37 - sca-cpp/trunk/modules/Makefile.am | 5 +- sca-cpp/trunk/modules/atom/Makefile.am | 2 - sca-cpp/trunk/modules/eval/Makefile.am | 2 - sca-cpp/trunk/modules/http/Makefile.am | 18 +- sca-cpp/trunk/modules/json/Makefile.am | 6 +- sca-cpp/trunk/modules/scdl/Makefile.am | 2 - sca-cpp/trunk/runtime/Makefile.am | 19 - sca-cpp/trunk/runtime/core/Makefile.am | 22 - sca-cpp/trunk/runtime/core/src/Makefile.am | 78 -- .../core/src/tuscany/sca/core/Exceptions.cpp | 285 ---- .../runtime/core/src/tuscany/sca/core/Exceptions.h | 346 ----- .../core/src/tuscany/sca/core/Operation.cpp | 578 -------- .../runtime/core/src/tuscany/sca/core/Operation.h | 251 ---- .../core/src/tuscany/sca/core/SCARuntime.cpp | 616 --------- .../runtime/core/src/tuscany/sca/core/SCARuntime.h | 295 ----- .../core/src/tuscany/sca/core/ServiceProxy.cpp | 50 - .../core/src/tuscany/sca/core/ServiceProxy.h | 75 -- .../core/src/tuscany/sca/core/ServiceWrapper.cpp | 50 - .../core/src/tuscany/sca/core/ServiceWrapper.h | 77 -- .../trunk/runtime/core/src/tuscany/sca/export.h | 41 - .../sca/extension/ImplementationExtension.cpp | 46 - .../sca/extension/ImplementationExtension.h | 79 -- .../tuscany/sca/extension/InterfaceExtension.cpp | 47 - .../src/tuscany/sca/extension/InterfaceExtension.h | 78 -- .../sca/extension/ReferenceBindingExtension.cpp | 46 - .../sca/extension/ReferenceBindingExtension.h | 81 -- .../sca/extension/ServiceBindingExtension.cpp | 46 - .../sca/extension/ServiceBindingExtension.h | 81 -- .../runtime/core/src/tuscany/sca/model/Binding.cpp | 49 - .../runtime/core/src/tuscany/sca/model/Binding.h | 83 -- .../core/src/tuscany/sca/model/Component.cpp | 148 --- .../runtime/core/src/tuscany/sca/model/Component.h | 183 --- .../core/src/tuscany/sca/model/ComponentType.cpp | 294 ----- .../core/src/tuscany/sca/model/ComponentType.h | 186 --- .../core/src/tuscany/sca/model/Composite.cpp | 427 ------ .../runtime/core/src/tuscany/sca/model/Composite.h | 250 ---- .../src/tuscany/sca/model/CompositeReference.cpp | 68 - .../src/tuscany/sca/model/CompositeReference.h | 93 -- .../sca/model/CompositeReferenceBinding.cpp | 62 - .../tuscany/sca/model/CompositeReferenceBinding.h | 98 -- .../src/tuscany/sca/model/CompositeService.cpp | 70 - .../core/src/tuscany/sca/model/CompositeService.h | 83 -- .../core/src/tuscany/sca/model/Contract.cpp | 49 - .../runtime/core/src/tuscany/sca/model/Contract.h | 85 -- .../core/src/tuscany/sca/model/Interface.cpp | 49 - .../runtime/core/src/tuscany/sca/model/Interface.h | 90 -- .../core/src/tuscany/sca/model/ModelLoader.cpp | 939 ------------- .../core/src/tuscany/sca/model/ModelLoader.h | 122 -- .../core/src/tuscany/sca/model/Reference.cpp | 77 -- .../runtime/core/src/tuscany/sca/model/Reference.h | 126 -- .../src/tuscany/sca/model/ReferenceBinding.cpp | 75 -- .../core/src/tuscany/sca/model/ReferenceBinding.h | 116 -- .../core/src/tuscany/sca/model/ReferenceType.cpp | 88 -- .../core/src/tuscany/sca/model/ReferenceType.h | 138 -- .../runtime/core/src/tuscany/sca/model/Service.cpp | 58 - .../runtime/core/src/tuscany/sca/model/Service.h | 101 -- .../core/src/tuscany/sca/model/ServiceBinding.cpp | 51 - .../core/src/tuscany/sca/model/ServiceBinding.h | 89 -- .../core/src/tuscany/sca/model/ServiceType.cpp | 62 - .../core/src/tuscany/sca/model/ServiceType.h | 108 -- .../core/src/tuscany/sca/model/WSDLDefinition.cpp | 633 --------- .../core/src/tuscany/sca/model/WSDLDefinition.h | 180 --- .../core/src/tuscany/sca/model/WSDLInterface.cpp | 107 -- .../core/src/tuscany/sca/model/WSDLInterface.h | 99 -- .../core/src/tuscany/sca/model/WSDLMessagePart.cpp | 70 - .../core/src/tuscany/sca/model/WSDLMessagePart.h | 113 -- .../core/src/tuscany/sca/model/WSDLOperation.cpp | 193 --- .../core/src/tuscany/sca/model/WSDLOperation.h | 196 --- .../runtime/core/src/tuscany/sca/model/Wire.cpp | 53 - .../runtime/core/src/tuscany/sca/model/Wire.h | 94 -- .../core/src/tuscany/sca/util/DefaultLogWriter.cpp | 51 - .../core/src/tuscany/sca/util/DefaultLogWriter.h | 51 - .../runtime/core/src/tuscany/sca/util/File.cpp | 243 ---- .../trunk/runtime/core/src/tuscany/sca/util/File.h | 160 --- .../core/src/tuscany/sca/util/FileLogWriter.cpp | 57 - .../core/src/tuscany/sca/util/FileLogWriter.h | 58 - .../runtime/core/src/tuscany/sca/util/Library.cpp | 175 --- .../runtime/core/src/tuscany/sca/util/Library.h | 103 -- .../core/src/tuscany/sca/util/LogWriter.cpp | 37 - .../runtime/core/src/tuscany/sca/util/LogWriter.h | 53 - .../runtime/core/src/tuscany/sca/util/Logger.cpp | 276 ---- .../runtime/core/src/tuscany/sca/util/Logger.h | 136 -- .../runtime/core/src/tuscany/sca/util/Logging.h | 44 - .../runtime/core/src/tuscany/sca/util/Mutex.cpp | 103 -- .../runtime/core/src/tuscany/sca/util/Mutex.h | 84 -- .../runtime/core/src/tuscany/sca/util/Queue.cpp | 222 ---- .../runtime/core/src/tuscany/sca/util/Queue.h | 93 -- .../runtime/core/src/tuscany/sca/util/SDOUtils.cpp | 438 ------- .../runtime/core/src/tuscany/sca/util/SDOUtils.h | 106 -- .../runtime/core/src/tuscany/sca/util/Thread.cpp | 124 -- .../runtime/core/src/tuscany/sca/util/Thread.h | 90 -- .../core/src/tuscany/sca/util/ThreadLocal.cpp | 114 -- .../core/src/tuscany/sca/util/ThreadLocal.h | 84 -- .../runtime/core/src/tuscany/sca/util/Utils.cpp | 598 --------- .../runtime/core/src/tuscany/sca/util/Utils.h | 76 -- sca-cpp/trunk/runtime/core/test/Makefile.am | 17 - sca-cpp/trunk/runtime/core/test/SCATestMacros.h | 84 -- sca-cpp/trunk/runtime/core/test/main.cpp | 95 -- sca-cpp/trunk/runtime/core/test/sca_test.bat | 43 - sca-cpp/trunk/runtime/core/test/sca_test.sh | 40 - .../runtime/core/test/wsdlTests/BaseWsdlTest.cpp | 127 -- .../runtime/core/test/wsdlTests/BaseWsdlTest.h | 50 - .../core/test/wsdlTests/WSDLDefinitionTest.cpp | 67 - .../core/test/wsdlTests/WSDLDefinitionTest.h | 40 - .../runtime/core/test/wsdlTests/WSDLErrorsTest.cpp | 545 -------- .../runtime/core/test/wsdlTests/WSDLErrorsTest.h | 34 - .../trunk/runtime/core/test/wsdlTests/wsdlTests.h | 34 - .../core/test/wsdlTests/wsdls_correct/simple.wsdl | 74 -- .../wsdls_erroneous/duplicate_binding_input.wsdl | 67 - .../wsdls_erroneous/duplicate_binding_output.wsdl | 67 - .../wsdls_erroneous/duplicate_bindings.wsdl | 77 -- .../wsdls_erroneous/duplicate_messages.wsdl | 67 - .../wsdls_erroneous/duplicate_partnames.wsdl | 65 - .../wsdls_erroneous/duplicate_portTypes.wsdl | 72 - .../wsdls_erroneous/duplicate_services.wsdl | 70 - .../wsdls_erroneous/duplicate_soap_address.wsdl | 46 - .../wsdls_erroneous/duplicate_soap_binding.wsdl | 41 - .../wsdls_erroneous/duplicate_soap_body.wsdl | 41 - .../wsdls_erroneous/duplicate_soap_operation.wsdl | 41 - .../wsdls_erroneous/missing_binding_for_port.wsdl | 43 - .../wsdlTests/wsdls_erroneous/missing_message.wsdl | 40 - .../wsdls_erroneous/missing_name_for_part.wsdl | 43 - .../wsdls_erroneous/missing_name_for_port.wsdl | 43 - .../wsdls_erroneous/missing_operation.wsdl | 40 - .../wsdls_erroneous/missing_portType.wsdl | 40 - .../wsdls_erroneous/missing_type_for_part.wsdl | 43 - sca-cpp/trunk/runtime/core/xsd/sca-core.xsd | 182 --- .../core/xsd/sca-implementation-composite.xsd | 38 - .../runtime/core/xsd/sca-implementation-java.xsd | 38 - .../trunk/runtime/core/xsd/sca-interface-java.xsd | 39 - .../trunk/runtime/core/xsd/sca-interface-wsdl.xsd | 39 - sca-cpp/trunk/runtime/core/xsd/sca.xsd | 31 - sca-cpp/trunk/runtime/core/xsd/tuscany.xsd | 50 - sca-cpp/trunk/runtime/core/xsd/wsdl_11.xsd | 307 ----- sca-cpp/trunk/runtime/core/xsd/wsdl_11_http.xsd | 74 -- sca-cpp/trunk/runtime/core/xsd/wsdl_11_mime.xsd | 71 - sca-cpp/trunk/runtime/core/xsd/wsdl_11_soap.xsd | 146 --- sca-cpp/trunk/runtime/core/xsd/wsdl_11_soap12.xsd | 140 -- sca-cpp/trunk/runtime/extensions/Makefile.am | 45 - sca-cpp/trunk/runtime/extensions/cpp/Makefile.am | 24 - .../trunk/runtime/extensions/cpp/src/Makefile.am | 55 - .../cpp/src/osoa/sca/ComponentContext.cpp | 150 --- .../extensions/cpp/src/osoa/sca/ComponentContext.h | 117 -- .../cpp/src/osoa/sca/CompositeContext.cpp | 127 -- .../extensions/cpp/src/osoa/sca/CompositeContext.h | 99 -- .../cpp/src/osoa/sca/ServiceRuntimeException.h | 105 -- .../runtime/extensions/cpp/src/osoa/sca/export.h | 42 - .../runtime/extensions/cpp/src/osoa/sca/sca.h | 31 - .../cpp/src/tuscany/sca/cpp/CPPExtension.cpp | 72 - .../cpp/src/tuscany/sca/cpp/CPPExtension.h | 57 - .../tuscany/sca/cpp/CPPImplementationExtension.cpp | 101 -- .../tuscany/sca/cpp/CPPImplementationExtension.h | 74 -- .../src/tuscany/sca/cpp/CPPInterfaceExtension.cpp | 71 - .../src/tuscany/sca/cpp/CPPInterfaceExtension.h | 74 -- .../cpp/src/tuscany/sca/cpp/CPPServiceProxy.cpp | 192 --- .../cpp/src/tuscany/sca/cpp/CPPServiceProxy.h | 117 -- .../cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp | 194 --- .../cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h | 155 --- .../src/tuscany/sca/cpp/ComponentContextImpl.cpp | 208 --- .../cpp/src/tuscany/sca/cpp/ComponentContextImpl.h | 119 -- .../src/tuscany/sca/cpp/CompositeContextImpl.cpp | 128 -- .../cpp/src/tuscany/sca/cpp/CompositeContextImpl.h | 89 -- .../cpp/src/tuscany/sca/cpp/TuscanyRuntime.cpp | 83 -- .../cpp/src/tuscany/sca/cpp/TuscanyRuntime.h | 77 -- .../tuscany/sca/cpp/model/CPPImplementation.cpp | 90 -- .../src/tuscany/sca/cpp/model/CPPImplementation.h | 163 --- .../cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp | 63 - .../cpp/src/tuscany/sca/cpp/model/CPPInterface.h | 117 -- .../tuscany/sca/cpp/model/CPPReferenceBinding.cpp | 61 - .../tuscany/sca/cpp/model/CPPReferenceBinding.h | 87 -- .../tuscany/sca/cpp/model/CPPServiceBinding.cpp | 54 - .../src/tuscany/sca/cpp/model/CPPServiceBinding.h | 81 -- .../trunk/runtime/extensions/cpp/tools/Makefile.am | 25 - .../extensions/cpp/tools/scagen/META-INF/LICENSE | 177 --- .../extensions/cpp/tools/scagen/META-INF/NOTICE | 5 - .../extensions/cpp/tools/scagen/META-INF/README | 19 - .../extensions/cpp/tools/scagen/Makefile.am | 35 - .../runtime/extensions/cpp/tools/scagen/build.xml | 151 --- .../sca/cpp/tools/junit/CalculatorTest.java | 33 - .../sca/cpp/tools/junit/EnvHandlerTest.java | 48 - ...mplClassWithNameSpaceButNotInClassAttrTest.java | 48 - .../tools/junit/ImplClassWithNameSpaceTest.java | 48 - ...ntfClassWithNameSpaceButNotInClassAttrTest.java | 48 - .../tools/junit/IntfClassWithNameSpaceTest.java | 48 - .../junit/MissingCompositeAndFragmentTest.java | 48 - .../junit/SimplePublicPrivateProtectedTest.java | 49 - .../sca/cpp/tools/junit/TestAllCompositesTest.java | 89 -- .../sca/cpp/tools/junit/TestDeployAssistTool.java | 97 -- .../sca/cpp/tools/junit/TuscanyTestCase.java | 341 ----- .../CalculatorCompositeAndComponent/Calculator.h | 36 - .../CalculatorImpl.componentType | 25 - .../CalculatorImpl.h | 37 - .../CalculatorCompositeAndComponent/sca.composite | 28 - .../otherSubFolder/CalculatorBack.h | 36 - .../otherSubFolder/CalculatorForward.h | 35 - .../CalculatorSlashDirectionTest/sca.composite | 31 - .../subFolder/CalculatorBackImpl.componentType | 26 - .../subFolder/CalculatorBackImpl.h | 37 - .../subFolder/CalculatorForwardImpl.componentType | 25 - .../subFolder/CalculatorForwardImpl.h | 37 - .../CustomerInfo.fragment | 39 - .../CustomerInfo.h | 98 -- .../CustomerInfoImpl.componentType | 33 - .../CustomerInfoImpl.h | 38 - .../CustomerInfo.fragment | 39 - .../CustomerInfo.h | 94 -- .../CustomerInfoImpl.componentType | 33 - .../CustomerInfoImpl.h | 47 - .../MyValueServiceComposite/CustomerInfo.fragment | 39 - .../MyValueServiceComposite/CustomerInfo.h | 36 - .../CustomerInfoImpl.componentType | 33 - .../MyValueServiceComposite/CustomerInfoImpl.h | 49 - .../composites/MyValueServiceComposite/MyValue.h | 40 - .../MyValueImpl.componentType | 39 - .../MyValueServiceComposite/MyValueImpl.hpp | 43 - .../MyValueImpl_stockQuote_Proxy.h | 38 - .../MyValueServiceComposite/StockQuoteService.h | 37 - .../MyValueServiceComposite/sca.composite | 60 - .../CustomerInfo.fragment | 39 - .../CustomerInfo.h | 41 - .../CustomerInfoImpl.componentType | 33 - .../CustomerInfoImpl.h | 52 - .../MyValue.h | 40 - .../MyValueImpl.componentType | 39 - .../MyValueImpl.hpp | 43 - .../MyValueImpl_stockQuote_Proxy.h | 38 - .../StockQuoteService.h | 37 - .../sca.composite | 60 - .../MyValue.h | 40 - .../MyValueImpl.componentType | 30 - .../MyValueImpl.hpp | 47 - .../sca.composite | 48 - .../MyValue.h | 43 - .../MyValueImpl.componentType | 29 - .../MyValueImpl.hpp | 43 - .../sca.composite | 49 - .../MyValue.h | 41 - .../MyValueImpl.componentType | 29 - .../MyValueImpl.hpp | 43 - .../sca.composite | 49 - .../CustomerInfo.fragmentX | 38 - .../sca.compositeX | 60 - .../CustomerInfo.fragment | 39 - .../CustomerInfo.h | 41 - .../CustomerInfoImpl.componentType | 33 - .../CustomerInfoImpl.h | 49 - .../MyValueServiceCompositeTwoClasses/MyValue.h | 40 - .../MyValueImpl.componentType | 39 - .../MyValueImpl.hpp | 43 - .../MyValueImpl_stockQuote_Proxy.h | 38 - .../StockQuoteService.h | 37 - .../sca.composite | 60 - .../CustomerInfo.fragment | 40 - .../CustomerInfo.h | 45 - .../CustomerInfoImpl.componentType | 33 - .../CustomerInfoImpl.h | 39 - .../CalculatorImpl_CalculatorService_Proxy.cpp | 65 - .../CalculatorImpl_CalculatorService_Proxy.h | 41 - .../CalculatorImpl_CalculatorService_Wrapper.cpp | 84 -- .../CalculatorImpl_CalculatorService_Wrapper.h | 43 - .../CalculatorBackImpl_CalculatorService_Proxy.cpp | 76 -- .../CalculatorBackImpl_CalculatorService_Proxy.h | 42 - ...alculatorBackImpl_CalculatorService_Wrapper.cpp | 101 -- .../CalculatorBackImpl_CalculatorService_Wrapper.h | 43 - ...lculatorForwardImpl_CalculatorService_Proxy.cpp | 76 -- ...CalculatorForwardImpl_CalculatorService_Proxy.h | 42 - ...ulatorForwardImpl_CalculatorService_Wrapper.cpp | 101 -- ...lculatorForwardImpl_CalculatorService_Wrapper.h | 43 - .../CustomerInfoImpl_CustomerInfoService_Proxy.cpp | 594 --------- .../CustomerInfoImpl_CustomerInfoService_Proxy.h | 90 -- ...ustomerInfoImpl_CustomerInfoService_Wrapper.cpp | 872 ------------ .../CustomerInfoImpl_CustomerInfoService_Wrapper.h | 43 - .../CustomerInfoImpl_CustomerInfoService_Proxy.cpp | 504 ------- .../CustomerInfoImpl_CustomerInfoService_Proxy.h | 86 -- ...ustomerInfoImpl_CustomerInfoService_Wrapper.cpp | 760 ----------- .../CustomerInfoImpl_CustomerInfoService_Wrapper.h | 43 - ...CustomerInfoImpl2_CustomerInfoService_Proxy.cpp | 64 - .../CustomerInfoImpl2_CustomerInfoService_Proxy.h | 41 - ...stomerInfoImpl2_CustomerInfoService_Wrapper.cpp | 83 -- ...CustomerInfoImpl2_CustomerInfoService_Wrapper.h | 43 - .../MyValueImpl_MyValueService_Proxy.cpp | 92 -- .../MyValueImpl_MyValueService_Proxy.h | 44 - .../MyValueImpl_MyValueService_Wrapper.cpp | 122 -- .../MyValueImpl_MyValueService_Wrapper.h | 43 - .../MyValueImpl_customerInfo_Proxy.cpp | 64 - .../MyValueImpl_customerInfo_Proxy.h | 41 - .../MyValueImpl_stockQuote_Proxy.cpp | 64 - .../expected_output/MyValueImpl_stockQuote_Proxy.h | 41 - .../CustomerInfoImpl_CustomerInfoService_Proxy.cpp | 64 - .../CustomerInfoImpl_CustomerInfoService_Proxy.h | 41 - ...ustomerInfoImpl_CustomerInfoService_Wrapper.cpp | 83 -- .../CustomerInfoImpl_CustomerInfoService_Wrapper.h | 43 - .../MyValueImpl_MyValueService_Proxy.cpp | 92 -- .../MyValueImpl_MyValueService_Proxy.h | 44 - .../MyValueImpl_MyValueService_Wrapper.cpp | 122 -- .../MyValueImpl_MyValueService_Wrapper.h | 43 - .../MyValueImpl_customerInfo_Proxy.cpp | 64 - .../MyValueImpl_customerInfo_Proxy.h | 41 - .../MyValueImpl_stockQuote_Proxy.cpp | 64 - .../expected_output/MyValueImpl_stockQuote_Proxy.h | 41 - .../MyValueImpl_MyValueService_Proxy.cpp | 92 -- .../MyValueImpl_MyValueService_Proxy.h | 44 - .../MyValueImpl_MyValueService_Wrapper.cpp | 122 -- .../MyValueImpl_MyValueService_Wrapper.h | 43 - .../MyValueImpl_MyValueService_Proxy.cpp | 92 -- .../MyValueImpl_MyValueService_Proxy.h | 44 - .../MyValueImpl_MyValueService_Wrapper.cpp | 122 -- .../MyValueImpl_MyValueService_Wrapper.h | 43 - .../MyValueImpl_MyValueService_Proxy.cpp | 92 -- .../MyValueImpl_MyValueService_Proxy.h | 44 - .../MyValueImpl_MyValueService_Wrapper.cpp | 122 -- .../MyValueImpl_MyValueService_Wrapper.h | 43 - ...CustomerInfoImpl2_CustomerInfoService_Proxy.cpp | 64 - .../CustomerInfoImpl2_CustomerInfoService_Proxy.h | 41 - ...stomerInfoImpl2_CustomerInfoService_Wrapper.cpp | 83 -- ...CustomerInfoImpl2_CustomerInfoService_Wrapper.h | 43 - .../MyValueImpl_MyValueService_Proxy.cpp | 92 -- .../MyValueImpl_MyValueService_Proxy.h | 44 - .../MyValueImpl_MyValueService_Wrapper.cpp | 122 -- .../MyValueImpl_MyValueService_Wrapper.h | 43 - .../MyValueImpl_customerInfo_Proxy.cpp | 64 - .../MyValueImpl_customerInfo_Proxy.h | 41 - .../MyValueImpl_stockQuote_Proxy.cpp | 64 - .../expected_output/MyValueImpl_stockQuote_Proxy.h | 41 - .../CustomerInfoImpl_CustomerInfoService_Proxy.cpp | 87 -- .../CustomerInfoImpl_CustomerInfoService_Proxy.h | 43 - ...ustomerInfoImpl_CustomerInfoService_Wrapper.cpp | 118 -- .../CustomerInfoImpl_CustomerInfoService_Wrapper.h | 43 - .../extensions/cpp/tools/scagen/lib/readme.txt | 4 - .../runtime/extensions/cpp/tools/scagen/scagen.bat | 19 - .../runtime/extensions/cpp/tools/scagen/scagen.sh | 21 - .../tuscany/sca/cpp/tools/common/BodyPart.java | 96 -- .../tuscany/sca/cpp/tools/common/CParsingTool.java | 124 -- .../sca/cpp/tools/common/Configuration.java | 132 -- .../sca/cpp/tools/common/DirectoryTree.java | 105 -- .../tuscany/sca/cpp/tools/common/FileActor.java | 37 - .../tuscany/sca/cpp/tools/common/FilePart.java | 80 -- .../tuscany/sca/cpp/tools/common/Headers.java | 167 --- .../sca/cpp/tools/common/InputCppSourceCode.java | 425 ------ .../tuscany/sca/cpp/tools/common/MacroPart.java | 87 -- .../tuscany/sca/cpp/tools/common/MethodPart.java | 133 -- .../tuscany/sca/cpp/tools/common/Options.java | 164 --- .../tuscany/sca/cpp/tools/common/Parameter.java | 216 --- .../sca/cpp/tools/common/ParsingException.java | 48 - .../sca/cpp/tools/common/PrototypePart.java | 56 - .../tuscany/sca/cpp/tools/common/Signature.java | 506 ------- .../apache/tuscany/sca/cpp/tools/common/Utils.java | 556 -------- .../tuscany/sca/cpp/tools/common/package.html | 58 - .../tools/services/ComponentDomNodeHandler.java | 366 ------ .../tools/services/ComponentTypeFileHandler.java | 130 -- .../services/CompositeOrFragmentFileHandler.java | 91 -- .../sca/cpp/tools/services/DirectoryScanner.java | 93 -- .../tuscany/sca/cpp/tools/services/DomHandler.java | 83 -- .../sca/cpp/tools/services/DomNodeHandler.java | 46 - .../cpp/tools/services/GenericDomNodeHandler.java | 220 ---- .../sca/cpp/tools/services/LittleClass.java | 33 - .../tools/services/ReferenceDomNodeHandler.java | 75 -- .../tuscany/sca/cpp/tools/services/Scagen.java | 176 --- .../cpp/tools/services/ServiceDomNodeHandler.java | 71 - .../sca/cpp/tools/services/ServicesGenerator.java | 831 ------------ .../sca/cpp/tools/services/XMLFileActor.java | 208 --- .../tuscany/sca/cpp/tools/services/package.html | 159 --- .../cpp/tools/services/xsl/SCA4CPPIntfProxyCPP.xsl | 278 ---- .../tools/services/xsl/SCA4CPPIntfProxyHeader.xsl | 228 ---- .../tools/services/xsl/SCA4CPPIntfWrapperCPP.xsl | 290 ---- .../services/xsl/SCA4CPPIntfWrapperHeader.xsl | 191 --- .../extensions/cpp/xsd/sca-implementation-cpp.xsd | 51 - .../extensions/cpp/xsd/sca-interface-cpp.xsd | 45 - sca-cpp/trunk/runtime/extensions/php/AUTHORS | 0 sca-cpp/trunk/runtime/extensions/php/COPYING | 203 --- sca-cpp/trunk/runtime/extensions/php/ChangeLog | 0 sca-cpp/trunk/runtime/extensions/php/INSTALL | 2 - sca-cpp/trunk/runtime/extensions/php/LICENSE | 177 --- sca-cpp/trunk/runtime/extensions/php/Makefile.am | 24 - sca-cpp/trunk/runtime/extensions/php/NEWS | 0 sca-cpp/trunk/runtime/extensions/php/NOTICE | 5 - sca-cpp/trunk/runtime/extensions/php/README | 276 ---- sca-cpp/trunk/runtime/extensions/php/autogen.sh | 31 - sca-cpp/trunk/runtime/extensions/php/build.sh | 55 - sca-cpp/trunk/runtime/extensions/php/configure.ac | 79 -- .../runtime/extensions/php/samples/Makefile.am | 18 - .../php/samples/PHPCalculator/Makefile.am | 21 - .../extensions/php/samples/PHPCalculator/README | 32 - .../PHPCalculator/sample.calculator.app.composite | 28 - .../sample.calculator.client/Makefile.am | 24 - .../sample.calculator.client/calculator_client.py | 50 - .../sample.calculator.client/runclient.sh | 48 - .../sample.calculator/Calculator.componentType | 31 - .../PHPCalculator/sample.calculator/Calculator.php | 89 -- .../sample.calculator/Divide.componentType | 29 - .../PHPCalculator/sample.calculator/Divide.php | 47 - .../sample.calculator/Log.componentType | 25 - .../PHPCalculator/sample.calculator/Log.php | 36 - .../PHPCalculator/sample.calculator/Makefile.am | 23 - .../PHPCalculator/sample.calculator/Multiply.php | 39 - .../sample.calculator/sample.calculator.composite | 44 - .../trunk/runtime/extensions/php/src/Makefile.am | 57 - .../php/src/tuscany/sca/php/PHPExtension.cpp | 71 - .../php/src/tuscany/sca/php/PHPExtension.h | 57 - .../tuscany/sca/php/PHPImplementationExtension.cpp | 73 -- .../tuscany/sca/php/PHPImplementationExtension.h | 74 -- .../src/tuscany/sca/php/PHPInterfaceExtension.cpp | 76 -- .../src/tuscany/sca/php/PHPInterfaceExtension.h | 74 -- .../php/src/tuscany/sca/php/PHPServiceProxy.cpp | 81 -- .../php/src/tuscany/sca/php/PHPServiceProxy.h | 83 -- .../php/src/tuscany/sca/php/PHPServiceWrapper.cpp | 505 ------- .../php/src/tuscany/sca/php/PHPServiceWrapper.h | 112 -- .../extensions/php/src/tuscany/sca/php/export.h | 41 - .../tuscany/sca/php/model/PHPImplementation.cpp | 85 -- .../src/tuscany/sca/php/model/PHPImplementation.h | 95 -- .../php/src/tuscany/sca/php/model/PHPInterface.cpp | 53 - .../php/src/tuscany/sca/php/model/PHPInterface.h | 77 -- .../tuscany/sca/php/model/PHPReferenceBinding.cpp | 61 - .../tuscany/sca/php/model/PHPReferenceBinding.h | 82 -- .../tuscany/sca/php/model/PHPServiceBinding.cpp | 58 - .../src/tuscany/sca/php/model/PHPServiceBinding.h | 81 -- .../extensions/php/src/tuscany/sca/php/php_sca.h | 132 -- .../extensions/php/src/tuscany/sca/php/sca.cpp | 517 -------- .../extensions/php/src/tuscany/sca/php/sca.h | 49 - .../extensions/php/xsd/sca-implementation-php.xsd | 41 - .../trunk/runtime/extensions/python/Makefile.am | 24 - .../runtime/extensions/python/src/Makefile.am | 63 - .../src/tuscany/sca/python/PythonExtension.cpp | 76 -- .../src/tuscany/sca/python/PythonExtension.h | 57 - .../sca/python/PythonImplementationExtension.cpp | 86 -- .../sca/python/PythonImplementationExtension.h | 75 -- .../sca/python/PythonInterfaceExtension.cpp | 123 -- .../tuscany/sca/python/PythonInterfaceExtension.h | 74 -- .../src/tuscany/sca/python/PythonServiceProxy.cpp | 81 -- .../src/tuscany/sca/python/PythonServiceProxy.h | 83 -- .../tuscany/sca/python/PythonServiceWrapper.cpp | 1095 ---------------- .../src/tuscany/sca/python/PythonServiceWrapper.h | 142 -- .../python/src/tuscany/sca/python/export.h | 41 - .../sca/python/model/PythonImplementation.cpp | 131 -- .../sca/python/model/PythonImplementation.h | 145 -- .../tuscany/sca/python/model/PythonInterface.cpp | 53 - .../src/tuscany/sca/python/model/PythonInterface.h | 77 -- .../sca/python/model/PythonReferenceBinding.cpp | 61 - .../sca/python/model/PythonReferenceBinding.h | 82 -- .../sca/python/model/PythonServiceBinding.cpp | 58 - .../sca/python/model/PythonServiceBinding.h | 81 -- .../python/src/tuscany/sca/python/sca_module.cpp | 540 -------- .../python/src/tuscany/sca/python/sca_proxy.py | 57 - .../python/xsd/sca-implementation-python.xsd | 50 - .../extensions/python/xsd/sca-interface-python.xsd | 64 - sca-cpp/trunk/runtime/extensions/rest/Makefile.am | 6 - .../runtime/extensions/rest/interface/Makefile.am | 1 - .../extensions/rest/interface/src/Makefile.am | 23 - .../tuscany/sca/rest/RESTInterfaceExtension.cpp | 85 -- .../src/tuscany/sca/rest/RESTInterfaceExtension.h | 76 -- .../src/tuscany/sca/rest/exportinterface.h | 38 - .../src/tuscany/sca/rest/model/RESTInterface.cpp | 51 - .../src/tuscany/sca/rest/model/RESTInterface.h | 80 -- .../runtime/extensions/rest/reference/Makefile.am | 1 - .../extensions/rest/reference/curl/Makefile.am | 1 - .../extensions/rest/reference/curl/src/Makefile.am | 28 - .../sca/rest/RESTServiceBindingExtension.cpp | 89 -- .../tuscany/sca/rest/RESTServiceBindingExtension.h | 75 -- .../src/tuscany/sca/rest/RESTServiceWrapper.cpp | 1225 ----------------- .../curl/src/tuscany/sca/rest/RESTServiceWrapper.h | 90 -- .../tuscany/sca/rest/model/RESTServiceBinding.cpp | 59 - .../tuscany/sca/rest/model/RESTServiceBinding.h | 76 -- .../runtime/extensions/rest/service/Makefile.am | 1 - .../extensions/rest/service/httpd/Makefile.am | 1 - .../extensions/rest/service/httpd/src/Makefile.am | 42 - .../service/httpd/src/tuscany/sca/rest/ModREST.cpp | 1372 ------------------- .../sca/rest/RESTReferenceBindingExtension.cpp | 86 -- .../sca/rest/RESTReferenceBindingExtension.h | 75 -- .../src/tuscany/sca/rest/RESTServiceProxy.cpp | 567 -------- .../httpd/src/tuscany/sca/rest/RESTServiceProxy.h | 95 -- .../service/httpd/src/tuscany/sca/rest/export.h | 38 - .../sca/rest/model/RESTReferenceBinding.cpp | 66 - .../tuscany/sca/rest/model/RESTReferenceBinding.h | 80 -- .../extensions/rest/xsd/sca-binding-rest.xsd | 36 - .../extensions/rest/xsd/sca-interface-rest.xsd | 40 - sca-cpp/trunk/runtime/extensions/ruby/Makefile.am | 24 - .../runtime/extensions/ruby/extension/Makefile.am | 34 - .../extensions/ruby/extension/src/Extension.cpp | 56 - .../extensions/ruby/extension/src/extconf.rb | 25 - .../trunk/runtime/extensions/ruby/src/Makefile.am | 53 - .../extensions/ruby/src/tuscany/sca/ruby/Ruby.h | 39 - .../src/tuscany/sca/ruby/RubyCompositeContext.cpp | 70 - .../src/tuscany/sca/ruby/RubyCompositeContext.h | 50 - .../ruby/src/tuscany/sca/ruby/RubyExtension.cpp | 72 - .../ruby/src/tuscany/sca/ruby/RubyExtension.h | 58 - .../sca/ruby/RubyImplementationExtension.cpp | 74 -- .../tuscany/sca/ruby/RubyImplementationExtension.h | 74 -- .../ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp | 384 ------ .../ruby/src/tuscany/sca/ruby/RubyServiceProxy.h | 114 -- .../src/tuscany/sca/ruby/RubyServiceWrapper.cpp | 794 ----------- .../ruby/src/tuscany/sca/ruby/RubyServiceWrapper.h | 94 -- .../extensions/ruby/src/tuscany/sca/ruby/export.h | 38 - .../tuscany/sca/ruby/model/RubyImplementation.cpp | 171 --- .../tuscany/sca/ruby/model/RubyImplementation.h | 136 -- .../sca/ruby/model/RubyReferenceBinding.cpp | 60 - .../tuscany/sca/ruby/model/RubyReferenceBinding.h | 83 -- .../tuscany/sca/ruby/model/RubyServiceBinding.cpp | 54 - .../tuscany/sca/ruby/model/RubyServiceBinding.h | 77 -- .../ruby/xsd/sca-implementation-ruby.xsd | 42 - sca-cpp/trunk/runtime/extensions/sca/Makefile.am | 23 - .../runtime/extensions/sca/reference/Makefile.am | 18 - .../extensions/sca/reference/src/Makefile.am | 42 - .../sca/binding/SCAServiceBindingExtension.cpp | 103 -- .../sca/binding/SCAServiceBindingExtension.h | 77 -- .../sca/binding/model/SCAServiceBinding.cpp | 59 - .../tuscany/sca/binding/model/SCAServiceBinding.h | 76 -- .../runtime/extensions/sca/service/Makefile.am | 18 - .../runtime/extensions/sca/service/src/Makefile.am | 42 - .../sca/binding/SCAReferenceBindingExtension.cpp | 103 -- .../sca/binding/SCAReferenceBindingExtension.h | 77 -- .../sca/binding/model/SCAReferenceBinding.cpp | 66 - .../sca/binding/model/SCAReferenceBinding.h | 85 -- .../runtime/extensions/sca/xsd/sca-binding-sca.xsd | 39 - sca-cpp/trunk/runtime/extensions/ws/Makefile.am | 23 - .../runtime/extensions/ws/reference/Makefile.am | 18 - .../extensions/ws/reference/axis2c/Makefile.am | 18 - .../extensions/ws/reference/axis2c/src/Makefile.am | 54 - .../axis2c/src/tuscany/sca/ws/Axis2Client.cpp | 820 ------------ .../axis2c/src/tuscany/sca/ws/Axis2Client.h | 65 - .../tuscany/sca/ws/WSServiceBindingExtension.cpp | 118 -- .../src/tuscany/sca/ws/WSServiceBindingExtension.h | 78 -- .../axis2c/src/tuscany/sca/ws/WSServiceWrapper.cpp | 131 -- .../axis2c/src/tuscany/sca/ws/WSServiceWrapper.h | 65 - .../reference/axis2c/src/tuscany/sca/ws/export.h | 38 - .../src/tuscany/sca/ws/model/WSServiceBinding.cpp | 144 -- .../src/tuscany/sca/ws/model/WSServiceBinding.h | 137 -- .../runtime/extensions/ws/service/Makefile.am | 18 - .../extensions/ws/service/axis2c/Makefile.am | 18 - .../extensions/ws/service/axis2c/src/Makefile.am | 94 -- .../extensions/ws/service/axis2c/src/axis2.xml | 181 --- .../extensions/ws/service/axis2c/src/deploy.bat | 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 | 177 --- .../src/tuscany/sca/ws/Axis2DispatcherModule.cpp | 149 --- .../axis2c/src/tuscany/sca/ws/Axis2Service.cpp | 553 -------- .../axis2c/src/tuscany/sca/ws/Axis2Utils.cpp | 77 -- .../service/axis2c/src/tuscany/sca/ws/Axis2Utils.h | 46 - .../tuscany/sca/ws/WSReferenceBindingExtension.cpp | 119 -- .../tuscany/sca/ws/WSReferenceBindingExtension.h | 76 -- .../axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp | 579 -------- .../axis2c/src/tuscany/sca/ws/WSServiceProxy.h | 95 -- .../ws/service/axis2c/src/tuscany/sca/ws/export.h | 38 - .../tuscany/sca/ws/model/WSReferenceBinding.cpp | 151 --- .../src/tuscany/sca/ws/model/WSReferenceBinding.h | 143 -- .../extensions/ws/xsd/sca-binding-webservice.xsd | 57 - sca-cpp/trunk/samples/AUTHORS | 0 .../AlertAggregator/AlertAggregatorSCADiagram.png | Bin 29041 -> 0 bytes sca-cpp/trunk/samples/AlertAggregator/Makefile.am | 21 - sca-cpp/trunk/samples/AlertAggregator/README | 38 - sca-cpp/trunk/samples/AlertAggregator/README.html | 263 ---- sca-cpp/trunk/samples/AlertAggregator/config.xml | 33 - .../samples/AlertAggregator/httpserver.php/README | 33 - .../AlertAggregator/httpserver.php/conf/httpd.conf | 28 - .../AlertAggregator/httpserver.php/conf/mime.types | 607 --------- .../httpserver.php/htdocs/AlertDisplay.php | 204 --- .../httpserver.php/htdocs/Alerter.xsd | 74 -- .../httpserver.php/htdocs/Cached_Alerts.xml | 214 --- .../httpserver.php/htdocs/index.html | 280 ---- .../AlertAggregator/httpserver.php/htdocs/pop.png | Bin 244 -> 0 bytes .../AlertAggregator/httpserver.php/htdocs/rss.png | Bin 689 -> 0 bytes .../httpserver.php/htdocs/style.css | 166 --- .../AlertAggregator/httpserver.php/startserver.bat | 76 -- .../samples/AlertAggregator/httpserver/Makefile.am | 23 - .../AlertAggregator/httpserver/conf/httpd.conf | 43 - .../AlertAggregator/httpserver/conf/mime.types | 607 --------- .../AlertAggregator/httpserver/htdocs/index.html | 290 ---- .../AlertAggregator/httpserver/htdocs/pop.png | Bin 244 -> 0 bytes .../AlertAggregator/httpserver/htdocs/rss.png | Bin 689 -> 0 bytes .../AlertAggregator/httpserver/htdocs/style.css | 166 --- .../AlertAggregator/httpserver/startserver.bat | 73 -- .../AlertAggregator/httpserver/startserver.sh | 78 -- .../AlertAggregator/httpserver/stopserver.sh | 25 - .../AlertAggregator/sample.alerter.app.composite | 33 - .../sample.alerter/AlertCheckerImpl.py | 116 -- .../sample.alerter/AlertConfigImpl.py | 175 --- .../AlertAggregator/sample.alerter/Alerter.xsd | 73 -- .../AlertAggregator/sample.alerter/Makefile.am | 23 - .../sample.alerter/POPCheckerImpl.py | 104 -- .../sample.alerter/POPCheckerImpl.rb | 122 -- .../sample.alerter/RSSCheckerImpl.py | 76 -- .../sample.alerter/sample.alerter.composite | 49 - .../AlertAggregator/sample.display/Alerter.xsd | 73 -- .../sample.display/HTMLDisplayImpl.py | 379 ------ .../AlertAggregator/sample.display/Makefile.am | 23 - .../sample.display/sample.display.composite | 39 - sca-cpp/trunk/samples/COPYING | 203 --- sca-cpp/trunk/samples/ChangeLog | 0 sca-cpp/trunk/samples/CppBigBank/Makefile.am | 21 - sca-cpp/trunk/samples/CppBigBank/README | 26 - sca-cpp/trunk/samples/CppBigBank/README.html | 389 ------ .../bigbank.account/AccountDataService.h | 63 - .../AccountDataServiceImpl.componentType | 28 - .../bigbank.account/AccountDataServiceImpl.cpp | 137 -- .../bigbank.account/AccountDataServiceImpl.h | 61 - .../CppBigBank/bigbank.account/AccountService.h | 51 - .../CppBigBank/bigbank.account/AccountService.wsdl | 126 -- .../AccountServiceImpl.componentType | 40 - .../bigbank.account/AccountServiceImpl.cpp | 132 -- .../bigbank.account/AccountServiceImpl.h | 44 - .../samples/CppBigBank/bigbank.account/Makefile.am | 59 - .../CppBigBank/bigbank.account/StockQuoteService.h | 36 - .../StockQuoteServiceImpl.componentType | 29 - .../bigbank.account/StockQuoteServiceImpl.cpp | 73 -- .../bigbank.account/StockQuoteServiceImpl.h | 36 - .../CppBigBank/bigbank.account/StockQuoteTypes.xsd | 37 - .../bigbank.account/StockQuoteWebService.h | 40 - .../bigbank.account/StockQuoteWebService.wsdl | 165 --- .../bigbank.account/bigbank.account.composite | 49 - .../CppBigBank/bigbank.account/runwsserver.bat | 50 - .../CppBigBank/bigbank.account/runwsserver.sh | 45 - .../trunk/samples/CppBigBank/bigbank.app.composite | 29 - .../CppBigBank/bigbank.client/AccountClient.cpp | 127 -- .../samples/CppBigBank/bigbank.client/Makefile.am | 35 - .../CppBigBank/bigbank.client/runclient.bat | 50 - .../samples/CppBigBank/bigbank.client/runclient.sh | 46 - .../bigbank.phpwsclient/AccountService.wsdl | 126 -- .../CppBigBank/bigbank.phpwsclient/Makefile.am | 22 - .../samples/CppBigBank/bigbank.phpwsclient/README | 137 -- .../CppBigBank/bigbank.phpwsclient/bigaccount.php | 113 -- .../CppBigBank/bigbank.phpwsclient/bigwelcome.php | 44 - sca-cpp/trunk/samples/CppCalculator/Makefile.am | 21 - sca-cpp/trunk/samples/CppCalculator/README | 4 - sca-cpp/trunk/samples/CppCalculator/README.html | 176 --- .../CppCalculator/sample.calculator.app.composite | 29 - .../sample.calculator.client/CalculatorClient.cpp | 150 --- .../sample.calculator.client/Makefile.am | 40 - .../sample.calculator.client/runclient.bat | 42 - .../sample.calculator.client/runclient.sh | 39 - .../CppCalculator/sample.calculator/Calculator.h | 34 - .../sample.calculator/CalculatorImpl.componentType | 31 - .../sample.calculator/CalculatorImpl.cpp | 90 -- .../sample.calculator/CalculatorImpl.h | 41 - .../CppCalculator/sample.calculator/Divide.h | 34 - .../sample.calculator/DivideImpl.componentType | 27 - .../CppCalculator/sample.calculator/DivideImpl.cpp | 48 - .../CppCalculator/sample.calculator/DivideImpl.h | 39 - .../CppCalculator/sample.calculator/Makefile.am | 53 - .../sample.calculator/sample.calculator.composite | 33 - sca-cpp/trunk/samples/GettingStarted.html | 513 -------- sca-cpp/trunk/samples/HttpdBigBank/Makefile.am | 21 - sca-cpp/trunk/samples/HttpdBigBank/README | 37 - sca-cpp/trunk/samples/HttpdBigBank/README.html | 197 --- .../bigbank.account/AccountService.wsdl | 126 -- .../bigbank.account/AccountServiceImpl.rb | 83 -- .../HttpdBigBank/bigbank.account/Makefile.am | 22 - .../bigbank.account/StockQuoteServiceImpl.rb | 52 - .../bigbank.account/StockQuoteTypes.xsd | 40 - .../bigbank.account/StockQuoteWebService.wsdl | 165 --- .../bigbank.account/bigbank.account.composite | 51 - .../bigbank.accountdata/AccountData.xsd | 45 - .../bigbank.accountdata/AccountDataServiceImpl.rb | 72 - .../HttpdBigBank/bigbank.accountdata/Makefile.am | 22 - .../bigbank.accountdata.composite | 33 - .../samples/HttpdBigBank/bigbank.app.composite | 39 - .../bigbank.wsclient/AccountService.wsdl | 126 -- .../bigbank.wsclient/AccountWSClient.rb | 40 - .../HttpdBigBank/bigbank.wsclient/Makefile.am | 6 - .../bigbank.wsclient/bigbank.wsclient.composite | 29 - .../HttpdBigBank/bigbank.wsclient/runwsclient.bat | 51 - .../HttpdBigBank/bigbank.wsclient/runwsclient.sh | 48 - .../samples/HttpdBigBank/httpserver/Makefile.am | 6 - .../HttpdBigBank/httpserver/conf/httpd.conf | 35 - .../HttpdBigBank/httpserver/conf/mime.types | 607 --------- .../HttpdBigBank/httpserver/htdocs/index.html | 21 - .../HttpdBigBank/httpserver/startserver.bat | 89 -- .../samples/HttpdBigBank/httpserver/startserver.sh | 78 -- .../samples/HttpdBigBank/httpserver/stopserver.sh | 25 - sca-cpp/trunk/samples/INSTALL | 2 - sca-cpp/trunk/samples/LICENSE | 177 --- sca-cpp/trunk/samples/Makefile.am | 40 - sca-cpp/trunk/samples/NEWS | 0 sca-cpp/trunk/samples/NOTICE | 5 - sca-cpp/trunk/samples/PHPCalculator/Makefile.am | 22 - sca-cpp/trunk/samples/PHPCalculator/README | 122 -- .../trunk/samples/PHPCalculator/phpcalculator.png | Bin 30001 -> 0 bytes .../PHPCalculator/sample.calculator.app.composite | 33 - .../sample.calculator.client/CalculatorClient.cpp | 61 - .../sample.calculator.client/CalculatorClient.php | 32 - .../PHPCalculator/sample.calculator.client/env.sh | 48 - .../sample.calculator.client/runclient_cpp.bat | 26 - .../sample.calculator.client/runclient_cpp.sh | 26 - .../sample.calculator.client/runclient_php.bat | 25 - .../sample.calculator.wsclient/Calculator.wsdl | 173 --- .../CalculatorWSClient.php | 31 - .../sample.calculator.wsclient/runwsclient.bat | 25 - .../sample.calculator/Add.componentType | 29 - .../samples/PHPCalculator/sample.calculator/Add.h | 34 - .../PHPCalculator/sample.calculator/Add.php | 32 - .../sample.calculator/Calculator.componentType | 43 - .../PHPCalculator/sample.calculator/Calculator.h | 34 - .../PHPCalculator/sample.calculator/Calculator.php | 97 -- .../sample.calculator/Calculator.wsdl | 161 --- .../sample.calculator/CalculatorImpl.componentType | 31 - .../sample.calculator/CalculatorImpl.cpp | 90 -- .../sample.calculator/CalculatorImpl.h | 41 - .../CalculatorImpl_CalculatorService_Proxy.cpp | 98 -- .../CalculatorImpl_CalculatorService_Proxy.h | 44 - .../CalculatorImpl_CalculatorService_Wrapper.cpp | 135 -- .../CalculatorImpl_CalculatorService_Wrapper.h | 43 - .../CalculatorImpl_divideService_Proxy.cpp | 65 - .../CalculatorImpl_divideService_Proxy.h | 41 - .../sample.calculator/Divide.componentType | 41 - .../PHPCalculator/sample.calculator/Divide.h | 34 - .../PHPCalculator/sample.calculator/Divide.php | 71 - .../sample.calculator/DivideImpl.componentType | 27 - .../PHPCalculator/sample.calculator/DivideImpl.cpp | 48 - .../PHPCalculator/sample.calculator/DivideImpl.h | 39 - .../DivideImpl_DivideService_Proxy.cpp | 65 - .../DivideImpl_DivideService_Proxy.h | 41 - .../DivideImpl_DivideService_Wrapper.cpp | 84 -- .../DivideImpl_DivideService_Wrapper.h | 43 - .../sample.calculator/Log.componentType | 25 - .../samples/PHPCalculator/sample.calculator/Log.h | 34 - .../PHPCalculator/sample.calculator/Log.php | 36 - .../PHPCalculator/sample.calculator/Makefile.am | 56 - .../sample.calculator/Multiply.componentType | 28 - .../PHPCalculator/sample.calculator/Multiply.h | 34 - .../PHPCalculator/sample.calculator/Multiply.php | 33 - .../sample.calculator/Subtract.componentType | 29 - .../PHPCalculator/sample.calculator/Subtract.h | 34 - .../PHPCalculator/sample.calculator/Subtract.php | 30 - .../PHPCalculator/sample.calculator/runwsserver.sh | 45 - .../sample.calculator/sample.calculator.composite | 81 -- sca-cpp/trunk/samples/PythonCalculator/Makefile.am | 21 - sca-cpp/trunk/samples/PythonCalculator/README | 20 - sca-cpp/trunk/samples/PythonCalculator/README.html | 191 --- .../sample.calculator.app.composite | 28 - .../sample.calculator.client/Makefile.am | 23 - .../sample.calculator.client/calculator_client.py | 50 - .../sample.calculator.client/runclient.bat | 45 - .../sample.calculator.client/runclient.sh | 48 - .../sample.calculator/Calculator.wsdl | 161 --- .../sample.calculator/CalculatorImpl.py | 56 - .../sample.calculator/DivideImpl.py | 65 - .../PythonCalculator/sample.calculator/Makefile.am | 23 - .../sample.calculator/sample.calculator.composite | 34 - .../samples/PythonWeatherForecast/Makefile.am | 21 - sca-cpp/trunk/samples/PythonWeatherForecast/README | 20 - .../samples/PythonWeatherForecast/README.html | 200 --- .../sample.weather.app.composite | 28 - .../sample.weather.client/Makefile.am | 23 - .../sample.weather.client/runclient.bat | 50 - .../sample.weather.client/runclient.sh | 54 - .../weather_forecast_client.py | 49 - .../sample.weather/Makefile.am | 23 - .../sample.weather/WeatherForecast.wsdl | 133 -- .../sample.weather/WeatherForecastImpl.py | 65 - .../sample.weather/sample.weather.composite | 36 - sca-cpp/trunk/samples/README | 2 - sca-cpp/trunk/samples/RestCalculator/Makefile.am | 23 - sca-cpp/trunk/samples/RestCalculator/README | 23 - sca-cpp/trunk/samples/RestCalculator/README.html | 231 ---- .../samples/RestCalculator/httpserver/Makefile.am | 6 - .../RestCalculator/httpserver/conf/httpd.conf | 34 - .../RestCalculator/httpserver/conf/mime.types | 607 --------- .../RestCalculator/httpserver/htdocs/index.html | 21 - .../RestCalculator/httpserver/startserver.bat | 72 - .../RestCalculator/httpserver/startserver.sh | 66 - .../RestCalculator/httpserver/stopserver.sh | 25 - .../RestCalculator/sample.calculator.app.composite | 33 - .../CalculatorRestClient.rb | 25 - .../sample.calculator.restclient/Makefile.am | 23 - .../sample.calculator.restclient/runrestclient.bat | 50 - .../sample.calculator.restclient/runrestclient.sh | 41 - .../sample.calculator.restclient.composite | 28 - .../sample.calculator/CalculatorImpl.rb | 48 - .../RestCalculator/sample.calculator/DivideImpl.rb | 39 - .../RestCalculator/sample.calculator/Makefile.am | 22 - .../sample.calculator/sample.calculator.composite | 39 - sca-cpp/trunk/samples/RestCustomer/Makefile.am | 22 - sca-cpp/trunk/samples/RestCustomer/README | 25 - sca-cpp/trunk/samples/RestCustomer/README.html | 236 ---- .../samples/RestCustomer/httpserver/Makefile.am | 6 - .../RestCustomer/httpserver/conf/httpd.conf | 34 - .../RestCustomer/httpserver/conf/mime.types | 607 --------- .../RestCustomer/httpserver/htdocs/index.html | 21 - .../RestCustomer/httpserver/startserver.bat | 75 -- .../samples/RestCustomer/httpserver/startserver.sh | 80 -- .../samples/RestCustomer/httpserver/stopserver.sh | 25 - .../RestCustomer/sample.customer.app.composite | 34 - .../sample.customer.restclient/Customer.xsd | 33 - .../CustomerRestClient.py | 85 -- .../sample.customer.restclient/Makefile.am | 23 - .../sample.customer.restclient/runrestclient.bat | 53 - .../sample.customer.restclient/runrestclient.sh | 50 - .../sample.customer.restclient.composite | 33 - .../samples/RestCustomer/sample.customer/2345.xml | 20 - .../RestCustomer/sample.customer/Customer.xsd | 33 - .../sample.customer/CustomerResourceImpl.py | 59 - .../RestCustomer/sample.customer/Makefile.am | 22 - .../sample.customer/sample.customer.composite | 39 - sca-cpp/trunk/samples/RestYahoo/Makefile.am | 23 - sca-cpp/trunk/samples/RestYahoo/README | 19 - sca-cpp/trunk/samples/RestYahoo/README.html | 202 --- .../samples/RestYahoo/sample.yahoo.app.composite | 28 - .../RestYahoo/sample.yahoo.client/Makefile.am | 23 - .../sample.yahoo.client/YahooWebSearchClient.rb | 25 - .../RestYahoo/sample.yahoo.client/runclient.bat | 50 - .../RestYahoo/sample.yahoo.client/runclient.sh | 51 - .../samples/RestYahoo/sample.yahoo/Makefile.am | 22 - .../RestYahoo/sample.yahoo/YahooWebSearchImpl.py | 60 - .../sample.yahoo/YahooWebSearchResponse.xsd | 47 - .../RestYahoo/sample.yahoo/sample.yahoo.composite | 33 - sca-cpp/trunk/samples/RubyBigBank/Makefile.am | 21 - sca-cpp/trunk/samples/RubyBigBank/README | 21 - sca-cpp/trunk/samples/RubyBigBank/README.html | 312 ----- .../bigbank.account/AccountDataServiceImpl.rb | 72 - .../bigbank.account/AccountService.wsdl | 126 -- .../bigbank.account/AccountServiceImpl.rb | 82 -- .../RubyBigBank/bigbank.account/Makefile.am | 24 - .../bigbank.account/StockQuoteServiceImpl.rb | 52 - .../bigbank.account/StockQuoteTypes.xsd | 40 - .../bigbank.account/StockQuoteWebService.wsdl | 165 --- .../bigbank.account/bigbank.account.composite | 53 - .../RubyBigBank/bigbank.account/runwsserver.bat | 51 - .../RubyBigBank/bigbank.account/runwsserver.sh | 46 - .../samples/RubyBigBank/bigbank.app.composite | 33 - .../RubyBigBank/bigbank.client/AccountClient.rb | 40 - .../samples/RubyBigBank/bigbank.client/Makefile.am | 23 - .../RubyBigBank/bigbank.client/runclient.bat | 51 - .../RubyBigBank/bigbank.client/runclient.sh | 48 - .../bigbank.wsclient/AccountService.wsdl | 126 -- .../bigbank.wsclient/AccountWSClient.rb | 40 - .../RubyBigBank/bigbank.wsclient/Makefile.am | 23 - .../bigbank.wsclient/bigbank.wsclient.composite | 29 - .../RubyBigBank/bigbank.wsclient/runwsclient.bat | 51 - .../RubyBigBank/bigbank.wsclient/runwsclient.sh | 48 - sca-cpp/trunk/samples/RubyCalculator/Makefile.am | 21 - sca-cpp/trunk/samples/RubyCalculator/README | 20 - sca-cpp/trunk/samples/RubyCalculator/README.html | 187 --- .../RubyCalculator/sample.calculator.app.composite | 28 - .../sample.calculator.client/CalculatorClient.rb | 25 - .../sample.calculator.client/Makefile.am | 23 - .../sample.calculator.client/runclient.bat | 44 - .../sample.calculator.client/runclient.sh | 42 - .../sample.calculator/Calculator.wsdl | 161 --- .../sample.calculator/CalculatorImpl.rb | 48 - .../RubyCalculator/sample.calculator/DivideImpl.rb | 39 - .../RubyCalculator/sample.calculator/Makefile.am | 22 - .../sample.calculator/sample.calculator.composite | 34 - .../SupplyChain/supplychain.demo.app.composite | 34 - .../supplychain.demo/DemoClientImpl.componentType | 33 - .../supplychain.demo/supplychain.demo.composite | 41 - .../supplychain.logging/LoggerImpl.componentType | 28 - .../supplychain.logging/LoggingFacility.wsdl | 37 - .../supplychain.logging.composite | 34 - .../supplychain.manufacturer/Manufacturer.wsdl | 39 - .../ManufacturerImpl.componentType | 39 - .../WarehouseCallback.wsdl | 38 - .../supplychain.manufacturer.composite | 50 - .../supplychain.manufacturerA.app.composite | 30 - .../supplychain.manufacturerB.app.composite | 30 - .../supplychain.manufacturerC.app.composite | 30 - .../SupplyChain/supplychain.retailer.app.composite | 66 - .../SupplyChain/supplychain.retailer/Retailer.wsdl | 39 - .../RetailerImpl.componentType | 37 - .../supplychain.retailer.composite | 46 - .../supplychain.warehouse/Warehouse.wsdl | 38 - .../WarehouseCallbackImpl.componentType | 34 - .../WarehouseImpl.componentType | 39 - .../supplychain.warehouse.composite | 62 - sca-cpp/trunk/samples/autogen.sh | 31 - sca-cpp/trunk/samples/build.sh | 22 - sca-cpp/trunk/samples/configure.ac | 206 --- sca-cpp/trunk/samples/runtest.sh | 159 --- sca-cpp/trunk/samples/scagen.bat | 37 - sca-cpp/trunk/test/store-function/Makefile.am | 8 +- sca-cpp/trunk/test/store-object/Makefile.am | 8 +- sca-cpp/trunk/test/store-script/Makefile.am | 10 +- 1766 files changed, 83799 insertions(+), 85553 deletions(-) delete mode 100644 sca-cpp/trunk/GettingStarted.html delete mode 100755 sca-cpp/trunk/build.sh delete mode 100755 sca-cpp/trunk/builddist.sh delete mode 100755 sca-cpp/trunk/configure.sh create mode 100644 sca-cpp/trunk/contrib/doc/Axis2CWSExtension.html create mode 100644 sca-cpp/trunk/contrib/doc/CPPGeneratorTool.txt create mode 100644 sca-cpp/trunk/contrib/doc/CppExtension.html create mode 100644 sca-cpp/trunk/contrib/doc/PythonExtension.html create mode 100644 sca-cpp/trunk/contrib/doc/RESTExtension.html create mode 100644 sca-cpp/trunk/contrib/doc/RubyExtension.html create mode 100644 sca-cpp/trunk/contrib/doc/SCAExtension.html create mode 100644 sca-cpp/trunk/contrib/doc/css/maven-base.css create mode 100644 sca-cpp/trunk/contrib/doc/css/maven-theme.css create mode 100644 sca-cpp/trunk/contrib/runtime/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/core/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/Exceptions.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/Exceptions.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/Operation.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/Operation.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/SCARuntime.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/SCARuntime.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/ServiceProxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/ServiceWrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/ServiceWrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/export.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ImplementationExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ImplementationExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/InterfaceExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/InterfaceExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Binding.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Binding.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Component.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Component.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ComponentType.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ComponentType.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Composite.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Composite.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeReference.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeReference.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeService.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeService.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Contract.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Contract.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Interface.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Interface.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ModelLoader.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ModelLoader.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Reference.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Reference.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ReferenceBinding.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ReferenceBinding.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ReferenceType.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ReferenceType.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Service.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Service.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ServiceBinding.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ServiceBinding.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ServiceType.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ServiceType.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLDefinition.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLInterface.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLInterface.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLMessagePart.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLMessagePart.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLOperation.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLOperation.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Wire.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Wire.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/DefaultLogWriter.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/DefaultLogWriter.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/File.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/File.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/FileLogWriter.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/FileLogWriter.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Library.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Library.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/LogWriter.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/LogWriter.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Logger.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Logger.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Logging.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Mutex.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Mutex.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Queue.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Queue.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/SDOUtils.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/SDOUtils.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Thread.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Thread.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/ThreadLocal.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/ThreadLocal.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Utils.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Utils.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/test/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/core/test/SCATestMacros.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/test/main.cpp create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/sca_test.bat create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/sca_test.sh create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/BaseWsdlTest.cpp create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/BaseWsdlTest.h create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/WSDLDefinitionTest.cpp create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/WSDLDefinitionTest.h create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/WSDLErrorsTest.cpp create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/WSDLErrorsTest.h create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdlTests.h create mode 100644 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_correct/simple.wsdl create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_binding_input.wsdl create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_binding_output.wsdl create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_bindings.wsdl create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_messages.wsdl create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_partnames.wsdl create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_portTypes.wsdl create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_services.wsdl create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_address.wsdl create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_binding.wsdl create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_body.wsdl create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_operation.wsdl create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_binding_for_port.wsdl create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_message.wsdl create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_name_for_part.wsdl create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_name_for_port.wsdl create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_operation.wsdl create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_portType.wsdl create mode 100755 sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_type_for_part.wsdl create mode 100644 sca-cpp/trunk/contrib/runtime/core/xsd/sca-core.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/core/xsd/sca-implementation-composite.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/core/xsd/sca-implementation-java.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/core/xsd/sca-interface-java.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/core/xsd/sca-interface-wsdl.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/core/xsd/sca.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/core/xsd/tuscany.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11_http.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11_mime.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11_soap.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11_soap12.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/ComponentContext.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/ComponentContext.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/CompositeContext.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/CompositeContext.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/ServiceRuntimeException.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/export.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/sca.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/META-INF/LICENSE create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/META-INF/NOTICE create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/META-INF/README create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/build.xml create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/CalculatorTest.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/EnvHandlerTest.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/ImplClassWithNameSpaceButNotInClassAttrTest.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/ImplClassWithNameSpaceTest.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/IntfClassWithNameSpaceButNotInClassAttrTest.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/IntfClassWithNameSpaceTest.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/MissingCompositeAndFragmentTest.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/SimplePublicPrivateProtectedTest.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TestAllCompositesTest.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TestDeployAssistTool.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TuscanyTestCase.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/Calculator.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/CalculatorImpl.componentType create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/CalculatorImpl.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/sca.composite create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/otherSubFolder/CalculatorBack.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/otherSubFolder/CalculatorForward.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/sca.composite create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorBackImpl.componentType create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorBackImpl.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorForwardImpl.componentType create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorForwardImpl.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfo.fragment create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfo.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfoImpl.componentType create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfoImpl.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfo.fragment create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfo.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfoImpl.componentType create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfoImpl.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfo.fragment create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfo.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfoImpl.componentType create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfoImpl.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValue.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl.componentType create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl.hpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl_stockQuote_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/StockQuoteService.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/sca.composite create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfo.fragment create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfo.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfoImpl.componentType create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfoImpl.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValue.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl.componentType create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl.hpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl_stockQuote_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/StockQuoteService.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/sca.composite create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValue.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValueImpl.componentType create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValueImpl.hpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/sca.composite create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValue.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValueImpl.componentType create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValueImpl.hpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/sca.composite create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValue.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValueImpl.componentType create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValueImpl.hpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/sca.composite create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeMissingScaComposite/CustomerInfo.fragmentX create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeMissingScaComposite/sca.compositeX create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfo.fragment create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfo.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfoImpl.componentType create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfoImpl.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValue.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl.componentType create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl.hpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl_stockQuote_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/StockQuoteService.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/sca.composite create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfo.fragment create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfo.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfoImpl.componentType create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfoImpl.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_customerInfo_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_customerInfo_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_stockQuote_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_stockQuote_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_customerInfo_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_customerInfo_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_stockQuote_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_stockQuote_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_customerInfo_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_customerInfo_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_stockQuote_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_stockQuote_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/lib/readme.txt create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/scagen.bat create mode 100755 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/scagen.sh create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/BodyPart.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/CParsingTool.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Configuration.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/DirectoryTree.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/FileActor.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/FilePart.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Headers.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/InputCppSourceCode.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/MacroPart.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/MethodPart.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Options.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Parameter.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/ParsingException.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/PrototypePart.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Signature.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Utils.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/package.html create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ComponentDomNodeHandler.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ComponentTypeFileHandler.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/CompositeOrFragmentFileHandler.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DirectoryScanner.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DomHandler.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DomNodeHandler.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/GenericDomNodeHandler.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/LittleClass.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ReferenceDomNodeHandler.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/Scagen.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ServiceDomNodeHandler.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ServicesGenerator.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/XMLFileActor.java create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/package.html create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyCPP.xsl create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyHeader.xsl create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperCPP.xsl create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperHeader.xsl create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/xsd/sca-implementation-cpp.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/cpp/xsd/sca-interface-cpp.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/AUTHORS create mode 100755 sca-cpp/trunk/contrib/runtime/extensions/php/COPYING create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/ChangeLog create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/INSTALL create mode 100755 sca-cpp/trunk/contrib/runtime/extensions/php/LICENSE create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/NEWS create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/NOTICE create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/README create mode 100755 sca-cpp/trunk/contrib/runtime/extensions/php/autogen.sh create mode 100755 sca-cpp/trunk/contrib/runtime/extensions/php/build.sh create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/configure.ac create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/samples/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/README create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator.app.composite create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/calculator_client.py create mode 100755 sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/runclient.sh create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Calculator.componentType create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Calculator.php create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Divide.componentType create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Divide.php create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Log.componentType create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Log.php create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Multiply.php create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/sample.calculator.composite create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPServiceProxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPServiceProxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/export.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPReferenceBinding.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPReferenceBinding.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/php_sca.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/sca.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/sca.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/php/xsd/sca-implementation-php.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/export.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/sca_proxy.py create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/xsd/sca-implementation-python.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/python/xsd/sca-interface-python.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/interface/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/RESTInterfaceExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/RESTInterfaceExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/exportinterface.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/model/RESTInterface.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/model/RESTInterface.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/reference/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceBindingExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceBindingExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/model/RESTServiceBinding.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/model/RESTServiceBinding.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/service/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/export.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/xsd/sca-binding-rest.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/rest/xsd/sca-interface-rest.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/extension/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/extension/src/Extension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/extension/src/extconf.rb create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/Ruby.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/export.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ruby/xsd/sca-implementation-ruby.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/sca/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/sca/reference/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/sca/service/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/sca/xsd/sca-binding-sca.xsd create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/reference/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/export.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/Makefile.am create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/axis2.xml create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/deploy.bat create mode 100755 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/deploy.sh create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/module.xml create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/services.xml create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Dispatcher.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2DispatcherModule.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Service.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/export.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.cpp create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.h create mode 100644 sca-cpp/trunk/contrib/runtime/extensions/ws/xsd/sca-binding-webservice.xsd create mode 100644 sca-cpp/trunk/contrib/samples/AUTHORS create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/AlertAggregatorSCADiagram.png create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/README create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/README.html create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/config.xml create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/README create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/conf/httpd.conf create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/conf/mime.types create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/AlertDisplay.php create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/Alerter.xsd create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/Cached_Alerts.xml create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/index.html create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/pop.png create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/rss.png create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/style.css create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/startserver.bat create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/conf/httpd.conf create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/conf/mime.types create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/htdocs/index.html create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/htdocs/pop.png create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/htdocs/rss.png create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/htdocs/style.css create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/startserver.bat create mode 100755 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/startserver.sh create mode 100755 sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/stopserver.sh create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter.app.composite create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/AlertCheckerImpl.py create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/AlertConfigImpl.py create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/Alerter.xsd create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/POPCheckerImpl.py create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/POPCheckerImpl.rb create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/RSSCheckerImpl.py create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/sample.alerter.composite create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/sample.display/Alerter.xsd create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/sample.display/HTMLDisplayImpl.py create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/sample.display/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/AlertAggregator/sample.display/sample.display.composite create mode 100755 sca-cpp/trunk/contrib/samples/COPYING create mode 100644 sca-cpp/trunk/contrib/samples/ChangeLog create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/README create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/README.html create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountDataService.h create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.componentType create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.cpp create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.h create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountService.h create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountService.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountServiceImpl.componentType create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountServiceImpl.cpp create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountServiceImpl.h create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteService.h create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.componentType create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.cpp create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.h create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteTypes.xsd create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteWebService.h create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteWebService.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/bigbank.account.composite create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/runwsserver.bat create mode 100755 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/runwsserver.sh create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.app.composite create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.client/AccountClient.cpp create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.client/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.client/runclient.bat create mode 100755 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.client/runclient.sh create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/AccountService.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/README create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/bigaccount.php create mode 100644 sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/bigwelcome.php create mode 100644 sca-cpp/trunk/contrib/samples/CppCalculator/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/CppCalculator/README create mode 100644 sca-cpp/trunk/contrib/samples/CppCalculator/README.html create mode 100644 sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.app.composite create mode 100644 sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.client/CalculatorClient.cpp create mode 100644 sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.client/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.client/runclient.bat create mode 100755 sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.client/runclient.sh create mode 100644 sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/Calculator.h create mode 100644 sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/CalculatorImpl.componentType create mode 100644 sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/CalculatorImpl.cpp create mode 100644 sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/CalculatorImpl.h create mode 100644 sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/Divide.h create mode 100644 sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/DivideImpl.componentType create mode 100644 sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/DivideImpl.cpp create mode 100644 sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/DivideImpl.h create mode 100644 sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/sample.calculator.composite create mode 100644 sca-cpp/trunk/contrib/samples/GettingStarted.html create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/README create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/README.html create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/AccountService.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/AccountServiceImpl.rb create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/StockQuoteServiceImpl.rb create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/StockQuoteTypes.xsd create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/StockQuoteWebService.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/bigbank.account.composite create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.accountdata/AccountData.xsd create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.accountdata/AccountDataServiceImpl.rb create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.accountdata/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.accountdata/bigbank.accountdata.composite create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.app.composite create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/AccountService.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/AccountWSClient.rb create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/bigbank.wsclient.composite create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/runwsclient.bat create mode 100755 sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/runwsclient.sh create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/conf/httpd.conf create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/conf/mime.types create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/htdocs/index.html create mode 100644 sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/startserver.bat create mode 100755 sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/startserver.sh create mode 100755 sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/stopserver.sh create mode 100644 sca-cpp/trunk/contrib/samples/INSTALL create mode 100755 sca-cpp/trunk/contrib/samples/LICENSE create mode 100644 sca-cpp/trunk/contrib/samples/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/NEWS create mode 100644 sca-cpp/trunk/contrib/samples/NOTICE create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/README create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/phpcalculator.png create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.app.composite create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/CalculatorClient.cpp create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/CalculatorClient.php create mode 100755 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/env.sh create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/runclient_cpp.bat create mode 100755 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/runclient_cpp.sh create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/runclient_php.bat create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.wsclient/Calculator.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.wsclient/CalculatorWSClient.php create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.wsclient/runwsclient.bat create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.componentType create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.php create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.componentType create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.php create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.componentType create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.cpp create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.componentType create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.php create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.componentType create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.cpp create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.componentType create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.php create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.componentType create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.php create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.componentType create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.php create mode 100755 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/runwsserver.sh create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/sample.calculator.composite create mode 100644 sca-cpp/trunk/contrib/samples/PythonCalculator/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/PythonCalculator/README create mode 100644 sca-cpp/trunk/contrib/samples/PythonCalculator/README.html create mode 100644 sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.app.composite create mode 100644 sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.client/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.client/calculator_client.py create mode 100644 sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.client/runclient.bat create mode 100755 sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.client/runclient.sh create mode 100644 sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/Calculator.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/CalculatorImpl.py create mode 100644 sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/DivideImpl.py create mode 100644 sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/sample.calculator.composite create mode 100644 sca-cpp/trunk/contrib/samples/PythonWeatherForecast/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/PythonWeatherForecast/README create mode 100644 sca-cpp/trunk/contrib/samples/PythonWeatherForecast/README.html create mode 100644 sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.app.composite create mode 100644 sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.client/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.client/runclient.bat create mode 100755 sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.client/runclient.sh create mode 100644 sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.client/weather_forecast_client.py create mode 100644 sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather/WeatherForecast.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather/WeatherForecastImpl.py create mode 100644 sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather/sample.weather.composite create mode 100644 sca-cpp/trunk/contrib/samples/README create mode 100644 sca-cpp/trunk/contrib/samples/RestCalculator/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/RestCalculator/README create mode 100644 sca-cpp/trunk/contrib/samples/RestCalculator/README.html create mode 100644 sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/conf/httpd.conf create mode 100644 sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/conf/mime.types create mode 100644 sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/htdocs/index.html create mode 100644 sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/startserver.bat create mode 100755 sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/startserver.sh create mode 100755 sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/stopserver.sh create mode 100644 sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.app.composite create mode 100644 sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/CalculatorRestClient.rb create mode 100644 sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/runrestclient.bat create mode 100755 sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/runrestclient.sh create mode 100644 sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/sample.calculator.restclient.composite create mode 100644 sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator/CalculatorImpl.rb create mode 100644 sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator/DivideImpl.rb create mode 100644 sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator/sample.calculator.composite create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/README create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/README.html create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/conf/httpd.conf create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/conf/mime.types create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/htdocs/index.html create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/startserver.bat create mode 100755 sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/startserver.sh create mode 100755 sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/stopserver.sh create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.app.composite create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/Customer.xsd create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/CustomerRestClient.py create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/runrestclient.bat create mode 100755 sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/runrestclient.sh create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/sample.customer.restclient.composite create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/2345.xml create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/Customer.xsd create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/CustomerResourceImpl.py create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/sample.customer.composite create mode 100644 sca-cpp/trunk/contrib/samples/RestYahoo/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/RestYahoo/README create mode 100644 sca-cpp/trunk/contrib/samples/RestYahoo/README.html create mode 100644 sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.app.composite create mode 100644 sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.client/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.client/YahooWebSearchClient.rb create mode 100644 sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.client/runclient.bat create mode 100755 sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.client/runclient.sh create mode 100644 sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo/YahooWebSearchImpl.py create mode 100644 sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo/YahooWebSearchResponse.xsd create mode 100644 sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo/sample.yahoo.composite create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/README create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/README.html create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/AccountDataServiceImpl.rb create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/AccountService.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/AccountServiceImpl.rb create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/StockQuoteServiceImpl.rb create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/StockQuoteTypes.xsd create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/StockQuoteWebService.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/bigbank.account.composite create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/runwsserver.bat create mode 100755 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/runwsserver.sh create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.app.composite create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.client/AccountClient.rb create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.client/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.client/runclient.bat create mode 100755 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.client/runclient.sh create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/AccountService.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/AccountWSClient.rb create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/bigbank.wsclient.composite create mode 100644 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/runwsclient.bat create mode 100755 sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/runwsclient.sh create mode 100644 sca-cpp/trunk/contrib/samples/RubyCalculator/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/RubyCalculator/README create mode 100644 sca-cpp/trunk/contrib/samples/RubyCalculator/README.html create mode 100644 sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.app.composite create mode 100644 sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.client/CalculatorClient.rb create mode 100644 sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.client/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.client/runclient.bat create mode 100755 sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.client/runclient.sh create mode 100644 sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/Calculator.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/CalculatorImpl.rb create mode 100644 sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/DivideImpl.rb create mode 100644 sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/sample.calculator.composite create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.demo.app.composite create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.demo/DemoClientImpl.componentType create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.demo/supplychain.demo.composite create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.logging/LoggerImpl.componentType create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.logging/LoggingFacility.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.logging/supplychain.logging.composite create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturer/Manufacturer.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturer/ManufacturerImpl.componentType create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturer/WarehouseCallback.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturer/supplychain.manufacturer.composite create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturerA.app.composite create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturerB.app.composite create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturerC.app.composite create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.retailer.app.composite create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.retailer/Retailer.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.retailer/RetailerImpl.componentType create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.retailer/supplychain.retailer.composite create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.warehouse/Warehouse.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.warehouse/WarehouseCallbackImpl.componentType create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.warehouse/WarehouseImpl.componentType create mode 100644 sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.warehouse/supplychain.warehouse.composite create mode 100755 sca-cpp/trunk/contrib/samples/autogen.sh create mode 100755 sca-cpp/trunk/contrib/samples/build.sh create mode 100644 sca-cpp/trunk/contrib/samples/configure.ac create mode 100755 sca-cpp/trunk/contrib/samples/runtest.sh create mode 100644 sca-cpp/trunk/contrib/samples/scagen.bat delete mode 100644 sca-cpp/trunk/doc/Axis2CWSExtension.html delete mode 100644 sca-cpp/trunk/doc/CPPGeneratorTool.txt delete mode 100644 sca-cpp/trunk/doc/CppExtension.html delete mode 100644 sca-cpp/trunk/doc/Doxyfile.w32 delete mode 100644 sca-cpp/trunk/doc/PythonExtension.html delete mode 100644 sca-cpp/trunk/doc/RESTExtension.html delete mode 100644 sca-cpp/trunk/doc/RubyExtension.html delete mode 100644 sca-cpp/trunk/doc/SCAExtension.html delete mode 100644 sca-cpp/trunk/doc/css/maven-base.css delete mode 100644 sca-cpp/trunk/doc/css/maven-theme.css delete mode 100755 sca-cpp/trunk/makebindist.sh delete mode 100644 sca-cpp/trunk/runtime/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/core/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/core/src/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/core/Exceptions.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/core/Exceptions.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/core/Operation.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/core/Operation.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/core/SCARuntime.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/core/SCARuntime.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/core/ServiceProxy.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/core/ServiceWrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/core/ServiceWrapper.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/export.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ImplementationExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ImplementationExtension.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/InterfaceExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/InterfaceExtension.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Binding.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Binding.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Component.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Component.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ComponentType.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ComponentType.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Composite.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Composite.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeReference.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeReference.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeService.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeService.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Contract.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Contract.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Interface.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Interface.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ModelLoader.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ModelLoader.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Reference.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Reference.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ReferenceBinding.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ReferenceBinding.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ReferenceType.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ReferenceType.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Service.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Service.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ServiceBinding.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ServiceBinding.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ServiceType.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ServiceType.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLDefinition.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLInterface.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLInterface.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLMessagePart.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLMessagePart.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLOperation.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLOperation.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Wire.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Wire.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/DefaultLogWriter.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/DefaultLogWriter.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/File.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/File.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/FileLogWriter.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/FileLogWriter.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Library.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Library.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/LogWriter.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/LogWriter.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Logger.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Logger.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Logging.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Mutex.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Mutex.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Queue.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Queue.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/SDOUtils.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/SDOUtils.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Thread.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Thread.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/ThreadLocal.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/ThreadLocal.h delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Utils.cpp delete mode 100644 sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Utils.h delete mode 100644 sca-cpp/trunk/runtime/core/test/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/core/test/SCATestMacros.h delete mode 100644 sca-cpp/trunk/runtime/core/test/main.cpp delete mode 100755 sca-cpp/trunk/runtime/core/test/sca_test.bat delete mode 100755 sca-cpp/trunk/runtime/core/test/sca_test.sh delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/BaseWsdlTest.cpp delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/BaseWsdlTest.h delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/WSDLDefinitionTest.cpp delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/WSDLDefinitionTest.h delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/WSDLErrorsTest.cpp delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/WSDLErrorsTest.h delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdlTests.h delete mode 100644 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_correct/simple.wsdl delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_binding_input.wsdl delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_binding_output.wsdl delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_bindings.wsdl delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_messages.wsdl delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_partnames.wsdl delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_portTypes.wsdl delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_services.wsdl delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_address.wsdl delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_binding.wsdl delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_body.wsdl delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_operation.wsdl delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_binding_for_port.wsdl delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_message.wsdl delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_name_for_part.wsdl delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_name_for_port.wsdl delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_operation.wsdl delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_portType.wsdl delete mode 100755 sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_type_for_part.wsdl delete mode 100644 sca-cpp/trunk/runtime/core/xsd/sca-core.xsd delete mode 100644 sca-cpp/trunk/runtime/core/xsd/sca-implementation-composite.xsd delete mode 100644 sca-cpp/trunk/runtime/core/xsd/sca-implementation-java.xsd delete mode 100644 sca-cpp/trunk/runtime/core/xsd/sca-interface-java.xsd delete mode 100644 sca-cpp/trunk/runtime/core/xsd/sca-interface-wsdl.xsd delete mode 100644 sca-cpp/trunk/runtime/core/xsd/sca.xsd delete mode 100644 sca-cpp/trunk/runtime/core/xsd/tuscany.xsd delete mode 100644 sca-cpp/trunk/runtime/core/xsd/wsdl_11.xsd delete mode 100644 sca-cpp/trunk/runtime/core/xsd/wsdl_11_http.xsd delete mode 100644 sca-cpp/trunk/runtime/core/xsd/wsdl_11_mime.xsd delete mode 100644 sca-cpp/trunk/runtime/core/xsd/wsdl_11_soap.xsd delete mode 100644 sca-cpp/trunk/runtime/core/xsd/wsdl_11_soap12.xsd delete mode 100644 sca-cpp/trunk/runtime/extensions/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/ComponentContext.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/ComponentContext.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/CompositeContext.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/CompositeContext.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/ServiceRuntimeException.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/export.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/sca.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/META-INF/LICENSE delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/META-INF/NOTICE delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/META-INF/README delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/build.xml delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/CalculatorTest.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/EnvHandlerTest.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/ImplClassWithNameSpaceButNotInClassAttrTest.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/ImplClassWithNameSpaceTest.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/IntfClassWithNameSpaceButNotInClassAttrTest.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/IntfClassWithNameSpaceTest.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/MissingCompositeAndFragmentTest.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/SimplePublicPrivateProtectedTest.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TestAllCompositesTest.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TestDeployAssistTool.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TuscanyTestCase.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/Calculator.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/CalculatorImpl.componentType delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/CalculatorImpl.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/sca.composite delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/otherSubFolder/CalculatorBack.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/otherSubFolder/CalculatorForward.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/sca.composite delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorBackImpl.componentType delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorBackImpl.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorForwardImpl.componentType delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorForwardImpl.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfo.fragment delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfo.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfoImpl.componentType delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfoImpl.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfo.fragment delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfo.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfoImpl.componentType delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfoImpl.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfo.fragment delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfo.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfoImpl.componentType delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfoImpl.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValue.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl.componentType delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl.hpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl_stockQuote_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/StockQuoteService.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/sca.composite delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfo.fragment delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfo.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfoImpl.componentType delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfoImpl.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValue.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl.componentType delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl.hpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl_stockQuote_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/StockQuoteService.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/sca.composite delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValue.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValueImpl.componentType delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValueImpl.hpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/sca.composite delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValue.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValueImpl.componentType delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValueImpl.hpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/sca.composite delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValue.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValueImpl.componentType delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValueImpl.hpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/sca.composite delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeMissingScaComposite/CustomerInfo.fragmentX delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeMissingScaComposite/sca.compositeX delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfo.fragment delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfo.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfoImpl.componentType delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfoImpl.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValue.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl.componentType delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl.hpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl_stockQuote_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/StockQuoteService.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/sca.composite delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfo.fragment delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfo.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfoImpl.componentType delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfoImpl.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Wrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Wrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Wrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Wrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Wrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Wrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Wrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Wrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_customerInfo_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_customerInfo_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_stockQuote_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_stockQuote_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_customerInfo_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_customerInfo_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_stockQuote_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_stockQuote_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Wrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Wrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_customerInfo_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_customerInfo_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_stockQuote_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_stockQuote_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/lib/readme.txt delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/scagen.bat delete mode 100755 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/scagen.sh delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/BodyPart.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/CParsingTool.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Configuration.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/DirectoryTree.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/FileActor.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/FilePart.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Headers.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/InputCppSourceCode.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/MacroPart.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/MethodPart.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Options.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Parameter.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/ParsingException.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/PrototypePart.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Signature.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Utils.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/package.html delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ComponentDomNodeHandler.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ComponentTypeFileHandler.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/CompositeOrFragmentFileHandler.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DirectoryScanner.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DomHandler.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DomNodeHandler.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/GenericDomNodeHandler.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/LittleClass.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ReferenceDomNodeHandler.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/Scagen.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ServiceDomNodeHandler.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ServicesGenerator.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/XMLFileActor.java delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/package.html delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyCPP.xsl delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyHeader.xsl delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperCPP.xsl delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperHeader.xsl delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/xsd/sca-implementation-cpp.xsd delete mode 100644 sca-cpp/trunk/runtime/extensions/cpp/xsd/sca-interface-cpp.xsd delete mode 100644 sca-cpp/trunk/runtime/extensions/php/AUTHORS delete mode 100755 sca-cpp/trunk/runtime/extensions/php/COPYING delete mode 100644 sca-cpp/trunk/runtime/extensions/php/ChangeLog delete mode 100644 sca-cpp/trunk/runtime/extensions/php/INSTALL delete mode 100755 sca-cpp/trunk/runtime/extensions/php/LICENSE delete mode 100644 sca-cpp/trunk/runtime/extensions/php/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/php/NEWS delete mode 100644 sca-cpp/trunk/runtime/extensions/php/NOTICE delete mode 100644 sca-cpp/trunk/runtime/extensions/php/README delete mode 100755 sca-cpp/trunk/runtime/extensions/php/autogen.sh delete mode 100755 sca-cpp/trunk/runtime/extensions/php/build.sh delete mode 100644 sca-cpp/trunk/runtime/extensions/php/configure.ac delete mode 100644 sca-cpp/trunk/runtime/extensions/php/samples/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/README delete mode 100644 sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator.app.composite delete mode 100644 sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/calculator_client.py delete mode 100755 sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/runclient.sh delete mode 100644 sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Calculator.componentType delete mode 100644 sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Calculator.php delete mode 100644 sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Divide.componentType delete mode 100644 sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Divide.php delete mode 100644 sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Log.componentType delete mode 100644 sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Log.php delete mode 100644 sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Multiply.php delete mode 100644 sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/sample.calculator.composite delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.h delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.h delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.h delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPServiceProxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPServiceProxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/export.h delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.h delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.h delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPReferenceBinding.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPReferenceBinding.h delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.h delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/php_sca.h delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/sca.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/sca.h delete mode 100644 sca-cpp/trunk/runtime/extensions/php/xsd/sca-implementation-php.xsd delete mode 100644 sca-cpp/trunk/runtime/extensions/python/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.h delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.h delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.h delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/export.h delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.h delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.h delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.h delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/sca_proxy.py delete mode 100644 sca-cpp/trunk/runtime/extensions/python/xsd/sca-implementation-python.xsd delete mode 100644 sca-cpp/trunk/runtime/extensions/python/xsd/sca-interface-python.xsd delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/interface/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/interface/src/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/RESTInterfaceExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/RESTInterfaceExtension.h delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/exportinterface.h delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/model/RESTInterface.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/model/RESTInterface.h delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/reference/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/reference/curl/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceBindingExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceBindingExtension.h delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/model/RESTServiceBinding.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/model/RESTServiceBinding.h delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/service/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/service/httpd/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.h delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/export.h delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.h delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/xsd/sca-binding-rest.xsd delete mode 100644 sca-cpp/trunk/runtime/extensions/rest/xsd/sca-interface-rest.xsd delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/extension/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/extension/src/Extension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/extension/src/extconf.rb delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/Ruby.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/export.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ruby/xsd/sca-implementation-ruby.xsd delete mode 100644 sca-cpp/trunk/runtime/extensions/sca/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/sca/reference/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/sca/reference/src/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.h delete mode 100644 sca-cpp/trunk/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.h delete mode 100644 sca-cpp/trunk/runtime/extensions/sca/service/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/sca/service/src/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.h delete mode 100644 sca-cpp/trunk/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.h delete mode 100644 sca-cpp/trunk/runtime/extensions/sca/xsd/sca-binding-sca.xsd delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/reference/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/export.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/Makefile.am delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/axis2.xml delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/deploy.bat delete mode 100755 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/deploy.sh delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/module.xml delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/services.xml delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Dispatcher.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2DispatcherModule.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Service.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/export.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.cpp delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.h delete mode 100644 sca-cpp/trunk/runtime/extensions/ws/xsd/sca-binding-webservice.xsd delete mode 100644 sca-cpp/trunk/samples/AUTHORS delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/AlertAggregatorSCADiagram.png delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/Makefile.am delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/README delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/README.html delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/config.xml delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver.php/README delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver.php/conf/httpd.conf delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver.php/conf/mime.types delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/AlertDisplay.php delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/Alerter.xsd delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/Cached_Alerts.xml delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/index.html delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/pop.png delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/rss.png delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/style.css delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver.php/startserver.bat delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver/Makefile.am delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver/conf/httpd.conf delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver/conf/mime.types delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver/htdocs/index.html delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver/htdocs/pop.png delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver/htdocs/rss.png delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver/htdocs/style.css delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/httpserver/startserver.bat delete mode 100755 sca-cpp/trunk/samples/AlertAggregator/httpserver/startserver.sh delete mode 100755 sca-cpp/trunk/samples/AlertAggregator/httpserver/stopserver.sh delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/sample.alerter.app.composite delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/sample.alerter/AlertCheckerImpl.py delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/sample.alerter/AlertConfigImpl.py delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/sample.alerter/Alerter.xsd delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/sample.alerter/Makefile.am delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/sample.alerter/POPCheckerImpl.py delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/sample.alerter/POPCheckerImpl.rb delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/sample.alerter/RSSCheckerImpl.py delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/sample.alerter/sample.alerter.composite delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/sample.display/Alerter.xsd delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/sample.display/HTMLDisplayImpl.py delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/sample.display/Makefile.am delete mode 100644 sca-cpp/trunk/samples/AlertAggregator/sample.display/sample.display.composite delete mode 100755 sca-cpp/trunk/samples/COPYING delete mode 100644 sca-cpp/trunk/samples/ChangeLog delete mode 100644 sca-cpp/trunk/samples/CppBigBank/Makefile.am delete mode 100644 sca-cpp/trunk/samples/CppBigBank/README delete mode 100644 sca-cpp/trunk/samples/CppBigBank/README.html delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountDataService.h delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.componentType delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.cpp delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.h delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountService.h delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountService.wsdl delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountServiceImpl.componentType delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountServiceImpl.cpp delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountServiceImpl.h delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/Makefile.am delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteService.h delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.componentType delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.cpp delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.h delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteTypes.xsd delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteWebService.h delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteWebService.wsdl delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/bigbank.account.composite delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.account/runwsserver.bat delete mode 100755 sca-cpp/trunk/samples/CppBigBank/bigbank.account/runwsserver.sh delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.app.composite delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.client/AccountClient.cpp delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.client/Makefile.am delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.client/runclient.bat delete mode 100755 sca-cpp/trunk/samples/CppBigBank/bigbank.client/runclient.sh delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/AccountService.wsdl delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/Makefile.am delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/README delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/bigaccount.php delete mode 100644 sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/bigwelcome.php delete mode 100644 sca-cpp/trunk/samples/CppCalculator/Makefile.am delete mode 100644 sca-cpp/trunk/samples/CppCalculator/README delete mode 100644 sca-cpp/trunk/samples/CppCalculator/README.html delete mode 100644 sca-cpp/trunk/samples/CppCalculator/sample.calculator.app.composite delete mode 100644 sca-cpp/trunk/samples/CppCalculator/sample.calculator.client/CalculatorClient.cpp delete mode 100644 sca-cpp/trunk/samples/CppCalculator/sample.calculator.client/Makefile.am delete mode 100644 sca-cpp/trunk/samples/CppCalculator/sample.calculator.client/runclient.bat delete mode 100755 sca-cpp/trunk/samples/CppCalculator/sample.calculator.client/runclient.sh delete mode 100644 sca-cpp/trunk/samples/CppCalculator/sample.calculator/Calculator.h delete mode 100644 sca-cpp/trunk/samples/CppCalculator/sample.calculator/CalculatorImpl.componentType delete mode 100644 sca-cpp/trunk/samples/CppCalculator/sample.calculator/CalculatorImpl.cpp delete mode 100644 sca-cpp/trunk/samples/CppCalculator/sample.calculator/CalculatorImpl.h delete mode 100644 sca-cpp/trunk/samples/CppCalculator/sample.calculator/Divide.h delete mode 100644 sca-cpp/trunk/samples/CppCalculator/sample.calculator/DivideImpl.componentType delete mode 100644 sca-cpp/trunk/samples/CppCalculator/sample.calculator/DivideImpl.cpp delete mode 100644 sca-cpp/trunk/samples/CppCalculator/sample.calculator/DivideImpl.h delete mode 100644 sca-cpp/trunk/samples/CppCalculator/sample.calculator/Makefile.am delete mode 100644 sca-cpp/trunk/samples/CppCalculator/sample.calculator/sample.calculator.composite delete mode 100644 sca-cpp/trunk/samples/GettingStarted.html delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/Makefile.am delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/README delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/README.html delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/AccountService.wsdl delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/AccountServiceImpl.rb delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/Makefile.am delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/StockQuoteServiceImpl.rb delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/StockQuoteTypes.xsd delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/StockQuoteWebService.wsdl delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/bigbank.account.composite delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/bigbank.accountdata/AccountData.xsd delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/bigbank.accountdata/AccountDataServiceImpl.rb delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/bigbank.accountdata/Makefile.am delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/bigbank.accountdata/bigbank.accountdata.composite delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/bigbank.app.composite delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/AccountService.wsdl delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/AccountWSClient.rb delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/Makefile.am delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/bigbank.wsclient.composite delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/runwsclient.bat delete mode 100755 sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/runwsclient.sh delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/httpserver/Makefile.am delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/httpserver/conf/httpd.conf delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/httpserver/conf/mime.types delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/httpserver/htdocs/index.html delete mode 100644 sca-cpp/trunk/samples/HttpdBigBank/httpserver/startserver.bat delete mode 100755 sca-cpp/trunk/samples/HttpdBigBank/httpserver/startserver.sh delete mode 100755 sca-cpp/trunk/samples/HttpdBigBank/httpserver/stopserver.sh delete mode 100644 sca-cpp/trunk/samples/INSTALL delete mode 100755 sca-cpp/trunk/samples/LICENSE delete mode 100644 sca-cpp/trunk/samples/Makefile.am delete mode 100644 sca-cpp/trunk/samples/NEWS delete mode 100644 sca-cpp/trunk/samples/NOTICE delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/Makefile.am delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/README delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/phpcalculator.png delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator.app.composite delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/CalculatorClient.cpp delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/CalculatorClient.php delete mode 100755 sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/env.sh delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/runclient_cpp.bat delete mode 100755 sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/runclient_cpp.sh delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/runclient_php.bat delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator.wsclient/Calculator.wsdl delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator.wsclient/CalculatorWSClient.php delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator.wsclient/runwsclient.bat delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Add.componentType delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Add.h delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Add.php delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Calculator.componentType delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Calculator.h delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Calculator.php delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Calculator.wsdl delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl.componentType delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl.cpp delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl.h delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.cpp delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.h delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.cpp delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.h delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.cpp delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.h delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Divide.componentType delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Divide.h delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Divide.php delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl.componentType delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl.cpp delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl.h delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.cpp delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.h delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.cpp delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.h delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Log.componentType delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Log.h delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Log.php delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Makefile.am delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Multiply.componentType delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Multiply.h delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Multiply.php delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Subtract.componentType delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Subtract.h delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Subtract.php delete mode 100755 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/runwsserver.sh delete mode 100644 sca-cpp/trunk/samples/PHPCalculator/sample.calculator/sample.calculator.composite delete mode 100644 sca-cpp/trunk/samples/PythonCalculator/Makefile.am delete mode 100644 sca-cpp/trunk/samples/PythonCalculator/README delete mode 100644 sca-cpp/trunk/samples/PythonCalculator/README.html delete mode 100644 sca-cpp/trunk/samples/PythonCalculator/sample.calculator.app.composite delete mode 100644 sca-cpp/trunk/samples/PythonCalculator/sample.calculator.client/Makefile.am delete mode 100644 sca-cpp/trunk/samples/PythonCalculator/sample.calculator.client/calculator_client.py delete mode 100644 sca-cpp/trunk/samples/PythonCalculator/sample.calculator.client/runclient.bat delete mode 100755 sca-cpp/trunk/samples/PythonCalculator/sample.calculator.client/runclient.sh delete mode 100644 sca-cpp/trunk/samples/PythonCalculator/sample.calculator/Calculator.wsdl delete mode 100644 sca-cpp/trunk/samples/PythonCalculator/sample.calculator/CalculatorImpl.py delete mode 100644 sca-cpp/trunk/samples/PythonCalculator/sample.calculator/DivideImpl.py delete mode 100644 sca-cpp/trunk/samples/PythonCalculator/sample.calculator/Makefile.am delete mode 100644 sca-cpp/trunk/samples/PythonCalculator/sample.calculator/sample.calculator.composite delete mode 100644 sca-cpp/trunk/samples/PythonWeatherForecast/Makefile.am delete mode 100644 sca-cpp/trunk/samples/PythonWeatherForecast/README delete mode 100644 sca-cpp/trunk/samples/PythonWeatherForecast/README.html delete mode 100644 sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.app.composite delete mode 100644 sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.client/Makefile.am delete mode 100644 sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.client/runclient.bat delete mode 100755 sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.client/runclient.sh delete mode 100644 sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.client/weather_forecast_client.py delete mode 100644 sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather/Makefile.am delete mode 100644 sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather/WeatherForecast.wsdl delete mode 100644 sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather/WeatherForecastImpl.py delete mode 100644 sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather/sample.weather.composite delete mode 100644 sca-cpp/trunk/samples/README delete mode 100644 sca-cpp/trunk/samples/RestCalculator/Makefile.am delete mode 100644 sca-cpp/trunk/samples/RestCalculator/README delete mode 100644 sca-cpp/trunk/samples/RestCalculator/README.html delete mode 100644 sca-cpp/trunk/samples/RestCalculator/httpserver/Makefile.am delete mode 100644 sca-cpp/trunk/samples/RestCalculator/httpserver/conf/httpd.conf delete mode 100644 sca-cpp/trunk/samples/RestCalculator/httpserver/conf/mime.types delete mode 100644 sca-cpp/trunk/samples/RestCalculator/httpserver/htdocs/index.html delete mode 100644 sca-cpp/trunk/samples/RestCalculator/httpserver/startserver.bat delete mode 100755 sca-cpp/trunk/samples/RestCalculator/httpserver/startserver.sh delete mode 100755 sca-cpp/trunk/samples/RestCalculator/httpserver/stopserver.sh delete mode 100644 sca-cpp/trunk/samples/RestCalculator/sample.calculator.app.composite delete mode 100644 sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/CalculatorRestClient.rb delete mode 100644 sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/Makefile.am delete mode 100644 sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/runrestclient.bat delete mode 100755 sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/runrestclient.sh delete mode 100644 sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/sample.calculator.restclient.composite delete mode 100644 sca-cpp/trunk/samples/RestCalculator/sample.calculator/CalculatorImpl.rb delete mode 100644 sca-cpp/trunk/samples/RestCalculator/sample.calculator/DivideImpl.rb delete mode 100644 sca-cpp/trunk/samples/RestCalculator/sample.calculator/Makefile.am delete mode 100644 sca-cpp/trunk/samples/RestCalculator/sample.calculator/sample.calculator.composite delete mode 100644 sca-cpp/trunk/samples/RestCustomer/Makefile.am delete mode 100644 sca-cpp/trunk/samples/RestCustomer/README delete mode 100644 sca-cpp/trunk/samples/RestCustomer/README.html delete mode 100644 sca-cpp/trunk/samples/RestCustomer/httpserver/Makefile.am delete mode 100644 sca-cpp/trunk/samples/RestCustomer/httpserver/conf/httpd.conf delete mode 100644 sca-cpp/trunk/samples/RestCustomer/httpserver/conf/mime.types delete mode 100644 sca-cpp/trunk/samples/RestCustomer/httpserver/htdocs/index.html delete mode 100644 sca-cpp/trunk/samples/RestCustomer/httpserver/startserver.bat delete mode 100755 sca-cpp/trunk/samples/RestCustomer/httpserver/startserver.sh delete mode 100755 sca-cpp/trunk/samples/RestCustomer/httpserver/stopserver.sh delete mode 100644 sca-cpp/trunk/samples/RestCustomer/sample.customer.app.composite delete mode 100644 sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/Customer.xsd delete mode 100644 sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/CustomerRestClient.py delete mode 100644 sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/Makefile.am delete mode 100644 sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/runrestclient.bat delete mode 100755 sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/runrestclient.sh delete mode 100644 sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/sample.customer.restclient.composite delete mode 100644 sca-cpp/trunk/samples/RestCustomer/sample.customer/2345.xml delete mode 100644 sca-cpp/trunk/samples/RestCustomer/sample.customer/Customer.xsd delete mode 100644 sca-cpp/trunk/samples/RestCustomer/sample.customer/CustomerResourceImpl.py delete mode 100644 sca-cpp/trunk/samples/RestCustomer/sample.customer/Makefile.am delete mode 100644 sca-cpp/trunk/samples/RestCustomer/sample.customer/sample.customer.composite delete mode 100644 sca-cpp/trunk/samples/RestYahoo/Makefile.am delete mode 100644 sca-cpp/trunk/samples/RestYahoo/README delete mode 100644 sca-cpp/trunk/samples/RestYahoo/README.html delete mode 100644 sca-cpp/trunk/samples/RestYahoo/sample.yahoo.app.composite delete mode 100644 sca-cpp/trunk/samples/RestYahoo/sample.yahoo.client/Makefile.am delete mode 100644 sca-cpp/trunk/samples/RestYahoo/sample.yahoo.client/YahooWebSearchClient.rb delete mode 100644 sca-cpp/trunk/samples/RestYahoo/sample.yahoo.client/runclient.bat delete mode 100755 sca-cpp/trunk/samples/RestYahoo/sample.yahoo.client/runclient.sh delete mode 100644 sca-cpp/trunk/samples/RestYahoo/sample.yahoo/Makefile.am delete mode 100644 sca-cpp/trunk/samples/RestYahoo/sample.yahoo/YahooWebSearchImpl.py delete mode 100644 sca-cpp/trunk/samples/RestYahoo/sample.yahoo/YahooWebSearchResponse.xsd delete mode 100644 sca-cpp/trunk/samples/RestYahoo/sample.yahoo/sample.yahoo.composite delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/Makefile.am delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/README delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/README.html delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/bigbank.account/AccountDataServiceImpl.rb delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/bigbank.account/AccountService.wsdl delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/bigbank.account/AccountServiceImpl.rb delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/bigbank.account/Makefile.am delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/bigbank.account/StockQuoteServiceImpl.rb delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/bigbank.account/StockQuoteTypes.xsd delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/bigbank.account/StockQuoteWebService.wsdl delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/bigbank.account/bigbank.account.composite delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/bigbank.account/runwsserver.bat delete mode 100755 sca-cpp/trunk/samples/RubyBigBank/bigbank.account/runwsserver.sh delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/bigbank.app.composite delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/bigbank.client/AccountClient.rb delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/bigbank.client/Makefile.am delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/bigbank.client/runclient.bat delete mode 100755 sca-cpp/trunk/samples/RubyBigBank/bigbank.client/runclient.sh delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/AccountService.wsdl delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/AccountWSClient.rb delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/Makefile.am delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/bigbank.wsclient.composite delete mode 100644 sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/runwsclient.bat delete mode 100755 sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/runwsclient.sh delete mode 100644 sca-cpp/trunk/samples/RubyCalculator/Makefile.am delete mode 100644 sca-cpp/trunk/samples/RubyCalculator/README delete mode 100644 sca-cpp/trunk/samples/RubyCalculator/README.html delete mode 100644 sca-cpp/trunk/samples/RubyCalculator/sample.calculator.app.composite delete mode 100644 sca-cpp/trunk/samples/RubyCalculator/sample.calculator.client/CalculatorClient.rb delete mode 100644 sca-cpp/trunk/samples/RubyCalculator/sample.calculator.client/Makefile.am delete mode 100644 sca-cpp/trunk/samples/RubyCalculator/sample.calculator.client/runclient.bat delete mode 100755 sca-cpp/trunk/samples/RubyCalculator/sample.calculator.client/runclient.sh delete mode 100644 sca-cpp/trunk/samples/RubyCalculator/sample.calculator/Calculator.wsdl delete mode 100644 sca-cpp/trunk/samples/RubyCalculator/sample.calculator/CalculatorImpl.rb delete mode 100644 sca-cpp/trunk/samples/RubyCalculator/sample.calculator/DivideImpl.rb delete mode 100644 sca-cpp/trunk/samples/RubyCalculator/sample.calculator/Makefile.am delete mode 100644 sca-cpp/trunk/samples/RubyCalculator/sample.calculator/sample.calculator.composite delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.demo.app.composite delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.demo/DemoClientImpl.componentType delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.demo/supplychain.demo.composite delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.logging/LoggerImpl.componentType delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.logging/LoggingFacility.wsdl delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.logging/supplychain.logging.composite delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturer/Manufacturer.wsdl delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturer/ManufacturerImpl.componentType delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturer/WarehouseCallback.wsdl delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturer/supplychain.manufacturer.composite delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturerA.app.composite delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturerB.app.composite delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturerC.app.composite delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.retailer.app.composite delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.retailer/Retailer.wsdl delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.retailer/RetailerImpl.componentType delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.retailer/supplychain.retailer.composite delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.warehouse/Warehouse.wsdl delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.warehouse/WarehouseCallbackImpl.componentType delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.warehouse/WarehouseImpl.componentType delete mode 100644 sca-cpp/trunk/samples/SupplyChain/supplychain.warehouse/supplychain.warehouse.composite delete mode 100755 sca-cpp/trunk/samples/autogen.sh delete mode 100755 sca-cpp/trunk/samples/build.sh delete mode 100644 sca-cpp/trunk/samples/configure.ac delete mode 100755 sca-cpp/trunk/samples/runtest.sh delete mode 100644 sca-cpp/trunk/samples/scagen.bat diff --git a/sca-cpp/trunk/AUTHORS b/sca-cpp/trunk/AUTHORS index e69de29bb2..8bb2a95d64 100644 --- a/sca-cpp/trunk/AUTHORS +++ b/sca-cpp/trunk/AUTHORS @@ -0,0 +1,2 @@ +The Apache Software Foundation (http://www.apache.org/) + diff --git a/sca-cpp/trunk/GettingStarted.html b/sca-cpp/trunk/GettingStarted.html deleted file mode 100644 index d41ed95580..0000000000 --- a/sca-cpp/trunk/GettingStarted.html +++ /dev/null @@ -1,487 +0,0 @@ - - - - - - - - - - - - Tuscany SCA Native - Getting Started - - - -
-
-
-

Tuscany - Getting Started - SCA Native Milestone release 3

- -

Tuscany SCA Native provides a runtime implementation for the Service Component - Architecture 0.96 Assembly specification and the 0.95 C++ Client & Implementation specification - (found here), - written in C++ and currently supports C++, Python and Ruby - component implementation types. This page describes what is needed to install and run Tuscany - SCA Native.
If you haven't already done so, the first - step is to download the SCA Native Milestone release 3 of Apache Tuscany from our - download page.
-

-
- - - - -
-

System Requirements

- -

In order to run Tuscany SCA there are some - minimum requirements:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SoftwareNotes and Download Link
Operating systems: -
    - -
  • Windows XP SP2
  • -
  • Linux
  • -
  • Mac OS X
  • -
-
- Linux distributions tested on include Redhat Enterprise Linux v3, Redhat Enterprise Linux v4, - Ubuntu 6.06 LTS and Fedora Core 5. -
Tuscany SDO for C++ Milestone Release 3 - http://incubator.apache.org/tuscany/download.html
- Please download and follow the installation instructions -
Optional: Java SDK 1.4 or later - http://java.sun.com/javase/downloads/index.jsp
- This is required for building and running the SCAGEN code generation tool, which is used - when developing Tuscany SCA C++ components. This is not required when only developing - Python or Ruby SCA components. -
Optional: Apache Ant 1.6 or later - http://ant.apache.org
- This is required for building the SCAGEN code generation tool, which is used - when developing Tuscany SCA C++ components. This is only required when building - the C++ extension from a source distribution of Tuscany SCA Native. -
Optional: Python version 2.5 - http://www.python.org/download/
- This is required for building or running the Tuscany SCA Python extension - (see below). - Please download and follow the installation instructions. -
Optional: Ruby version 1.8.x - http://www.ruby-lang.org
- This is required for building or running the Tuscany SCA Ruby extension - (see below). - Please download and follow the installation instructions. You should - be able to build the Tuscany SCA Ruby Extension with other versions of Ruby. -
Optional: Axis2/C Release 0.96 - http://ws.apache.org/axis2/c/download.cgi
- This is required for building and running the Tuscany SCA Web Service extension - (see below). - Please download and follow the installation instructions. Ensure you can run the Axis2/C samples -
Optional: Apache HTTPD version 2.2 - http://httpd.apache.org
- This is required for building and running the Tuscany SCA REST extension - (see below). It is also required for some - of the Web Services samples. - Please download and follow the installation instructions. -
Optional: libcurl version 7.15 or higher - http://curl.haxx.se/download.html
- This is required for building and running the Tuscany SCA REST extension - (see below). - Please download and follow the installation instructions. -
-
-
-

Installing Tuscany SCA Native

-

Getting Tuscany SCA Native working with the source release on Linux or Mac OS X

-
    -
  1. Extract the source tar package to a folder <tuscany_sca_install_dir>
  2. -
  3. The following environment variables are required: -
      -
    • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
  4. -
  5. See the extensions documentation for other environment variables and - configration flags that are required to build specific extensions.
  6. -
  7. To build only the Tuscany SCA Native kernel libraries use the following command sequence: -
      -
    • ./configure --prefix=<tuscany_sca_install_dir>/deploy --enable-static=no --enable-cpp=no --enable-wsbinding=no
    • -
    • make
    • -
    • make install
    • -
    - NOTE: If you don't provide a --prefix configure option, it will by default install into - /usr/local/tuscany/sca. Use ./configure --help to see all the available - options: - --enable-cpp build C++ component type extension [default=yes] - --enable-wsbinding build Web Service binding extension [default=no] - --enable-scabinding build SCA default binding extension [default=no] - --enable-restbinding build REST binding extension [default=no] - --enable-python build Python component type extension [default=no] - --enable-ruby build Ruby component type extension [default=no] - A script, build.sh, is provided that will build and install SCA Native. This script will install to the - location specified by the TUSCANY_SCACPP environment variable if set or into a deploy directory at <tuscany_sca_install_dir>/deploy. - This script will check the environment variable settings and will build the extensions whose dependencies are set. For example if RUBY_LIB and - RUBY_HOME are set configure will be called with the --enable-ruby=yes option. -
  8. -
  9. Set the TUSCANY_SCACPP environment variable to point to the <tuscany_sca_install_dir>/deploy - directory that contains the built Tuscany SCA distribution
  10. -
- -

Getting Tuscany SCA Native working with the binary release on Windows

-
    -
  1. Unzip the supplied zip file to a folder
  2. -
  3. Set the TUSCANY_SCACPP environment variable to point to the directory that was just unzipped
  4. -
  5. Add the <tuscany_sca_install_dir>\bin directory to the PATH environment variable
  6. -
-

Getting Tuscany SCA Native working with the source release on Windows

-
    -
  1. Unzip the supplied source zip file
  2. -
  3. The following environment variables are required: -
      -
    • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
    • -
  4. -
  5. You must have set up the environment for Microsoft Visual C++ tools. The build command - will call vcvars32 to set the environment. Ensure the directory containing this is on your path. - This will be where you installed the compiler.
  6. -
  7. See the extensions documentation for other environment variables - that are required to build specific extensions.
  8. -
  9. Build the source: -
      -
    • cd <to where you unzipped the source>
    • -
    • build [Debug]
    • -
    - This will build all the projects and put the required output into the 'deploy' directory

    - Alternatively, open the VS Express workspace at <tuscany_sca_install_dir>\VSExpress\tuscany_sca\tuscany_sca.sln
  10. -
  11. Set the TUSCANY_SCACPP environment variable to point to the 'deploy' directory that was just created
  12. -
-
- -
-

Tuscany SCA Extensions

-

Tuscany SCA is composed of two distinct areas: the kernel and extensions. The kernel provides the - implementation of the - Service - Component Architecture Assembly Model specification, reading composite files, loading the - appropriate extensions and invoking components via references and services during runtime. The - extensions provide the functionality required to call a component implementation (e.g. a C++ class - compiled into a dll) or invoke a binding (e.g. make a Web Services call). -

-

The table below details the extensions that are included with Tuscany SCA Native Milestone - Release 3. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ExtensionDetails
- C++ - Provides the SCA C++ client API and enables C++ component implementations - and interfaces. See the C++ extension documentation, the - SCA - C++ Client and Implementation specification for more details about the SCA C++ - Programming Model and the Creating C++ SCA Components - document for a step-by-step example.
- Requires: -
    -
  • Java SDK 1.4 or later - - for building and running the SCAGEN code generation tool, which is used - when developing Tuscany SCA C++ components.
  • -
  • Apache Ant 1.6 or later - - for building the SCAGEN code generation tool. This is only required when building - the C++ extension from a source distribution of Tuscany SCA Native.
  • -
-
- Python - Provides a Python SCA client API and enables Python component implementations. - See the Python extension documentation for - more details.
- Requires: - -
- Ruby - Provides a Ruby SCA client API and enables Ruby component implementations. - See the Ruby extension documentation for - more details.
- Requires: - -
- Axis2/C Web Services - Provides the Web Service bindings enabling Tuscany to call SCA references via - Web Services or expose SCA services as Web Services. See the - SCA - Web Service bindings specification for more details about SCA Web Service support - and the Enabling Web Service - access to SCA Components document for a step-by-step example.
- Requires: - -
- REST - Provides the REST bindings enabling Tuscany to call SCA references via - REST HTTP calls or expose SCA services as REST Services. See the - REST extension documentation for more details.
- Requires: - -
- SCA - Provides a default SCA binding enabling Tuscany to determine the appropriate technology - to use to provide services or invoke references. Currently this defaults to using the - Axis2/C Web Services binding. See the - SCA extension documentation for more details.
- Requires: - -
-
- -
-

Samples

- - - - - - - -
SCA Technology samples - Simple samples that emphasize how to to use - Service Component Architecture technology. Follow the - instructions on the samples Getting Started - page to build and run the Tuscany SCA samples -
-
-
-
-

User Guide Documents

- - - - - - - - - - - - - - - - - - - -
Creating and building a Tuscany SCA C++ component - A document that describes how to create, build and run a Tuscany SCA C++ component. -
Enabling Web Service access to your Tuscany SCA component - A document that describes how to expose a Tuscany SCA C++ component as a Web Service via the Tuscany Axis2/C Web Service support. -
The Tuscany SCA Python Programming Model - A document that describes how to create and run a Tuscany SCA Python component. -
The Tuscany SCA Ruby Programming Model - A document that describes how to create and run a Tuscany SCA Ruby component. -
-
-
-
-

Getting Help

- -

The first place to look is at the Tuscany FAQ at -

- -

Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

- - -

 

- -

 

- -

 

- - - - - - -
- -

Thank you for your interest in Tuscany.

-The - Tuscany Development Team -
-
-
-
- - - diff --git a/sca-cpp/trunk/INSTALL b/sca-cpp/trunk/INSTALL index 9b027cad1f..c183bd97a1 100644 --- a/sca-cpp/trunk/INSTALL +++ b/sca-cpp/trunk/INSTALL @@ -1,2 +1,50 @@ -Please read the GettingStarted.html document for information on -building and installing Tuscany SCA Native +Apache Tuscany SCA Runtime +========================== + +Building +======== + +First get the following dependencies: + +HTTP server and APR +httpd-2.2-13 +libapr-1-0.3.8 +libaprutil-1-0.3.9 +(the easiest is to build httpd using configure --with-included-apr) + +XML +libxml2-2.7.5 + +JSON +SpiderMonkey libmozjs +(included in xulrunner-1.9.1.5) + +To configure the build do this: +./autogen.sh +./configure --prefix= + +To configure where to find dependencies, see: +./configure --help + +To build the runtime, do this: +make + +To run the tests, do this: +make check + +To build doxygen documentation, do this: +./configure --prefix= --enable-doxygen +make + +To build ctags for the source, do this: +make ctags + +To build a source distribution, do this: +make dist + +To build a binary distribution, do this: +make bindist + +Layout +====== + diff --git a/sca-cpp/trunk/Makefile.am b/sca-cpp/trunk/Makefile.am index caa00d389a..df348fbc3c 100644 --- a/sca-cpp/trunk/Makefile.am +++ b/sca-cpp/trunk/Makefile.am @@ -15,16 +15,16 @@ # specific language governing permissions and limitations # under the License. -SUBDIRS = kernel modules test doc runtime -DIST_SUBDIRS = doc runtime samples +ACLOCAL_AMFLAGS = -I m4 + +SUBDIRS = kernel modules components test doc + datadir=$(prefix) -data_DATA = INSTALL README LICENSE COPYING NOTICE GettingStarted.html +data_DATA = INSTALL README LICENSE COPYING NOTICE nobase_data_DATA = xsd/*.* -EXTRA_DIST = LICENSE COPYING INSTALL README NOTICE autogen.sh build.sh builddist.sh configure.sh makebindist.sh GettingStarted.html xsd -dist-hook: - rm -rf `find $(distdir)/ -type d -name .svn` - rm -rf `find $(distdir)/ -type d -name .deps` +DIST_SUBDIRS = kernel modules components test doc samples +EXTRA_DIST = LICENSE COPYING INSTALL README NOTICE autogen.sh xsd install-data-hook: rm -rf $(prefix)/doc @@ -38,17 +38,15 @@ install-data-hook: rm -rf `find $(prefix)/samples -type d -name .svn` rm -rf `find $(prefix)/samples -type d -name .deps` -bindist: dist - rm -rf ${PACKAGE}-${PACKAGE_VERSION} - rm -rf ${PACKAGE}-${PACKAGE_VERSION}-src +dist-hook: + rm -rf `find $(distdir)/ -type d -name .svn` + rm -rf `find $(distdir)/ -type d -name .deps` + +bindist: install rm -rf ${PACKAGE}-${PACKAGE_VERSION}-bin - gunzip -f ${PACKAGE}-${PACKAGE_VERSION}.tar.gz - tar -xf ${PACKAGE}-${PACKAGE_VERSION}.tar - mv ${PACKAGE}-${PACKAGE_VERSION} ${PACKAGE}-${PACKAGE_VERSION}-src - tar -cf - ${PACKAGE}-${PACKAGE_VERSION}-src | gzip -c > ${PACKAGE}-${PACKAGE_VERSION}-src.tar.gz - cd ${PACKAGE}-${PACKAGE_VERSION}-src \ - && sh ../makebindist.sh mkdir ${PACKAGE}-${PACKAGE_VERSION}-bin - cp -r ${PACKAGE}-${PACKAGE_VERSION}-src/deploy/* ${PACKAGE}-${PACKAGE_VERSION}-bin + cp -r $(prefix)/* ${PACKAGE}-${PACKAGE_VERSION}-bin + rm -rf ${PACKAGE}-${PACKAGE_VERSION}-bin/test tar -cf - ${PACKAGE}-${PACKAGE_VERSION}-bin | gzip -c > ${PACKAGE}-${PACKAGE_VERSION}-bin.tar.gz + rm -rf ${PACKAGE}-${PACKAGE_VERSION}-bin diff --git a/sca-cpp/trunk/NOTICE b/sca-cpp/trunk/NOTICE index 44befbee63..d96b5dba76 100644 --- a/sca-cpp/trunk/NOTICE +++ b/sca-cpp/trunk/NOTICE @@ -1,5 +1,6 @@ -Apache Tuscany SCA Native -Copyright 2005, 2007 The Apache Software Foundation +Apache Tuscany SCA +Copyright 2005, 2009 The Apache Software Foundation This product includes software developed by -The Apache Software Foundation (http://www.apache.org/) \ No newline at end of file +The Apache Software Foundation (http://www.apache.org/) + diff --git a/sca-cpp/trunk/README b/sca-cpp/trunk/README index f17e5a86bb..3bc9272d49 100644 --- a/sca-cpp/trunk/README +++ b/sca-cpp/trunk/README @@ -1,83 +1,34 @@ -Apache Tuscany SCA Native M3 build (March, 2007) -================================================ +Apache Tuscany SCA Runtime +========================== -http://incubator.apache.org/tuscany +Getting the code +================ -Tuscany is an effort undergoing incubation at the Apache Software Foundation -(ASF), sponsored by the Web Services PMC. +To checkout the source code with commit access, do this: +git svn init -s https://svn.apache.org/repos/asf/tuscany/sca-cpp tuscany-sca-cpp +cd tuscany-sca-cpp +wget -P .git http://git.apache.org/authors.txt +git config svn.authorsfile .git/authors.txt +git config user.email @apache.org +git config svn.rmdir true +git svn fetch --log-window-size 10000 -Incubation is required of all newly accepted projects until a further review -indicates that the infrastructure, communications, and decision making process -have stabilized in a manner consistent with other successful ASF projects. +To checkout the source without commit access, do this: +git clone git://git.apache.org/tuscany-sca-cpp +or +svn checkout http://svn.apache.org/repos/asf/tuscany/sca-cpp tuscany-sca-cpp -While incubation status is not necessarily a reflection of the completeness or -stability of the code, it does indicate that the project has yet to be fully -endorsed by the ASF. +Contributing to the project +=========================== -Getting Started -=============== +To contribute to the project or report issues see the mailing list: +dev@tuscany.apache.org -Documentation describing the system requirements and the steps to install -Tuscany SCA C++ and run the samples can be found in the GettingStarted.html -file. +Archives: +http://www.mail-archive.com/dev@tuscany.apache.org +http://marc.info/?l=tuscany-dev +To subscribe: +dev-subscribe@tuscany.apache.org -About Tuscany SCA C++ -===================== - -Tuscany SCA C++ provides a runtime implementation for the for the Service -Component Architecture 0.96 Assembly specification and the 0.95 C++ Client -& Implementation Model specification, written in C++ and will currently -support C++, Python and Ruby component implementation types. - -The specifications can be found at -http://www.osoa.org/display/Main/Service+Component+Architecture+Specifications - -It is possible to interoperate with Tuscany SCA Java via the Web Service -bindings for services and references but restrictions apply. This is not yet a -complete implementation and known restrictions are described below. - -Supported SCA Assembly Model features - * All features are supported unless listed under the known restrictions - below. See SCA Assembly Model specification. - -Supported language bindings - * Component implementations written in C++. See the SCA C++ Client and - Implementation Model specification. - * Component implementations written in Python. See the - doc/PythonExtension.html documentation. - * Component implementations written in Ruby. See the doc/RubyExtension.html - documentation. - * Component interfaces described by C++ classes. See SCA Client and - Implementation Model specification. - -Supported service and reference bindings - * The web service binding is supported. This implementation will support - web services which using document literal SOAP bindings conforming to the - WS-I basic profile (rpc/encoded is not yet supported). - * A REST binding is supported. This implementation supports HTTP calls using - a resource or RPC pattern depending on the use of a REST interface. See the - doc/RESTExtension.html documentation. - * A SCA binding is supported. This implementation uses the web services - binding to provide the "default" binding. - -Known restrictions - * Local service interfaces cannot use overloaded operations (the SCA - specification limits remote service interfaces to not using overloaded - operations). - * Each WSDL definition for a web service binding must be in a single WSDL - document. - * No load time validation of the deployed SCA application (run time - validation only). - * No metadata API. - * Components implemented in Python and Ruby are restricted to passing - simple types and language-specific XML objects as parameters and return - values. - * Composites that use the Web Services, REST and SCA bindings are restricted - to transporting simple types and XML. - - -Thank you for using Tuscany! - -The Tuscany Team. diff --git a/sca-cpp/trunk/build.sh b/sca-cpp/trunk/build.sh deleted file mode 100755 index c306d2a20d..0000000000 --- a/sca-cpp/trunk/build.sh +++ /dev/null @@ -1,22 +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. - -./configure.sh -make install - diff --git a/sca-cpp/trunk/builddist.sh b/sca-cpp/trunk/builddist.sh deleted file mode 100755 index 737cc9dbf1..0000000000 --- a/sca-cpp/trunk/builddist.sh +++ /dev/null @@ -1,23 +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. - - -./configure.sh -make bindist - diff --git a/sca-cpp/trunk/configure.ac b/sca-cpp/trunk/configure.ac index 22eae7f4e3..ceb86d885b 100644 --- a/sca-cpp/trunk/configure.ac +++ b/sca-cpp/trunk/configure.ac @@ -18,14 +18,17 @@ dnl run autogen.sh to generate the configure script. AC_PREREQ(2.59) -AC_INIT(tuscany-sca, 1.0-M3) +AC_INIT(tuscany-sca, 1.0, dev@tuscany.apache.org) +AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_SYSTEM AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE([tar-ustar]) AC_PREFIX_DEFAULT(/usr/local/tuscany/sca) # Checks for programs. +AC_MSG_NOTICE([checking for programs]) AC_PROG_CXX +AC_PROG_AWK AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL @@ -34,7 +37,7 @@ AC_PROG_MAKE_SET AC_PROG_LIBTOOL # Check for running on Darwin -AC_MSG_CHECKING([Checking if running on Darwin]) +AC_MSG_CHECKING([if running on Darwin]) UNAME=`uname -s` if test "x$UNAME" = "xDarwin"; then AC_DEFINE([IS_DARWIN], [1], [Set to 1 when running on Darwin - Mac OSX]) @@ -48,274 +51,163 @@ else fi AM_CONDITIONAL([DARWIN], [test x$is_darmin = xtrue]) +# Configure CURL_INCLUDE and CURL_LIB +AC_MSG_CHECKING([for curl]) +AC_ARG_WITH([curl], [AC_HELP_STRING([--with-curl=PATH], [path to installed curl [default=/usr]])], [ + CURL_INCLUDE="$withval/include" + CURL_LIB="$withval/lib" + AC_MSG_RESULT("$withval") +], [ + CURL_INCLUDE="/usr/include" + CURL_LIB="/usr/lib" + AC_MSG_RESULT(/usr) +]) +AC_SUBST(CURL_INCLUDE) +AC_SUBST(CURL_LIB) + +# Configure LIBXML2_INCLUDE and LIBXML2_LIB +AC_MSG_CHECKING([for libxml2]) +AC_ARG_WITH([libxml2], [AC_HELP_STRING([--with-libxml2=PATH], [path to installed libxml2 [default=/usr]])], [ + LIBXML2_INCLUDE="$withval/include/libxml2" + LIBXML2_LIB="$withval/lib" + AC_MSG_RESULT("$withval") +], [ + LIBXML2_INCLUDE="/usr/include/libxml2" + LIBXML2_LIB="/usr/lib" + AC_MSG_RESULT(/usr) +]) +AC_SUBST(LIBXML2_INCLUDE) +AC_SUBST(LIBXML2_LIB) + +# Configure LIBMOZJS_INCLUDE and LIBMOZJS_LIB +AC_MSG_CHECKING([for js-include]) +AC_ARG_WITH([js-include], [AC_HELP_STRING([--with-js-include=PATH], [path to installed SpiderMonkey include dir + [default=/usr/include/xulrunner-1.9.1.5/unstable]])], [ + JS_INCLUDE="$withval" + AC_MSG_RESULT("$withval") +], [ + JS_INCLUDE="/usr/include/xulrunner-1.9.1.5/unstable" + AC_MSG_RESULT(/usr/include/xulrunner-1.9.1.5/unstable) +]) +AC_MSG_CHECKING([for js-lib]) +AC_ARG_WITH([js-lib], [AC_HELP_STRING([--with-js-lib=PATH], [path to installed SpiderMonkey lib dir [default=/usr/lib/xulrunner-1.9.1.5]])], [ + JS_LIB="$withval" + AC_MSG_RESULT("$withval") +], [ + JS_LIB="/usr/lib/xulrunner-1.9.1.5" + AC_MSG_RESULT(/usr/lib/xulrunner-1.9.1.5) +]) +AC_SUBST(JS_INCLUDE) +AC_SUBST(JS_LIB) + +# Configure APR and HTTPD +AC_MSG_CHECKING([for apr]) +AC_ARG_WITH([apr], [AC_HELP_STRING([--with-apr=PATH], [path to installed apr [default=/usr/local/apache2]])], [ + APR_INCLUDE="$withval/include" + APR_LIB="$withval/lib" + AC_MSG_RESULT("$withval") +], [ + APR_INCLUDE="/usr/local/apache2/include" + APR_LIB="/usr/local/apache2/lib" + AC_MSG_RESULT(/usr/local/apache2/lib) +]) +AC_SUBST(APR_INCLUDE) +AC_SUBST(APR_LIB) + +AC_MSG_CHECKING([for httpd]) +AC_ARG_WITH([httpd], [AC_HELP_STRING([--with-httpd=PATH], [path to installed httpd [default=/usr/local/apache2]])], [ + HTTPD_INCLUDE="$withval/include" + AC_MSG_RESULT("$withval") +], [ + HTTPD_INCLUDE="/usr/local/apache2/include" + AC_MSG_RESULT(/usr/local/apache2/lib) +]) +AC_SUBST(HTTPD_INCLUDE) + # Checks for libraries. +original_LIBS="$LIBS" +AC_MSG_NOTICE([checking for libraries]) +LIBS="-L$CURL_LIB $original_LIBS" +AC_CHECK_LIB([curl], [curl_global_init], [], [AC_MSG_ERROR([couldn't find a suitable libcurl, use --with-curl=PATH])]) +LIBS="-L$JS_LIB $original_LIBS" +AC_CHECK_LIB([mozjs], [JS_NewContext], [], [AC_MSG_ERROR([couldn't find a suitable libmozjs, use --with-js-lib=PATH])]) +LIBS="$original_LIBS" +AC_CHECK_LIB([pthread], [pthread_create], [], [AC_MSG_ERROR([couldn't find a suitable libpthread])]) +LIBS="-L$LIBXML2_LIB $original_LIBS" +AC_CHECK_LIB([xml2], [xmlInitParser], [], [AC_MSG_ERROR([couldn't find a suitable libxml2, use --with-libxml2=PATH])]) +LIBS="-L$APR_LIB $original_LIBS" +AC_CHECK_LIB([apr-1], [apr_pool_initialize], [], [AC_MSG_ERROR([couldn't find a suitable libapr-1, use --with-apr=PATH])]) +AC_CHECK_LIB([aprutil-1], [apr_memcache_replace], [], [AC_MSG_ERROR([couldn't find a suitable libaprutil-1, use --with-apr=PATH])]) +LIBS="$original_LIBS" # Checks for header files. +AC_MSG_NOTICE([checking for header files]) AC_HEADER_DIRENT AC_HEADER_STDC -AC_CHECK_HEADERS([inttypes.h stdlib.h string.h sys/time.h unistd.h]) +AC_CHECK_HEADERS([string.h sys/time.h]) # Checks for typedefs, structures, and compiler characteristics. +AC_MSG_NOTICE([checking for typedefs, structures, and compiler characteristics]) AC_HEADER_STDBOOL AC_C_CONST AC_C_INLINE +AC_TYPE_SIZE_T # Checks for library functions. -AC_FUNC_CLOSEDIR_VOID -AC_FUNC_STAT -AC_FUNC_VPRINTF -AC_CHECK_FUNCS([getcwd putenv strdup]) -# AC_CONFIG_SUBDIRS([samples]) +AC_MSG_NOTICE([checking for library functions]) +AC_CHECK_FUNCS([gettimeofday select]) + +# Configure GCC C++ compile options +AC_SUBST([CXXFLAGS], ["${CXXFLAGS} -D_DEBUG -O0 -g3 -Wall -std=c++0x -fmessage-length=0"]) -# Configure TUSCANY_SCACPP and TUSCANY_SDOCPP +# Configure exuberant ctags +TAGSFILE="`pwd`/tags" +AC_SUBST([CTAGSFLAGS], ["${CTAGSFLAGS} --c++-kinds=+p --fields=+iaS --extra=+q --append --tag-relative=yes -f $TAGSFILE"]) + +# Configure TUSCANY_SCACPP TUSCANY_SCACPP=`echo "$TUSCANY_SCACPP"` if test "x$TUSCANY_SCACPP" = "x"; then SCAPWD=`pwd` AC_SUBST([TUSCANY_SCACPP], ["$SCAPWD"]) fi -TUSCANY_SDOCPP=`echo "$TUSCANY_SDOCPP"` -if test "x$TUSCANY_SDOCPP" = "x"; then - SCAPWD=`pwd` - AC_SUBST([TUSCANY_SDOCPP], ["$SCAPWD/../sdo/deploy"]) -fi - -# Configure LIBXML2_INCLUDE and LIBXML2_LIB -LIBXML2_INCLUDE=`echo "$LIBXML2_INCLUDE"` -if test "x$LIBXML2_INCLUDE" = "x"; then - AC_SUBST([LIBXML2_INCLUDE], ["/usr/include/libxml2"]) -fi -LIBXML2_LIB=`echo "$LIBXML2_LIB"` -if test "x$LIBXML2_LIB" = "x"; then - AC_SUBST([LIBXML2_LIB], ["/usr/lib"]) -fi - -# Configure LIBMOZJS_INCLUDE and LIBMOZJS_LIB -LIBMOZJS_INCLUDE=`echo "$LIBMOZJS_INCLUDE"` -if test "x$LIBMOZJS_INCLUDE" = "x"; then - AC_SUBST([LIBMOZJS_INCLUDE], ["/usr/include/xulrunner-1.9.1.5/unstable"]) -fi -LIBMOZJS_LIB=`echo "$LIBMOZJS_LIB"` -if test "x$LIBMOZJS_LIB" = "x"; then - AC_SUBST([LIBMOZJS_LIB], ["/usr/lib/xulrunner-1.9.1.5"]) -fi - -# Configure GCC C++ compile options -AC_SUBST([CXXFLAGS], ["$(CXXFLAGS) -D_DEBUG -O0 -g3 -Wall -std=c++0x -fmessage-length=0"]) - -AC_MSG_CHECKING(whether to build all component type and binding extensions) -AC_ARG_ENABLE(all-extensions, [AS_HELP_STRING([--enable-all-extensions],[build all runtime extensions [default=no]])], -[ case "${enableval}" in - no) - AC_MSG_RESULT(no) - want_all=false - ;; - *) - AC_MSG_RESULT(yes) - want_all=true - ;; - esac ], -[ AC_MSG_RESULT(no) - want_all=false ] -) -AM_CONDITIONAL([WANT_ALL], [test x$want_all = xtrue]) - -AC_MSG_CHECKING(whether to build C++ component type extension) -AC_ARG_ENABLE(cpp, [AS_HELP_STRING([--enable-cpp],[build C++ component type extension [default=yes]])], -[ case "${enableval}" in - no) - AC_MSG_RESULT(no) - want_cpp=false - ;; - *) - AC_MSG_RESULT(yes) - want_cpp=true - ;; - esac ], -[ AC_MSG_RESULT(yes) - want_cpp=true ] -) -AM_CONDITIONAL([WANT_CPP], [test x$want_cpp = xtrue]) - -AC_MSG_CHECKING(whether to build Web Service binding extension) -AC_ARG_ENABLE(wsbinding, [AS_HELP_STRING([--enable-wsbinding],[build Web Service binding extension [default=no]])], -[ case "${enableval}" in - no) - AC_MSG_RESULT(no) - want_wsbinding=false - ;; - *) - AC_MSG_RESULT(yes) - want_wsbinding=true - ;; - esac ], -[ AC_MSG_RESULT(no) - want_wsbinding=false ] -) -AM_CONDITIONAL([WANT_WSBINDING], [test x$want_wsbinding = xtrue]) - -AC_MSG_CHECKING(whether to build SCA default binding extension) -AC_ARG_ENABLE(scabinding, [AS_HELP_STRING([--enable-scabinding],[build SCA default binding extension [default=no]])], +# Configure Doxygen build +AC_MSG_CHECKING([whether to build Doxygen documentation]) +AC_ARG_ENABLE(doxygen, [AS_HELP_STRING([--enable-doxygen], [build Doxygen documentation [default=no]])], [ case "${enableval}" in no) AC_MSG_RESULT(no) - want_scabinding=false - ;; - *) - AC_MSG_RESULT(yes) - want_scabinding=true - ;; - esac ], -[ AC_MSG_RESULT(no) - want_scabinding=false ] -) -AM_CONDITIONAL([WANT_SCABINDING], [test x$want_scabinding = xtrue]) - -AC_MSG_CHECKING(whether to build REST binding extension) -AC_ARG_ENABLE(restbinding, [AS_HELP_STRING([--enable-restbinding],[build REST binding extension [default=no]])], -[ case "${enableval}" in - no) - AC_MSG_RESULT(no) - want_restbinding=false - ;; - *) - AC_MSG_RESULT(yes) - want_restbinding=true - ;; - esac ], -[ AC_MSG_RESULT(no) - want_restbinding=false ] -) -AM_CONDITIONAL([WANT_RESTBINDING], [test x$want_restbinding = xtrue]) - -AC_MSG_CHECKING(whether to build Python component type extension) -AC_ARG_ENABLE(python, [AS_HELP_STRING([--enable-python],[build Python component type extension [default=no]])], -[ case "${enableval}" in - no) - AC_MSG_RESULT(no) - want_python=false - ;; - *) - AC_MSG_RESULT(yes) - want_python=true - ;; - esac ], -[ AC_MSG_RESULT(no) - want_python=false ] -) -AM_CONDITIONAL([WANT_PYTHON], [test x$want_python = xtrue]) - -AC_MSG_CHECKING(whether to build Ruby component type extension) -AC_ARG_ENABLE(ruby, [AS_HELP_STRING([--enable-ruby],[build Ruby component type extension [default=no]])], -[ case "${enableval}" in - no) - AC_MSG_RESULT(no) - want_ruby=false - ;; - *) - AC_MSG_RESULT(yes) - want_ruby=true - ;; - esac ], -[ AC_MSG_RESULT(no) - want_ruby=false ] -) -AM_CONDITIONAL([WANT_RUBY], [test x$want_ruby = xtrue]) - -AC_MSG_CHECKING(whether to build PHP component type extension) -AC_ARG_ENABLE(php, [AS_HELP_STRING([--enable-php],[build PHP component type extension [default=no]])], -[ case "${enableval}" in - no) - AC_MSG_RESULT(no) - want_php=false - ;; - *) - AC_MSG_RESULT(yes) - want_php=true - ;; - esac ], -[ AC_MSG_RESULT(no) - want_php=false ] -) -AM_CONDITIONAL([WANT_PHP], [test x$want_php = xtrue]) - -AC_MSG_CHECKING(whether to build Doxygen documentation) -AC_ARG_ENABLE(doxygen, [AS_HELP_STRING([--enable-doxygen],[build Doxygen documentation [default=no]])], -[ case "${enableval}" in - no) - AC_MSG_RESULT(no) - want_doxygen=false ;; *) AC_MSG_RESULT(yes) + AC_PATH_PROG(DOXYGEN, doxygen, , $PATH) + if test x$DOXYGEN = x; then + AC_MSG_ERROR([could not find doxygen]) + fi want_doxygen=true ;; esac ], -[ AC_MSG_RESULT(no) - want_doxygen=false ] -) -if test x$want_doxygen = xyes; then - AC_PATH_PROG(DOXYGEN, doxygen, , $PATH) - if test x$DOXYGEN = x; then - AC_MSG_ERROR([could not find doxygen]) - want_doxygen=no - fi -fi +[ AC_MSG_RESULT(no)]) AM_CONDITIONAL([WANT_DOXYGEN], [test x$want_doxygen = xtrue]) -# Configure exuberant ctags -TAGSFILE="`pwd`/tags" -AC_SUBST([CTAGSFLAGS], ["$(CTAGSFLAGS) --c++-kinds=+p --fields=+iaS --extra=+q --append --tag-relative=yes -f $TAGSFILE"]) - AC_CONFIG_FILES([Makefile kernel/Makefile modules/Makefile modules/atom/Makefile - modules/cache/Makefile modules/eval/Makefile modules/http/Makefile modules/json/Makefile modules/scdl/Makefile + modules/server/Makefile + components/Makefile + components/cache/Makefile + components/store/Makefile test/Makefile test/store-object/Makefile test/store-function/Makefile test/store-script/Makefile doc/Makefile doc/Doxyfile - runtime/Makefile - runtime/core/Makefile - runtime/core/src/Makefile - runtime/core/test/Makefile - runtime/extensions/Makefile - runtime/extensions/cpp/Makefile - runtime/extensions/cpp/src/Makefile - runtime/extensions/cpp/tools/Makefile - runtime/extensions/cpp/tools/scagen/Makefile - runtime/extensions/ws/Makefile - runtime/extensions/ws/reference/Makefile - runtime/extensions/ws/reference/axis2c/Makefile - runtime/extensions/ws/reference/axis2c/src/Makefile - runtime/extensions/ws/service/Makefile - runtime/extensions/ws/service/axis2c/Makefile - runtime/extensions/ws/service/axis2c/src/Makefile - runtime/extensions/sca/Makefile - runtime/extensions/sca/reference/Makefile - runtime/extensions/sca/reference/src/Makefile - runtime/extensions/sca/service/Makefile - runtime/extensions/sca/service/src/Makefile - runtime/extensions/rest/Makefile - runtime/extensions/rest/interface/Makefile - runtime/extensions/rest/interface/src/Makefile - runtime/extensions/rest/reference/Makefile - runtime/extensions/rest/reference/curl/Makefile - runtime/extensions/rest/reference/curl/src/Makefile - runtime/extensions/rest/service/Makefile - runtime/extensions/rest/service/httpd/Makefile - runtime/extensions/rest/service/httpd/src/Makefile - runtime/extensions/python/Makefile - runtime/extensions/python/src/Makefile - runtime/extensions/ruby/Makefile - runtime/extensions/ruby/src/Makefile - runtime/extensions/ruby/extension/Makefile ]) AC_OUTPUT + diff --git a/sca-cpp/trunk/configure.sh b/sca-cpp/trunk/configure.sh deleted file mode 100755 index ca78ad8be0..0000000000 --- a/sca-cpp/trunk/configure.sh +++ /dev/null @@ -1,80 +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. - -TUSCANY_SCACPP_HOME=`pwd` - -if [ x$AXIS2C_HOME = x ]; then - echo "AXIS2C_HOME not set. Not building Axis2C WS binding extensions" - ENABLE_WS=--enable-wsbinding=no -else -echo "Using Axis2C installed at $AXIS2C_HOME" - ENABLE_SCABINDING=--enable-scabinding - ENABLE_WS=--enable-wsbinding -fi - -if [ x$TUSCANY_SDOCPP = x ]; then - export TUSCANY_SDOCPP="$TUSCANY_SCACPP_HOME/../sdo/deploy" -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -if [ x$PYTHON_LIB = x ]; then - echo "PYTHON_LIB not set. Python extension will not be built" -elif [ x$PYTHON_INCLUDE = x ]; then - echo "PYTHON_INCLUDE not set. Python extension will not be built" -elif [ x$PYTHON_VERSION = x ]; then - echo "PYTHON_VERSION not set. Python extension will not be built" -else - echo "Building PYTHON extension with Python $PYTHON_VERSION installed at $PYTHON_LIB, $PYTHON_INCLUDE" - ENABLE_PYTHON=--enable-python -fi - -if [ x$RUBY_LIB = x ]; then - echo "RUBY_LIB not set. Ruby extension will not be built" -elif [ x$RUBY_INCLUDE = x ]; then - echo "RUBY_INCLUDE not set. Ruby extension will not be built" -else - echo "Building Ruby extension with Ruby installed at $RUBY_LIB, $RUBY_INCLUDE" - ENABLE_RUBY=--enable-ruby -fi - -if [ x$CURL_LIB = x ]; then - echo "CURL_LIB not set. REST extension will not be built" -elif [ x$CURL_INCLUDE = x ]; then - echo "CURL_INCLUDE not set. REST extension will not be built" -elif [ x$HTTPD_INCLUDE = x ]; then - echo "HTTPD_INCLUDE not set. REST extension will not be built" -elif [ x$APR_INCLUDE = x ]; then - echo "APR_INCLUDE not set. REST extension will not be built" -else - echo "Building REST extension using HTTPD from $HTTPD_INCLUDE, APR from $APR_INCLUDE and libCURL from $CURL_LIB" - ENABLE_REST=--enable-restbinding -fi - -if [ x$TUSCANY_SCACPP = x ]; then - export TUSCANY_SCACPP="$TUSCANY_SCACPP_HOME/deploy" -fi - -./autogen.sh -./configure --prefix=${TUSCANY_SCACPP} --enable-static=no ${ENABLE_WS} ${ENABLE_SCABINDING} ${ENABLE_RUBY} ${ENABLE_PYTHON} ${ENABLE_REST} - -cd ${TUSCANY_SCACPP_HOME}/samples -./autogen.sh -./configure --prefix=${TUSCANY_SCACPP} --enable-static=no ${ENABLE_RUBY} ${ENABLE_PYTHON} - -cd $TUSCANY_SCACPP_HOME diff --git a/sca-cpp/trunk/contrib/doc/Axis2CWSExtension.html b/sca-cpp/trunk/contrib/doc/Axis2CWSExtension.html new file mode 100644 index 0000000000..17b9676650 --- /dev/null +++ b/sca-cpp/trunk/contrib/doc/Axis2CWSExtension.html @@ -0,0 +1,498 @@ + + + + + + + + + + + + Tuscany SCA Native - Axis2/C Web Services Extension + + + +
+
+
+

Tuscany SCA Native - Axis2/C Web Services Extension

+ +

This document describes the installation, deployment and use of the Axis2/C Web Service + support in the Apache Tuscany SCA Native runtime. +

+

The WS service code is based on Apache + Axis2/C version 0.96 and allows SCA components to be invoked via Web + Service calls. +

+

WS service currently supports Document/literal Wrapped style Web Services + only. There are also restrictions about the parameter and return types of the + operations in SCA components that can be exposed as Web Services, see below + for more details. +

+

See the SCA + Web Service binding specification for more details about SCA Web + Service support. +

+

Also, see the samples for various + demonstrations of the use of the binding.ws service support. +

+
+ + + +
+

System Requirements

+ +

In order to install and use the Tuscany SCA Axis2/C Web Services Extension there are some + extra requirements in addition to the Tuscany + SCA requirements:

+ + + + + + + + + + + + + +
SoftwareDownload Link
Axis2/C version 0.96 + http://ws.apache.org/axis2/c/download.cgi
+ Please download and follow the installation instructions. Ensure you can run + the Axis2/C samples. +
+
+ +
+

Installing the Tuscany SCA Axis2/C Extension

+

Getting the Tuscany SCA Axis2/C Extension working with the binary release on Linux and Mac OS X

+
    +
  1. Ensure the AXIS2C_HOME environment variable is set to the Axis2/C installation
  2. +
  3. Deploy the Axis2/C Web Services extension by following the deployment steps
  4. +
+

Getting the Tuscany SCA Axis2/C Extension working with the source release on Linux and Mac OS X

+
    +
  1. You will need the Tuscany SCA and SDO libraries - follow the instructions + here to build the SCA libraries and default extensions
  2. +
  3. The following environment variables are required: +
      +
    • TUSCANY_SCACPP=<path to built Tuscany SCA>
    • +
    • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
    • +
    • AXIS2C_HOME=<path to Axis2/C installation>
    • +
  4. +
  5. Build the Axis2/C source only with the following command sequence: +
      +
    • cd <tuscany_sca_install_dir>
    • +
    • ./configure --prefix=$TUSCANY_SCACPP --enable-wsbinding --enable-cpp=no
    • +
    • make
    • +
    • make install
    • +
    + NOTE: If you don't provide a --prefix configure option, it will by default install into + /usr/local/tuscany/sca
  6. +
+ +

Getting the Tuscany SCA Axis2/C Extension working with the binary release on Windows

+
    +
  1. Ensure the AXIS2C_HOME environment variable is set to the Axis2/C installation
  2. +
  3. Deploy the Axis2/C Web Services extension by following the deployment steps
  4. +
+

Getting the Tuscany SCA Axis2/C Extension working with the source release on Windows

+
    +
  1. Unzip the supplied source zip file
  2. +
  3. The following environment variables are required: +
      +
    • TUSCANY_SCACPP=<path to built Tuscany SCA>
    • +
    • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
    • +
    • AXIS2C_HOME=<path to Axis2/C installation>
    • +
  4. +
  5. You must have set up the environment for Microsoft Visual C++ tools. The build command + will call vcvars32 to set the environment. Ensure the directory containing this is on your path. + This will be where you installed the compiler.
  6. +
  7. Build the source: +
      +
    • cd <to where you unzipped the source>
    • +
    • build
    • +
    + This will build all the projects and put the required output into the 'deploy' directory

    + Alternatively, open the workspace at <tuscany_sca_install_dir>/projects/tuscany_sca/tuscany_sca.dsw + in Visual Studio 6 or at at <tuscany_sca_install_dir>/projectsvc7/tuscany_sca/tuscany_sca.sln + in Visual Studio 7.1 - you can build projects individually + or build the samples to rebuild all the projects
  8. +
+
+ + +
+

Deploying the Tuscany Web Service support to Axis2/C

+

Deploying via scripts

+

Tuscany provides simple shell scripts to deploy the Web Service support to Axis2/C. + However, the script will overwrite your Axis2/C axis.xml file, so if you + have altered your axis2.xml from the default provided by the Axis2/C distribution, it is + recommended that you follow the manual deployment steps + outlined below. +

+

To automatically deploy Tuscany Web Service support to Axis2/C on Linux and Mac OS X: +

    +
  1. The AXIS2C_HOME environment variable is required: +
      +
    • set AXIS2C_HOME=<path to axis2c version 0.96>
    • +
  2. +
  3. Use the following command sequence to run the deploy script: +
      +
    • cd <tuscany_sca_install_dir>/extensions/ws/service
    • +
    • ./deploy.sh
    • +
    +
  4. +
+

+

To automatically deploy Tuscany Web Service support to Axis2/C on Windows: +

    +
  1. The AXIS2C_HOME environment variable is required: +
      +
    • export AXIS2C_HOME=<path to axis2c version 0.96>
    • +
  2. +
  3. Use the following command sequence to run the deploy script: +
      +
    • cd <tuscany_sca_install_dir>\extensions\ws\service
    • +
    • deploy.bat
    • +
    +
  4. +
+

+ + +

Deploying manually

+

To deploy Tuscany Web Service support to Axis2/C manually, use the following steps: +

+
    +
  1. + Linux and Mac OS X: +
      +
    1. cd <axis2c version 0.96>/services
    2. +
    3. ln -sf <tuscany_sca_install_dir>/extensions/ws/service/services/tuscany
    4. +
    5. cd <axis2c version 0.96>/modules
    6. +
    7. ln -sf <tuscany_sca_install_dir>/extensions/ws/service/modules/tuscany
    8. +
    + Windows: +
      +
    1. Create a <axis2c version 0.96>\services\tuscany directory +
    2. +
    3. Copy all the files in <tuscany_sca_install_dir>\extensions\ws\service\services\tuscany + to the directory created above +
    4. +
    5. Create a <axis2c version 0.96>\modules\tuscany directory +
    6. +
    7. Copy all the files in <tuscany_sca_install_dir>\extensions\ws\service\modules\tuscany + to the directory created above +
    8. +
    +
  2. +
  3. Edit the <axis2c version 0.96>/axis2.xml file to add a <ref module="tuscany"> + element. This will register the above module. E.g.: +
    ...
    +    <!-- ================================================= -->
    +    <!-- Global Modules  -->
    +    <!-- ================================================= -->
    +    <!-- Comment this to disable Addressing -->
    +    <module ref="addressing"/>
    +
    +    <module ref="tuscany"/>
    +
    +...              
    +
  4. + +
+
+ +
+

Deploying Axis2/C to the Apache HTTPD server

+

Follow the Axis2/C documentation + to deploy Axis2/C to Apache HTTPD. Also see the HTTPDBigBank + sample, which demonstrates running Axis2/C under Apache HTTPD.

+
+ + +
+

Defining an SCA Composite with a WS service

+ +

In this section we will use the Calculator sample as a worked example. + The Calculator code and files can be found at + <tuscany_sca_install_dir>samples/CppCalculator. +

+

Pre-requisites: +

    +
  • At least one working component within a composite and solution + composite. The component(s) can be implemented in C++, Ruby or Python. + If this includes C++ components, the SCAGEN generated Proxy and Wrapper + classes and the component class files must have been compiled into a + .dll or .so library. The *.composite and *.componentType files must + also be available and working. +
  • +
+

+
    +
  1. Optionally, create the WSDL that defines the interface of your SCA component. See the + table XML Schema Type to C++ Type Mapping and + Notes on creating WSDL below + for mapping the parameters and return types of the component operations to XML + schema types in the WSDL. This file will need to be accessible from the component, + so place it in the same directory as the component or in a subdirectory. +
    + See the <tuscany_sca_install_dir>/samples/CppCalculator/sample.calculator/Calculator.wsdl + file as an example. +
    + If you do not provide a WSDL file describing the service interface then the service will + accept any incoming document/literal wrapped XML request that matches an operation on the + target service (the wrapper element name and types of the sub-elements must match the operation + name and its parameter types). Additionally, if the target component is a Python or Ruby + scripting component, it will accept any parameter type so you can pretty much pass whatever + data you want, as long at the incoming XML request matches to an operation name with the + correct number of parameters on the target service. +
  2. +
  3. Add a service definition to the component .composite file. If you have created a WSDL + definition, set the interface.wsdl interface attribute to the namespace and port name + specified in the WSDL, in the form: "<namespace>#wsdl.interface(<port-name>)". + Link a reference from this service definition to your + component, give the service a name and set the multiplicity if required. +
    + E.g. for the Calculator component, based on the Calculator.wsdl file: +
    <service name="CalculatorService">
    +    <interface.wsdl interface="http://sample/calculator#wsdl.interface(Calculator)"/>
    +    <binding.ws/>
    +    <reference>CalculatorComponent/CalculatorService</reference>
    +</service>
    + If the Calculator.wsdl file were not included, the service definition would simply + be as follows: +
    <service name="CalculatorService">
    +    <binding.ws/>
    +    <reference>CalculatorComponent/CalculatorService</reference>
    +</service>
    +
  4. +
  5. You are now ready to start the Axis2/C HTTP server. Remember you will need to have the + TUSCANY_SCACPP, TUSCANY_SDOCPP and AXIS2C_HOME environment variables set, + as well as the SCA and SDO bin directories and the Axis2/C lib directory on + your PATH on Windows or the SCA, SDO and Axis2/C lib directories on + your LD_LIBRARY_PATH on Linux and your DYLD_LIBRARY_PATH on Mac OS X. + You will also need to set the TUSCANY_SCACPP_SYSTEM_ROOT + and TUSCANY_SCACPP_DEFAULT_COMPONENT environment variables to the + path to your SCA component directory structure and the default component respectively. + E.g. on Windows run the following commands: +
      +
    • set TUSCANY_SCACPP=C:/tuscany_sca
    • +
    • set TUSCANY_SDOCPP=C:/tuscany_sdo
    • +
    • set AXIS2C_HOME=C:/axis2c-bin-0.96-win32
    • +
    • set PATH=%PATH%;C:/tuscany_sca/bin;C:/tuscany_sdo/bin;C:/axis2c-bin-0.96-win32/lib
    • +
    • set TUSCANY_SCACPP_SYSTEM_ROOT=C:/tuscany_sca/samples/CppCalculator/deploy
    • +
    • set TUSCANY_SCACPP_DEFAULT_COMPONENT=sample.calculator.CalculatorComponent
    • +
    • cd %AXIS2C_HOME%/bin/
    • +
    • ./axis2_http_server.exe
    • +
    +
  6. +
  7. Optionally, enable Tuscany logging by setting the TUSCANY_SCACPP_LOGGING + environment variable with the level you wish to log at (0 for minimal + logging, up to 9 for more detailed logging) and the TUSCANY_SCACPP_LOG + environment variable to define the file to log to (if this is not set, + logging will go to the console). E.g. on Windows run the following + commands: +
      +
    • set TUSCANY_SCACPP_LOGGING=5
    • +
    • set TUSCANY_SCACPP_LOG=C:/tuscany/mylogfile.txt
    • +
    +
  8. +
+

Your component should now be exposed as an Axis2/C Web Service, via the WS + service you created. See the Axis2/C documentation for writing clients to + invoke the Web Service, or you can use any other Web Service client platform + (e.g. Axis2 for Java), or you can + invoke your service from another SCA application by using Tuscany's WS + reference support. +

+ +
+ +
+

XML Schema Type to C++ Type Mapping

+

To help define the WSDL that describes the interface of your component, the + table below lists how incoming XML data in Web Service messages is mapped to + C++ types used in the parameters and return types of your component operations. +

+

This lists the only C++ types that can currently be used on the operations of a + component exposed as a Web Service. For other types, use an SDO DataObject to + wrap the data, and define that wrapping as a complexType in the WSDL. See the + SDO + specifications for the C++ types that SDO supports. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
XML Schema TypeC++ Type
stringstd::string
intlong
integerlong
shortshort
floatfloat
doublelong double
booleanbool
hexBinarychar*
base64Binarychar*
bytechar
complexTypecommonj::sdo::DataObjectPtr
anycommonj::sdo::DataObjectPtr with OpenDataObjectType
+
+ +
+

Notes on creating WSDL

+

Currently only Document/literal Wrapped style Web Services are supported by + WS EntryPoint, support for RPC style Web Services is planned for future + releases. +

+

See this article + for an explanation of Document/literal Wrapped style WSDL and Web Services +

+

Document/literal Wrapped services require that the operation name is used as + the name of the incoming element that wraps the operation parameters. Additionally, + operation parameter and return messages that are defined in the WSDL must be + XML Schema elements containing a complexType. +

+

For example, a component operation defined in C++ as: +

long myOperation(std::string arg1, short arg2, DataObjectPtr arg3);
+ will need to be described in WSDL with messages like: +
<wsdl:message name="myOperationRequestMsg">                                               
+  <wsdl:part element="tns:myOperation" name="myOperationRequestPart"/>                    
+</wsdl:message>                                                                           
+<wsdl:message name="myOperationResponseMsg">                                              
+  <wsdl:part element="tns:myOperationResponse" name="myOperationResponsePart"/>           
+</wsdl:message>
+ and will need an XML schema to define the types like: +
<xsd:element name="myOperation">                                                          
+ <xsd:complexType>                                                                       
+   <xsd:sequence>                                                                        
+     <xsd:element name="arg1" type="xsd:string" minOccurs="1"/>                          
+     <xsd:element name="arg2" type="xsd:short" minOccurs="1"/>                           
+     <xsd:element name="arg3" minOccurs="1">                                             
+       <xsd:complexType>                                                                 
+         <xsd:sequence>                                                                  
+           <xsd:element name="dataObjectFloatData" type="xsd:float"/>                    
+           <xsd:element name="dataObjectStringData" type="xsd:string"/>                  
+           <xsd:element name="dataObjectIntData" type="xsd:int"/>                        
+         </xsd:sequence>                                                                 
+       </xsd:complexType>                                                                
+     </xsd:element>                                                                      
+   </xsd:sequence>                                                                       
+ </xsd:complexType>                                                                      
+</xsd:element>                                                                            
+                                                                                         
+<xsd:element name="myOperationResponse">                                                  
+ <xsd:complexType>                                                                       
+   <xsd:sequence>                                                                        
+     <xsd:element name="result" type="xsd:int" minOccurs="1"/>                           
+   </xsd:sequence>                                                                       
+ </xsd:complexType>                                                                      
+</xsd:element>
+
+ +
+

Getting Help

+ +

First place to look is at the Tuscany FAQ at + http://incubator.apache.org/tuscany/faq.html

+ +

Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

+
+
+
+ + + + diff --git a/sca-cpp/trunk/contrib/doc/CPPGeneratorTool.txt b/sca-cpp/trunk/contrib/doc/CPPGeneratorTool.txt new file mode 100644 index 0000000000..c004799791 --- /dev/null +++ b/sca-cpp/trunk/contrib/doc/CPPGeneratorTool.txt @@ -0,0 +1,362 @@ + +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. + + + +Tuscany SCA For C++ - scagen C++ generator tool +=============================================== + + +See cpp/build.txt in the parent directory or the cpp/sca/INSTALL file +for build instructions. + +Building the tools +------------------ + +NOTE: this is built and installed by the build step above. + +Currently, there is only one tool: "scagen". It can be built using the +ant build script at \tuscany\cpp\sca\tools\scagen\build.xml. +The default target "all" will build the java jars, documentation, +scripts and a zip file of the whole thing. This is all the ant +build tasks apart from "test" which runs all the junit tests. + +The ant build script can be altered to add the junit tests to the +default target. Replace the line + + + +The "test" task was not included in "all" as it requires a +junit jar file to run. This jar is available here: +http://www.junit.org/index.htm testing has been done with +Junit version 3.8.1. + +Running the scagen tool +----------------------- + +The scagen tool user interface is quite basic in this initial release. +It can be run from the scagen.jar file using "java -jar scagen.jar" +or from small scripts - scagen.bat for Windows and scagen.sh for Unix. +The parameters are: + -dir + -output + +e.g. + scagen -dir c:\mycomposites\composite1 -output c:\mycomposites\bld\composite1 + +What scagen does +---------------- + +The input directory passed to the scagen tools as +the -dir parameter method is taken to be the SCA +composite root directory. All the sca.composite and .fragment +files in that directory are inspected to resolve all +the elements within them. + +Each element found is inspected +to see if it has a element within it. + +Each element should have a +header attribute that represents a C++ header file +that contains function prototypes for the C++ +implementation of the service. An optional class +attribute can be used to select one class if more than +one that is present in the header file. The default +class is the one with the same name as the header file. +The tool will verify that the implementation header +contains an appropriate class prototype. + +The directory that contains the implementation header +should also contain a matching .componentType file for +the equivalent SCA component. So for example, a +MyServiceImpl.h file would have a corresponding +MyServiceImpl.componentType file in the same directory. + +Each componentType file is inspected for +and elements. For each element +that is found that contains a element +within it, + +the header attribute of the is taken +as the filename of the C++ interface header for the +SCA service. This C++ header file is opened and used +as a means for specifying the SCA service resulting +in an appropriate wrapper and proxy being generated +for this service interface. Both method bodies and h +eaders are generated in the given output directory. +The processing of a element is the same +except that only a proxy header and implementation +re generated. + + +Getting started with the code +----------------------------- + +The following is a list of tasks that are performed by the scagen tool +for each task we will describe technically how it is accomplished and +the location of the code that can be inspected/changed to alter the +behaviour. + +Here are the tasks listed, below is a paragraph for each one: + + o (Overall structure of the code) + o Walking the input directory + o Scanning the .composite and .fragment files + o finding the C++ implementation headers + o finding/checking the classname in the C++ implementation headers + o find the matching .componentTemplate files + o going into the componentTemplate files to extract the interface header filenames + o going into the interface header files and parsing them to extract the method signatures + into a network of objects we can inspect. + o taking all the meta data stored as objects and building a DOM for XSLT processing + o using XSLT to produce a proxy header + o using XSLT to produce a proxy implementation + o using XSLT to produce a wrapper header + o using XSLT to produce a wrapper implementation + + +Overall structure of the code +----------------------------- + +There are two packages org.apache.tuscany.sca.cpp.tools.common and +org.apache.tuscany.sca.cpp.tools.services. The ...common package is +taken from some existing code that was also contributed to axis that +was used to parse C++ code and do various tasks like insert trace. +This code was repackaged and shipped as a tuscany package but there +has been a desire not to change it significantly from the equivalent +org.apache.axis.tools.common package to leave the door open for +future convergence. + +Where the ...common package has been amended (for example to cope with +namespaces better or the provision of an Options.reset method to reset a static +variable and enable the tuscany junit tests to run independently) these +have been flagged with a "Tuscany" comment. The ...common package basically +provides two functions - 1) the ability to go into a directory (see DirectoryTree.java) +and process files that fit a particular filter (e.g. "*.hpp") by passing them to +implementer of the FileActor Interface (see the classes "Headers" for the +actor that processes C++ headers and "XMLFileActor" for the file actor that +processes the .componentType and sca.composite/fragment files.) + +The ...services package contains the majority of code written afresh for the +scagen tool including the subclasses of XMLFileActor (see ComponentTypeFileHandler.java +and CompositeOrFragmentFileHandler.java) that are the classes that tie this +package to the ...common package and which are called by the +DirectoryTree walker. + +Walking the composite root input directory +--------------------------------------- + +The main method of the scagen class creates an instance of +"DirectoryScanner" and registers with it a file handler of +type "CompositeOrFragmentFileHandler" for all files that end +in ".composite" or ".fragment". On calling the "walkTree" method +on the scanner it will in turn call the actOnFile method on the +CompositeOrFragmentFileHandler for appropriate files. + +Scanning the .composite and .fragment files +---------------------------------------- + +The scanning of these files by the respective "CompositeOrFragmentFileHandler" +and "ComponentTypeFileHandler" is mostly handled by the superclass +"XMLFileActor". This class will recursively goes through the whole +XML file and considers the name of the XML element it finds. +"XMLFileActor" contains a map of element names to element handlers +that will "flatten out" the structure of the XML file "above" the +level of node we are interested in. + +So for example the ComponentTypeFile handler sets up the handlers +map as follows: + + GenericDomNodeHandler gdnh = new GenericDomNodeHandler(); + handlers.put("componentType", gdnh); + handlers.put("interface.cpp", gdnh); + ServiceDomNodeHandler sdnh = new ServiceDomNodeHandler(); + handlers.put("service", sdnh); + + ReferenceDomNodeHandler rdnh = new ReferenceDomNodeHandler(); + handlers.put("reference", rdnh); + +The majority of processing done by these DomNOdeHandlers is to +place the attributes and values discovered into another map that +maps an (static version of) the XPath of a value to the value itself. +So for example "/componentType/service/interface.cpp/@header" might contain +the current ("root to here") value of the header attribute of the current +interface. + +Particular handlers for the "leaves" of this tree +such as ServiceDomNodeHandler and ReferenceDomNodeHandler +can then consume these values from the map without having +to be concerned with the actual names of things, +like the service name, appearing in the key. It should be +understood though that there are multiple values placed in the map +for one "key" as the processing works its way through the +XML tree. For example the processing of a second component will +overlay its data over the same keys as the first component. +(After "wiping" the appropriate subtree.) + +Finding the C++ implementation headers +-------------------------------------- + +The "/composite/component/implementation.cpp/@header" and +is used to key into the name of the implementation header +and this is opened directly and passed to the +actOnFileMethod of a Headers object from the ...common package +bypassing the DirectoryScanner code. The path is relative to +the given (-dir option) composite root directory. + +Finding/checking the classname in the C++ implementation headers +----------------------------------------------------------------- + +This implementation header is not used to define the +methods of the SCA service but rather is opened to check + any given implementation.cpp/@class attribute +(or find out the name of the implementation class +in the header if this is not specified in the XML. This +is done using the same method that later parses the interface +C++ headers into java objects - we just them inspect the +class attribute of the "Signature" objects that represent the methods +we find in the header. + +Find the matching .componentType files +------------------------------------------ + +By SCA convention we go to the same directory as the implementation +files and look for the XXX.componentType files with the same name. +A instance of the ComponentDOMNodeHandler handles the data in the +Component Element and pre-creates a ComponentTypeFileHandler that +will eventually be called to process the .componentType file. This +object receives a number of "setParameter" calls to poke into it +matadata that is available prior/outside the the actual .componentType +file it will read. + +Go into the componentType files to extract the interface header filenames +----------------------------------------------------------------------------- + +We open up the .componentTemplateFiles with exactly the same +mechanism as we read the sca.composite/fragment file (by creating +a DOM and descending through it this time using a ComponentTypeFileHandler that it +has had various data values ( e.g. the implementation class and namespace used later) +poked into it. The ComponentTypeFileHandler itself has individual +handlers for the service and reference XML/DOM element/nodes +that is comes across (ServiceDomNodeHandler and ReferenceDomNodeHandler +respectively). Each these handlers will pull out the name of +a C++ interface header and use it to resolve the interface of the +SCA Service. + +Parsing the interface header files for signatures +------------------------------------------------- + +The Service/Reference DOM Node hander both call the + ServicesGenerator.handleInterfaceHeader(parameters, true); +method, the second parameter is used to differentiate +the call source as we don't need wrapper files for +SCA references (just proxies). + +The ServicesGenerator uses the Headers file actor from +the ...common package to create a List of Signature +objects that describe the interface methods in the C++ +header. + +Take all the meta data stored as objects and build a DOM +-------------------------------------------------------- +We now have a List of Signature objects and a map that +represents the flattened information that we have pulled +from the XML files in the ServiceGenerator class. +We call a "createDOMofMethods" method +to consolidate all this information into one DOM +(this task should be split into more than one method as the +signature/parameter list of the method is too large). + +Use XSLT to produce the output files (Proxy/Wrapper headers and Implementations) +-------------------------------------------------------------------------------- + +The ServicesGenerator.handleInterfaceHeader(parameters, forReference); +method closes of with the code: + + createProxyCPPFromDom(outputDir, dom); + createProxyHeaderFromDom(outputDir, dom); + + if (!forReference) { + createWrapperCPPFromDom(outputDir, dom); + createWrapperHeaderFromDom(outputDir, dom); + } + + +Each of the create methods sets up the output +file name and a different XSLT transform and calls +"createOutputFromDom" to transform/filter the data in the +"model" that is held in our DOM of the data to a particular +"view" as expressed in the C++ output file. + +The four XSLT style sheets are in rough order of the output +file and this corresponds very roughly to a depth first descent +of the DOM tree so, for example, we could have in a stylesheet: + +... + void* + ::newImplementation() + { + return new (target); + } + +which would be output as: + + void* MyClassImpl_MyClass_Proxy::newImplementation() + { + return new MyClassImpl(target) + } + +given appropriate valies for $class and "../@implClass" and +$class might be defined to be: +xsl:variable name="clazz"> + + _ + + _Proxy + + +giving "MyClassImpl_MyClass_Proxy" + +The stylesheets can be found in the xsl subdirectory of the +org.apache.tuscany.sca.cpp.tools.services package. + +Unit Testing Scagen Code Changes +-------------------------------- + +The junit unit test + /tuscany/cpp/sca/tools/scagen/ + junit/org/apache/tuscany/sca/cpp/tools/junit/TestAllCompositesTest.java + +will dynamically look for all the subdirectores of the directory +path given by TuscanyTestCase.junit_composites and run the scagen +tool on them as if they were composites roots. + +By convention an "expected_output" directory is located +(see the CVS tree or the test program) and the actual +and expected results compared. This testcase is thus a +good first/basic regression test for any changes. + +New test cases can thus be added without having to write +any new junit java code by by creating new SCA composites and +the associated expected Scagen output - perhaps by using the tool +initially and checking the output is satisfactory before copying +it to the expected output directory at: + +/tuscany/cpp/sca/tools/scagen/junit/testoutput//expected_output +where input data is taken from +/tuscany/cpp/sca/tools/scagen/junit/testinput/composites/ diff --git a/sca-cpp/trunk/contrib/doc/CppExtension.html b/sca-cpp/trunk/contrib/doc/CppExtension.html new file mode 100644 index 0000000000..6e7420a9d4 --- /dev/null +++ b/sca-cpp/trunk/contrib/doc/CppExtension.html @@ -0,0 +1,430 @@ + + + + + + + + + + + + Tuscany SCA Native - Creating C++ SCA Components + + + +
+
+
+

Tuscany SCA Native - C++ Extension

+

The Tuscany C++ extension allows C++ classes to be used as components in + SCA composites and as clients that can invoke SCA services. +

+

This document describes how to build and install the C++ extension and create and run SCA + components in Tuscany SCA Native milestone release 3. +

+

See the SCA + C++ Client and Implementation specification for more details about the SCA C++ + programming model. +

+

See CppCalculator or + CppBigBank for samples that + demonstrate the use of C++ components +

+
+ + +
+

System Requirements

+ +

In order to install and use the Tuscany SCA C++ Extension there are some + extra requirements in addition to the Tuscany + SCA requirements:

+ + + + + + + + + + + + + + + + +
SoftwareDownload Link
Java SDK 1.4 or laterhttp://java.sun.com/javase/downloads
+ For building and running the SCAGEN code generation tool, which is used when developing + Tuscany SCA C++ components. Please download and follow the installation instructions
Apache Ant 1.6 or laterhttp://ant.apache.org
+ For building the SCAGEN code generation tool. This is only required when building + the C++ extension from a source distribution of Tuscany SCA Native. + Please download and follow the installation instructions
+
+ +
+

Installing the Tuscany SCA C++ Extension

+

Getting the Tuscany SCA C++ Extension working with the binary release on Linux and Mac OS X

+
    +
  1. Add the <tuscany_sca_install_dir>/extensions/cpp/lib directory to the PATH environment variable
  2. +
+

Getting the Tuscany SCA C++ Extension working with the source release on Linux and Mac OS X

+
    +
  1. You will need the Tuscany SCA kernel and SDO libraries - follow the instructions + here to build the SCA libraries and default extensions
  2. +
  3. The following environment variables are required: +
      +
    • TUSCANY_SCACPP=<path to built Tuscany SCA>
    • +
    • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
    • +
  4. +
  5. Build the C++ source only with the following command sequence: +
      +
    • cd <tuscany_sca_install_dir>
    • +
    • ./configure --prefix=$TUSCANY_SCACPP --enable-cpp --enable-wsbinding=no
    • +
    • make
    • +
    • make install
    • +
    + NOTE: If you don't provide a --prefix configure option, it will by default install into + /usr/local/tuscany/sca
  6. +
+ +

Getting the Tuscany SCA C++ Extension working with the binary release on Windows

+
    +
  1. Add the <tuscany_sca_install_dir>/extensions/cpp/lib directory to the PATH environment variable
  2. +
+

Getting the Tuscany SCA C++ Extension working with the source release on Windows

+
    +
  1. Unzip the supplied source zip file
  2. +
  3. The following environment variables are required: +
      +
    • TUSCANY_SCACPP=<path to built Tuscany SCA> +
    • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
  4. +
  5. You must have set up the environment for Microsoft Visual C++ tools. The build command + will call vcvars32 to set the environment. Ensure the directory containing this is on your path. + This will be where you installed the compiler.
  6. +
  7. Build the source: +
      +
    • cd <to where you unzipped the source>
    • +
    • build
    • +
    + This will build all the projects and put the required output into the 'deploy' directory

    + Alternatively, open the workspace at <tuscany_sca_install_dir>/projects/tuscany_sca/tuscany_sca.dsw + in Visual Studio 6 or at at <tuscany_sca_install_dir>/projectsvc7/tuscany_sca/tuscany_sca.sln + in Visual Studio 7.1 - you can build projects individually +
  8. Set the TUSCANY_SCACPP environment variable to point to the 'deploy' directory that was just created
  9. +
+
+ +
+

Creating and deploying an SCA C++ Component

+

Each SCA C++ component needs: +

+
    +
  • A service header file that defines the operations that can be invoked on the + component +
  • +
  • An implementation header file that defines the implementation and extends + the service header file +
  • +
  • A C++ implementation of the service that implements the operations defined + in the service header file +
  • +
  • Proxy and wrapper header and implementation files generated by the Tuscany + C++ SCAGEN tool +
  • +
  • A service definition in a .componentType file +
  • +
  • An SCDL component definition within an SCDL composite file. Usually this + composite file will contain multiple components configured and assembled together. +
  • +
+

Once these items are in place for each component in your composite, you will need to + deploy this composite to your SCA system. In this release we are + using the SCA recursive composition model to do this. You simply create another + SCDL component definition in a separate composite file that will represent the composite + you created above in the SCA system. Follow the steps below to see each of these items + being created and used. +

+

In this section we will use the Calculator sample as a worked example. + The Calculator code and files can be found at samples/CppCalculator and has been + developed further than the details specified below. In the interests of + readability, the example used below takes the simplest path. +

+
    +
  1. Create the service header file that defines the operations your component + will implement. E.g. Calculator.h contains the following:
    +
    #ifndef CALCULATOR_H
    +#define CALCULATOR_H
    +class Calculator  
    +{
    +public:
    +    virtual float add(float arg1, float arg2) = 0;
    +    virtual float sub(float arg1, float arg2) = 0;
    +    virtual float mul(float arg1, float arg2) = 0;
    +    virtual float div(float arg1, float arg2) = 0;
    +};
    +
    +#endif
    +
  2. +
  3. Create the implementation header file that extends the service header file. + E.g. CalculatorImpl.h contains the following:
    +
    #ifndef CALCULATORIMPL_H
    +#define CALCULATORIMPL_H
    +
    +#include "Calculator.h"
    +
    +class CalculatorImpl : public Calculator
    +{
    +public:
    +    CalculatorImpl();
    +    virtual ~CalculatorImpl();
    +
    +    // Calculator interface
    +    virtual float add(float arg1, float arg2);
    +    virtual float sub(float arg1, float arg2);
    +    virtual float mul(float arg1, float arg2);
    +    virtual float div(float arg1, float arg2);
    +};
    +
    +#endif
    +
  4. +
  5. Create the implementation for the component based on the implementation + header file. E.g. CalculatorImpl.cpp contains the following code:
    +
    #include "CalculatorImpl.h"
    +#include 
    +
    +CalculatorImpl::CalculatorImpl()
    +{
    +}
    +    
    +CalculatorImpl::~CalculatorImpl()
    +{
    +}
    +
    +// Calculator interface
    +float CalculatorImpl::add(float arg1, float arg2)
    +{
    +    float result = arg1 + arg2;
    +
    +    printf("CalculatorImpl::add %f + %f = %f\n", arg1, arg2, result);
    +    return result;
    +}
    +
    +float CalculatorImpl::sub(float arg1, float arg2)
    +{
    +    float result = arg1 - arg2;
    +    printf("CalculatorImpl::sub %f - %f = %f\n", arg1, arg2, result);
    +    return result;
    +}
    +
    +float CalculatorImpl::div(float arg1, float arg2)
    +{
    +    float result = arg1 / arg2;
    +    printf("CalculatorImpl::div %f / %f = %f\n", arg1, arg2, result);
    +    return result;
    +}
    +	
    +float CalculatorImpl::mul(float arg1, float arg2)
    +{
    +    float result = arg1 * arg2;
    +    printf("CalculatorImpl::mul %f * %f = %f\n", arg1, arg2, result);
    +    return result;
    +}
    +
  6. +
  7. Create the componentType file for your component to define the service that + your component provides. The file must be named after your implementation + class and specifies the name of the service and the service header file + (which describes the service operations). E.g. CalculatorImpl.componentType + contains the following XML:
    +
    <componentType xmlns="http://www.osoa.org/xmlns/sca/1.0">
    +
    +	<service name="CalculatorService">
    +		<interface.cpp header="Calculator.h"/>
    +	</service>
    +
    +</componentType>
    +
  8. +
  9. Create a sample.calculator.composite file for your composite and define your + component within it. The component definition specifies the implementation + library to use (a .dll file on Windows, a .so file on Linux and a .dylib file on Mac OS X) and the + implementation header file (which describes the implementation class). Component + properties and references to other services can also be specified here. E.g. the + Calculator sample.calculator.composite file contains the following XML:
    +
    <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" 
    +	name="sample.calculator">
    +
    +	<component name="CalculatorComponent">
    +		<implementation.cpp library="Calculator" header="CalculatorImpl.h"/>
    +	</component>
    +
    +</composite>
    +
  10. +
  11. Generate the proxy and wrapper classes and header files using the SCAGEN + tool. These classes are used by the Tuscany SCA C++ runtime to enable + service implementations to be invoked from a client or another component. + Run the SCAGEN tool, specifying the directory where your header files, + sca.composite and componentType file are and the directory where you + want the generated files to be placed. E.g. on Windows, the + following command is run from the directory where Tuscany SCA is deployed:
    +
    ./extensions/cpp/bin/scagen.bat -dir ./samples/CppCalculator/sample.calculator -output ./samples/CppCalculator/sample.calculator
    + which produces the following files: +
      +
    • CalculatorImpl_CalculatorService_Proxy.h
    • +
    • CalculatorImpl_CalculatorService_Proxy.cpp
    • +
    • CalculatorImpl_CalculatorService_Wrapper.h
    • +
    • CalculatorImpl_CalculatorService_Wrapper.cpp
    • +
    +
  12. +
  13. Compile and link the code that has been written and generated. This will + produce a .dll or .so library file. The name should match the library name + specified in the sample.calculator.composite file. +
  14. +
  15. Create the sample.calculator.solution.composite file and define the Calculator composite + as a component within it. This is used to include the Calculator composite in the SCA system + and should specify the composite name used in the sample.calculator.composite file. + E.g. the Calculator sample.calculator.solution.composite + file contains the following XML:
    +
    <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
    +	name="sample.calculator.solution">
    +	
    +        <component name="sample.calculator.CalculatorComponent">
    +        	<implementation.composite name="sample.calculator" />
    +       	</component>
    +
    +</composite>
    +
  16. +
  17. Deploy the various files into the SCA directory structure, as follows: +
      +
    • <deploy_root>/CompositeName/CompositeName.composite
    • +
    • <deploy_root>/CompositeName/Implementation.componentType
    • +
    • <deploy_root>/CompositeName/Implementation.dll (or .so on Linux and .dylib on Mac OS X)
    • +
    • <deploy_root>/SolutionName.composite
    • +
    + E.g. for the Calculator sample the structure is: +
      +
    • samples/CppCalculator/deploy/sample.calculator/Calculator.h
    • +
    • samples/CppCalculator/deploy/sample.calculator/CalculatorImpl.h
    • +
    • samples/CppCalculator/deploy/sample.calculator/sample.calculator.composite
    • +
    • samples/CppCalculator/deploy/sample.calculator/CalculatorImpl.componentType
    • +
    • samples/CppCalculator/deploy/sample.calculator/Calculator.dll
    • +
    • samples/CppCalculator/deploy/sample.calculator.solution.composite
    • +
    +
  18. +
  19. Your component, composite and subsystem are now ready to be invoked. Create a + client that will call the service. E.g. the Calculator client (in the + CalculatorClient.cpp file) contains code similar to the following:
    +
    try
    +{
    +    // Locate the service
    +    CompositeContext myContext = CompositeContext::getCurrent();
    +    Calculator *calcService = (Calculator*) myContext.locateService("CalculatorComponent/CalculatorService");
    +    if (calcService == 0)
    +    {
    +        cout << "calculator_client: Unable to find Calculator service" << endl;
    +    }
    +    else
    +    {
    +        float result = calcService->add(arg1, arg2);
    +        cout << "calculator_client add(" << arg1 << "," << arg2 << ") = " << result << endl; 
    +    }
    +}
    +catch (ServiceRuntimeException& ex)
    +{
    +    cout << "calculator_client: Error whilst invoking Tuscany: " << 
    +            ex.getMessageText() << endl; 
    +}
    +
    +
  20. +
  21. Compile, link and run the client that has been created. You should + (hopefully!) see your component invoked. Remember you will need to have the + TUSCANY_SCACPP and TUSCANY_SDOCPP environment variables set, + as well as the SCA and SDO bin directories on + your PATH on Windows or the SCA and SDO lib directories on your LD_LIBRARY_PATH on Linux + and your DYLD_LIBRARY_PATH on Mac OS X. You will also need to set the TUSCANY_SCACPP_SYSTEM_ROOT + and TUSCANY_SCACPP_DEFAULT_COMPONENT environment variables to the + path to your SCA component directory structure and the default component respectively. + TUSCANY_SCACPP_SYSTEM_ROOT is the directory where the SCA runtime will look for any + .composite files and TUSCANY_SCACPP_DEFAULT_COMPONENT is the name of the base component + to be used by SCA clients or containers when finding services - this component must be + an instance of a composite (i.e. contain an <implementation.composite> element). +
    + E.g. on Windows run the following commands: +
      +
    • set TUSCANY_SCACPP=C:/tuscany_sca
    • +
    • set TUSCANY_SDOCPP=C:/tuscany_sdo
    • +
    • set PATH=%PATH%;C:/tuscany_sca/bin;C:/tuscany_sdo/bin
    • +
    • set TUSCANY_SCACPP_SYSTEM_ROOT=C:/tuscany_sca/samples/CppCalculator/deploy
    • +
    • set TUSCANY_SCACPP_DEFAULT_COMPONENT=sample.calculator.CalculatorComponent
    • +
    • ./calculator_client.exe
    • +
    +
  22. +
  23. Optionally, enable Tuscany logging by setting the TUSCANY_SCACPP_LOGGING + environment variable with the level you wish to log at (0 for minimal + logging, up to 9 for more detailed logging) and the TUSCANY_SCACPP_LOG + environment variable to define the file to log to (if this is not set, + logging will go to the console). E.g. on Windows run the following + commands: +
      +
    • set TUSCANY_SCACPP_LOGGING=5
    • +
    • set TUSCANY_SCACPP_LOG=C:/tuscany/mylogfile.txt
    • +
    +
  24. +
+
+
+

Getting Help

+ +

First place to look is at the Tuscany FAQ at + http://incubator.apache.org/tuscany/faq.html

+ +

Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

+
+
+
+ + + + diff --git a/sca-cpp/trunk/contrib/doc/PythonExtension.html b/sca-cpp/trunk/contrib/doc/PythonExtension.html new file mode 100644 index 0000000000..f51af0d6c9 --- /dev/null +++ b/sca-cpp/trunk/contrib/doc/PythonExtension.html @@ -0,0 +1,281 @@ + + + + + + + + + + + + Tuscany SCA Native - Python Extension + + + +
+
+
+

Tuscany SCA Native - Python Extension

+ +

The Tuscany Python extension allows Python scripts to be used as components in + SCA composites and as clients that can invoke SCA services. +

+

The following samples demonstrate use of the Python extension:

+ + +
+ +
+

System Requirements

+ +

In order to install and use the Tuscany SCA Python Extension there are some + extra requirements in addition to the Tuscany + SCA requirements:

+ + + + + + + + + + + + + +
SoftwareDownload Link
Python version 2.5 + http://www.python.org/download/
+ Please download and follow the installation instructions. +
+
+ +
+

Installing the Tuscany SCA Python Extension

+

Getting the Tuscany SCA Python Extension working with the binary release on Linux and Mac OS X

+
    +
  1. Ensure the Python libraries are available on the PATH environment variable
  2. +
  3. Add the <tuscany_sca_install_dir>/extensions/python/lib directory to the PYTHONPATH environment variable
  4. +
+

Getting the Tuscany SCA Python Extension working with the source release on Linux and Mac OS X

+
    +
  1. You will need the Tuscany SCA and SDO libraries - follow the instructions + here to build the SCA libraries and default extensions
  2. +
  3. The following environment variables are required: +
      +
    • TUSCANY_SCACPP=<path to built Tuscany SCA> +
    • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
    • PYTHON_LIB=<path to Python libraries>
    • +
    • PYTHON_INCLUDE=<path to Python includes>
    • +
    • PYTHON_VERSION=<name of the Python version>
      + Note: If you are using a default installation of Python 2.5 these are usually:
      + PYTHON_LIB=/usr/lib
      + PYTHON_INCLUDE=/usr/include/python2.5
      + PYTHON_VERSION=python2.5
    • +
  4. +
  5. Build the Python source only with the following command sequence: +
      +
    • cd <tuscany_sca_install_dir>
    • +
    • ./configure --prefix=$TUSCANY_SCACPP --enable-python --enable-cpp=no --enable-wsbinding=no
    • +
    • make
    • +
    • make install
    • +
    + NOTE: If you don't provide a --prefix configure option, it will by default install into + /usr/local/tuscany/sca
  6. +
+ +

Getting the Tuscany SCA Python Extension working with the binary release on Windows

+
    +
  1. Ensure the Python libraries are available on the PATH environment variable
  2. +
  3. Add the <tuscany_sca_install_dir>\extensions\python\bin directory to the PYTHONPATH environment variable
  4. +
+

Getting the Tuscany SCA Python Extension working with the source release on Windows

+
    +
  1. Unzip the supplied source zip file
  2. +
  3. The following environment variables are required: +
      +
    • TUSCANY_SCACPP=<path to built Tuscany SCA> +
    • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
    • PYTHON_HOME=<path to installed Python> +
  4. +
  5. You must have set up the environment for Microsoft Visual C++ tools. The build command + will call vcvars32 to set the environment. Ensure the directory containing this is on your path. + This will be where you installed the compiler.
  6. +
  7. Build the source: +
      +
    • cd <to where you unzipped the source>
    • +
    • build
    • +
    + This will build all the projects and put the required output into the 'deploy' directory

    + Alternatively, open the workspace at <tuscany_sca_install_dir>/projects/tuscany_sca/tuscany_sca.dsw + in Visual Studio 6 or at at <tuscany_sca_install_dir>/projectsvc7/tuscany_sca/tuscany_sca.sln + in Visual Studio 7.1 - you can build projects individually +
  8. Set the TUSCANY_SCACPP environment variable to point to the 'deploy' directory that was just created
  9. +
+
+ + +
+

The Tuscany Python Programming Model

+

This section will explain + the Tuscany Python programming model to help you to write your own Python + components and clients. +

+

The Tuscany Python component and client support comes from a Python extension + package that is built in the <tuscany_sca_install_dir>/extensions/python/bin + directory on Windows and <tuscany_sca_install_dir>/extensions/python/lib on + Linux and Mac OS X. This package must be made available to your Python environment by + adding this directory to your PYTHONPATH environment variable. This makes the sca + module available for use by clients and allows references and properties to be + used in your Python components +

+

Clients

+

Using the sca module, a Python client can search for an SCA service with: +

+
import sca
+
+calculator = sca.locateservice("CalculatorComponent/CalculatorService")
+
+

This finds the component and service as defined in the composite and componentType + side files and returns a proxy object that can call the SCA service. You can then + simply call a business method on "calculator", like this: +

+
result = calculator.add(12.3, 45.6)
+

+

Components

+

Python component implementations are standard Python scripts, where class-level + functions or module-level functions can be invoked by the Tuscany runtime. To + use a Python component implementation, use the implementation.python element in + your .composite file. For example, the following snippet will use the Python script + at path/to/module/PythonModuleName.py, where the path is relative to the location of + the composite file: +

+
<implementation.python module="PythonModuleName" path="path/to/module"/>
+
+

To instantiate a class instance and use a class-level function, the Python class must + have a default constructor (an __init__ method that takes no arguments besides + 'self') and the class attribute must be defined in the implementation.python element + in your composite, like so: +

+
<implementation.python module="PythonModuleName" path="path/to/module" class="PythonClassName"/>
+
+

Tuscany currently supports passing simple types (strings, ints, floats, etc) as well + as Service Data Objects into and out of Ruby components. Service Data Objects are represented + in Python as xml.etree.ElementTree Element objects (see the + PythonWeatherForecast sample for a demonstration). +

+

You can write a componentType file for your Python component, but you don't have to - the Python + extension automatically exposes a service and adds references and properties to your Python component + implementation classes based on the information in the composite file. +

+ +

References

+

References are automatically added to your Python component implementation when + the runtime loads the implementation script, so they can be used like so: +

+
# The module-level div function
+def div(val1, val2):
+    # Use the divideService reference
+    result = divideService.divide(val1, val2)
+    return result
+
+

and in your composite file: +

+
<component name="CalculatorComponent">
+    <implementation.python module="CalculatorImpl"/>
+    <reference name="divideService">DivideComponent/DivideService</reference>
+</component>
+
+

Properties

+

A composite with a property defined for a component like so: +

+
<component name="DivideComponent">
+    <implementation.python module="DivideImpl"/>
+    <property name="doRounding">true</property>
+</component>
+
+

means the property is automatically instantiated and assigned the + property value in the Python component implementation, so it can be + used like so: +

+
def divide(val1, val2):
+    result = float(val1) / float(val2)
+    print "Python - DivideImpl.divide " + str(val1) + " / " + str(val2) + " = " + str(result)
+
+    # Use the doRounding property
+    if doRounding:
+        result = round(result)
+        print "Python - DivideImpl.divide is rounding the result to " + str(result)
+
+    return result
+
+

+
+ +
+

Getting Help

+ +

First place to look is at the Tuscany FAQ at + http://incubator.apache.org/tuscany/faq.html

+ +

Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

+
+
+
+ + + + diff --git a/sca-cpp/trunk/contrib/doc/RESTExtension.html b/sca-cpp/trunk/contrib/doc/RESTExtension.html new file mode 100644 index 0000000000..71482d43ec --- /dev/null +++ b/sca-cpp/trunk/contrib/doc/RESTExtension.html @@ -0,0 +1,291 @@ + + + + + + + + + + + + Tuscany SCA Native - REST Extension + + + +
+
+
+

Tuscany SCA Native - REST Extension

+ +

This document describes the deployment and use of the REST + binding support in the Apache Tuscany SCA Native runtime. +

+

The Tuscany REST extension allows SCA services and references to be invoked + via HTTP REST calls +

+

The following samples demonstrate use of the REST extension:

+ +
+ +
+

System Requirements

+ +

In order to install and use the Tuscany SCA REST Extension there are some + extra requirements in addition to the Tuscany + SCA requirements:

+ + + + + + + + + + + + + + + + +
SoftwareDownload Link
Apache HTTPD version 2.2 + http://httpd.apache.org
+ Please download and follow the installation instructions. This is required + for building the REST Service extension and for hosting and running REST services. +
libcurl version 7.15 or higher + http://curl.haxx.se/download.html
+ Please download and follow the installation instructions. This is required + for building the REST Reference extension and for calling REST references.
+ On Windows, the extension was developed and tested against the "Win32 - MSVC 7.15.1 devel" + library provided by Chris Drake. On Linux the libcurl libraries were built from + the 7.16.1 source. On Mac OS X the library was downloaded, built and installed via the + standard "port" command. +
+
+ +
+

Installing the Tuscany SCA REST Extension

+

Getting the Tuscany SCA REST Extension working with the binary release on Linux and Mac OS X

+
    +
  1. Follow the deployment steps below to ensure the HTTPD server + invokes Tuscany when it receives an appropriate HTTP request
  2. +
  3. Ensure the libcurl and HTTPD libraries are available on the LD_LIBRARY_PATH environment variable on Linux and + the DYLD_LIBRARY_PATH environment variable on Mac OS X
  4. +
+

Getting the Tuscany SCA REST Extension working with the source release on Linux and Mac OS X

+
    +
  1. You will need the Tuscany SCA and SDO libraries - follow the instructions + here to build the SCA libraries and default extensions
  2. +
  3. The following environment variables are required: +
      +
    • TUSCANY_SCACPP=<path to built Tuscany SCA> +
    • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
    • APR_INCLUDE=<path to APR includes>
    • +
    • HTTPD_INCLUDE=<path to HTTPD includes>
      + Note: If you are using a default installation of HTTPD these are usually:
      + APR_INCLUDE=/usr/include/apr-1
      + HTTPD_INCLUDE=/usr/include/httpd
    • +
    • CURL_INCLUDE=<path to libcurl includes>
    • +
    • CURL_LIB<path to libcurl libraries>
      + Note: If you are using a default installation of libcurl these are usually:
      + CURL_INCLUDE=/usr/include/curl
      + CURL_LIB=/usr/lib
    • +
  4. +
  5. Build the REST source only with the following command sequence: +
      +
    • cd <tuscany_sca_install_dir>
    • +
    • ./configure --prefix=$TUSCANY_SCACPP --enable-restbinding --enable-cpp=no --enable-wsbinding=no
    • +
    • make
    • +
    • make install
    • +
    + NOTE: If you don't provide a --prefix configure option, it will by default install into + /usr/local/tuscany/sca
  6. +
+ +

Getting the Tuscany SCA REST Extension working with the binary release on Windows

+
    +
  1. Follow the deployment steps below to ensure the HTTPD server + invokes Tuscany when it receives an appropriate HTTP request
  2. +
  3. Ensure the libcurl and HTTPD libraries are available on the PATH environment variable
  4. +
+

Getting the Tuscany SCA REST Extension working with the source release on Windows

+
    +
  1. Unzip the supplied source zip file
  2. +
  3. The following environment variables are required: +
      +
    • TUSCANY_SCACPP=<path to built Tuscany SCA> +
    • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
    • HTTPD_HOME=<path to installed HTTPD server> +
    • LIBCURL_HOME=<path to installed libcurl libraries> +
  4. +
  5. You must have set up the environment for Microsoft Visual C++ tools. The build command + will call vcvars32 to set the environment. Ensure the directory containing this is on your path. + This will be where you installed the compiler.
  6. +
  7. Build the source: +
      +
    • cd <to where you unzipped the source>
    • +
    • build
    • +
    + This will build all the projects and put the required output into the 'deploy' directory

    + Alternatively, open the workspace at <tuscany_sca_install_dir>/projects/tuscany_sca/tuscany_sca.dsw + in Visual Studio 6 or at at <tuscany_sca_install_dir>/projectsvc7/tuscany_sca/tuscany_sca.sln + in Visual Studio 7.1 - you can build projects individually + or build the samples to rebuild all the projects
  8. +
+
+ + +
+

Deploying the Tuscany REST Service extension to the HTTPD server

+

The following samples demonstrate use of the REST extension:

+ +

Each of these samples generate a set of configuration files for the HTTPD server. Use the startserver + script that comes with each sample to generate the files and start the server with the REST Service + extension enabled. The instructions below detail the information that is provided in these configuration + files.

+
    +
  1. On Windows, load the sca_rest_module into HTTPD by adding the following line to the conf/httpd.conf file: +
    LoadModule sca_rest_module <path to installed Tuscany SCA>/extensions/rest/service/bin/tuscany_sca_mod_rest.dll
    + On Linux, use the following line: +
    LoadModule sca_rest_module <path to installed Tuscany SCA>/extensions/rest/service/lib/libtuscany_sca_mod_rest.so
    + On Mac OS X, use the following line: +
    LoadModule sca_rest_module <path to installed Tuscany SCA>/extensions/rest/service/lib/libtuscany_sca_mod_rest.dylib
    +
  2. +
  3. Set a TuscanyHome directive to the installation of Tuscany SCA Native: +
    TuscanyHome <path to installed Tuscany SCA>
    +
  4. +
  5. Create a Location directive for the URL to be used and set the sca_rest_module as the handler to + be invoked when requests for the location are received. Also set the TuscanyRoot directive for + this Location, set to the location of the SCA application to be invoked: +
    +<Location /rest>
    +       SetHandler sca_rest_module 
    +       TuscanyRoot <path to installed Tuscany SCA>/samples/RestCalculator/deploy/
    +</Location>
    +
    + The above example will mean that calls to http://myserver/rest will be handled by Tuscany SCA Native + and configured to invoke the RestCalculator sample application. +
  6. +
+
+ +
+

Tuscany REST Extension Resource Pattern

+

If the SCA service or reference uses an <interface.rest> interface, CRUD + (Create, Retrieve, Update, Delete) methods are mapped to HTTP verbs to access resource + representations as follows:

+
    +
  • uri = create(resource)
    + HTTP POST <binding-uri> + an XML element representing the resource to create
    + Returns Location header containing the uri of the created resource
  • +
  • resource = retrieve()
    + HTTP GET <binding-uri>
    + Returns an XML element representing the REST resource
  • +
  • resource = retrieve(uri, parm-value-1, parm-value-n)
    + HTTP GET uri/parm-value-1/parm-value-n
    + or if uri ends with a '?':
    + HTTP GET uri?parm-name-1=parm-value1&parm-name-n=parm-value-n
    + Returns an XML element representing the REST resource
  • +
  • update(resource)
    + HTTP PUT <binding-uri> + an XML element representing the updated resource
  • +
  • update(uri, parm-1, parm-n, resource)
    + HTTP PUT uri/parm-value-1/parm-value-n + an XML element representing the updated resource
    + or if uri ends with a '?':
    + HTTP PUT uri?parm-name-1=parm-value1&parm-name-n=parm-value-n + an XML element representing the updated resource
  • +
  • delete()
    + HTTP DELETE <binding-uri>
  • +
  • delete(uri, parm-1, parm-n)
    + HTTP DELETE uri/parm-value-1/parm-value-n
    + or if uri ends with a '?':
    + HTTP DELETE uri?parm-name-1=parm-value1&parm-name-n=parm-value-n
  • +
+

In this mode, HTTP return codes are used almost as described in the Atom spec. Also + GET returns etags with the retrieved resource representations to help caching by clients.

+
+ +
+

Tuscany REST Extension RPC Pattern

+

If the SCA service/reference does not use an <interface.rest> interface, then this is + not a real REST pattern, we simply flow method calls over XML / HTTP as follows:

+
  • result = method-abc(parm-1, parm-n) +
      +
    • if single input parameter of complex type:
      + HTTP POST <binding-uri>/method-abc + XML element representing the complex parameter
    • +
    • or if multiple parameters including parameters of complex types:
      + HTTP POST <binding-uri>/method-abc + Mime multipart/form-data body containing one parameter per part
    • +
    • or if multiple parameters all of simple types:
      + HTTP GET <binding-uri>/method-abc?parm-1-name=parm-1-value&parm-n-name=parm-n-value
    • +
    + Returns an XML element representing the result
  • +
+
+ +
+

Getting Help

+ +

First place to look is at the Tuscany FAQ at + http://incubator.apache.org/tuscany/faq.html

+ +

Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

+
+
+
+ + + + diff --git a/sca-cpp/trunk/contrib/doc/RubyExtension.html b/sca-cpp/trunk/contrib/doc/RubyExtension.html new file mode 100644 index 0000000000..96a4ad2b82 --- /dev/null +++ b/sca-cpp/trunk/contrib/doc/RubyExtension.html @@ -0,0 +1,292 @@ + + + + + + + + + + + + Tuscany SCA Native - Ruby Extension + + + +
+
+
+

Tuscany SCA Native - Ruby Extension

+ +

The Tuscany Ruby extension allows Ruby scripts to be used as components in + SCA composites and as clients that can invoke SCA services. +

+

The following samples demonstrate use of the Ruby extension:

+ +
+ +
+

System Requirements

+ +

In order to install and use the Tuscany SCA Ruby Extension there are some + extra requirements in addition to the Tuscany + SCA requirements:

+ + + + + + + + + + + + + +
SoftwareDownload Link
Ruby version 1.8.x + http://www.ruby-lang.org
+ Please download and follow the installation instructions. You should + be able to build the Tuscany SCA Ruby Extension with other versions of Ruby. + The extension has been tested with the + Ruby 1.8.5 One-Click Installer + on Windows and the 1.8.5 source code + (compiled locally) on Linux. +
+
+ +
+

Installing the Tuscany SCA Ruby Extension

+

Getting the Tuscany SCA Ruby Extension working with the binary release on Linux and Mac OS X

+
    +
  1. Ensure the Ruby libraries are available on the PATH environment variable
  2. +
+

Getting the Tuscany SCA Ruby Extension working with the source release on Linux and Mac OS X

+
    +
  1. You will need the Tuscany SCA and SDO libraries - follow the instructions + here to build the SCA libraries and default extensions
  2. +
  3. The following environment variables are required: +
      +
    • TUSCANY_SCACPP=<path to built Tuscany SCA> +
    • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
    • RUBY_LIB=<path to Ruby libraries>
    • +
    • RUBY_INCLUDE=<path to Ruby includes>
      + Note: If you are using a default installation of Ruby these are usually:
      + RUBY_LIB=/usr/lib
      + RUBY_INCLUDE=/usr/lib/ruby/1.8/i386-linux
    • +
  4. +
  5. Build the Ruby source only with the following command sequence: +
      +
    • cd <tuscany_sca_install_dir>
    • +
    • ./configure --prefix=$TUSCANY_SCACPP --enable-ruby --enable-cpp=no --enable-wsbinding=no
    • +
    • make
    • +
    • make install
    • +
    + NOTE: If you don't provide a --prefix configure option, it will by default install into + /usr/local/tuscany/sca
  6. +
+ +

Getting the Tuscany SCA Ruby Extension working with the binary release on Windows

+
    +
  1. Ensure the Ruby libraries are available on the PATH environment variable
  2. +
+

Getting the Tuscany SCA Ruby Extension working with the source release on Windows

+
    +
  1. Unzip the supplied source zip file
  2. +
  3. The following environment variables are required: +
      +
    • TUSCANY_SCACPP=<path to built Tuscany SCA> +
    • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
    • RUBY_HOME=<path to installed Ruby> +
  4. +
  5. You must have set up the environment for Microsoft Visual C++ tools. The build command + will call vcvars32 to set the environment. Ensure the directory containing this is on your path. + This will be where you installed the compiler.
  6. +
  7. Build the source: +
      +
    • cd <to where you unzipped the source>
    • +
    • build
    • +
    + This will build all the projects and put the required output into the 'deploy' directory

    + Alternatively, open the workspace at <tuscany_sca_install_dir>/projects/tuscany_sca/tuscany_sca.dsw + in Visual Studio 6 or at at <tuscany_sca_install_dir>/projectsvc7/tuscany_sca/tuscany_sca.sln + in Visual Studio 7.1 - you can build projects individually + or build the samples to rebuild all the projects
  8. +
+
+ + +
+

The Tuscany Ruby Programming Model

+

This section will explain the Tuscany Ruby programming model to help you to + write your own Ruby components and clients. +

+

The Tuscany Ruby component and client support comes from a Ruby extension + library that is built in the <tuscany_sca_install_dir>/extensions/ruby/bin + directory on Windows and <tuscany_sca_install_dir>/extensions/ruby/lib on + Linux and Mac OS X. +

+

Clients

+

Using the Ruby SCA extension library, a Ruby client can search for an SCA service with: +

+
require("libtuscany_sca_ruby")
+
+calculator = SCA::locateService("CalculatorComponent/CalculatorService")
+
+

This finds the component and service as defined in the composite and componentType + side files and returns a proxy object that can call the SCA service. You can then + simply call a business method on "calculator", like this: +

+
result = calculator.add(12.3, 45.6)
+

+

Components

+

Ruby component implementations are standard Ruby scripts, where class-level + functions or module-level functions can be invoked by the Tuscany runtime. To + use a Ruby component implementation, use the implementation.ruby element in + your .composite file. For example: +

+
<implementation.ruby script="CalculatorImpl.rb"/>
+
+

To instantiate a class instance and use a class-level function, the Ruby class must + have a default constructor (an initialize() method that takes no arguments) and the + class attribute must be definde in the implementation.ruby element + in your composite, like so: +

+
<implementation.ruby script="CalculatorImpl.rb" class="CalculatorImpl"/>
+
+

Tuscany currently supports passing simple types (strings, ints, floats, etc) as well + as Service Data Objects into and out of Ruby components. Service Data Objects are represented + in Ruby as REXML Document objects (see the + Ruby BigBank sample for a demonstration). +

+

You can write a componentType file for your Ruby component, but you don't have to - the Ruby + extension introspects Ruby component implementation classes for you and binds public + attributes to references and properties. +

+

References

+

References can be invoked from Ruby component implementations by the use of public + attributes in the component implementation classes, like this: +

+
class CalculatorImpl
+
+  # Define the public attribute that corresponds to the divideService reference
+  attr_writer :divideService
+
+...	
+
+  def div(arg1, arg2)
+    print "Ruby - CalculatorImpl.div\n"
+    # Invoke the divideService reference
+    @divideService.divide(arg1.to_f, arg2.to_f)
+  end
+
+...
+end
+
+

and in your composite file: +

+
<component name="CalculatorComponent">
+    <implementation.ruby script="CalculatorImpl.rb"/>
+    <reference name="divideService">DivideComponent/DivideService</reference>
+</component>
+
+

Properties

+

A composite with a property defined for a component like so: +

+
<component name="DivideComponent">
+    <implementation.ruby script="DivideImpl.rb" class="DivideImpl"/>
+    <property name="round">true</property>
+</component>
+
+

allows a public attribute of a Ruby component implementation class to be + assigned the property value, so it can be used like so: +

+
class DivideImpl
+
+  # Define the public attribute that corresponds to the round property
+  attr_writer :round           
+
+...	
+
+  def divide(arg1, arg2)
+    print "Ruby - DivideImpl.divide ", arg1, " / ", arg2, "\n"
+    res = arg1.to_f / arg2.to_f
+    # Use the round property
+    if @round then
+      res = res.round
+      print "DivideImpl.divide rounding\n"
+    end
+    print "DivideImpl.divide ", res, "\n"
+    res
+  end
+end
+
+

+
+ +
+

Getting Help

+ +

First place to look is at the Tuscany FAQ at + http://incubator.apache.org/tuscany/faq.html

+ +

Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

+
+
+
+ + + + diff --git a/sca-cpp/trunk/contrib/doc/SCAExtension.html b/sca-cpp/trunk/contrib/doc/SCAExtension.html new file mode 100644 index 0000000000..63157dc9bf --- /dev/null +++ b/sca-cpp/trunk/contrib/doc/SCAExtension.html @@ -0,0 +1,173 @@ + + + + + + + + + + + + Tuscany SCA Native - SCA Binding Extension + + + +
+
+
+

Tuscany SCA Native - SCA Binding Extension

+ +

This document describes the deployment and use of the SCA + binding support in the Apache Tuscany SCA Native runtime. +

+

The SCA binding allows components to be invoked via an + implementation specific protocol. Currently, in the Tuscany SCA binding + extension, the Axis2/C Web Service binding extension + is used to provide the implementaion, so calls use the SOAP protocol +

+

The HTTPDBigBank sample demonstrates the + use of the SCA binding extension. +

+
+ +
+

System Requirements

+ +

In order to install and use the Tuscany SCA Binding Extension there are some + extra requirements in addition to the Tuscany + SCA requirements:

+ + + + + + + + + + + + + +
SoftwareDetails
Tuscany Axis2/C Web Service binding extension + Please follow the installation instructions. The Axis2/C Web Service extension requires + Axis2/C version 0.96. +
+
+ +
+

Installing the Tuscany SCA Binding Extension

+

Getting the Tuscany SCA Binding Extension working with the binary release on Linux and Mac OS X

+
    +
  1. Ensure the AXIS2C_HOME environment variable is set to the Axis2/C installation
  2. +
  3. Deploy the Axis2/C Web Services extension by following the deployment steps
  4. +
  5. Ensure the Axis2/C Web Service extension and SCA Binding extension libraries are available + on the LD_LIBRARY_PATH environment variable on Linux and the DYLD_LIBRARY_PATH environment variable on Mac OS X
  6. +
+

Getting the Tuscany SCA Binding Extension working with the source release on Linux and Mac OS X

+
    +
  1. You will need the Tuscany SCA and SDO libraries - follow the instructions + here to build the SCA libraries and default extensions
  2. +
  3. The following environment variables are required: +
      +
    • TUSCANY_SCACPP=<path to built Tuscany SCA>
    • +
    • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
    • +
  4. +
  5. Build the SCA Binding source only with the following command sequence: +
      +
    • cd <tuscany_sca_install_dir>
    • +
    • ./configure --prefix=$TUSCANY_SCACPP --enable-scabinding --enable-cpp=no --enable-wsbinding=no
    • +
    • make
    • +
    • make install
    • +
    + NOTE: If you don't provide a --prefix configure option, it will by default install into + /usr/local/tuscany/sca
  6. +
+ +

Getting the Tuscany SCA Binding Extension working with the binary release on Windows

+
    +
  1. Ensure the AXIS2C_HOME environment variable is set to the Axis2/C installation
  2. +
  3. Deploy the Axis2/C Web Services extension by following the deployment steps
  4. +
  5. Ensure the Axis2/C Web Services extension and SCA Binding extension libraries are available + on the PATH environment variable
  6. +
+

Getting the Tuscany SCA Binding Extension working with the source release on Windows

+
    +
  1. Unzip the supplied source zip file
  2. +
  3. The following environment variables are required: +
      +
    • TUSCANY_SCACPP=<path to built Tuscany SCA> +
    • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
  4. +
  5. You must have set up the environment for Microsoft Visual C++ tools. The build command + will call vcvars32 to set the environment. Ensure the directory containing this is on your path. + This will be where you installed the compiler.
  6. +
  7. Build the source: +
      +
    • cd <to where you unzipped the source>
    • +
    • build
    • +
    + This will build all the projects and put the required output into the 'deploy' directory

    + Alternatively, open the workspace at <tuscany_sca_install_dir>/projects/tuscany_sca/tuscany_sca.dsw + in Visual Studio 6 or at at <tuscany_sca_install_dir>/projectsvc7/tuscany_sca/tuscany_sca.sln + in Visual Studio 7.1 - you can build projects individually + or build the samples to rebuild all the projects
  8. +
+
+ +
+
+ +
+

Getting Help

+ +

First place to look is at the Tuscany FAQ at + http://incubator.apache.org/tuscany/faq.html

+ +

Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

+
+
+
+ + + + diff --git a/sca-cpp/trunk/contrib/doc/css/maven-base.css b/sca-cpp/trunk/contrib/doc/css/maven-base.css new file mode 100644 index 0000000000..e23caf04e5 --- /dev/null +++ b/sca-cpp/trunk/contrib/doc/css/maven-base.css @@ -0,0 +1,168 @@ +/* + * 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$ */ + +body { + margin: 0px; + padding: 0px; +} +img { + border:none; +} +table { + padding:0px; + width: 100%; + margin-left: -2px; + margin-right: -2px; +} +acronym { + cursor: help; + border-bottom: 1px dotted #feb; +} +table.bodyTable th, table.bodyTable td { + padding: 2px 4px 2px 4px; + vertical-align: top; +} +div.clear{ + clear:both; + visibility: hidden; +} +div.clear hr{ + display: none; +} +#bannerLeft, #bannerRight { + font-size: xx-large; + font-weight: bold; +} +#bannerLeft img, #bannerRight img { + margin: 0px; +} +.xleft, #bannerLeft img { + float:left; + text-shadow: #7CFC00; +} +.xright, #bannerRight img { + float:right; + text-shadow: #7CFC00; +} +#banner { + padding: 0px; +} +#banner img { + border: none; +} +#breadcrumbs { + padding: 3px 10px 3px 10px; +} +#leftColumn { + width: 150px; + float:left; +} +#bodyColumn { + margin-right: 1.5em; + margin-left: 30px; +} +#legend { + padding: 8px 0 8px 0; +} +#navcolumn { + padding: 8px 4px 0 8px; +} +#navcolumn h5 { + margin: 0; + padding: 0; + font-size: small; +} +#navcolumn ul { + margin: 0; + padding: 0; + font-size: small; +} +#navcolumn li { + list-style-type: none; + background-image: none; + background-repeat: no-repeat; + background-position: 0 0.4em; + padding-left: 16px; + list-style-position: ouside; + line-height: 1.2em; + font-size: smaller; +} +#navcolumn li.expanded { + background-image: url(../images/expanded.gif); +} +#navcolumn li.collapsed { + background-image: url(../images/collapsed.gif); +} +#poweredBy { + text-align: center; +} +#navcolumn img { + margin-top: 10px; + margin-bottom: 3px; +} +#poweredBy img { + display:block; + margin: 20px 0 20px 17px; + border: 1px solid black; + width: 90px; + height: 30px; +} +#search img { + margin: 0px; + display: block; +} +#search #q, #search #btnG { + border: 1px solid #999; + margin-bottom:10px; +} +#search form { + margin: 0px; +} +#lastPublished { + font-size: x-small; +} +.navSection { + margin-bottom: 2px; + padding: 8px; +} +.navSectionHead { + font-weight: bold; + font-size: x-small; +} +.section { + padding: 4px; +} +#footer { + padding: 3px 10px 3px 10px; + font-size: x-small; +} +#breadcrumbs { + font-size: x-small; + margin: 0pt; +} +.source { + padding: 12px; + margin: 1em 7px 1em 7px; +} +.source pre { + margin: 0px; + padding: 0px; +} diff --git a/sca-cpp/trunk/contrib/doc/css/maven-theme.css b/sca-cpp/trunk/contrib/doc/css/maven-theme.css new file mode 100644 index 0000000000..91cf29cda2 --- /dev/null +++ b/sca-cpp/trunk/contrib/doc/css/maven-theme.css @@ -0,0 +1,173 @@ +/* + * 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$ */ + +body { + padding: 0px 0px 10px 0px; +} +body, td, select, input, li{ + font-family: Verdana, Helvetica, Arial, sans-serif; + #font-size: 13px; + padding: 4px 4px 4px 4px; + line-height: 1.5em; + font-size: small; +} +code{ + font-family: Courier, monospace; + font-size: 13px; +} +a { + text-decoration: none; +} +a:link { + color:#36a; +} +a:visited { + color:#47a; +} +a:active, a:hover { + color:#69c; +} +#legend li.externalLink { + background: url(../images/external.png) left top no-repeat; + padding-left: 18px; +} +a.externalLink, a.externalLink:link, a.externalLink:visited, a.externalLink:active, a.externalLink:hover { + background: url(../images/external.png) right center no-repeat; + padding-right: 18px; +} +#legend li.newWindow { + background: url(../images/newwindow.png) left top no-repeat; + padding-left: 18px; +} +a.newWindow, a.newWindow:link, a.newWindow:visited, a.newWindow:active, a.newWindow:hover { + background: url(../images/newwindow.png) right center no-repeat; + padding-right: 18px; +} +h1 { + font-size: x-large; + line-height: 1em; +} + + +h2 { + padding: 4px 4px 4px 6px; + border: 1px solid #999; + color: #900; + background-color: #ddd; + + font-size: large; +} +h3 { + padding: 4px 4px 4px 6px; + border: 1px solid #aaa; + color: #900; + background-color: #eee; + font-weight: normal; + font-size: large; +} +h4 { + padding: 4px 4px 4px 6px; + border: 1px solid #bbb; + color: #900; + background-color: #fff; + font-weight: normal; + font-size: large; +} +h5 { + padding: 4px 4px 4px 6px; + color: #900; + font-size: normal; +} +p { + line-height: 1.5em; + font-size: small; +} +#breadcrumbs { + border-top: 1px solid #aaa; + border-bottom: 1px solid #aaa; + background-color: #ccc; +} +#leftColumn { + margin: 10px 0 0 5px; + border: 1px solid #999; + background-color: #eee; +} +#navcolumn h5 { + font-size: smaller; + border-bottom: 1px solid #aaaaaa; + padding-top: 2px; + color: #000; +} + +table.bodyTable th { + color: white; + background-color: #bbb; + text-align: left; + font-weight: bold; +} + +table.bodyTable th, table.bodyTable td { + font-size: small; +} + +table.bodyTable tr.a { + background-color: #ddd; +} + +table.bodyTable tr.b { + background-color: #eee; +} + +.source { + border: 1px solid #999; +} +dl { + padding: 4px 4px 4px 6px; + border: 1px solid #aaa; + background-color: #ffc; +} +dt { + color: #900; +} +#organizationLogo img, #projectLogo img, #projectLogo span{ + margin: 8px; +} +#banner { + border-bottom: 1px solid #fff; +} +.sourcecode { + border: 1px solid #999; + font-family: Courier, monospace; + font-size: 13px; + white-space: pre; + padding: 4px 4px 4px 6px; + margin: 4px 4px 4px 6px; +} +pre { + border: 1px solid #999; + font-family: Courier, monospace; + font-size: 13px; + white-space: pre; + padding: 4px 4px 4px 6px; + margin: 4px 4px 4px 6px; +} + + diff --git a/sca-cpp/trunk/contrib/runtime/Makefile.am b/sca-cpp/trunk/contrib/runtime/Makefile.am new file mode 100644 index 0000000000..a03650cd83 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/Makefile.am @@ -0,0 +1,19 @@ +# 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 = core extensions + diff --git a/sca-cpp/trunk/contrib/runtime/core/Makefile.am b/sca-cpp/trunk/contrib/runtime/core/Makefile.am new file mode 100644 index 0000000000..f833a2cb08 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/Makefile.am @@ -0,0 +1,22 @@ +# 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 test +nobase_data_DATA = xsd/*.* + +EXTRA_DIST = xsd + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/Makefile.am b/sca-cpp/trunk/contrib/runtime/core/src/Makefile.am new file mode 100644 index 0000000000..ebba243583 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/Makefile.am @@ -0,0 +1,78 @@ +# 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. + +lib_LTLIBRARIES = libtuscany_sca.la + +nobase_include_HEADERS = \ +tuscany/sca/*.h \ +tuscany/sca/core/*.h \ +tuscany/sca/model/*.h \ +tuscany/sca/util/*.h \ +tuscany/sca/extension/*.h + +## To list the source files execute the following: +## ls -1 tuscany/sca/util/*.cpp tuscany/sca/extension/*.cpp tuscany/sca/model/*.cpp tuscany/sca/core/*.cpp tuscany/sca/cpp/*.cpp tuscany/sca/ws/*.cpp | awk '{ print $1 " \\" }' +## and copy/paste the output below +libtuscany_sca_la_SOURCES = \ +tuscany/sca/core/Exceptions.cpp \ +tuscany/sca/core/Operation.cpp \ +tuscany/sca/core/SCARuntime.cpp \ +tuscany/sca/core/ServiceProxy.cpp \ +tuscany/sca/core/ServiceWrapper.cpp \ +tuscany/sca/extension/ImplementationExtension.cpp \ +tuscany/sca/extension/InterfaceExtension.cpp \ +tuscany/sca/extension/ReferenceBindingExtension.cpp \ +tuscany/sca/extension/ServiceBindingExtension.cpp \ +tuscany/sca/model/Binding.cpp \ +tuscany/sca/model/Component.cpp \ +tuscany/sca/model/ComponentType.cpp \ +tuscany/sca/model/Composite.cpp \ +tuscany/sca/model/CompositeReference.cpp \ +tuscany/sca/model/CompositeReferenceBinding.cpp \ +tuscany/sca/model/CompositeService.cpp \ +tuscany/sca/model/Contract.cpp \ +tuscany/sca/model/Interface.cpp \ +tuscany/sca/model/ModelLoader.cpp \ +tuscany/sca/model/ReferenceBinding.cpp \ +tuscany/sca/model/Reference.cpp \ +tuscany/sca/model/ReferenceType.cpp \ +tuscany/sca/model/ServiceBinding.cpp \ +tuscany/sca/model/Service.cpp \ +tuscany/sca/model/ServiceType.cpp \ +tuscany/sca/model/Wire.cpp \ +tuscany/sca/model/WSDLDefinition.cpp \ +tuscany/sca/model/WSDLInterface.cpp \ +tuscany/sca/model/WSDLMessagePart.cpp \ +tuscany/sca/model/WSDLOperation.cpp \ +tuscany/sca/util/DefaultLogWriter.cpp \ +tuscany/sca/util/File.cpp \ +tuscany/sca/util/FileLogWriter.cpp \ +tuscany/sca/util/Library.cpp \ +tuscany/sca/util/Logger.cpp \ +tuscany/sca/util/LogWriter.cpp \ +tuscany/sca/util/Mutex.cpp \ +tuscany/sca/util/Queue.cpp \ +tuscany/sca/util/SDOUtils.cpp \ +tuscany/sca/util/Thread.cpp \ +tuscany/sca/util/ThreadLocal.cpp \ +tuscany/sca/util/Utils.cpp + +libtuscany_sca_la_LIBADD = -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo -lpthread + +INCLUDES = -I$(top_builddir)/runtime/core/src \ + -I${TUSCANY_SDOCPP}/include + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/Exceptions.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/Exceptions.cpp new file mode 100644 index 0000000000..7fa9c5e6b9 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/Exceptions.cpp @@ -0,0 +1,285 @@ +/* + * 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 +#if defined(WIN32) || defined (_WINDOWS) || defined (IS_DARWIN) +#else +#include +#endif + +#include "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/util/Logging.h" + +using namespace std; + +namespace tuscany +{ + namespace sca + { + + // ======================================================================== + // Constructor + // ======================================================================== + TuscanyRuntimeException :: TuscanyRuntimeException(const char* name, + severity_level sev, + const char* msg_text) + { + severity = sev; + location_set = 0; + class_name = new char[strlen(name) + 1]; + strcpy(class_name,name); + message_text = new char[strlen(msg_text)+1]; + strcpy(message_text,msg_text); + +#if defined(WIN32) || defined (_WINDOWS) || defined (IS_DARWIN) +#else + void* array[25]; + stacktrace_size = backtrace(array, 25); + stacktrace_symbols = backtrace_symbols(array, stacktrace_size); +#endif + + logwarning("%s raised: %s", class_name, message_text); + + } // end TuscanyRuntimeException constuctor + + // ======================================================================== + // Constructor + // ======================================================================== + TuscanyRuntimeException :: TuscanyRuntimeException(const TuscanyRuntimeException& c) + { + severity = c.getSeverity(); + location_set = c.location_set; + class_name = new char[strlen(c.getEClassName()) + 1]; + strcpy(class_name, c.getEClassName()); + message_text = new char[strlen(c.getMessageText())+1]; + strcpy(message_text,c.getMessageText()); + + for (int i=0; i < location_set; i++) + { + locations[i].file = new char[strlen(c.locations[i].file) + 1]; + strcpy(locations[i].file,c.locations[i].file); + locations[i].line = c.locations[i].line; + locations[i].function = new char[strlen(c.locations[i].function) + 1]; + strcpy(locations[i].function, c.locations[i].function); + } + +#if defined(WIN32) || defined (_WINDOWS) || defined (IS_DARWIN) +#else + void* array[25]; + stacktrace_size = backtrace(array, 25); + stacktrace_symbols = backtrace_symbols(array, stacktrace_size); +#endif + + logwarning("%s raised: %s", class_name, message_text); + } + + // ======================================================================== + // Constructor + // ======================================================================== + TuscanyRuntimeException :: TuscanyRuntimeException(const commonj::sdo::SDORuntimeException& c) + { + class_name = new char[strlen(c.getEClassName()) + 1]; + strcpy(class_name, c.getEClassName()); + message_text = new char[strlen(c.getMessageText())+1]; + strcpy(message_text,c.getMessageText()); + severity = Warning; + const char* file = c.getFileName(); + unsigned long line = c.getLineNumber(); + const char* function = c.getFunctionName(); + location_set = 0; + if (file) + { + setLocation(file, line, function); + } + +#if defined(WIN32) || defined (_WINDOWS) || defined (IS_DARWIN) +#else + void* array[25]; + stacktrace_size = backtrace(array, 25); + stacktrace_symbols = backtrace_symbols(array, stacktrace_size); +#endif + + logwarning("%s raised: %s", class_name, message_text); + } + + // ======================================================================== + // Destructor + // ======================================================================== + TuscanyRuntimeException :: ~TuscanyRuntimeException() + { + if (class_name) delete class_name; + if (message_text) delete message_text; + for (int i=0;i1) + { + os << " Path:" << endl; + int i=1; + while (i < location_set) + { + os << " File: " << locations[i].file << endl; + os << " Line: " << locations[i].line << endl; + os << " Function: " << locations[i].function << endl; + i++; + } + } + } +#if defined(WIN32) || defined (_WINDOWS) || defined (IS_DARWIN) +#else + if (stacktrace_size != 0) + { + os << " Backtrace:" << endl; + for (int j = 0; j < stacktrace_size; j++) + { + os << " " << stacktrace_symbols[j] << endl; + } + } +#endif + return os; + } // end ostream operator << + + + // ======================================================================== + // ostream operator << + // ======================================================================== + SCA_API ostream& operator<< (ostream &os, const TuscanyRuntimeException &except) + { + return except.PrintSelf(os); + } // end ostream operator << + + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/Exceptions.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/Exceptions.h new file mode 100644 index 0000000000..50cf91f7d4 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/Exceptions.h @@ -0,0 +1,346 @@ +/* + * 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_core_exceptions_h +#define tuscany_sca_core_exceptions_h + +#include + +#include "commonj/sdo/SDO.h" + +#include "tuscany/sca/export.h" + + +namespace tuscany +{ + namespace sca + { + /** + * Top level exception to represent all the exceptions that may be + * thrown by an SCA runtime implementation. + */ + class SCA_API TuscanyRuntimeException + { + public: + /** + * Represents the possible severity levels for an exception. + */ + enum severity_level + { + Normal, + Warning, + Error, + Severe + }; + + /** + * Constructor. + * @param name Class name of the exception. + * @param sev Severity level. + * @param msg_text Detailed description of the exception. + */ + TuscanyRuntimeException( + const char *name = "TuscanyRuntimeException", + severity_level sev = Severe, + const char* msg_text = ""); + + TuscanyRuntimeException(const TuscanyRuntimeException& c); + TuscanyRuntimeException(const commonj::sdo::SDORuntimeException& c); + + // Destructor + virtual ~TuscanyRuntimeException(); + + /** + * Return class name of this exception. + */ + const char* getEClassName() const; + + /** + * Return severity. + */ + severity_level getSeverity() const; + + /** + * Return message text associated with exception. + */ + const char* getMessageText() const; + + /* + * Return file name where the exception was raised. + */ + const char* getFileName() const; + + /** + * Return line number where the exception was raised. + */ + unsigned long getLineNumber() const; + + /** + * Return function name where the exception was raised. + */ + const char* getFunctionName() const; + + /** + * Set the exception severity. + */ + void setSeverity(severity_level sev); + + /** + * Set the message text associated with exception. + */ + void setMessageText(const char* msg_text); + + /** + * Set the location where the exception was raised. + * @param file Name of the file. + * @param line Line number in the file. + * @param function Name of the function. + */ + void setLocation(const char* file, + unsigned long line, + const char* function=""); + + /** + * Append exception details to ostream. + */ + virtual std::ostream& PrintSelf(std::ostream &os) const; + + /** + * Operator to send exceptions details to a stream. + */ + SCA_API friend std::ostream& operator<< (std::ostream &os, const TuscanyRuntimeException &except); + + protected: + + private: + /** + * Class name of the exception. + */ + char* class_name; + + /** + * Severity level of the exception. + */ + severity_level severity; + + /** + * Description of the exception. + */ + char* message_text; // Description of exception + + /** + * Location where the exception was thrown or handled and thrown. + */ + class location + { + public: + char* file; // File name (from __FILE__) + unsigned long line; // Line number (from __LINE__) + char* function; // Function name + }; + + + enum {num_locations=5}; + /** + * Array of locations where the exception has been handled and thrown. + */ + location locations[num_locations]; + + /** + * The current location (index into TuscanyRuntimeException#location). + */ + int location_set; + + /** + * A snapshot of the stack when the exception was constructed + */ +#if defined(WIN32) || defined (_WINDOWS) +#else + int stacktrace_size; + char** stacktrace_symbols; +#endif + + }; // End TuscanyRuntimeException class definition + + + /** + * Indicates a problem in the consistency of the SCA model provided to the + * Tuscany runtime. + */ + class SCA_API SystemConfigurationException: public TuscanyRuntimeException + { + public: + SystemConfigurationException(const char* msg) + : TuscanyRuntimeException("SystemConfigurationException", Severe, + msg) + { + } + + SystemConfigurationException( + const char *name, + severity_level sev, + const char* msg_text) + : TuscanyRuntimeException(name, sev, msg_text) + { + } + + SystemConfigurationException(const commonj::sdo::SDORuntimeException& c) + : TuscanyRuntimeException(c) + { + } + private: + }; + + /** + * Indicates a problem while invoking a service. + */ + class SCA_API ServiceInvocationException: public TuscanyRuntimeException + { + public: + ServiceInvocationException(const char* msg) + : TuscanyRuntimeException("ServiceInvocationException", Severe, msg) + { + } + + ServiceInvocationException( + const char *name, + severity_level sev, + const char* msg_text) + : TuscanyRuntimeException(name, sev, msg_text) + { + } + + ServiceInvocationException(const commonj::sdo::SDORuntimeException& c) + : TuscanyRuntimeException(c) + { + } + + private: + }; + + /** + * Indicates a problem while working with service data. + */ + class SCA_API ServiceDataException: public TuscanyRuntimeException + { + public: + ServiceDataException(const char* msg) + : TuscanyRuntimeException("ServiceDataException", Severe, + msg) + { + } + + ServiceDataException( + const char *name, + severity_level sev, + const char* msg_text) + : TuscanyRuntimeException(name, sev, msg_text) + { + } + + ServiceDataException(const commonj::sdo::SDORuntimeException& c) + : TuscanyRuntimeException(c) + { + } + private: + }; + + } // End namespace sca +} // End namespace tuscany + + +/** + * ========================================================================= + * Macro - throwException + * + * adds the current file name, line number and function name to the exception. + * then throws the exception. + * The parameter 'function_name' should be the name of the function throwing + * this exception. + * The parameter 'type' is the class of exception to throw and must be a + * SDORuntimeException or a class derived from SDORuntimeException. + * The parameter 'parameter' is the construction parameter for the exception + * ========================================================================= +*/ + +#if defined(WIN32) || defined (_WINDOWS) +#define throwException(type, parameter) \ +{\ + type __TuscanyThrownException__(parameter); \ + __TuscanyThrownException__.setLocation(__FILE__,__LINE__,__FUNCTION__); \ + throw __TuscanyThrownException__;\ +} +#else +#define throwException(type, parameter) \ +{\ + type __TuscanyThrownException__(parameter); \ + __TuscanyThrownException__.setLocation(__FILE__,__LINE__,__PRETTY_FUNCTION__); \ + throw __TuscanyThrownException__;\ +} +#endif + +/** + ========================================================================= + * Macro - rethrowException + * + * adds the current file name, line number and function name to the exception. + * then re-throws the exception. + * The parameter 'function_name' should be the name of the function throwing + * this exception. + * ========================================================================= +*/ +#if defined(WIN32) || defined (_WINDOWS) +#define rethrowException(exception) \ +{\ + (exception).setLocation(__FILE__,__LINE__,__FUNCTION__); \ + throw (exception);\ +} +#else +#define rethrowException(exception) \ +{\ + (exception).setLocation(__FILE__,__LINE__,__PRETTY_FUNCTION__); \ + throw (exception);\ +} +#endif + +/** + * ========================================================================= + * Macro - handleException + * + * adds the current file name, line number and function name to the exception. + * Writes an exception trace entry then continues. + * The parameter 'function_name' should be the name of the function handling + * this exception. + * ========================================================================= +*/ +#if defined(WIN32) || defined (_WINDOWS) +#define handleException(__PRETTY_FUNCTION__, exception) \ +{\ + (exception).setLocation(__FILE__,__LINE__,__FUNCTION__); \ +} +#else +#define handleException(__PRETTY_FUNCTION__, exception) \ +{\ + (exception).setLocation(__FILE__,__LINE__,__PRETTY_FUNCTION__); \ +} +#endif + +#endif // tuscany_sca_core_exceptions_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/Operation.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/Operation.cpp new file mode 100644 index 0000000000..335ed5d369 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/Operation.cpp @@ -0,0 +1,578 @@ +/* + * 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 + +#include "tuscany/sca/core/Operation.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/core/SCARuntime.h" + +using namespace std; +using namespace commonj::sdo; + + +namespace tuscany +{ + namespace sca + { + // =========== + // Constructor + // =========== + Operation::Operation(const char* operationName) + { + logentry(); + if (operationName != 0) + { + name = operationName; + } + } + + // ========== + // Destructor + // ========== + Operation::~Operation() + { + logentry(); + clean(); + } + + // ========== + // Copy Constructor + // ========== + Operation::Operation(const Operation& op) + { + logentry(); + copy(op); + } + + // ========== + // operator= + // ========== + Operation& Operation::operator=(const Operation& op) + { + logentry(); + if (&op != this) + { + copy(op); + } + return *this; + } + + // ========== + // Clean + // ========== + void Operation::clean() + { + logentry(); + for (unsigned int i = 0; i < getNParms(); i++) + { + const Parameter& parm = getParameter(i); + if (parm.getType() == DATAOBJECT) + { + delete (DataObjectPtr*)parm.getValue(); + } + } + + parameters.empty(); + + if (getReturnType() == DATAOBJECT) + { + delete (DataObjectPtr*)getReturnValue(); + } + } + + // ========== + // Copy + // ========== + void Operation::copy(const Operation& op) + { + logentry(); + clean(); + for (unsigned int i = 0; i < op.getNParms(); i++) + { + const Parameter& parm = op.getParameter(i); + if (parm.getType() == DATAOBJECT) + { + addParameter((const DataObject*)parm.getValue()); + } + else + { + parameters.insert(parameters.end(), parm); + } + } + + if (getReturnType() == DATAOBJECT) + { + setReturnValue((const DataObjectPtr*)op.getReturnValue()); + } + else + { + returnValue = op.returnValue; + } + } + + // ============================================== + // getParameter: return parameter at position pos + // ============================================== + void* Operation::getParameterValue(unsigned int pos) const + { + logentry(); + if (pos < parameters.size()) + { + return parameters[pos].getValue(); + } + + return 0; + } + + // ================================================== + // getParameter: return parameter value based on name + // ================================================== + void* Operation::getParameterValue(const string& name) const + { + logentry(); + try + { + return getParameter(name).getValue(); + } + catch(ServiceInvocationException) + {} + + return 0; + } + + // ====================================================== + // getParameter: return parameter based on index position + // ====================================================== + const Operation::Parameter& Operation::getParameter(unsigned int pos) const + { + logentry(); + if (pos < parameters.size()) + { + return parameters[pos]; + } + + throwException(ServiceInvocationException, "Index out of range"); + } + + // =============================================== + // getParameter: return of parameter based on name + // =============================================== + const Operation::Parameter& Operation::getParameter(const string& name) const + { + logentry(); + for(unsigned int pos=0; pos < parameters.size(); pos++) + { + if(parameters[pos].getName() == name) + { + return parameters[pos]; + } + } + + throwException(ServiceInvocationException, "Parameter name not found"); + } + + + // ============================================================ + // getParameterType: return type of parameter based on position + // ============================================================ + Operation::ParameterType Operation::getParameterType(unsigned int pos) const + { + logentry(); + if (pos < parameters.size()) + { + return parameters[pos].getType(); + } + + return VOID_TYPE; + } + + // ======================================================== + // getParameterType: return type of parameter based on name + // ======================================================== + Operation::ParameterType Operation::getParameterType(const string& name) const + { + logentry(); + try + { + return getParameter(name).getType(); + } + catch(ServiceInvocationException) + {} + + return VOID_TYPE; + } + + const string emptyString = string(); + + // ============================================== + // getParameterName: return name of parameter + // ============================================== + const string& Operation::getParameterName(unsigned int pos) const + { + logentry(); + if (pos < parameters.size()) + { + return parameters[pos].getName(); + } + + return emptyString; + } + + // =========================================== + // addParameter: set parameter at position pos + // =========================================== + void Operation::addParameter(const void *parm) + { + logentry(); + loginfo("Adding operation parameter, type: void, value: %p", parm); + parameters.insert(parameters.end(), Parameter((void*)parm, VOID_TYPE)); + } + + void Operation::addParameter(const bool *parm) + { + logentry(); + loginfo("Adding operation parameter, type: bool, value: %d", (int)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, BOOL)); + } + + void Operation::addParameter(const short *parm) + { + logentry(); + loginfo("Adding operation parameter, type: short, value: %hd", (short)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, SHORT)); + } + + void Operation::addParameter(const int *parm) + { + logentry(); + loginfo("Adding operation parameter, type: int, value: %d", (int)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, INT)); + } + + void Operation::addParameter(const long *parm) + { + logentry(); + loginfo("Adding operation parameter, type: long, value: %ld", (long)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, LONG)); + } + + void Operation::addParameter(const unsigned short *parm) + { + logentry(); + loginfo("Adding operation parameter, type: unsigned short, value: %hu", (unsigned short)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, USHORT)); + } + + void Operation::addParameter(const unsigned int *parm) + { + logentry(); + loginfo("Adding operation parameter, type: unsigned int, value: %u", (unsigned int)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, UINT)); + } + + void Operation::addParameter(const unsigned long *parm) + { + logentry(); + loginfo("Adding operation parameter, type: unsigned long, value: %lu", (unsigned long)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, ULONG)); + } + + void Operation::addParameter(const float *parm) + { + logentry(); + loginfo("Adding operation parameter, type: float, value: %f", (float)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, FLOAT)); + } + + void Operation::addParameter(const double *parm) + { + logentry(); + loginfo("Adding operation parameter, type: double, value: %lf", (double)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, DOUBLE)); + } + + void Operation::addParameter(const long double *parm) + { + logentry(); + loginfo("Adding operation parameter, type: long double, value: %Lf", (long double)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, LONGDOUBLE)); + } + + void Operation::addParameter(const char* *parm) + { + logentry(); + loginfo("Adding operation parameter, type: char*, value: %s", (const char*)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, CHARS)); + } + + void Operation::addParameter(const char *parm) + { + logentry(); + loginfo("Adding operation parameter, type: char, value: %d", (int)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, CHAR)); + } + + void Operation::addParameter(const string *parm) + { + logentry(); + loginfo("Adding operation parameter, type: string, value: %s", (const char*)(*parm).c_str()); + parameters.insert(parameters.end(), Parameter((void*)parm, STRING)); + } + + void Operation::addParameter(const DataObjectPtr *parm) + { + logentry(); + ostringstream os; + os << *parm; + loginfo("Adding operation parameter, type: DataObject, value: %s", os.str().c_str()); + parameters.insert(parameters.end(), Parameter((void*)new DataObjectPtr(*parm), DATAOBJECT)); + } + + // ======================================================= + // addParameter: set parameter at position pos with a name + // ======================================================= + void Operation::addParameter(const string& name, const void *parm) + { + logentry(); + loginfo("Adding operation parameter, name: %s, type: void, value: %p", name.c_str(), parm); + parameters.insert(parameters.end(), Parameter((void*)parm, VOID_TYPE, (string&) name)); + } + + void Operation::addParameter(const string& name, const bool *parm) + { + logentry(); + loginfo("Adding operation parameter, name: %s, type: bool, value: %d", name.c_str(), (int)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, BOOL, (string&) name)); + } + + void Operation::addParameter(const string& name, const short *parm) + { + logentry(); + loginfo("Adding operation parameter, name: %s, type: short, value: %hd", name.c_str(), (short)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, SHORT, (string&) name)); + } + + void Operation::addParameter(const string& name, const int *parm) + { + logentry(); + loginfo("Adding operation parameter, name: %s, type: int, value: %d", name.c_str(), (int)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, INT, (string&) name)); + } + + void Operation::addParameter(const string& name, const long *parm) + { + logentry(); + loginfo("Adding operation parameter, name: %s, type: long, value: %ld", name.c_str(), (long)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, LONG, (string&) name)); + } + + void Operation::addParameter(const string& name, const unsigned short *parm) + { + logentry(); + loginfo("Adding operation parameter, name: %s, type: unsigned short, value: %hu", (unsigned short)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, USHORT, (string&) name)); + } + + void Operation::addParameter(const string& name, const unsigned int *parm) + { + logentry(); + loginfo("Adding operation parameter, name: %s, type: unsigned int, value: %u", name.c_str(), (unsigned int)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, UINT, (string&) name)); + } + + void Operation::addParameter(const string& name, const unsigned long *parm) + { + logentry(); + loginfo("Adding operation parameter, name: %s, type: unsigned long, value: %lu", name.c_str(), (unsigned long)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, ULONG, (string&) name)); + } + + void Operation::addParameter(const string& name, const float *parm) + { + logentry(); + loginfo("Adding operation parameter, name: %s, type: float, value: %f", name.c_str(), (float)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, FLOAT, (string&) name)); + } + + void Operation::addParameter(const string& name, const double *parm) + { + logentry(); + loginfo("Adding operation parameter, name: %s, type: double, value: %lf", name.c_str(), (double)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, DOUBLE, (string&) name)); + } + + void Operation::addParameter(const string& name, const long double *parm) + { + logentry(); + loginfo("Adding operation parameter, name: %s, type: long double, value: %Lf", name.c_str(), (long double)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, LONGDOUBLE, (string&) name)); + } + + void Operation::addParameter(const string& name, const char* *parm) + { + logentry(); + loginfo("Adding operation parameter, name: %s, type: char*, value: %s", name.c_str(), (const char*)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, CHARS, (string&) name)); + } + + void Operation::addParameter(const string& name, const char *parm) + { + logentry(); + loginfo("Adding operation parameter, name: %s, type: char, value: %d", name.c_str(), (int)*parm); + parameters.insert(parameters.end(), Parameter((void*)parm, CHAR, (string&) name)); + } + + void Operation::addParameter(const string& name, const string *parm) + { + logentry(); + loginfo("Adding operation parameter, name: %s, type: string, value: %s", name.c_str(), (const char*)(*parm).c_str()); + parameters.insert(parameters.end(), Parameter((void*)parm, STRING, (string&) name)); + } + + void Operation::addParameter(const string& name, const DataObjectPtr *parm) + { + logentry(); + ostringstream os; + os << *parm; + loginfo("Adding operation parameter, name: %s, type: DataObject, value: %s", name.c_str(), os.str().c_str()); + parameters.insert(parameters.end(), Parameter((void*)new DataObjectPtr(*parm), DATAOBJECT, (string&) name)); + } + + Operation::Parameter::Parameter(void* val, Operation::ParameterType typ, const string& nam) + : value(val), type(typ), name(nam) + { + } + + // =========================================== + // setReturnValue + // =========================================== + void Operation::setReturnValue(const void *parm) + { + logentry(); + loginfo("Setting operation return value, type: void, value: %p", parm); + returnValue = Parameter((void*)parm, VOID_TYPE); + } + + void Operation::setReturnValue(const bool *parm) + { + logentry(); + loginfo("Setting operation return value, type: bool, value: %d", (bool)*parm); + returnValue = Parameter((void*)parm, BOOL); + } + + void Operation::setReturnValue(const short *parm) + { + logentry(); + loginfo("Setting operation return value, type: short, value: %h", (short)*parm); + returnValue = Parameter((void*)parm, SHORT); + } + + void Operation::setReturnValue(const int *parm) + { + logentry(); + loginfo("Setting operation return value, type: int, value: %d", (int)*parm); + returnValue = Parameter((void*)parm, INT); + } + + void Operation::setReturnValue(const long *parm) + { + logentry(); + loginfo("Setting operation return value, type: long, value: %l", (long)*parm); + returnValue = Parameter((void*)parm, LONG); + } + + void Operation::setReturnValue(const unsigned short *parm) + { + logentry(); + loginfo("Setting operation return value, type: unsigned short, value: %hu", (unsigned short)*parm); + returnValue = Parameter((void*)parm, USHORT); + } + + void Operation::setReturnValue(const unsigned int *parm) + { + logentry(); + loginfo("Setting operation return value, type: unsigned short, value: %u", (unsigned int)*parm); + returnValue = Parameter((void*)parm, UINT); + } + + void Operation::setReturnValue(const unsigned long *parm) + { + logentry(); + loginfo("Setting operation return value, type: unsigned long, value: %lu", (unsigned long)*parm); + returnValue = Parameter((void*)parm, ULONG); + } + + void Operation::setReturnValue(const float *parm) + { + logentry(); + loginfo("Setting operation return value, type: float, value: %f", (float)*parm); + returnValue = Parameter((void*)parm, FLOAT); + } + + void Operation::setReturnValue(const double *parm) + { + logentry(); + loginfo("Setting operation return value, type: double, value: %lf", (double)*parm); + returnValue = Parameter((void*)parm, DOUBLE); + } + + void Operation::setReturnValue(const long double *parm) + { + logentry(); + loginfo("Setting operation return value, type: long double, value: %Lf", (long double)*parm); + returnValue = Parameter((void*)parm, LONGDOUBLE); + } + + void Operation::setReturnValue(const char *parm) + { + logentry(); + loginfo("Setting operation return value, type: char, value: %d", (char)*parm); + returnValue = Parameter((void*)parm, CHAR); + } + + void Operation::setReturnValue(const char* *parm) + { + logentry(); + loginfo("Setting operation return value, type: char*, value: %s", (char*)*parm); + returnValue = Parameter((void*)parm, CHARS); + } + + void Operation::setReturnValue(const string *parm) + { + logentry(); + loginfo("Setting operation return value, type: string, value: %s", (*parm).c_str()); + returnValue = Parameter((void*)parm, STRING); + } + + void Operation::setReturnValue(const DataObjectPtr *parm) + { + logentry(); + ostringstream os; + os << *parm; + loginfo("Setting operation return value, type: DataObject, value: %s", os.str().c_str()); + returnValue = Parameter((void*)new DataObjectPtr(*parm), DATAOBJECT); + } + + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/Operation.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/Operation.h new file mode 100644 index 0000000000..89cf0b63b7 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/Operation.h @@ -0,0 +1,251 @@ +/* + * 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_core_operation_h +#define tuscany_sca_core_operation_h + +#include +#include + +#include "commonj/sdo/SDO.h" + +#include "tuscany/sca/export.h" + + +namespace tuscany +{ + namespace sca + { + /** + * Holds the details of a single invocation of a business method. + * This class is used to pass the parameters and operation name from the + * client to a service. It will also hold the return value on the + * return from the business method. + */ + class Operation + { + public: + /** + * Create a new operation. + * @param operationName The method name of the business method to be invoked. + * @param numParameters The number of parameters to be passed. + */ + SCA_API Operation(const char* operationName = 0); + + /** + * Destructor. + */ + SCA_API virtual ~Operation(); + + /** + * Copy constructor. + */ + SCA_API Operation(const Operation& op); + + /** + * Assignment operator. + */ + SCA_API Operation& operator=(const Operation& op); + + /** + * Return the operation name. + * @return The name of the operation. + */ + SCA_API const std::string& getName() const {return name;} + + + enum ParameterType + { + UNSET = 0, + VOID_TYPE, + BOOL, + SHORT, + INT, + LONG, + USHORT, + UINT, + ULONG, + FLOAT, + DOUBLE, + LONGDOUBLE, + CHARS, + CHAR, + STRING, + DATAOBJECT + }; + + class Parameter + { + public: + SCA_API Parameter(void* value = NULL, ParameterType type = VOID_TYPE, const std::string& name = ""); + SCA_API void* getValue() const {return value;} + SCA_API ParameterType getType() const {return type;} + SCA_API const std::string& getName() const {return name;} + SCA_API bool hasName() const {return (name.length() > 0);} + + private: + std::string name; + void* value; + ParameterType type; + }; + + /** + * Set a return value for the operation. + * @param retVal Pointer to the return value. + */ + SCA_API void setReturnValue(const void *retVal); + SCA_API void setReturnValue(const bool *retVal); + SCA_API void setReturnValue(const short *retVal); + SCA_API void setReturnValue(const int *retVal); + SCA_API void setReturnValue(const long *retVal); + SCA_API void setReturnValue(const unsigned short *retVal); + SCA_API void setReturnValue(const unsigned int *retVal); + SCA_API void setReturnValue(const unsigned long *retVal); + SCA_API void setReturnValue(const float *retVal); + SCA_API void setReturnValue(const double *retVal); + SCA_API void setReturnValue(const long double *retVal); + SCA_API void setReturnValue(const char *retVal); + SCA_API void setReturnValue(const char* *retVal); + SCA_API void setReturnValue(const std::string *retVal); + SCA_API void setReturnValue(const commonj::sdo::DataObjectPtr *retVal); + + /** + * Set a parameter on the operation. + * @param parm Pointer to the parameter to be passed. + */ + SCA_API void addParameter(const void *parm); + SCA_API void addParameter(const bool *parm); + SCA_API void addParameter(const short *parm); + SCA_API void addParameter(const int *parm); + SCA_API void addParameter(const long *parm); + SCA_API void addParameter(const unsigned short *parm); + SCA_API void addParameter(const unsigned int *parm); + SCA_API void addParameter(const unsigned long *parm); + SCA_API void addParameter(const float *parm); + SCA_API void addParameter(const double *parm); + SCA_API void addParameter(const long double *parm); + SCA_API void addParameter(const char *parm); + SCA_API void addParameter(const char* *parm); + SCA_API void addParameter(const std::string *parm); + SCA_API void addParameter(const commonj::sdo::DataObjectPtr *parm); + + /** + * Set a parameter on the operation. + * @param name The name of the parameter in the parameter list. + * @param parm Pointer to the parameter to be passed. + */ + SCA_API void addParameter(const std::string& name, const void *parm); + SCA_API void addParameter(const std::string& name, const bool *parm); + SCA_API void addParameter(const std::string& name, const short *parm); + SCA_API void addParameter(const std::string& name, const int *parm); + SCA_API void addParameter(const std::string& name, const long *parm); + SCA_API void addParameter(const std::string& name, const unsigned short *parm); + SCA_API void addParameter(const std::string& name, const unsigned int *parm); + SCA_API void addParameter(const std::string& name, const unsigned long *parm); + SCA_API void addParameter(const std::string& name, const float *parm); + SCA_API void addParameter(const std::string& name, const double *parm); + SCA_API void addParameter(const std::string& name, const long double *parm); + SCA_API void addParameter(const std::string& name, const char *parm); + SCA_API void addParameter(const std::string& name, const char* *parm); + SCA_API void addParameter(const std::string& name, const std::string *parm); + SCA_API void addParameter(const std::string& name, const commonj::sdo::DataObjectPtr *parm); + + SCA_API unsigned int getNParms() const {return parameters.size();} + + /** + * Get a parameter from the operation. + * @param pos The position of the parameter in the parameter list. + * @return Pointer to the paramter at the given postion. Should be + * cast to the appropriate type. + */ + SCA_API const Parameter& getParameter(unsigned int pos) const; + + /** + * Get a parameter from the operation. + * @param name The name of the parameter in the parameter list. + * @return Pointer to the paramter with the given name. Should be + * cast to the appropriate type. + */ + SCA_API const Parameter& getParameter(const std::string& name) const; + + /** + * Get a parameter type from the operation. + * @param pos The position of the parameter in the parameter list. + * @return Type of the parameter at the given position. + */ + SCA_API ParameterType getParameterType(unsigned int pos) const; + + /** + * Get a parameter type from the operation. + * @param name The name of the parameter in the parameter list. + * @return Type of the parameter with the given name. + */ + SCA_API ParameterType getParameterType(const std::string& name) const; + + /** + * Get a parameter name from the operation. + * @param pos The position of the parameter in the parameter list. + * @return Name of the parameter at the given position. + */ + SCA_API const std::string& getParameterName(unsigned int pos) const; + + /** + * Get the parameter value from the operation. + * @param pos The position of the parameter in the parameter list. + * @return Pointer to the value of the parameter at the given postion. Should be + * cast to the appropriate type. + */ + SCA_API void* getParameterValue(unsigned int pos) const; + + /** + * Get the parameter value from the operation. + * @param name The name of the parameter in the parameter list. + * @return Pointer to the value of the parameter with the given name. Should be + * cast to the appropriate type. + */ + SCA_API void* getParameterValue(const std::string& name) const; + + SCA_API ParameterType getReturnType() const {return returnValue.getType();} + SCA_API void* getReturnValue() const {return returnValue.getValue();} + + private: + /** + * Operation name (method name). + */ + std::string name; + + /** + * Array of parameters. + */ + typedef std::vector PARAMETER_VECTOR; + + PARAMETER_VECTOR parameters; + + Parameter returnValue; + + void clean(); + void copy(const Operation& op); + + }; + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_core_operation_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/SCARuntime.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/SCARuntime.cpp new file mode 100644 index 0000000000..d605f37f95 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/SCARuntime.cpp @@ -0,0 +1,616 @@ +/* + * 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/core/SCARuntime.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/model/ModelLoader.h" +#include "tuscany/sca/util/File.h" +#include "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/model/Composite.h" +#include "tuscany/sca/model/Component.h" + +using namespace std; +using namespace tuscany::sca::model; +using namespace tuscany::sca::util; + +namespace tuscany +{ + namespace sca + { + /** + * Environment variable names + */ + static const char* TUSCANY_SCACPP = "TUSCANY_SCACPP"; + static const char* TUSCANY_SCACPP_SYSTEM_ROOT = "TUSCANY_SCACPP_SYSTEM_ROOT"; + static const char* TUSCANY_SCACPP_DEFAULT_COMPONENT = "TUSCANY_SCACPP_DEFAULT_COMPONENT"; + + static const char* TUSCANY_SCACPP_ROOT = "TUSCANY_SCACPP_ROOT"; + static const char* TUSCANY_SCACPP_COMPONENT = "TUSCANY_SCACPP_COMPONENT"; + static const char* TUSCANY_SCACPP_PATH = "TUSCANY_SCACPP_PATH"; + static const char* TUSCANY_SCACPP_BASE_URI = "TUSCANY_SCACPP_BASE_URI"; + + // Initialize statics + SCARuntime* SCARuntime::sharedRuntime = NULL; + Mutex SCARuntime::sharedRuntimeLock; + ThreadLocal SCARuntime::current; + + + // =================================================================== + // Constructor for the SCARuntime class. This will + // hold all the information about the current runtime. + // =================================================================== + SCARuntime::SCARuntime(const string& insRoot, + const string& sysRoot, const string& sysPath, + const string& base, const string& defName) + : system(0), + installRoot(insRoot), systemRoot(sysRoot), systemPath(sysPath), + defaultBaseURI(base), defaultComponentName(defName) + { + logentry(); + + if (installRoot == "") + { + // Get install dir from environment variable TUSCANY_SCACPP + const char* root = getenv(TUSCANY_SCACPP); + if (root != NULL) + { + installRoot = root; + } + else + { + string msg = TUSCANY_SCACPP; + msg += " environment variable not set"; + throwException(SystemConfigurationException, msg.c_str()); + } + } + loginfo("SCA runtime install root: %s", installRoot.c_str()); + + if (systemRoot == "") + { + // Get root from environment variable TUSCANY_SCACPP_ROOT + char* systemRootEnv = getenv(TUSCANY_SCACPP_ROOT); + if (systemRootEnv == 0) + { + // Get root from environment variable TUSCANY_SCACPP_SYSTEM_ROOT + systemRootEnv = getenv(TUSCANY_SCACPP_SYSTEM_ROOT); + } + if (systemRootEnv == 0) + { + string msg = TUSCANY_SCACPP_ROOT; + msg += " environment variable not set"; + throwException(SystemConfigurationException, msg.c_str()); + } + + systemRoot = systemRootEnv; + } + else + { + loginfo("System root: %s", systemRoot.c_str()); + } + + if (systemPath == "") + { + + // Get system path from environment variable TUSCANY_SCACPP_PATH + char* systemPathEnv = getenv(TUSCANY_SCACPP_PATH); + if (systemPathEnv != 0) + { + systemPath = systemPathEnv; + } + } + else + { + loginfo("System path: %s", systemPath.c_str()); + } + + if (defaultBaseURI == "") + { + + // Get default base URI from environment variable TUSCANY_SCACPP_BASE_URI + char* baseURI = getenv(TUSCANY_SCACPP_BASE_URI); + if (baseURI != 0) + { + defaultBaseURI = baseURI; + } + } + else + { + loginfo("Default base URI: %s", defaultBaseURI.c_str()); + } + + if (defaultComponentName == "") + { + const char* defComp = getenv(TUSCANY_SCACPP_COMPONENT); + if (!defComp) + { + defComp = getenv(TUSCANY_SCACPP_DEFAULT_COMPONENT); + } + if (defComp) + { + defaultComponentName = defComp; + } + } + loginfo("Default component: %s", defaultComponentName.c_str()); + + SCARuntime* currentRuntime = (SCARuntime*)current.getValue(); + current.setValue(this); + try + { + + // Load the runtime extensions + loadExtensions(); + + // Load the system composite + loadSystem(); + } + catch (...) + { + current.setValue(currentRuntime); + throw; + } + current.setValue(currentRuntime); + + // Find the default component + if (defaultComponentName != "") + { + Component* comp = system->findComponent(defaultComponentName); + if (!comp) + { + string message = "Component \'" + defaultComponentName + "\' not found"; + throwException(SystemConfigurationException, message.c_str()); + } + defaultComponent.setValue(comp); + } + + } + + // =================================================================== + // Destructor for the SCARuntime class. + // =================================================================== + SCARuntime::~SCARuntime() + { + logentry(); + + if (system) + { + delete system; + } + } + + // ========================================================== + // Returns the system configuration root + // ========================================================== + const string& SCARuntime::getSystemRoot() + { + return systemRoot; + } + + // ========================================================== + // Returns the system path + // ========================================================== + const string& SCARuntime::getSystemPath() + { + return systemPath; + } + + // ========================================================== + // Returns the default component name + // ========================================================== + const string& SCARuntime::getDefaultComponentName() + { + return defaultComponentName ; + } + + // ========================================================== + // Returns the default base URI + // ========================================================== + const string& SCARuntime::getDefaultBaseURI() + { + return defaultBaseURI; + } + + // ========================================================== + // Returns the install root + // ========================================================== + const string& SCARuntime::getInstallRoot() + { + return installRoot; + } + + // ============================================================= + // Get the runtime associated with the current thread. + // ============================================================= + SCARuntime* SCARuntime::getCurrentRuntime() + { + logentry(); + + SCARuntime* runtime = (SCARuntime*)current.getValue(); + if (runtime == NULL) + { + runtime = getSharedRuntime(); + if (runtime != NULL) + { + setCurrentRuntime(runtime); + } + else + { + runtime = new SCARuntime(); + setCurrentRuntime(runtime); + } + } + loginfo("Runtime: %p", runtime); + return runtime; + } + + // ============================================================= + // Set the runtime associated with the current thread. + // ============================================================= + void SCARuntime::setCurrentRuntime(SCARuntime* runtime) + { + logentry(); + + loginfo("Runtime: %p", runtime); + current.setValue(runtime); + } + + // ============================================================= + // Get the runtime associated with the current process. + // ============================================================= + SCARuntime* SCARuntime::getSharedRuntime() + { + logentry(); + + sharedRuntimeLock.lock(); + SCARuntime* runtime = sharedRuntime; + sharedRuntimeLock.unlock(); + + return runtime; + } + + // ============================================================= + // Initialize the runtime associated with the current process. + // ============================================================= + SCARuntime* SCARuntime::initializeSharedRuntime(const string& installRoot, const string& systemRoot, + const string& systemPath, const string& baseURI, const string& defaultComponentName) + { + logentry(); + + SCARuntime* runtime; + + sharedRuntimeLock.lock(); + try + { + if (sharedRuntime == NULL) + { + sharedRuntime = new SCARuntime(installRoot, systemRoot, systemPath, baseURI, defaultComponentName); + } + else + { + if (installRoot.size() != 0 && sharedRuntime->getInstallRoot() != installRoot) + { + string msg = "Cannot reconfigure runtime installation directory: " + string(installRoot); + throwException(SystemConfigurationException, msg.c_str()); + } + if (systemRoot.size() != 0 && sharedRuntime->getSystemRoot() != systemRoot) + { + string msg = "Cannot reconfigure SCA system root: " + string(systemRoot); + throwException(SystemConfigurationException, msg.c_str()); + } + if (systemPath.size() != 0 && sharedRuntime->getSystemPath() != systemPath) + { + string msg = "Cannot reconfigure SCA system path: " + string(systemPath); + throwException(SystemConfigurationException, msg.c_str()); + } + if (baseURI.size() != 0 && sharedRuntime->getDefaultBaseURI() != baseURI) + { + string msg = "Cannot reconfigure SCA system URI: " + string(baseURI); + throwException(SystemConfigurationException, msg.c_str()); + } + if (defaultComponentName.size() != 0 && sharedRuntime->getDefaultComponentName() != defaultComponentName) + { + string msg = "Cannot reconfigure main SCA component: " + string(baseURI); + throwException(SystemConfigurationException, msg.c_str()); + } + } + + runtime = sharedRuntime; + } + catch (...) + { + sharedRuntimeLock.unlock(); + throw; + } + sharedRuntimeLock.unlock(); + + return runtime; + } + + // ====================================== + // Load the system composite + // ====================================== + void SCARuntime::loadSystem() + { + logentry(); + + system = new Composite("tuscany/sca/system", ""); + ModelLoader loader(this, system); + loader.load(systemRoot, systemPath); + } + + // ====================================== + // Load up extensions to the runtime + // ====================================== + void SCARuntime::loadExtensions() + { + logentry(); + + string extensionsRoot = installRoot + "/extensions"; + +#if defined(WIN32) || defined (_WINDOWS) + string libraryExtension = ".dll"; +#else +#if defined(IS_DARWIN) + string libraryExtension = ".dylib"; +#else + string libraryExtension = ".so"; +#endif +#endif + string pattern = "*" + libraryExtension; + + // Get list of all directories named "module" + Files extensionModules(extensionsRoot, "module", true, true); + loginfo("Found %i extension modules", extensionModules.size() ); + for (unsigned int emI=0; emI < extensionModules.size(); emI++) + { + string extensionRoot = extensionModules[emI].getDirectory().c_str(); + extensionRoot += "/module"; + loginfo("Loading extension module: %s", extensionRoot.c_str() ); + + Files files(extensionRoot, pattern, true); + loginfo("Found %i extension libraries", files.size() ); + for (unsigned int i=0; i < files.size(); i++) + { + try + { + string filename = files[i].getFileName(); + loginfo("Loading extension library: %s", filename ); + Library lib = Library( files[i].getDirectory() + "/" + filename); + + // Determine the name of the initialize method + // 1) strip the .dll/.so/.dylib suffix + // 2) for non-Windows strip any lib prefix + string initializeMethod; + #if defined(WIN32) || defined (_WINDOWS) + #else + if (filename.substr(0,3) == "lib") + { + initializeMethod = filename.substr(3, filename.size()-libraryExtension.size() - 3); + } + else + #endif + { + initializeMethod = filename.substr(0, filename.size()-libraryExtension.size()); + } + initializeMethod += "_initialize"; + TUSCANY_IMPLEMENTATION_EXTENSION_INITIALIZE extension = + (TUSCANY_IMPLEMENTATION_EXTENSION_INITIALIZE)lib.getSymbol(initializeMethod); + if (extension) + { + extension(); + extensionsList.push_back(lib); + } + } + catch (TuscanyRuntimeException& ex) + { + logwarning("Failed to load extension library: %s: %s: %s", + files[i].getFileName().c_str(), ex.getEClassName(), ex.getMessageText()); + } + } + } + } + + + // ====================================== + // register an interfaceExtension + // ====================================== + void SCARuntime::registerInterfaceExtension(InterfaceExtension* extension) + { + logentry(); + if (extension) + { + loginfo("Registering interface: %s", extension->getExtensionTypeQName().c_str()); + interfaceExtensions[extension->getExtensionTypeQName()] = extension; + } + } + + // ====================================== + // find an InterfaceExtension + // ====================================== + InterfaceExtension* SCARuntime::getInterfaceExtension(const string& extensionTypeQName) + { + return interfaceExtensions[extensionTypeQName]; + } + + // ====================================== + // register an implementationExtension + // ====================================== + void SCARuntime::registerImplementationExtension(ImplementationExtension* extension) + { + logentry(); + if (extension) + { + loginfo("Registering implementation: %s", extension->getExtensionTypeQName().c_str()); + implementationExtensions[extension->getExtensionTypeQName()] = extension; + } + } + + // ====================================== + // find an implementationExtension + // ====================================== + ImplementationExtension* SCARuntime::getImplementationExtension(const string& extensionTypeQName) + { + return implementationExtensions[extensionTypeQName]; + } + + // ====================================== + // register a referenceBindingExtension + // ====================================== + void SCARuntime::registerReferenceBindingExtension(ReferenceBindingExtension* extension) + { + logentry(); + if (extension) + { + loginfo("Registering reference binding: %s", extension->getExtensionTypeQName().c_str()); + referenceBindingExtensions[extension->getExtensionTypeQName()] = extension; + } + } + + // ====================================== + // find a referenceBindingExtension + // ====================================== + ReferenceBindingExtension* SCARuntime::getReferenceBindingExtension(const string& extensionTypeQName) + { + return referenceBindingExtensions[extensionTypeQName]; + } + + // ====================================== + // register a serviceBindingExtension + // ====================================== + void SCARuntime::registerServiceBindingExtension(ServiceBindingExtension* extension) + { + logentry(); + if (extension) + { + loginfo("Registering service binding: %s", extension->getExtensionTypeQName().c_str()); + serviceBindingExtensions[extension->getExtensionTypeQName()] = extension; + } + } + + // ====================================== + // find a serviceBindingExtension + // ====================================== + ServiceBindingExtension* SCARuntime::getServiceBindingExtension(const string& extensionTypeQName) + { + return serviceBindingExtensions[extensionTypeQName]; + } + + + // =================================== + // Return the top of the runtime model + // =================================== + Composite* SCARuntime::getSystem() + { + logentry(); + + return system; + } + + + // =================================================== + // setCurrentComponent: push component for this thread + // =================================================== + void SCARuntime::setCurrentComponent(Component* component) + { + logentry(); + + COMPONENT_STACK* compStack = (COMPONENT_STACK*)componentStack.getValue(); + if (compStack == NULL) + { + compStack = new COMPONENT_STACK(); + componentStack.setValue(compStack); + } + compStack->push(component); + } + + // ==================================================== + // unsetCurrentComponent: pop component for this thread + // ==================================================== + Component* SCARuntime::unsetCurrentComponent() + { + logentry(); + + COMPONENT_STACK* compStack = (COMPONENT_STACK*)componentStack.getValue(); + if (compStack != NULL) + { + if (compStack->size() > 0) + { + Component* component = compStack->top(); + compStack->pop(); + return component; + } + } + + return NULL; + } + + // ============================================================= + // getCurrentComponent: return current component for this thread + // ============================================================= + Component* SCARuntime::getCurrentComponent() + { + logentry(); + + COMPONENT_STACK* compStack = (COMPONENT_STACK*)componentStack.getValue(); + if (compStack != NULL) + { + if (compStack->size() > 0) + { + return compStack->top(); + } + } + + return NULL; + } + + // =========================================== + // getDefaultComponent: return the default composite component + // =========================================== + Component* SCARuntime::getDefaultComponent() + { + logentry(); + + Component* comp = (Component*)defaultComponent.getValue(); + if (comp == NULL && defaultComponentName != "") + { + comp = system->findComponent(defaultComponentName); + if (!comp) + { + string message = "Component \'" + defaultComponentName + "\' not found"; + throwException(SystemConfigurationException, message.c_str()); + } + defaultComponent.setValue(comp); + } + return comp; + } + + // =========================================== + // Set the default composite component + // =========================================== + void SCARuntime::setDefaultComponent(Component* component) + { + logentry(); + + return defaultComponent.setValue(component); + } + + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/SCARuntime.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/SCARuntime.h new file mode 100644 index 0000000000..ff93bd5005 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/SCARuntime.h @@ -0,0 +1,295 @@ +/* + * 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_core_scaruntime_h +#define tuscany_sca_core_scaruntime_h + +#if defined(WIN32) || defined (_WINDOWS) +#include +#else +#include +#endif + +#include +#include +#include +#include + +#include "tuscany/sca/export.h" +#include "tuscany/sca/extension/InterfaceExtension.h" +#include "tuscany/sca/extension/ImplementationExtension.h" +#include "tuscany/sca/extension/ReferenceBindingExtension.h" +#include "tuscany/sca/extension/ServiceBindingExtension.h" +#include "tuscany/sca/model/Composite.h" +#include "tuscany/sca/model/Component.h" +#include "tuscany/sca/util/Library.h" +#include "tuscany/sca/util/ThreadLocal.h" +#include "tuscany/sca/util/Mutex.h" + + +namespace tuscany +{ + namespace sca + { + + /** + * Represents an executing SCA runtime. + */ + class SCARuntime { + public: + + /** + * Constructor + */ + SCA_API SCARuntime(const std::string& installRoot = "", + const std::string& systemRoot = "", const std::string& systemPath = "", + const std::string& baseURI = "", const std::string& defaultComponentName = ""); + + /** + * Destructor + */ + SCA_API virtual ~SCARuntime(); + + /** + * Get the runtime associated with the current thread. + * @return The runtime associated with the current thread. + */ + SCA_API static SCARuntime* getCurrentRuntime(); + + /** + * Get the runtime associated with the current thread. + * @return The runtime associated with the current thread. + */ + SCA_API static void setCurrentRuntime(SCARuntime* runtime); + + /** + * Get the runtime associated with the current process. + * @return The runtime associated with the current process. + */ + SCA_API static SCARuntime* getSharedRuntime(); + + /** + * Initialize the runtime associated with the current process. + * @return The runtime associated with the current process. + */ + SCA_API static SCARuntime* initializeSharedRuntime(const std::string& installRoot = "", + const std::string& systemRoot = "", const std::string& systemPath = "", + const std::string& baseURI = "", const std::string& defaultComponentName = ""); + + /** + * Returns the directory in which the Tuscany runtime has been installed. + */ + SCA_API const std::string& getInstallRoot(); + + /** + * Returns the system root + */ + SCA_API const std::string& getSystemRoot(); + + /** + * Returns the search path for composites. + */ + SCA_API const std::string& getSystemPath(); + + /** + * Returns the default component name. + */ + SCA_API const std::string& getDefaultComponentName(); + + /** + * Returns the default base URI for the system + */ + SCA_API const std::string& getDefaultBaseURI(); + + /** + * Set the current component for the current thread. + * @param component The current component. + */ + SCA_API void setCurrentComponent(tuscany::sca::model::Component* component); + + /** + * Remove the current component from this thread, and return + * to the previous component (if there was one). + * @return The previous component. + */ + SCA_API tuscany::sca::model::Component* unsetCurrentComponent(); + + /** + * Get a pointer to the configured SCA system which this + * SCA runtime represents. + * The rest of the SCA configuration can be navigated from + * the System. + * @return The configured SCA system. + */ + SCA_API tuscany::sca::model::Composite* getSystem(); + + /** + * Return the current component for this thread. + * @return The current component for this thread. + */ + SCA_API tuscany::sca::model::Component* getCurrentComponent(); + + /** + * Get the default component set for the current thread. + * @return The default composite. + */ + SCA_API tuscany::sca::model::Component* getDefaultComponent(); + + /** + * Set the default component for the current thread. + * @return The default component. + */ + SCA_API void setDefaultComponent(tuscany::sca::model::Component* component); + + /** + * Register an implementation extension + */ + SCA_API void registerImplementationExtension(ImplementationExtension* extension); + + /** + * Returns the implementation extension associated with + * the specified qname + */ + SCA_API ImplementationExtension* getImplementationExtension(const std::string& typeQname); + + /** + * Register a reference binding extension + */ + SCA_API void registerReferenceBindingExtension(ReferenceBindingExtension* extension); + + /** + * Returns the reference binding extension associated with + * the specified qname + */ + SCA_API ReferenceBindingExtension* getReferenceBindingExtension(const std::string& typeQname); + + /** + * Register a service binding extension + */ + SCA_API void registerServiceBindingExtension(ServiceBindingExtension* extension); + + /** + * Returns the service binding extension associated with + * the specified qname + */ + SCA_API ServiceBindingExtension* getServiceBindingExtension(const std::string& typeQname); + + /** + * Register an interface extension + */ + SCA_API void registerInterfaceExtension(InterfaceExtension* extension); + + /** + * Returns the interface extension associated with + * the specified qname + */ + SCA_API InterfaceExtension* getInterfaceExtension(const std::string& typeQname); + + private: + + /** + * The runtime associated with the current thread. + */ + static tuscany::sca::util::ThreadLocal current; + + /** + * The runtime shared by all threads of the current process. + */ + static tuscany::sca::util::Mutex sharedRuntimeLock; + static SCARuntime* sharedRuntime; + + /** + * Pointer to the top of the runtime model. + */ + tuscany::sca::model::Composite* system; + + /** + * The installed path of the Tuscany runtime. + */ + std::string installRoot; + + /** + * The path to the system configuration + */ + std::string systemRoot; + + /** + * The search path for composites. + */ + std::string systemPath; + + /** + * The default base URI. + */ + std::string defaultBaseURI; + + /** + * The default CompositeComponent name. + */ + std::string defaultComponentName; + + /** + * Load the SCA configuration from the scdl files (sca.composite, + * *.fragment, etc). + * This will create the runtime model from which the SCA runtime + * will operate. + */ + void loadSystem(); + + /** + * Component stack for the current thread. + */ + typedef std::stack COMPONENT_STACK; + tuscany::sca::util::ThreadLocal componentStack; + + /** + * The default component for the current thread. + */ + tuscany::sca::util::ThreadLocal defaultComponent; + + /** + * Runtime Extensions + */ + typedef std::map IMPLEMENTATION_EXTENSIONS_MAP; + IMPLEMENTATION_EXTENSIONS_MAP implementationExtensions; + + typedef std::map REFERENCE_BINDING_EXTENSIONS_MAP; + REFERENCE_BINDING_EXTENSIONS_MAP referenceBindingExtensions; + + typedef std::map SERVICE_BINDING_EXTENSIONS_MAP; + SERVICE_BINDING_EXTENSIONS_MAP serviceBindingExtensions; + + typedef std::map INTERFACE_EXTENSIONS_MAP; + INTERFACE_EXTENSIONS_MAP interfaceExtensions; + + void loadExtensions(); + + typedef std::list EXTENSIONS_LIST; + EXTENSIONS_LIST extensionsList; + + }; + + } // End namespace sca +} // End namespace tuscany + +typedef void (* TUSCANY_IMPLEMENTATION_EXTENSION_INITIALIZE) (); + +#endif // tuscany_sca_core_scaruntime_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp new file mode 100644 index 0000000000..c54d7648e3 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp @@ -0,0 +1,50 @@ +/* + * 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/core/ServiceProxy.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/Exceptions.h" + +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + // ============================ + // Constructor: Create a proxy + // ============================ + ServiceProxy::ServiceProxy(Reference* reference) + : reference(reference) + { + logentry(); + } + + // ========== + // Destructor + // ========== + ServiceProxy::~ServiceProxy() + { + logentry(); + } + + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/ServiceProxy.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/ServiceProxy.h new file mode 100644 index 0000000000..f1a0309be1 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/ServiceProxy.h @@ -0,0 +1,75 @@ +/* + * 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_core_serviceproxy_h +#define tuscany_sca_core_serviceproxy_h + +#include "tuscany/sca/export.h" +#include "tuscany/sca/model/Component.h" +#include "tuscany/sca/model/Reference.h" + + +namespace tuscany +{ + namespace sca + { + + /** + * Holds a proxy for a given component and reference. + * The proxy which is held inside a ServiceProxy will be specific to the component + * and reference and will have been code generated and be contained in a dll + * created by a developer of an SCA application. + */ + class SCA_API 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. + */ + ServiceProxy(tuscany::sca::model::Reference* reference); + + /** + * Destructor. + */ + virtual ~ServiceProxy(); + + /** + * Returns the reference represented by this proxy. + * @return The Reference represented by this proxy. + */ + tuscany::sca::model::Reference* getReference() const { return reference; }; + + private: + + /** + * The reference represented by this proxy. + */ + tuscany::sca::model::Reference* reference; + + }; + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_core_serviceproxy_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/ServiceWrapper.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/ServiceWrapper.cpp new file mode 100644 index 0000000000..17666a5bb7 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/ServiceWrapper.cpp @@ -0,0 +1,50 @@ +/* + * 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/core/ServiceWrapper.h" +#include "tuscany/sca/util/Logging.h" + +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + + // =========== + // Constructor + // =========== + ServiceWrapper::ServiceWrapper(Service* service) + : service(service) + { + logentry(); + } + + // ========== + // Destructor + // ========== + ServiceWrapper::~ServiceWrapper() + { + logentry(); + } + + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/ServiceWrapper.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/ServiceWrapper.h new file mode 100644 index 0000000000..6a44c57675 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/core/ServiceWrapper.h @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#ifndef tuscany_sca_core_servicewrapper_h +#define tuscany_sca_core_servicewrapper_h + +#include "tuscany/sca/export.h" +#include "tuscany/sca/core/Operation.h" +#include "tuscany/sca/model/Service.h" + + +namespace tuscany +{ + namespace sca + { + + /** + * An abstract class that wraps a component implementation or an external + * service. + */ + class SCA_API ServiceWrapper + { + public: + /** + * Constructor. + * @param target The service wrapper wraps the target of a wire. + */ + ServiceWrapper(tuscany::sca::model::Service* service); + + /** + * Destructor. + */ + virtual ~ServiceWrapper(); + + /** + * Get the service represented by this wrapper. + * @return The service represented by this wrapper. + */ + tuscany::sca::model::Service* getService() const { return service; } + + /** + * All business method calls on the target service are performed through + * this invoke method. + * @param operation The details of the method, paramaters and return value for the + * business method to be called on the target service. + */ + virtual void invoke(Operation& operation) = 0; + + private: + /** + * The target represented by this wrapper. + */ + tuscany::sca::model::Service* service; + + }; + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_core_servicewrapper_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/export.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/export.h new file mode 100644 index 0000000000..79b02fe4cf --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/export.h @@ -0,0 +1,41 @@ +/* + * 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_export_h +#define tuscany_sca_export_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) + +#ifdef SCA_EXPORTS +#define SCA_API __declspec(dllexport) +#else +#define SCA_API __declspec(dllimport) +#endif + +#else +#include +#include +#include +#define SCA_API +#endif + +#endif // tuscany_sca_export_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ImplementationExtension.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ImplementationExtension.cpp new file mode 100644 index 0000000000..a20cf1f6da --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ImplementationExtension.cpp @@ -0,0 +1,46 @@ +/* + * 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/extension/ImplementationExtension.h" +#include "tuscany/sca/util/Logging.h" + +namespace tuscany +{ + namespace sca + { + // =================================================================== + // Constructor for the ImplementationExtension class. + // =================================================================== + ImplementationExtension::ImplementationExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the ImplementationExtension class. + // =================================================================== + ImplementationExtension::~ImplementationExtension() + { + logentry(); + } + + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ImplementationExtension.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ImplementationExtension.h new file mode 100644 index 0000000000..524af2df77 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ImplementationExtension.h @@ -0,0 +1,79 @@ +/* + * 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_implementationextension_h +#define tuscany_sca_extension_implementationextension_h + +#include + +#include "commonj/sdo/SDO.h" + +#include "tuscany/sca/export.h" +#include "tuscany/sca/model/Component.h" +#include "tuscany/sca/model/Service.h" +#include "tuscany/sca/core/ServiceWrapper.h" +#include "tuscany/sca/model/Composite.h" + +namespace tuscany +{ + namespace sca + { + class SCA_API ImplementationExtension + { + public: + /** + * Default constructor + */ + ImplementationExtension(); + + /** + * Destructor + */ + virtual ~ImplementationExtension(); + + /** + * return the name of the extension (e.g. "cpp" "php") + */ + virtual const std::string& getExtensionName() = 0; + + /** + * return the QName of schema elemant for this implementation extension + * (e.g. "http://www.osoa.org/xmlns/sca/1.0#implementation.cpp") + */ + virtual const std::string& getExtensionTypeQName() = 0; + + /** + * Get an implementation from a DataObject representing + * an SCDL implementation element + */ + virtual tuscany::sca::model::ComponentType* getImplementation( + tuscany::sca::model::Composite* composite, + commonj::sdo::DataObjectPtr scdlImplementation) = 0; + + }; + + + } // End namespace sca +} // End namespace tuscany + + +#endif // tuscany_sca_extension_implementationextension_h + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/InterfaceExtension.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/InterfaceExtension.cpp new file mode 100644 index 0000000000..584945344b --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/InterfaceExtension.cpp @@ -0,0 +1,47 @@ +/* + * 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/extension/InterfaceExtension.h" +#include "tuscany/sca/util/Logging.h" + +namespace tuscany +{ + namespace sca + { + // =================================================================== + // Constructor for the InterfaceExtension class. + // =================================================================== + InterfaceExtension::InterfaceExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the InterfaceExtension class. + // =================================================================== + InterfaceExtension::~InterfaceExtension() + { + logentry(); + } + + + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/InterfaceExtension.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/InterfaceExtension.h new file mode 100644 index 0000000000..5329104c77 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/InterfaceExtension.h @@ -0,0 +1,78 @@ +/* + * 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_interfaceextension_h +#define tuscany_sca_extension_interfaceextension_h + +#include + +#include "commonj/sdo/SDO.h" + +#include "tuscany/sca/export.h" +#include "tuscany/sca/model/Interface.h" +#include "tuscany/sca/model/Composite.h" + + +namespace tuscany +{ + namespace sca + { + class SCA_API InterfaceExtension + { + public: + /** + * Default constructor + */ + InterfaceExtension(); + + /** + * Destructor + */ + virtual ~InterfaceExtension(); + + /** + * return the name of the extension (e.g. "cpp" "php") + */ + virtual const std::string& getExtensionName() = 0; + + /** + * return the QName of schema elemant for this interface extension + * (e.g. "http://www.osoa.org/xmlns/sca/1.0#interface.cpp") + */ + virtual const std::string& getExtensionTypeQName() = 0; + + /** + * Get an interface from a DataObject representing an + * SCDL interface + */ + virtual tuscany::sca::model::Interface* getInterface( + tuscany::sca::model::Composite *composite, + commonj::sdo::DataObjectPtr scdlInterface) = 0; + + }; + + + } // End namespace sca +} // End namespace tuscany + + +#endif // tuscany_sca_extension_interfaceextension_h + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.cpp new file mode 100644 index 0000000000..a7f60dcbec --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.cpp @@ -0,0 +1,46 @@ +/* + * 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/extension/ReferenceBindingExtension.h" +#include "tuscany/sca/util/Logging.h" + +namespace tuscany +{ + namespace sca + { + // =================================================================== + // Constructor for the ReferenceBindingExtension class. + // =================================================================== + ReferenceBindingExtension::ReferenceBindingExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the ReferenceBindingExtension class. + // =================================================================== + ReferenceBindingExtension::~ReferenceBindingExtension() + { + logentry(); + } + + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.h new file mode 100644 index 0000000000..c3d1e97c9e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.h @@ -0,0 +1,81 @@ +/* + * 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_referencebindingextension_h +#define tuscany_sca_extension_referencebindingextension_h + +#include + +#include "commonj/sdo/SDO.h" + +#include "tuscany/sca/export.h" +#include "tuscany/sca/model/Component.h" +#include "tuscany/sca/model/Reference.h" +#include "tuscany/sca/core/ServiceWrapper.h" +#include "tuscany/sca/model/Composite.h" +#include "tuscany/sca/model/ReferenceBinding.h" + + +namespace tuscany +{ + namespace sca + { + class SCA_API ReferenceBindingExtension + { + public: + /** + * Default constructor + */ + ReferenceBindingExtension(); + + /** + * Destructor + */ + virtual ~ReferenceBindingExtension(); + + /** + * return the name of the extension (e.g. "cpp" "php") + */ + virtual const std::string& getExtensionName() = 0; + + /** + * return the QName of schema elemant for this binding extension + * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.ws") + */ + virtual const std::string& getExtensionTypeQName() = 0; + + /** + * Get a reference binding from a DataObject representing + * an SCDL binding element + */ + virtual tuscany::sca::model::ReferenceBinding* getReferenceBinding( + tuscany::sca::model::Composite* composite, + tuscany::sca::model::Reference* reference, + commonj::sdo::DataObjectPtr scdlBinding) = 0; + + }; + + + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_extension_referencebindingextension_h + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.cpp new file mode 100644 index 0000000000..f5fe361d36 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.cpp @@ -0,0 +1,46 @@ +/* + * 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/extension/ServiceBindingExtension.h" +#include "tuscany/sca/util/Logging.h" + +namespace tuscany +{ + namespace sca + { + // =================================================================== + // Constructor for the ServiceBindingExtension class. + // =================================================================== + ServiceBindingExtension::ServiceBindingExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the ServiceBindingExtension class. + // =================================================================== + ServiceBindingExtension::~ServiceBindingExtension() + { + logentry(); + } + + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.h new file mode 100644 index 0000000000..d2f7e72ed0 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.h @@ -0,0 +1,81 @@ +/* + * 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_servicebindingextension_h +#define tuscany_sca_extension_servicebindingextension_h + +#include + +#include "commonj/sdo/SDO.h" + +#include "tuscany/sca/export.h" +#include "tuscany/sca/model/Component.h" +#include "tuscany/sca/model/Service.h" +#include "tuscany/sca/core/ServiceWrapper.h" +#include "tuscany/sca/model/Composite.h" +#include "tuscany/sca/model/ServiceBinding.h" + + +namespace tuscany +{ + namespace sca + { + class SCA_API ServiceBindingExtension + { + public: + /** + * Default constructor + */ + ServiceBindingExtension(); + + /** + * Destructor + */ + virtual ~ServiceBindingExtension(); + + /** + * return the name of the extension (e.g. "cpp" "php") + */ + virtual const std::string& getExtensionName() = 0; + + /** + * return the QName of schema elemant for this binding extension + * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.ws") + */ + virtual const std::string& getExtensionTypeQName() = 0; + + /** + * Get a reference binding from a DataObject representing + * an SCDL binding element + */ + virtual tuscany::sca::model::ServiceBinding* getServiceBinding( + tuscany::sca::model::Composite* composite, + tuscany::sca::model::Service* service, + commonj::sdo::DataObjectPtr scdlBinding) = 0; + + }; + + + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_extension_servicebindingextension_h + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Binding.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Binding.cpp new file mode 100644 index 0000000000..a654b9f0f7 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Binding.cpp @@ -0,0 +1,49 @@ +/* + * 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/model/Binding.h" + +using namespace std; + +namespace tuscany +{ + namespace sca + { + + namespace model + { + + // Constructor + Binding::Binding(const string& uri) : uri(uri) + { + logentry(); + } + + // Destructor + Binding::~Binding() + { + logentry(); + } + + } // End namespace model + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Binding.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Binding.h new file mode 100644 index 0000000000..66dc66e853 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Binding.h @@ -0,0 +1,83 @@ +/* + * 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_model_binding_h +#define tuscany_sca_model_binding_h + +#include + +namespace tuscany +{ + namespace sca + { + namespace model + { + /** + * Represents a binding. + * Bindings are used by services and references. References use bindings + * to describe the access mechanism used to call an external service (which can + * be a service provided by another SCA composite). Services use bindings to describe + * the access mechanism that clients (which can be a client from another SCA composite) + * have to use to call the service. + * This interface will typically be extended by binding implementations to allow + * specification of binding/transport specific information. + */ + class Binding + { + + public: + + /** + * Constructor to create a new binding. + * @param uri The binding URI. + */ + SCA_API Binding(const std::string& uri); + + /** + * Destructor. + */ + SCA_API virtual ~Binding(); + + /** + * Returns the binding type + * @return The binding type. + */ + SCA_API virtual std::string getType() = 0; + + /** + * Returns the binding URI. + * @return The binding URI. + */ + SCA_API virtual const std::string& getURI() const { return uri; }; + + private: + + /** + * The binding URI. + */ + std::string uri; + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_binding_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Component.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Component.cpp new file mode 100644 index 0000000000..37bf381811 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Component.cpp @@ -0,0 +1,148 @@ +/* + * 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/util/Logging.h" +#include "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/model/Component.h" +#include "tuscany/sca/model/Service.h" +#include "tuscany/sca/model/Reference.h" +#include "tuscany/sca/model/ServiceType.h" +#include "tuscany/sca/model/ReferenceType.h" +#include "tuscany/sca/model/ComponentType.h" + +using namespace std; +using namespace commonj::sdo; + +namespace tuscany +{ + namespace sca + { + namespace model + { + // Constructor + Component::Component(Composite* composite, const std::string& componentName, ComponentType *componentType) + : name(componentName), composite(composite), type(componentType) + { + logentry(); + loginfo("Component name: %s", name.c_str()); + + // Initialize the component from its component type + componentType->initializeComponent(this); + + } + + Component::~Component() + { + logentry(); + } + + void Component::addService(Service* service) + { + logentry(); + services[service->getType()->getName()] = service; + } + + Service* Component::findService(const string& serviceName) + { + logentry(); + + // If serviceName is empty then return the ONLY service + if (serviceName == "" + && services.size() == 1) + { + return services.begin()->second; + } + else + { + Service* service = services[serviceName]; + if (service == NULL) + { + // A service with an empty name will match any service name + service = services[""]; + } + return service; + } + } + + void Component::addReference(Reference* reference) + { + logentry(); + references[reference->getType()->getName()] = reference; + } + + Reference* Component::findReference(const std::string& referenceName) + { + logentry(); + return references[referenceName]; + } + + DataObjectPtr Component::getProperties() + { + logentry(); + + if (!properties) + { + properties = type->getPropertyDataFactory()->create("org/osoa/sca", "Properties"); + } + return properties; + } + + void Component::setProperty(const string& name, DataObjectPtr value) + { + logentry(); + + DataObjectPtr props = getProperties(); + + // Get the property's type + PropertyPtr propProperty = props->getInstanceProperty(name); + if (!propProperty) { + std::string msg("Property not found: "); + msg += name; + throwException(SystemConfigurationException, msg.c_str()); + } + const Type& propType = propProperty->getType(); + if (propType.isDataType()) + { + if (propProperty->isMany()) + { + DataObjectList& dol = props->getList(*propProperty); + dol.append(value->getCString("")); + } + else + { + props->setCString(*propProperty, value->getCString("")); + } + } + else + { + // Create a new instance of the DO + // iterate over properties setting each one + // for now: + props->setDataObject(*propProperty, value); + } + } + + } // End namespace model + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Component.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Component.h new file mode 100644 index 0000000000..882d79a94c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Component.h @@ -0,0 +1,183 @@ +/* + * 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_model_component_h +#define tuscany_sca_model_component_h + +#include +#include + +#include "commonj/sdo/SDO.h" + +#include "tuscany/sca/export.h" + + +namespace tuscany +{ + namespace sca + { + namespace model + { + + class Composite; + class ComponentType; + class Reference; + class ReferenceType; + class Service; + class ServiceType; + + /** + * A component is a configured instance of an implementation. Components provide + * and consume services. More than one component can use and configure the same + * implementation, where each component configures the implementation differently. + * For example each component may configure a reference of the same implementation + * to consume a different service. + */ + class Component + { + public: + + /** + * Constructor + * @param composite The composite containing the component. + * @param name The name of the component. + */ + SCA_API Component(Composite *composite, const std::string& name, ComponentType *type); + + /** + * Destructor. + */ + SCA_API virtual ~Component(); + + /** + * Returns the name of this component. + * @return the name of this component + */ + SCA_API const std::string& getName() const { return name; } + + /** + * Returns the composite containing this component. + * @return The composite containing this component. + */ + SCA_API Composite* getComposite() const { return composite; } + + /** + * Returns the type of this component. + * @return The type of this component. + */ + SCA_API ComponentType* getType() const { return type; } + + /** + * Add a new service to this component. + * @param service The service to add. + */ + SCA_API void addService(Service* service); + + /** + * Find an existing service on this component. + * @param serviceName The name of the service to find. + * If the serviceName is the zero length string then if there is + * only one service it will be returned. + * @return The found service, or 0 if not found. + */ + SCA_API Service* findService(const std::string& serviceName); + + /** + * Add a new reference to this component. + * @param reference The reference to add. + */ + SCA_API void addReference(Reference* reference); + + /** + * Find an existing reference on this component. + * @param referenceName The name of the reference to find. + * @return The found reference, or 0 if not found. + */ + SCA_API Reference* findReference(const std::string& referenceName); + + /** + * Returns all the services defined on this component. + * @return All the services defined on this component. + */ + typedef std::map SERVICE_MAP; + SCA_API const SERVICE_MAP& getServices() const { return services; }; + + /** + * Returns all the references defined on this component. + * @return All the references defined on this component. + */ + typedef std::map REFERENCE_MAP; + SCA_API const REFERENCE_MAP& getReferences() const { return references; }; + + /** + * Set the value of a property defined on this component. The values + * will usually come from a component declaration in a composite file. + * @param name The name of the property. + * @param value The value of the property. + */ + SCA_API void setProperty(const std::string& name, commonj::sdo::DataObjectPtr value); + + /** + * Returns a data object from which all the properties of the component + * and their values can be accessed. + * @return A data object holding the property values. + */ + SCA_API commonj::sdo::DataObjectPtr getProperties(); + + private: + + /** + * Name of the component. + */ + std::string name; + + /** + * Composite containing the component. + */ + Composite* composite; + + /** + * Type of the component. + */ + ComponentType* type; + + /** + * Map of all the services defined on this component. + */ + SERVICE_MAP services; + + /** + * Map of all the references defined on this component. + */ + REFERENCE_MAP references; + + /** + * The properties and their values for this component. + */ + commonj::sdo::DataObjectPtr properties; + + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_component_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ComponentType.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ComponentType.cpp new file mode 100644 index 0000000000..20e70ede20 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ComponentType.cpp @@ -0,0 +1,294 @@ +/* + * 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/util/Logging.h" +#include "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/model/ComponentType.h" +#include "tuscany/sca/model/ServiceType.h" +#include "tuscany/sca/model/ReferenceType.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" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::util; + +namespace tuscany +{ + namespace sca + { + namespace model + { + + // Constructor + ComponentType::ComponentType(Composite* composite, const string& name) + : composite(composite), name(name) + { + logentry(); + } + + // Destructor + ComponentType::~ComponentType() + { + logentry(); + } + + void ComponentType::addServiceType(ServiceType* serviceType) + { + logentry(); + serviceTypes[serviceType->getName()] = serviceType; + } + + ServiceType* ComponentType::findServiceType(const string& serviceName) + { + logentry(); + + // If serviceName is empty then return the ONLY service + if (serviceName == "" + && serviceTypes.size() == 1) + { + return serviceTypes.begin()->second; + } + else + { + return serviceTypes[serviceName]; + } + } + + void ComponentType::addReferenceType(ReferenceType* referenceType) + { + logentry(); + + referenceTypes[referenceType->getName()] = referenceType; + } + + ReferenceType* ComponentType::findReferenceType(const string& referenceName) + { + logentry(); + + return referenceTypes[referenceName]; + } + + void ComponentType::addPropertyType(const string& name, + const string& type, + bool many, + DataObjectPtr* defaultValue) + { + logentry(); + + // Create a Type in the Properties dataFactory + DataFactoryPtr factory = getPropertyDataFactory(); + + string typeUri, typeName; + Utils::tokeniseQName(type, typeUri, typeName); + + if (typeUri == "http://www.w3.org/2001/XMLSchema") + { + typeUri = "commonj.sdo"; + if (typeName == "string") + { + typeName = "String"; + } + else if (typeName == "anyType") + { + typeName = "DataObject"; + } + else if (typeName == "int") + { + typeName = "Int"; + } + else if (typeName == "integer") + { + typeName = "Integer"; + } + else if (typeName == "negativeInteger") + { + typeName = "Integer"; + } + else if (typeName == "nonNegativeInteger") + { + typeName = "Integer"; + } + else if (typeName == "positiveInteger") + { + typeName = "Integer"; + } + else if (typeName == "nonPositiveInteger") + { + typeName = "Integer"; + } + else if (typeName == "unsignedLong") + { + typeName = "Integer"; + } + else if (typeName == "unsignedShort") + { + typeName = "Integer"; + } + else if (typeName == "unsignedInt") + { + typeName = "Long"; + } + else if (typeName == "long") + { + typeName = "Long"; + } + else if (typeName == "double") + { + typeName = "Double"; + } + else if (typeName == "short") + { + typeName = "Short"; + } + else if (typeName == "unsignedByte") + { + typeName = "Short"; + } + else if (typeName == "float") + { + typeName = "Float"; + } + else if (typeName == "boolean") + { + typeName = "Boolean"; + } + else if (typeName == "byte") + { + typeName = "Byte"; + } + else if (typeName == "base64Binary") + { + typeName = "Bytes"; + } + else if (typeName == "hexBinary") + { + typeName = "Bytes"; + } + else if (typeName == "anyURI") + { + typeName = "URI"; + } + else if (typeName == "QName") + { + typeName = "URI"; + } + else + { + // Default unknown xs: types to string?? + typeName = "String"; + } + } + else + { + // It's not an XML type + } + + factory->addPropertyToType( + "org/osoa/sca", + "Properties", + name.c_str(), + typeUri.c_str(), + typeName.c_str(), + many, + false, + true); + + // Set the default for a dataType + if (defaultValue!=NULL) + { + try + { + const Type& propType = factory->getType(typeUri.c_str(), typeName.c_str()); + if (propType.isDataType()) + { + factory->setDefault("org/osoa/sca", "Properties", + name.c_str(), + (char*)(*defaultValue)->getCString("")); + } + } + catch (SDOTypeNotFoundException&) + { + } + } + } + + const Property* ComponentType::findPropertyType(const string& propertyName) + { + logentry(); + const Property* property = NULL; + + DataFactoryPtr dataFactory = getPropertyDataFactory(); + const Type& propertiesType = dataFactory->getType("org/osoa/sca", "Properties"); + + try + { + const Property& prop = propertiesType.getProperty(propertyName); + property = ∝ + } + catch(SDOPropertyNotFoundException) + { + loginfo("Property named %s not found, returning null", propertyName.c_str()); + } + return property; + } + + DataFactoryPtr ComponentType::getPropertyDataFactory() + { + logentry(); + + if (!propertyFactory) + { + propertyFactory = DataFactory::getDataFactory(); + // Add the root type + propertyFactory->addType("org/osoa/sca", "Properties", false, false, false, false); + } + return propertyFactory; + } + + void ComponentType::initializeComponent(Component* component) + { + logentry(); + + for (SERVICETYPE_MAP::iterator iter = serviceTypes.begin(); + iter != serviceTypes.end(); + iter++) + { + Service* service = new Service(component, iter->second); + component->addService(service); + } + for (REFERENCETYPE_MAP::iterator refiter = referenceTypes.begin(); + refiter != referenceTypes.end(); + refiter++) + { + Reference* reference = new Reference(component, refiter->second); + component->addReference(reference); + } + } + + } // End namespace model + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ComponentType.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ComponentType.h new file mode 100644 index 0000000000..86f17890e9 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ComponentType.h @@ -0,0 +1,186 @@ +/* + * 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_model_componenttype_h +#define tuscany_sca_model_componenttype_h + +#include +#include + +#include "commonj/sdo/SDO.h" + +#include "tuscany/sca/model/ReferenceType.h" + +namespace tuscany +{ + namespace sca + { + namespace model + { + class ServiceType; + class ReferenceType; + class Interface; + class Component; + class Composite; + + /** + * Component type represents the configurable aspects of an implementation. + * A component type consists of services that are offered, references to other services + * that can be wired and properties that can be set. The settable properties and the settable + * references to services are configured by a component which uses the implementation. + * The component type can be thought of as the contract which is honoured by an implementation. + */ + class ComponentType + { + public: + + /** + * Constructor + */ + SCA_API ComponentType(Composite* composite, const std::string& name); + + /** + * Destructor. + */ + SCA_API virtual ~ComponentType(); + + /** + * Returns the name of the component type + */ + SCA_API const std::string& getName() const { return name; }; + + /** + * Returns the composite containing this component type + */ + SCA_API Composite* getComposite() const { return composite; }; + + /** + * Add a new service type to this component type. + * @param serviceType The service type to add. + */ + SCA_API virtual void addServiceType(ServiceType* serviceType); + + /** + * Find an existing service type on this component type. + * @param serviceName The name of the service type to find. + * If the serviceName is the zero length string then if there is + * only one service type it will be returned. + * @return The found service, or 0 if not found. + */ + SCA_API virtual ServiceType* findServiceType(const std::string& serviceName); + + /** + * Add a new reference type to this component type. + * @param referenceType The reference type to add. + */ + SCA_API virtual void addReferenceType(ReferenceType* referenceType); + + /** + * Find an existing reference type on this component type. + * @param referenceName The name of the reference type to find. + * @return The found reference type, or 0 if not found. + */ + SCA_API virtual ReferenceType* findReferenceType(const std::string& referenceName); + + /** + * Returns the service types defined on this component. + * @return The service types defined on this component. + */ + typedef std::map SERVICETYPE_MAP; + SERVICETYPE_MAP getServiceTypes() const { return serviceTypes; }; + + /** + * Returns the reference types defined on this component. + * @return The reference types defined on this component. + */ + typedef std::map REFERENCETYPE_MAP; + REFERENCETYPE_MAP getReferenceTypes() const { return referenceTypes; }; + + /** + * Add a new property type to this component type. Property types are added + * one at a time. The property definitions usually come from a component type file. + * @param name The name of the property type. + * @param type The full name of the property data type (including uri and local name). + * @param many True if this is a many valued property. + * @param defaultValue The default value if the property does not have a + * value set. + */ + SCA_API virtual void addPropertyType(const std::string& name, + const std::string& type, + bool many, + commonj::sdo::DataObjectPtr* defaultValue); + + /** + * Find an existing property type on this component type. + * @param propertyName The name of the property type to find. + * @return The found property, or 0 if not found. + */ + SCA_API virtual const commonj::sdo::Property* findPropertyType(const std::string& propertyName); + + /** + * Return the SDO data factory which has the types of the properties defined + * in this component type. + * @return The data factory. + */ + SCA_API virtual commonj::sdo::DataFactoryPtr getPropertyDataFactory(); + + /** + * Initialize a component of this type. + * @param component The component to initialize. + */ + SCA_API virtual void initializeComponent(Component* component); + + private: + + /** + * The name of the component type + */ + std::string name; + + /** + * The composite containing this component type + */ + Composite* composite; + + /** + * Map of all the service types defined on this component. + */ + SERVICETYPE_MAP serviceTypes; + + /** + * Map of all the reference types defined on this component. + */ + REFERENCETYPE_MAP referenceTypes; + + /** + * SDO data factory which has all the types of the properties defined in + * this component type + */ + commonj::sdo::DataFactoryPtr propertyFactory; + + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_componenttype_h + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Composite.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Composite.cpp new file mode 100644 index 0000000000..6456b0cede --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Composite.cpp @@ -0,0 +1,427 @@ +/* + * 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/model/Composite.h" +#include "tuscany/sca/model/Component.h" +#include "tuscany/sca/model/CompositeReference.h" +#include "tuscany/sca/model/CompositeReferenceBinding.h" +#include "tuscany/sca/model/CompositeService.h" +#include "tuscany/sca/model/ServiceType.h" +#include "tuscany/sca/model/ReferenceType.h" +#include "tuscany/sca/model/Wire.h" +#include "tuscany/sca/model/WSDLDefinition.h" +#include "tuscany/sca/model/Service.h" +#include "tuscany/sca/model/Reference.h" +#include "tuscany/sca/model/ServiceBinding.h" +#include "tuscany/sca/model/ReferenceBinding.h" + +using namespace std; +using namespace tuscany::sca::util; + +namespace tuscany +{ + namespace sca + { + + namespace model + { + + // Constructor + Composite::Composite(const string& name, const string& root) + : ComponentType(0, name), root(root) + { + logentry(); + } + +#if defined(COPY_COMPOSITES_ON_INSTANCIATION) + // Constructor + Composite::Composite(Composite* templateComposite, Composite* containerComposite) + : ComponentType(containerComposite, templateComposite->getName()), root(templateComposite->root) + { + logentry(); + components = templateComposite->components; + includes = templateComposite->includes; + wires = templateComposite->wires; + wsdlDefinitions = templateComposite->wsdlDefinitions; + // Copy all services from the cloned template + SERVICETYPE_MAP serviceTypeMap = templateComposite->getServiceTypes(); + for (SERVICETYPE_MAP::iterator serviter = serviceTypeMap.begin(); + serviter != serviceTypeMap.end(); + ++serviter) + { + addServiceType(serviter->second); + } + // Copy all references from the cloned template + REFERENCETYPE_MAP referenceTypeMap = templateComposite->getReferenceTypes(); + for (REFERENCETYPE_MAP::iterator refiter = referenceTypeMap.begin(); + refiter != referenceTypeMap.end(); + refiter++) + { + addReferenceType(refiter->second); + } + // Copy the dataFactory from the cloned template + commonj::sdo::DataFactoryPtr propertyFactory = getPropertyDataFactory(); + commonj::sdo::DataFactoryPtr dataFactory = templateComposite->getPropertyDataFactory(); + commonj::sdo::TypeList typeList = dataFactory->getTypes(); + for (int typeiter1=0; + typeiter1 < typeList.size(); + ++typeiter1) + { + const commonj::sdo::Type& type = typeList[typeiter1]; + propertyFactory->addType( + type.getURI(), + type.getName(), + type.isSequencedType(), + type.isOpenType(), + type.isAbstractType(), + type.isDataType()); + } + for (int typeiter2=0; + typeiter2 < typeList.size(); + ++typeiter2) + { + const commonj::sdo::Type& type = typeList[typeiter2]; + commonj::sdo::PropertyList propertyList = type.getProperties(); + for (int propertyiter=0; + propertyiter < propertyList.size(); + ++propertyiter) + { + const commonj::sdo::Property& property = propertyList[propertyiter]; + propertyFactory->addPropertyToType( + type.getURI(), + type.getName(), + property.getName(), + property.getType().getURI(), + property.getType().getName(), + property.isMany(), + property.isReadOnly(), + property.isContainment()); + } + for (int propertyiter=0; + propertyiter < propertyList.size(); + ++propertyiter) + { + const commonj::sdo::Property& property = propertyList[propertyiter]; + for (int aliasiter = 0; + aliasiter < property.getAliasCount(); + ++aliasiter) + { + propertyFactory->setAlias( + type.getURI(), + type.getName(), + property.getName(), + property.getAlias(aliasiter)); + } + } + for (int aliasiter = 0; + aliasiter < type.getAliasCount(); + ++aliasiter) + { + propertyFactory->setAlias( + type.getURI(), + type.getName(), + type.getAlias(aliasiter)); + } + if ( type.getBaseType() ) + { + propertyFactory->setBaseType( + type.getURI(), + type.getName(), + type.getBaseType()->getURI(), + type.getBaseType()->getName(), + false); //TODO: Where do we know if the cloned Type is a restriction ??? + } + } + + } +#endif + + // Destructor + Composite::~Composite() + { + logentry(); + } + + void Composite::addComponent(Component* component) + { + logentry(); + components[component->getName()] = component; + } + + void Composite::addCompositeReference(CompositeReference* compositeReference) + { + logentry(); + components[compositeReference->getName()] = compositeReference; + + // Create a reference type describing the composite reference + ServiceType* serviceType = compositeReference->getType()->findServiceType(""); + ReferenceType* referenceType = new ReferenceType( + this, compositeReference->getName(), + serviceType->getInterface(), + serviceType->getCallbackInterface(), + compositeReference->getMultiplicity()); + addReferenceType(referenceType); + } + + void Composite::addCompositeService(CompositeService* compositeService) + { + logentry(); + components[compositeService->getName()] = compositeService; + + // Create a service type describing the composite service + ReferenceType* referenceType = compositeService->getType()->findReferenceType(""); + ServiceType* serviceType = new ServiceType( + this, compositeService->getName(), + referenceType->getInterface(), + referenceType->getCallbackInterface()); + addServiceType(serviceType); + } + + void Composite::initializeComponent(Component* component) + { + ComponentType::initializeComponent(component); + + // Create 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; + //CompositeServiceBinding* binding = new CompositeServiceBinding(service); + //service->setBinding(binding); + iter++; + } + + // Create bindings for all the references + const Component::REFERENCE_MAP& references = component->getReferences(); + Component::REFERENCE_MAP::const_iterator refiter = references.begin(); + for (unsigned int ri=0; ri< references.size(); ri++) + { + Reference *reference = refiter->second; + CompositeReferenceBinding* binding = new CompositeReferenceBinding(reference); + reference->setBinding(binding); + refiter++; + } + } + + Component* Composite::findComponent(const std::string& name) + { + logentry(); + Component* component = components[name]; + return component; + } + + std::list Composite::getComponents() const + { + logentry(); + + std::list componentList; + COMPONENT_MAP::const_iterator iter = components.begin(); + COMPONENT_MAP::const_iterator iterEnd = components.end(); + + for( ; iter != iterEnd; ++iter ) + { + componentList.push_back( iter->first ); + } + + return componentList; + } + + Service* Composite::findComponentService(const std::string& name) + { + logentry(); + + Service* service = 0; + + string componentName; + string serviceName; + Utils::tokeniseUri(name, componentName, serviceName); + + // Locate the component + Component* component = findComponent(componentName); + if (component) + { + // Locate the service + service = component->findService(serviceName); + } + return service; + } + + void Composite::addWire(const std::string& source, const std::string& target) + { + logentry(); + Wire* wire=new Wire(source, target); + wires.push_back(wire); + } + + void Composite::addInclude(Composite* composite) + { + logentry(); + includes[composite->getName()] = composite; + + for (COMPONENT_MAP::iterator iter = composite->components.begin(); + iter != composite->components.end(); + iter++) + { + components[iter->first] = iter->second; + } + } + + void Composite::resolveWires() + { + logentry(); + + for (WIRES::iterator iter = wires.begin(); + iter != wires.end(); + iter++) + { + Wire* wire = *iter; + + // Find the source component and reference + Component* component = findComponent(wire->getSourceComponent()); + Reference* reference; + if (component) + { + reference = component->findReference(wire->getSourceReference()); + if (!reference) + { + logerror("Wire source reference %s not found", wire->getSourceReference().c_str()); + } + } + else + { + reference = NULL; + logerror("Wire source %s not found", wire->getSourceComponent().c_str()); + } + + // Configure the reference binding with the wire target URI + if (reference) + { + reference->getBinding()->configure(wire->getTarget()); + } + } + } + + void Composite::addWSDLDefinition(commonj::sdo::DataObjectPtr wsdlModel) + { + logentry(); + WSDLDefinition* wsdlDefinition = new WSDLDefinition(wsdlModel); + + WSDLDefinition* existingDefinition = wsdlDefinitions[wsdlDefinition->getNamespace()]; + if (existingDefinition == NULL) + { + wsdlDefinitions[wsdlDefinition->getNamespace()] = wsdlDefinition; + } + else{ + existingDefinition->addWSDLModel(wsdlModel); + } + } + + WSDLDefinition* Composite::findWSDLDefinition(const std::string& wsdlNamespace ) + { + logentry(); + // remember the map operator[] inserts a blank object if key not found + WSDL_MAP::iterator iter = wsdlDefinitions.find( wsdlNamespace ); + if( iter == wsdlDefinitions.end() ) + { + return NULL; + } + + return iter->second; + } + + std::list Composite::getWSDLNamespaces() const + { + logentry(); + std::list namespaceList; + WSDL_MAP::const_iterator iter = wsdlDefinitions.begin(); + WSDL_MAP::const_iterator iterEnd = wsdlDefinitions.end(); + + for( ; iter != iterEnd; ++iter ) + { + namespaceList.push_back( iter->first ); + } + + return namespaceList; + } + + Composite* Composite::findIncludedComposite(const std::string& compositeName) + { + logentry(); + + // remember the map operator[] inserts a blank object if key not found + INCLUDES::iterator iter = includes.find( compositeName ); + if( iter == includes.end() ) + { + return NULL; + } + + return iter->second; + } + + std::list Composite::getIncludedComposites() const + { + logentry(); + std::list compositeList; + INCLUDES::const_iterator iter = includes.begin(); + INCLUDES::const_iterator iterEnd = includes.end(); + + for( ; iter != iterEnd; ++iter ) + { + compositeList.push_back( iter->first ); + } + + return compositeList; + } + + commonj::sdo::XSDHelperPtr Composite::getXSDHelper() + { + logentry(); + if (xsdHelper == 0) + { + xsdHelper = commonj::sdo::HelperProvider::getXSDHelper(); + } + + return xsdHelper; + } + + commonj::sdo::XMLHelperPtr Composite::getXMLHelper() + { + logentry(); + if (xmlHelper == 0) + { + xmlHelper = commonj::sdo::HelperProvider::getXMLHelper(getXSDHelper()->getDataFactory()); + } + + return xmlHelper; + } + + commonj::sdo::DataFactoryPtr Composite::getDataFactory() + { + logentry(); + return getXSDHelper()->getDataFactory(); + } + + } // End namespace model + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Composite.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Composite.h new file mode 100644 index 0000000000..40626feb14 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Composite.h @@ -0,0 +1,250 @@ +/* + * 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_model_composite_h +#define tuscany_sca_model_composite_h + +#include +#include +#include + +#include "commonj/sdo/SDO.h" + +#include "tuscany/sca/export.h" +#include "tuscany/sca/model/ComponentType.h" + +#define COPY_COMPOSITES_ON_INSTANCIATION + +namespace tuscany +{ + namespace sca + { + + namespace model + { + class Component; + class ComponentType; + class CompositeReference; + class CompositeService; + class Service; + class WSDLDefinition; + class Wire; + + /** + * Represents a composite. + * A composite is used to assemble SCA elements in logical groupings. + * It is the basic unit of composition within an SCA System. An SCA composite contains a + * set of components, services, references and the wires that interconnect them, plus a set + * of properties which can be used to configure components. + */ + class Composite : public ComponentType + { + public: + + /** + * Constructor. + * @param name the name of the composite. + * @param root the root of the composite in the file system. + */ + SCA_API Composite(const std::string& name, const std::string& root); + +#if defined(COPY_COMPOSITES_ON_INSTANCIATION) + /** + * Constructor to create a composite representing an instance by copying a template. + * @param templateComposite the template copmosite that will be copied. + * @param containerComposite the container of the instance. + */ + SCA_API Composite(Composite* templateComposite, Composite* containerComposite); +#endif + + /** + * Destructor. + */ + SCA_API virtual ~Composite(); + + /** + * Returns the root directory of the composite. + * @return The root of the composite in the file system. + */ + SCA_API const std::string& getRoot() const { return root; } + + /** + * Add a new component to the composite. + * @param component The component to add. + */ + SCA_API void addComponent(Component* component); + + /** + * Add a new composite reference to the composite. + * @param compositeReference The composite reference to add. + */ + SCA_API void addCompositeReference(CompositeReference* compositeReference); + + /** + * Add a new composite service to the composite. + * @param compositeService The composite service to add. + */ + SCA_API void addCompositeService(CompositeService* compositeService); + + /** + * Add/include a composite in this composite. + * @param composite The composite included in this composite. + */ + SCA_API void addInclude(Composite* composite); + + /** + * Add a wire to the model. + * @param source The source location. Either the source component and + * reference (optional), or an entry point. + * @param target The target location. Either the target component and + * service (optional), or an external service. + */ + SCA_API void addWire(const std::string& source, const std::string& target); + + /** + * Find a component by name. + * @param componentName The name of the component to be found. + * @return The component that was found, or 0 if not found. + */ + SCA_API Component* findComponent(const std::string& componentName); + + /** + * Get all included components + * @return A list of Component name strings + */ + SCA_API std::list getComponents() const; + + /** + * Find a component and service by name. + * @param componentServiceName A string of the form + * "componentName"/"serviceName" where the service name is optional + * if there is only one service on the component. + * @return The Service that was found, or 0 if not found. + */ + SCA_API Service* findComponentService(const std::string& componentServiceName); + + /** + * Add a WSDL definition to the composite. + * @param wsdlModel A data object holding all the information about + * the WSDL definition from a WSDL file. + */ + SCA_API void addWSDLDefinition(commonj::sdo::DataObjectPtr wsdlModel); + + /** + * Find a WSDL definition by target namespace. + * @param wsdlNamespace The namespace of the WSDL definitions to find. + */ + SCA_API WSDLDefinition* findWSDLDefinition(const std::string& wsdlNamespace); + + /** + * Get all loaded WSDL namespaces + * @return A list of strings, each of which is a different project namespace + */ + SCA_API std::list getWSDLNamespaces() const; + + /** + * Find an Included Composite by its name + * @param compositeName The name of the included composite to find. + */ + SCA_API Composite* findIncludedComposite(const std::string& compositeName); + + /** + * Get all included composites + * @return A list of Composite name strings + */ + SCA_API std::list getIncludedComposites() const; + + /** + * Initialize a component of this type. + * @param component The component to initialize. + */ + virtual void initializeComponent(Component* component); + + /** + * Return a cached SDO XSDHelper. + */ + SCA_API commonj::sdo::XSDHelperPtr getXSDHelper(void); + + /** + * Return a cached SDO XMLHelper. + */ + SCA_API commonj::sdo::XMLHelperPtr getXMLHelper(void); + + /** + * Return a data factory which has all the types defined in XSDs and + * WSDL files configured for this composite. + * @return The data factory for this composite. + */ + SCA_API commonj::sdo::DataFactoryPtr getDataFactory(void); + + /** + * Work through the list of wires and connect the source and target uris. + */ + SCA_API void resolveWires(); + + private: + + /** + * Directory of the root of the composite. + */ + std::string root; + + /** + * Cached XSDHelper. + */ + commonj::sdo::XSDHelperPtr xsdHelper; + + /** + * Cached XMLHelper. + */ + commonj::sdo::XMLHelperPtr xmlHelper; + + /** + * Map (by name) of all the components in this composite. + */ + typedef std::map COMPONENT_MAP; + COMPONENT_MAP components; + + /** + * Map of all the composites included by this composite. + * Map the Composite name to the Composite + */ + typedef std::map INCLUDES; + INCLUDES includes; + + /** + * Vector of all the wires in this composite. + */ + typedef std::vector WIRES; + WIRES wires; + + /** + * Map by namespace of all the wsdl definitions in this composite. + */ + typedef std::map WSDL_MAP; + WSDL_MAP wsdlDefinitions; + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_composite_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeReference.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeReference.cpp new file mode 100644 index 0000000000..be0bf71a17 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeReference.cpp @@ -0,0 +1,68 @@ +/* + * 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/model/CompositeReference.h" +#include "tuscany/sca/model/ReferenceType.h" +#include "tuscany/sca/model/Composite.h" +#include "tuscany/sca/model/Component.h" +#include "tuscany/sca/model/ComponentType.h" +#include "tuscany/sca/model/ServiceType.h" +#include "tuscany/sca/model/Service.h" + +using namespace std; + +namespace tuscany +{ + namespace sca + { + + namespace model + { + + // Constructor + CompositeReference::CompositeReference(Composite* composite, const string& name, + Interface* intface, Interface* callbackInterface, bool conversational, ReferenceType::Multiplicity multiplicity) : + Component(composite, name, new ComponentType(composite, name)) + { + logentry(); + loginfo("Composite reference name: %s", name.c_str()); + + // Initialize the component type, service type and service + ComponentType* componentType = getType(); + ServiceType* serviceType = new ServiceType( + componentType, "", intface, callbackInterface); + componentType->addServiceType(serviceType); + + service = new Service(this, serviceType); + addService(service); + } + + // Destructor + CompositeReference::~CompositeReference() + { + logentry(); + } + + } // End namespace model + + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeReference.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeReference.h new file mode 100644 index 0000000000..f5e2166e06 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeReference.h @@ -0,0 +1,93 @@ +/* + * 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_model_compositereferencetype_h +#define tuscany_sca_model_compositereferencetype_h + +#include + +#include "tuscany/sca/model/Component.h" +#include "tuscany/sca/model/ReferenceType.h" + +namespace tuscany +{ + namespace sca + { + + namespace model + { + class ComponentType; + class Composite; + class Interface; + class Service; + + /** + * Represents a reference in a composite. + * Composite references represent dependencies that the composite has on services provided elsewhere, + * outside the composite. + */ + class CompositeReference : public Component + { + public: + + /** + * Constructor. + * @param name The name of the reference. + */ + SCA_API CompositeReference(Composite* composite, const std::string& name, + Interface* intface, Interface* callbackInterface, bool conversational, ReferenceType::Multiplicity multiplicity); + + /** + * Destructor. + */ + SCA_API virtual ~CompositeReference(); + + /** + * Returns the service exposed by this composite reference. + * @return The service exposed by this composite reference. + */ + SCA_API Service* getService() const { return service; }; + + /** + * Returns the multiplicity of this composite reference + * @return The multiplicity of the composite reference + */ + SCA_API ReferenceType::Multiplicity getMultiplicity() { return multiplicity; } + + private: + + /** + * The service exposed by this composite reference. + */ + Service* service; + + /** + * The multiplicity of this reference + */ + ReferenceType::Multiplicity multiplicity; + + }; + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_compositereferencetype_h + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.cpp new file mode 100644 index 0000000000..24191285c5 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.cpp @@ -0,0 +1,62 @@ +/* + * 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/model/CompositeReferenceBinding.h" + +using namespace std; + +namespace tuscany +{ + namespace sca + { + namespace model + { + + // Constructor + CompositeReferenceBinding::CompositeReferenceBinding(Reference* reference) + : ReferenceBinding(reference, ""), uri("") + { + } + + // Destructor + CompositeReferenceBinding::~CompositeReferenceBinding() + { + } + + void CompositeReferenceBinding::configure(ServiceBinding *binding) + { + setTargetServiceBinding(binding); + } + + ServiceProxy* CompositeReferenceBinding::getServiceProxy() + { + return serviceProxy; + } + + void CompositeReferenceBinding::configure(const string& uri) + { + this->uri = uri; + } + + } // End namespace model + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.h new file mode 100644 index 0000000000..5c64c3b657 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.h @@ -0,0 +1,98 @@ +/* + * 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_model_compositereferencebinding_h +#define tuscany_sca_model_compositereferencebinding_h + +#include + +#include "tuscany/sca/model/ReferenceBinding.h" + +namespace tuscany +{ + namespace sca + { + namespace model + { + /** + * A default composite reference binding + */ + class CompositeReferenceBinding : public ReferenceBinding + { + public: + + /** + * Constructor. + * @param uri The uri of the binding. + */ + SCA_API CompositeReferenceBinding(Reference* reference); + + /** + * Destructor. + */ + SCA_API virtual ~CompositeReferenceBinding(); + + /** + * Returns the type of binding. + */ + virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#CompositeServiceBinding"; }; + + /** + * Configure this binding from a service binding. + */ + SCA_API virtual void configure(ServiceBinding* serviceBinding); + + /** + * Configure this binding from a URI. + */ + SCA_API virtual void configure(const std::string& uri); + + /** + * Create a proxy representing the reference to the + * client component. + */ + SCA_API virtual ServiceProxy* getServiceProxy(); + + /** + * Returns the binding URI. + * @return The binding URI. + */ + SCA_API virtual const std::string& getURI() const { return uri; }; + + private: + + /** + * The proxy representing the reference to the client + * component. + */ + ServiceProxy* serviceProxy; + + /** + * The binding URI + */ + std::string uri; + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_compositereferencebinding_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeService.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeService.cpp new file mode 100644 index 0000000000..e06dc548c1 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeService.cpp @@ -0,0 +1,70 @@ +/* + * 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/model/CompositeService.h" +#include "tuscany/sca/model/ServiceType.h" +#include "tuscany/sca/model/Composite.h" +#include "tuscany/sca/model/Component.h" +#include "tuscany/sca/model/ComponentType.h" +#include "tuscany/sca/model/Reference.h" +#include "tuscany/sca/model/Service.h" +#include "tuscany/sca/model/ReferenceType.h" +#include "tuscany/sca/model/ServiceType.h" + +using namespace std; + +namespace tuscany +{ + namespace sca + { + + namespace model + { + + // Constructor + CompositeService::CompositeService(Composite* composite, const string& name, + Interface* intface, Interface* callbackInterface, bool conversational, + ReferenceType::Multiplicity multiplicity) : + Component(composite, name, new ComponentType(composite, name)) + { + logentry(); + loginfo("Composite service name: %s", name.c_str()); + + // Initialize the component type, reference type and reference + ComponentType* componentType = getType(); + ReferenceType* referenceType = new ReferenceType( + componentType, "", intface, callbackInterface, multiplicity); + componentType->addReferenceType(referenceType); + + reference = new Reference(this, referenceType); + addReference(reference); + } + + // Destructor + CompositeService::~CompositeService() + { + logentry(); + } + + } // End namespace model + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeService.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeService.h new file mode 100644 index 0000000000..8c626ccac3 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/CompositeService.h @@ -0,0 +1,83 @@ +/* + * 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_model_compositeservicetype_h +#define tuscany_sca_model_compositeservicetype_h + +#include + +#include "tuscany/sca/model/Component.h" +#include "tuscany/sca/model/ReferenceType.h" + +namespace tuscany +{ + namespace sca + { + namespace model + { + class Composite; + class Component; + class Interface; + class Reference; + + /** + * Represents a service in a composite. + * Composite services define the public services provided by the composite, which can be + * accessed from outside the composite. + */ + class CompositeService : public Component + { + + public: + + /** + * Constructor. + * @param componentType The component type on which this service is defined. + * @param name The name of the service. + */ + SCA_API CompositeService(Composite* composite, const std::string& name, + Interface* intface, Interface* callbackInterface, bool conversational, ReferenceType::Multiplicity multiplicity); + + /** + * Destructor. + */ + SCA_API virtual ~CompositeService(); + + /** + * Returns the reference used by this composite service. + * @return The reference used by this composite service. + */ + SCA_API Reference* getReference() const { return reference; }; + + private: + + /** + * The reference used by this composite service. + */ + Reference* reference; + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_compositeservicetype_h + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Contract.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Contract.cpp new file mode 100644 index 0000000000..99a1d04dc2 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Contract.cpp @@ -0,0 +1,49 @@ +/* + * 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/model/Contract.h" + + +namespace tuscany +{ + namespace sca + { + + namespace model + { + + // Constructor + Contract::Contract(Interface *intface, Interface* callbackInterface) : + iface(intface), callbackInterface(callbackInterface) + { + logentry(); + } + + // Destructor + Contract::~Contract() + { + logentry(); + } + + } // End namespace model + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Contract.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Contract.h new file mode 100644 index 0000000000..e1d526f842 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Contract.h @@ -0,0 +1,85 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#ifndef tuscany_sca_model_contract_h +#define tuscany_sca_model_contract_h + +#include "tuscany/sca/model/Interface.h" + +namespace tuscany +{ + namespace sca + { + namespace model + { + /** + * Interface contracts define one or more business functions. These business functions are + * provided by services and are used by references. Services are defined by the interface which + * they implement. + * This interface will typically be extended to support concrete interface type systems, such as + * CPP classes, Java interfaces, WSDL 1.1 portTypes and WSDL 2.0 interfaces. + */ + class Contract + { + public: + + /** + * Constructor. + */ + SCA_API Contract(Interface* intface, Interface* callbackInterface); + + /** + * Destructor. + */ + SCA_API virtual ~Contract(); + + /** + * Returns the interface for invocations from the requestor to the provider. + * @return The interface for invocations from the requestor to the provider. + */ + SCA_API Interface* getInterface() const { return iface; } + + /** + * Returns the interface for invocations from the provider back to the requestor. + * @return The interface for invocations from the provider back to the requestor. + */ + SCA_API Interface* getCallbackInterface() const { return callbackInterface; } + + private: + + /** + * The interface for invocations from the requestor to the provider. + */ + Interface* iface; + + /** + * The interface for invocations from the provider back to the requestor. + */ + Interface* callbackInterface; + + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_contract_h + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Interface.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Interface.cpp new file mode 100644 index 0000000000..f8dd02a74a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Interface.cpp @@ -0,0 +1,49 @@ +/* + * 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/model/Interface.h" + + +namespace tuscany +{ + namespace sca + { + + namespace model + { + + // Constructor + Interface::Interface(bool remotable, bool conversational) + : remotable(remotable), conversational(conversational) + { + logentry(); + } + + Interface::~Interface() + { + logentry(); + } + + } // End namespace model + + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Interface.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Interface.h new file mode 100644 index 0000000000..5ac7736d43 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Interface.h @@ -0,0 +1,90 @@ +/* + * 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_model_interface_h +#define tuscany_sca_model_interface_h + +#include + +namespace tuscany +{ + namespace sca + { + namespace model + { + + /** + * Information about an interface. Subtypes will hold information + * specific to a type of interface. + */ + class Interface + { + + public: + + /** + * Constructor + */ + SCA_API Interface(bool remotable, bool conversational); + + /** + * Destructor + */ + SCA_API virtual ~Interface(); + + /** + * Returns true if the interface is remotable. + * @return True if the interface is remotable. + */ + SCA_API bool isRemotable() const { return remotable; }; + + /** + * Returns true if the interface is conversational. + * @return True if the interface is conversational. + */ + SCA_API bool isConversational() const { return conversational; }; + + /** + * return the QName of schema type for this interface type + * (e.g. "http://www.osoa.org/xmlns/sca/1.0#WSDLInterface") + */ + SCA_API virtual const std::string& getInterfaceTypeQName() = 0; + + private: + + /** + * True if the interface is remotable + */ + bool remotable; + + /** + * True if the interface is conversational + */ + bool conversational; + + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_interface_h + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ModelLoader.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ModelLoader.cpp new file mode 100644 index 0000000000..549ffcfc7e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ModelLoader.cpp @@ -0,0 +1,939 @@ +/* + * 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/export.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/model/ModelLoader.h" +#include "tuscany/sca/model/Composite.h" +#include "tuscany/sca/model/Component.h" +#include "tuscany/sca/model/Reference.h" +#include "tuscany/sca/model/Service.h" +#include "tuscany/sca/model/CompositeService.h" +#include "tuscany/sca/model/CompositeReference.h" +#include "tuscany/sca/model/ServiceType.h" +#include "tuscany/sca/model/ReferenceType.h" +#include "tuscany/sca/model/WSDLInterface.h" +#include "tuscany/sca/core/SCARuntime.h" +#include "tuscany/sca/util/File.h" + + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::util; + + +#if defined(WIN32) || defined (_WINDOWS) +#define PATH_SEPARATOR ";" +#else +#define PATH_SEPARATOR ":" +#endif + +namespace tuscany +{ + namespace sca + { + + namespace model + { + // =========== + // Constructor + // =========== + ModelLoader::ModelLoader(SCARuntime* runtime, Composite* system) + : system(system), runtime(runtime) + { + logentry(); + } + + // ========== + // Destructor + // ========== + ModelLoader::~ModelLoader() + { + logentry(); + } + + // ========================================================= + // load: Load the runtime model from the deployed xml files + // This class has the responsibility for translating from + // the SCDL files to the SCA runtime's in memory model. + // ========================================================= + void ModelLoader::load(const string& systemRoot, const string& systemPath) + { + logentry(); + loginfo("System root: %s", systemRoot.c_str()); + loginfo("System path: %s", systemPath.c_str()); + + // Load composite implementations + // Composite implementations can occur anywhere on the given search path + if (systemPath != "") + { + loadComposites(systemRoot + PATH_SEPARATOR + systemPath); + } + else + { + loadComposites(systemRoot); + } + + // Load system composites + // Composites on the the system root path get included + // in the System composite + loadSystem(systemRoot); + + // Resolve the wires in the system composite + system->resolveWires(); + } + + // ======================================================================== + // loadSystem: + // Load all the composite files on the system root path + // Translate the composite information to composite model objects + // ======================================================================== + void ModelLoader::loadSystem(const string& systemRoot) + { + logentry(); + + // Get all the composite files on the system root path + // These composites are included in the system composite + for (string path = systemRoot; path != ""; ) + { + string dir; + Utils::tokeniseString(PATH_SEPARATOR, path, dir, path); + if (dir != "") + { + loginfo("System root directory: %s", dir.c_str()); + Files files(dir, "*.composite", false); + for (unsigned int i=0; i < files.size(); i++) + { + string fileName = files[i].getDirectory() + "/" + files[i].getFileName(); + Composite* composite = compositeFiles[fileName]; + if (composite) + { + // Include the composite in the system composite + system->addInclude(composite); + } + else + { + // We already got an error or warning indicating why the file + // didn't turn into a composite + } + } + } + } + } + + // ===================================================================== + // loadComposites: + // Load all the composites from any directory under the composite search path + // Translate the composite information to composite model objects + // ===================================================================== + void ModelLoader::loadComposites(const string& searchPath) + { + logentry(); + + // Get all the composite files on the composite search path + for (string path = searchPath; path != ""; ) + { + string dir; + Utils::tokeniseString(PATH_SEPARATOR, path, dir, path); + if (dir != "") + { + loginfo("Composite path directory: %s", dir.c_str()); + Files files(dir, "*.composite", true); + for (unsigned int i=0; i < files.size(); i++) + { + loadCompositeFile(files[i]); + } + } + } + + // Complete the mapping of the composites + for (COMPOSITE_DATAOBJECTS::iterator iter = compositeDataObjects.begin(); + iter != compositeDataObjects.end(); + iter++) + { + mapCompositePass2(iter->first, iter->second); + } + } + + // ==================================================================== + // loadCompositeFile: + // This method is called for each .composite file found under the composite search + // path. The location of this composite file will indicate the root of a composite. + // ==================================================================== + Composite* ModelLoader::loadCompositeFile(const File& file) + { + logentry(); + + loginfo("Composite file name: %s", file.getFileName().c_str()); + + Composite* composite = NULL; + try + { + string fileName = file.getDirectory() + "/" + file.getFileName(); + if (compositeFiles[fileName] == NULL) + { + XMLDocumentPtr compositeFile = getXMLHelper()->loadFile(fileName.c_str()); + if (compositeFile->getRootDataObject() == NULL) + { + logerror("Unable to load file: %s", fileName.c_str()); + } + else + { + // Map the SCDL + composite = mapCompositePass1(file, compositeFile->getRootDataObject()); + + // Load the xsd types and wsdl files in the composite + loadTypeMetadata(file.getDirectory(), composite); + } + } + + } catch (SDORuntimeException& ex) + { + logerror("Unable to load composite: %s", ex.getMessageText()); + } + return composite; + } + + // =========== + // mapCompositePass1 + // =========== + Composite* ModelLoader::mapCompositePass1(const File& file, DataObjectPtr root) + { + logentry(); + + const string& compositeRootDir = file.getDirectory(); + const string compositeName = root->getCString("name"); + loginfo("Composite: %s, root directory: %s", compositeName.c_str(), compositeRootDir.c_str()); + + Composite* composite = new Composite(compositeName, compositeRootDir); + compositeModels[compositeName] = composite; + compositeDataObjects[compositeName] = root; + compositeFiles[file.getDirectory() + "/" + file.getFileName()] = composite; + + // ------------ + // Composite services + // ------------ + DataObjectList& compositeServiceList = root->getList("service"); + for (unsigned int i = 0; i < compositeServiceList.size(); i++) + { + addCompositeService(composite, compositeServiceList[i]); + } + + // ----------------- + // Composite references + // ----------------- + DataObjectList& compositeReferenceList = root->getList("reference"); + for (unsigned int cri = 0; cri < compositeReferenceList.size(); cri++) + { + addCompositeReference(composite, compositeReferenceList[cri]); + } + + // ----- + // Wires + // ----- + DataObjectList& wireList = root->getList("wire"); + for (unsigned int l = 0; l < wireList.size(); l++) + { + string source = wireList[l]->getCString("source"); + string target = wireList[l]->getCString("target"); + composite->addWire(source, target); + } + + return composite; + } + + // =========== + // mapCompositePass2 + // =========== + Composite* ModelLoader::mapCompositePass2(const string& compositeName, DataObjectPtr root) + { + logentry(); + loginfo("Composite: %s", compositeName.c_str()); + + Composite* composite = compositeModels[compositeName]; + + // ---------------------------- + // Add components to the composite + // ---------------------------- + DataObjectList& componentList = root->getList("component"); + unsigned int i; + for (i=0; i < componentList.size(); i++) + { + addComponent(composite, componentList[i]); + } + + // Resolve all the wires inside the composite + composite->resolveWires(); + + return composite; + } + + // ================================= + // addComponent: + // ================================= + void ModelLoader::addComponent(Composite* composite, DataObjectPtr componentDO) + { + logentry(); + + // ------------------- + // Get the component implementation + // ------------------- + DataObjectPtr impl = componentDO->getDataObject("implementation"); + if (!impl) + { + string message = "No implementation for component: "; + message = message + componentDO->getCString("name"); + throwException(SystemConfigurationException, message.c_str()); + } + + // Create the component type + ComponentType* componentType; + string componentTypeName; + string componentTypePath; + + string implTypeQname = impl->getType().getURI(); + implTypeQname += "#"; + implTypeQname += impl->getType().getName(); + + if (implTypeQname == "http://www.osoa.org/xmlns/sca/1.0#SCAImplementation") + { + // Handle a composite implementation + Composite* compositeComponentType = compositeModels[impl->getCString("name")]; + if (!compositeComponentType) + { + string message = "Composite not found: "; + message = message + impl->getCString("name"); + throwException(SystemConfigurationException, message.c_str()); + } +#if defined(COPY_COMPOSITES_ON_INSTANCIATION) + componentType = new Composite(compositeComponentType, composite); +#else + componentType = compositeComponentType; +#endif + } + else + { + + // Locate extension that handles this implementation type + ImplementationExtension* implExtension = runtime->getImplementationExtension(implTypeQname); + if (implExtension) + { + componentType = implExtension->getImplementation(composite, impl); + + // ----------------------- + // Load the .componentType + // ----------------------- + string typeFileName = composite->getRoot() + "/" + componentType->getName() + ".componentType"; + + // Check that the component type file exists + //TODO We need a better and portable way to do this + string dirName; + string fileName; + Utils::rTokeniseString("/", typeFileName, dirName, fileName); + Files files(dirName, fileName, false); + if (files.size() !=0) + { + try + { + XMLDocumentPtr componentTypeFile = getXMLHelper()->loadFile(typeFileName.c_str()); + if (!componentTypeFile || componentTypeFile->getRootDataObject() == 0) + { + // Component type files are optional + logerror("Unable to load file: %s", typeFileName.c_str()); + } + else + { + //Utils::printDO(componentTypeFile->getRootDataObject()); + //commonj::sdo::SDOUtils::printDataObject(componentTypeFile->getRootDataObject()); + addServiceTypes(composite, componentType, componentTypeFile->getRootDataObject()); + addReferenceTypes(composite, componentType, componentTypeFile->getRootDataObject()); + addPropertyTypes(componentType, componentTypeFile->getRootDataObject()); + } + } catch (SDORuntimeException& ex) + { + logerror("Unable to load file:%s", typeFileName.c_str()); + throwException(SystemConfigurationException, ex); + } + } + } + else + { + logerror("Unsupported implementation type: %s", implTypeQname.c_str()); + + string message = "Implementation type not supported: "; + message = message + implTypeQname; + throwException(SystemConfigurationException, message.c_str()); + } + } + + // First check that references and properties exist, some component types + // will create all used references & properties automatically + DataObjectList& refs = componentDO->getList("reference"); + for (unsigned int i=0; igetCString("name"); + if (!componentType->findReferenceType(refName)) + { + // Configuration error: reference is not defined + string message = "Undefined reference: " + refName; + throwException(SystemConfigurationException, message.c_str()); + } + } + + DataObjectList& props = componentDO->getList("property"); + for (unsigned int pi=0; pigetCString("name"); + if (!componentType->findPropertyType(propName)) + { + // Configuration error: property is not defined + string message = "Undefined property: " + propName; + throwException(SystemConfigurationException, message.c_str()); + } + } + + + // Create the component + Component* component = new Component(composite, componentDO->getCString("name"), componentType); + composite->addComponent(component); + + // ---------- + // Properties + // ---------- + for (unsigned int pi=0; pigetCString("name"); + DataObjectPtr propValue = props[pi]->getDataObject("value"); + + component->setProperty(propName, propValue); + } + + // ---------- + // References + // ---------- + for (unsigned int ri=0; rigetCString("name"); + if (!component->findReference(refName)) + { + // Configuration error: reference is not defined + string message = "Undefined reference: " + refName; + throwException(SystemConfigurationException, message.c_str()); + } + + string src = component->getName() + "/" + refName; + + // Get the reference value + string refValue = refs[ri]->getCString("value"); + + composite->addWire(src, refValue); + } + } + + // ===================================================================== + // addServiceTypes: add the services to the component type + // ===================================================================== + void ModelLoader::addServiceTypes(Composite* composite, ComponentType* componentType, DataObjectPtr componentTypeDO) + { + logentry(); + + DataObjectList& serviceTypes = componentTypeDO->getList("service"); + for (unsigned int i=0; igetCString("name"), iface, NULL); + componentType->addServiceType(serviceType); + } + } + + // =================================================== + // addReferenceTypes: add the references to the component type + // =================================================== + void ModelLoader::addReferenceTypes(Composite* composite, ComponentType* componentType, DataObjectPtr componentTypeDO) + { + logentry(); + + DataObjectList& refs = componentTypeDO->getList("reference"); + for (unsigned int i=0; iisSet("multiplicity")) + { + string s = refs[i]->getCString("multiplicity"); + multiplicity = ReferenceType::getMultiplicityFromString(s); + } + else + { + multiplicity = ReferenceType::ONE_ONE; + } + + Interface* iface = getInterface(composite, refs[i]); + + ReferenceType* referenceType = new ReferenceType( + componentType, refs[i]->getCString("name"), iface, NULL, multiplicity); + componentType->addReferenceType(referenceType); + + } + } + + + // ============== + // getInterface + // ============== + Interface* ModelLoader::getInterface(Composite* composite, DataObjectPtr obj) + { + logentry(); + + // ----------------- + // get the interface + // ----------------- + DataObjectPtr iface = obj->getDataObject("interface"); + if (!iface) + { + string message = "No interface for: "; + message = message + obj->getCString("name"); + throwException(SystemConfigurationException, message.c_str()); + } + + string typeQname = iface->getType().getURI(); + typeQname += "#"; + typeQname += iface->getType().getName(); + + if (typeQname == WSDLInterface::typeQName) + { + // Load a WSDL interface + string qname = iface->getCString("interface"); + + return new WSDLInterface(qname, true, false); + } + else + { + // Locate extension that handles this interface type + InterfaceExtension* ifaceExtension = runtime->getInterfaceExtension(typeQname); + if (ifaceExtension) + { + return ifaceExtension->getInterface(composite, iface); + } + else + { + // log this for now. + logerror("Unsupported interface type: %s", typeQname.c_str()); + return 0; + } + } + + } + + // ============================================== + // addProperties: add properties to the component type + // ============================================== + void ModelLoader::addPropertyTypes(ComponentType* componentType, DataObjectPtr componentTypeDO) + { + logentry(); + + DataObjectList& props = componentTypeDO->getList("property"); + for (unsigned int i=0; igetCString("name"); + string type = props[i]->getCString("type"); + bool many=false; + if (props[i]->isSet("many")) + { + many = props[i]->getBoolean("many"); + } + + //TODO need to add support for complex properties, need the SDO + // folks to help understand how to do this... + DataObjectPtr defaultValue = props[i]->getDataObject("value"); + + componentType->addPropertyType(name, type, many, &defaultValue); + } + } + + // =============================================== + // addCompositeService: add an CompositeService to the composite + // =============================================== + void ModelLoader::addCompositeService(Composite* composite, DataObjectPtr compositeServiceDO) + { + logentry(); + + string compositeServiceName = compositeServiceDO->getCString("name"); + + Interface* iface; + if (compositeServiceDO->getDataObject("interface")) + { + iface = getInterface(composite, compositeServiceDO); + } + else + { + iface = NULL; + } + + ReferenceType::Multiplicity multiplicity; + if (compositeServiceDO->isSet("multiplicity")) + { + string s = compositeServiceDO->getCString("multiplicity"); + multiplicity = ReferenceType::getMultiplicityFromString(s); + } + else + { + multiplicity = ReferenceType::ONE_ONE; + } + + CompositeService* compositeService = new CompositeService( + composite, compositeServiceName, iface, NULL, false, multiplicity); + + composite->addCompositeService(compositeService); + + DataObjectList& refs = compositeServiceDO->getList("reference"); + for (unsigned int i=0; iaddWire(compositeServiceName, targ); + } + + // Get binding, it will be the first and only binding + DataObjectList& bindings = compositeServiceDO->getList("binding"); + if (bindings.size()==0) + { + string message = "No binding for compositeService: "; + message = message + compositeServiceDO->getCString("name"); + throwException(SystemConfigurationException, message.c_str()); + } + DataObjectPtr binding = bindings[0]; + + // Determine the binding type + string bindingType = binding->getType().getName(); + string bindingTypeQname = binding->getType().getURI(); + bindingTypeQname += "#"; + bindingTypeQname += binding->getType().getName(); + + // Locate the extension that handles this binding type + ReferenceBindingExtension* bindingExtension = runtime->getReferenceBindingExtension(bindingTypeQname); + if (bindingExtension) + { + Reference* reference = compositeService->getReference(); + ReferenceBinding* referenceBinding = bindingExtension->getReferenceBinding(composite, reference, binding); + reference->setBinding(referenceBinding); + } + else + { + logerror("Unsupported binding type: %s", bindingTypeQname.c_str()); + + string message = "Binding type not supported: "; + message = message + bindingTypeQname; + throwException(SystemConfigurationException, message.c_str()); + } + } + + + // ========================================================= + // addCompositeReference: add a CompositeReference to the composite + // ========================================================= + void ModelLoader::addCompositeReference(Composite* composite, DataObjectPtr compositeReferenceDO) + { + logentry(); + + string compositeReferenceName = compositeReferenceDO->getCString("name"); + + Interface* iface; + if (compositeReferenceDO->getDataObject("interface")) + { + iface = getInterface(composite, compositeReferenceDO); + } + else + { + iface = NULL; + } + + CompositeReference* compositeReference = new CompositeReference( + composite, compositeReferenceName, iface, NULL, false, ReferenceType::ONE_ONE); + + composite->addCompositeReference(compositeReference); + + // Get binding, it will be the first and only binding + DataObjectList& bindings = compositeReferenceDO->getList("binding"); + if (bindings.size()==0) + { + string message = "No binding for compositeReference: "; + message = message + compositeReferenceDO->getCString("name"); + throwException(SystemConfigurationException, message.c_str()); + } + DataObjectPtr binding = bindings[0]; + + // Determine the binding type + string bindingType = binding->getType().getName(); + string bindingTypeQname = binding->getType().getURI(); + bindingTypeQname += "#"; + bindingTypeQname += binding->getType().getName(); + + // Locate the extension that handles this binding type + ServiceBindingExtension* bindingExtension = runtime->getServiceBindingExtension(bindingTypeQname); + if (bindingExtension) + { + Service *service = compositeReference->getService(); + ServiceBinding* serviceBinding = bindingExtension->getServiceBinding(composite, service, binding); + service->setBinding(serviceBinding); + } + else + { + logerror("Unsupported binding type: %s", bindingTypeQname.c_str()); + + string message = "Binding type not supported: "; + message = message + bindingTypeQname; + throwException(SystemConfigurationException, message.c_str()); + } + } + + + /// + /// Use the Tuscany.config file in the composite root directory to + /// determine which xsds and wsdls to load into a dataFactory. + /// + void ModelLoader::loadTypeMetadata(const string &compositeRootDir, Composite* composite) + { + logentry(); + + // Load the "Tuscany.config" file, if it exists + Files files(compositeRootDir, "Tuscany.config", false); + if (files.size() !=0) + { + for (unsigned int i=0; i < files.size(); i++) + { + string filename = compositeRootDir + "/" + files[i].getFileName(); + XMLDocumentPtr compositeConfigFile = getXMLHelper()->loadFile(filename.c_str()); + if (compositeConfigFile->getRootDataObject() == 0) + { + logerror("Unable to load file: %s", filename.c_str()); + } + else + { + loginfo("Composite config for: %s, root directory: %s", composite->getName().c_str(), compositeRootDir.c_str()); + + if(compositeConfigFile->getRootDataObject()->isSet("xsd")) + { + DataObjectList& xsds = compositeConfigFile->getRootDataObject()->getList("xsd/file"); + + for (unsigned int i=0; iisSet("name")) + { + // Load a xsd file -> set the types in the compositeComponents data factory file + string xsdName = compositeRootDir + "/" +xsds[i]->getCString("name"); + loadXMLSchema(composite, xsdName.c_str()); + } + } + } + + + if( compositeConfigFile->getRootDataObject()->isSet("wsdl")) + { + DataObjectList& wsdls = compositeConfigFile->getRootDataObject()->getList("wsdl/file"); + for (unsigned int j=0; jisSet("name")) + { + string wsdlName = compositeRootDir + "/" +wsdls[j]->getCString("name"); + // Load a wsdl file -> get the types, then the contents of the wsdl + loadXMLSchema(composite, wsdlName.c_str()); + + // Load the contents of the wsdl files + loadWSDLDefinition(composite, wsdlName.c_str()); + } + } + } + } + } + } + else + { + // The default scheme is to have no Tuscany.config file, then we simply load all + // WSDLs and XSDs that we find under the composite root + + Files xsdFiles(compositeRootDir, "*.xsd", true); + for (unsigned int i=0; i < xsdFiles.size(); i++) + { + // Load a xsd file -> set the types in the compositeComponents data factory file + string xsdName = xsdFiles[i].getDirectory() + "/" + xsdFiles[i].getFileName(); + loadXMLSchema(composite, xsdName.c_str()); + + } + + Files wsdlFiles(compositeRootDir, "*.wsdl", true); + for (unsigned int wi=0; wi < wsdlFiles.size(); wi++) + { + // Load a wsdl file -> get the types, then the contents of the wsdl + string wsdlName = wsdlFiles[wi].getDirectory() + "/" + wsdlFiles[wi].getFileName(); + loadXMLSchema(composite, wsdlName.c_str()); + + // Load the contents of the wsdl files + loadWSDLDefinition(composite, wsdlName.c_str()); + } + } + } + + + /// + /// Use the types from an xsd or wsdl file + /// + void ModelLoader::loadXMLSchema(Composite* composite, const char *fileName) + { + logentry(); + loginfo("Loading XML schema %s", fileName); + // Load a xsd file -> set the types in the data factory associated with + // the composite + try { + composite->getXSDHelper()->defineFile(fileName); + //Utils::printTypes(composite->getXSDHelper()->getDataFactory()); + + } catch (SDORuntimeException& ex) + { + logerror("Unable to load schema: %s", fileName); + throwException(SystemConfigurationException, ex); + } + } + + /// + /// Load the web services definition from a wsdl + /// + void ModelLoader::loadWSDLDefinition(Composite* composite, const char *fileName) + { + logentry(); + + try { + // Load the wsdl file + XMLDocumentPtr doc = getXMLHelper()->loadFile(fileName); + + if (doc!=0 && doc->getRootDataObject()!=0) + { + //Utils::printDO(doc->getRootDataObject()); + + // Add the root WSDL object to the composite + composite->addWSDLDefinition(doc->getRootDataObject()); + + } + else + { + logerror("Unable to load or parse WSDL: %s", fileName); + } + + } catch (SDORuntimeException& ex) + { + logerror("Unable to load or parse WSDL: %s", fileName); + throwException(SystemConfigurationException, ex); + } + } + + ////////////////////////////////////////////////////////////////////////////// + // Methods used to load the model into memory + ////////////////////////////////////////////////////////////////////////////// + + /// + /// Get an XSDHelper that has the appropriate XSDs already loaded + /// + const XSDHelperPtr ModelLoader::getXSDHelper() + { + logentry(); + + if (myXSDHelper == 0) + { + + // Create an xsd helper + myXSDHelper = HelperProvider::getXSDHelper(); + + try { + + // Load the Assembly model schema + string root = runtime->getInstallRoot(); + string filename = root + "/xsd/sca.xsd"; + + myXSDHelper->defineFile(filename.c_str()); + + // Tuscany specific xsd for config files + filename = root + "/xsd/tuscany.xsd"; + myXSDHelper->defineFile(filename.c_str()); + + filename = root + "/xsd/wsdl_11.xsd"; + myXSDHelper->defineFile(filename.c_str()); + + filename = root + "/xsd/wsdl_11_http.xsd"; + myXSDHelper->defineFile(filename.c_str()); + + filename = root + "/xsd/wsdl_11_mime.xsd"; + myXSDHelper->defineFile(filename.c_str()); + + filename = root + "/xsd/wsdl_11_soap.xsd"; + myXSDHelper->defineFile(filename.c_str()); + + filename = root + "/xsd/wsdl_11_soap12.xsd"; + myXSDHelper->defineFile(filename.c_str()); + + // Load any schema from the extensions directory + string extensionsRoot = root + "/extensions"; + + Files files(extensionsRoot, "*.xsd", true); + for (unsigned int i=0; i < files.size(); i++) + { + string extensionSchema = files[i].getDirectory() + "/" + files[i].getFileName(); + myXSDHelper->defineFile(extensionSchema.c_str()); + } + + + } catch (SDORuntimeException& ex) + { + throwException(SystemConfigurationException, ex); + } + } + + return myXSDHelper; + } + + /// + /// Get an XMLHelper to load files + /// + const XMLHelperPtr ModelLoader::getXMLHelper() + { + logentry(); + + if (myXMLHelper == 0) { + + // Create an xml helper + myXMLHelper = HelperProvider::getXMLHelper(getXSDHelper()->getDataFactory()); + + } + + return myXMLHelper; + } + + } // End namespace model + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ModelLoader.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ModelLoader.h new file mode 100644 index 0000000000..b3b3ec2df6 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ModelLoader.h @@ -0,0 +1,122 @@ +/* + * 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_model_modelloader_h +#define tuscany_sca_model_modelloader_h + +#include + +#include "commonj/sdo/SDO.h" + +#include "tuscany/sca/export.h" +#include "tuscany/sca/core/SCARuntime.h" +#include "tuscany/sca/model/Interface.h" +#include "tuscany/sca/model/Composite.h" +#include "tuscany/sca/model/Component.h" +#include "tuscany/sca/model/ComponentType.h" +#include "tuscany/sca/util/File.h" + +namespace tuscany +{ + namespace sca + { + namespace model + { + + /** + * Provides methods to load the runtime model from the SCDL file. + */ + class ModelLoader { + + public: + /** + * Constructor. + * @param system The SCA system to load. + */ + ModelLoader(tuscany::sca::SCARuntime* runtime, Composite* system); + + /** + * Destructor. + */ + virtual ~ModelLoader(); + + /** + * Load the model from the configuration information. + * @param systemRoot The location of the system configuration + * @param systemPath The search path for composites + */ + void load(const std::string& systemRoot, const std::string& systemPath); + + private: + void loadSystem(const std::string& systemRoot); + + void loadComposites(const std::string& searchPath); + Composite* loadCompositeFile(const tuscany::sca::util::File& file); + Composite* mapCompositePass1(const tuscany::sca::util::File& file, commonj::sdo::DataObjectPtr rootDO); + Composite* mapCompositePass2(const std::string& compositeName, commonj::sdo::DataObjectPtr rootDO); + + void addComponent(Composite* composite, commonj::sdo::DataObjectPtr componentDO); + void addCompositeService(Composite* composite, commonj::sdo::DataObjectPtr compositeServiceDO); + void addCompositeReference(Composite* composite, commonj::sdo::DataObjectPtr referenceServiceDO); + + void addServiceTypes(Composite* composite, ComponentType* componentType, commonj::sdo::DataObjectPtr componentTypeDO); + void addReferenceTypes(Composite* composite, ComponentType* componentType, commonj::sdo::DataObjectPtr componentTypeDO); + void addPropertyTypes(ComponentType* componentType, commonj::sdo::DataObjectPtr componentTypeDO); + + void loadTypeMetadata(const std::string &compositeRootDir, Composite* composite); + + void loadXMLSchema(Composite* composite, const char *fileName); + void loadWSDLDefinition(Composite* composite, const char *fileName); + + Interface* getInterface(Composite* composite, commonj::sdo::DataObjectPtr obj); + + SCARuntime* runtime; + + commonj::sdo::XMLHelperPtr myXMLHelper; // Used to load scdl files + commonj::sdo::XSDHelperPtr myXSDHelper; // Used to load xsds + + const commonj::sdo::XSDHelperPtr getXSDHelper(void); + const commonj::sdo::XMLHelperPtr getXMLHelper(void); + + /** + * The composite describing the composition of the system + */ + Composite* system; + + /** + * Maps of all the composites installed on the system. + */ + typedef std::map COMPOSITE_MODELS; + COMPOSITE_MODELS compositeModels; + + typedef std::map COMPOSITE_DATAOBJECTS; + COMPOSITE_DATAOBJECTS compositeDataObjects; + + typedef std::map COMPOSITE_FILES; + COMPOSITE_FILES compositeFiles; + + }; + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_modelloader_h + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Reference.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Reference.cpp new file mode 100644 index 0000000000..8820379c4e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Reference.cpp @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/model/Reference.h" +#include "tuscany/sca/model/ReferenceType.h" + +using namespace std; + +namespace tuscany +{ + namespace sca + { + namespace model + { + + // Constructor + Reference::Reference(Component* component, ReferenceType* referenceType) + : component(component), type(referenceType), binding(0) + { + logentry(); + } + + // Destructor + Reference::~Reference() + { + logentry(); + } + + void Reference::setBinding(ReferenceBinding* binding) + { + this->binding = binding; + } + + ReferenceBinding* Reference::getBinding() const + { + return binding; + } + + void Reference::addTarget(Service* target) + { + logentry(); + + if (type->getMultiplicity() == ReferenceType::ONE_ONE || type->getMultiplicity() == ReferenceType::ZERO_ONE) + { + if (targets.size() > 0) + { + string message = "Duplicate wire for reference: " + type->getName(); + throwException(SystemConfigurationException, message.c_str()); + } + } + + targets.push_back(target); + } + + } // End namespace model + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Reference.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Reference.h new file mode 100644 index 0000000000..33413b488f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Reference.h @@ -0,0 +1,126 @@ +/* + * 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_model_reference_h +#define tuscany_sca_model_reference_h + +#include + +namespace tuscany +{ + namespace sca + { + namespace model + { + class Component; + class ReferenceType; + class ReferenceBinding; + class Service; + + /** + * An addressable instance of a reference type associated with a particular component. + * Each reference represents a configured version of a logical + * reference type defined in the component type. If the logical reference + * has a multiplicity greater than 1 (0..n or 1..n) then the configured + * reference many have multiple targets. + */ + class Reference + { + public: + /** + * Constructor. + * @param component The component on which the reference is defined. + * @param referenceType The reference type defining the characteristics of the reference. + */ + SCA_API Reference(Component* component, ReferenceType* referenceType); + + /** + * Destructor. + */ + SCA_API virtual ~Reference(); + + /** + * Returns the component on which this reference is defined. + * @return The component on which this reference is defined. + */ + SCA_API Component* getComponent() const { return component; } + + /** + * Returns the reference type defining the characteristics of the reference. + * @return The reference type defining the characteristics of the reference. + */ + SCA_API ReferenceType* getType() const { return type; } + + /** + * Returns the binding supported by the reference. + * @return The binding supported by the reference. + */ + SCA_API ReferenceBinding* getBinding() const; + + /** + * Sets the binding supported by the reference. + * @param binding The binding supported by the reference. + */ + SCA_API void setBinding(ReferenceBinding* binding); + + /** + * Add a target for this reference. There may be more than + * one if the multiplicity is 0..n or 1..n. + * @param target The target of the reference. + */ + SCA_API void addTarget(Service* target); + + typedef std::vector TARGETS; + + /** + * Get a vector of all the targets from this reference. + * @return The targets of this reference. + */ + SCA_API const TARGETS& getTargets() const { return targets; } + + private: + + /** + * The component on which this reference is defined. + */ + Component* component; + + /** + * The reference type defining the characteristics of the reference. + */ + ReferenceType* type; + + /** + * The binding supported by this reference + */ + ReferenceBinding* binding; + + /** + * Vector of all the targets wired from this reference. + */ + TARGETS targets; + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_reference_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ReferenceBinding.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ReferenceBinding.cpp new file mode 100644 index 0000000000..c4e9d875b6 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ReferenceBinding.cpp @@ -0,0 +1,75 @@ +/* + * 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/model/ReferenceBinding.h" +#include "tuscany/sca/model/Component.h" +#include "tuscany/sca/model/Reference.h" +#include "tuscany/sca/model/Composite.h" +#include "tuscany/sca/model/Service.h" + + +using namespace std; + +namespace tuscany +{ + namespace sca + { + + namespace model + { + + // Constructor + ReferenceBinding::ReferenceBinding(Reference *reference, const string& uri) : + Binding(uri), reference(reference), targetServiceBinding(0) + { + logentry(); + } + + // Destructor + ReferenceBinding::~ReferenceBinding() + { + logentry(); + } + + void ReferenceBinding::configure(const string& uri) + { + logentry(); + + // Find the target service + Component* component = reference->getComponent(); + Composite* composite = component->getComposite(); + Service* service; + service = composite->findComponentService(uri); + if (!service) + { + logerror("Wire target %s not found", uri.c_str()); + } + else + { + // Configure this binding from the target service binding + configure(service->getBinding()); + } + } + + } // End namespace model + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ReferenceBinding.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ReferenceBinding.h new file mode 100644 index 0000000000..197d40aabf --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ReferenceBinding.h @@ -0,0 +1,116 @@ +/* + * 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_model_referencebinding_h +#define tuscany_sca_model_referencebinding_h + +#include + +#include "tuscany/sca/model/Binding.h" + +namespace tuscany +{ + namespace sca + { + class ServiceProxy; + + + namespace model + { + class Reference; + class ServiceBinding; + + /** + * Represents a reference binding. + * Bindings are used by services and references. References use bindings + * to describe the access mechanism used to call an external service (which can + * be a service provided by another SCA composite). Services use bindings to describe + * the access mechanism that clients (which can be a client from another SCA composite) + * have to use to call the service. + * This interface will typically be extended by binding implementations to allow + * specification of binding/transport specific information. + */ + class ReferenceBinding : public Binding + { + public: + + /** + * Constructor to create a new binding. + */ + SCA_API ReferenceBinding(Reference* reference, const std::string& uri); + + /** + * Destructor. + */ + SCA_API virtual ~ReferenceBinding(); + + /** + * Create a proxy representing the reference to the + * client component. + */ + SCA_API virtual ServiceProxy* getServiceProxy() = 0; + + /** + * Configure this binding from a service binding. + */ + SCA_API virtual void configure(ServiceBinding* serviceBinding) = 0; + + /** + * Configure this binding from a URI. + */ + SCA_API virtual void configure(const std::string& uri); + + /** + * Returns the reference. + * @return The reference. + */ + SCA_API Reference* getReference() const { return reference; }; + + /** + * Returns the target service binding. + */ + SCA_API ServiceBinding* getTargetServiceBinding() const { return targetServiceBinding; }; + + protected: + + /** + * Sets the target service binding. + */ + SCA_API void setTargetServiceBinding(ServiceBinding* binding) { targetServiceBinding = binding; }; + + private: + + /** + * The reference configured with the binding. + */ + Reference* reference; + + /** + * The service binding of the target + */ + ServiceBinding* targetServiceBinding; + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_referencebinding_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ReferenceType.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ReferenceType.cpp new file mode 100644 index 0000000000..732a14cace --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ReferenceType.cpp @@ -0,0 +1,88 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/model/ReferenceType.h" + +using namespace std; + +namespace tuscany +{ + namespace sca + { + namespace model + { + + + // Constructor + ReferenceType::ReferenceType(ComponentType* componentType, const string& name, + Interface* intface, Interface* callbackInterface, Multiplicity multiplicity) + : Contract(intface, callbackInterface), + componentType(componentType), name(name), multiplicity(multiplicity) + { + logentry(); + } + + ReferenceType::~ReferenceType() + { + logentry(); + } + + ReferenceType::Multiplicity ReferenceType::getMultiplicityFromString(const string& multip) + { + logentry(); + + if (multip == "0..1") + { + return ReferenceType::ZERO_ONE; + } + else if (multip == "1..1") + { + return ReferenceType::ONE_ONE; + } + else if (multip == "0..n") + { + return ReferenceType::ZERO_MANY; + } + else if (multip == "1..n") + { + return ReferenceType::ONE_MANY; + } + else + { + return ReferenceType::UNKNOWN; + } + } + + void ReferenceType::setBinding(Binding* binding) + { + this->binding = binding; + } + + Binding* ReferenceType::getBinding() const + { + return binding; + } + + } // End namespace model + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ReferenceType.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ReferenceType.h new file mode 100644 index 0000000000..87d38ab330 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ReferenceType.h @@ -0,0 +1,138 @@ +/* + * 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_model_referencetype_h +#define tuscany_sca_model_referencetype_h + +#include + +#include "tuscany/sca/model/Contract.h" + +namespace tuscany +{ + namespace sca + { + namespace model + { + class ComponentType; + class Interface; + class Binding; + + /** + * Represents an SCA reference. SCA references within an implementation represent + * links to services that the implementation uses that must be provided by other components + * in the SCA system. + */ + class ReferenceType : public Contract + { + public: + + /** + * Multiplicity (how many wires can be connected to this + * reference) + */ + enum Multiplicity + { + ZERO_ONE = 1, + ONE_ONE = 2, + ZERO_MANY = 3, + ONE_MANY = 4, + UNKNOWN = 0, + }; + + /** + * Constructor. + * @param name The name of the reference. + */ + SCA_API ReferenceType(ComponentType* componentType, const std::string& name, + Interface* intface, Interface* callbackInterface, Multiplicity multiplicity); + + /** + * Destructor. + */; + SCA_API virtual ~ReferenceType(); + + /** + * Returns the component type on which this reference is defined. + * @return The component type on which this reference is defined. + */ + SCA_API ComponentType* getComponentType() const { return componentType; } + + /** + * Returns the name of the reference. + * @return The name of the reference. + */ + SCA_API const std::string& getName() const { return name; } + + /** + * Returns the multiplicity allowed for wires connected to this reference. + * @return The multiplicity allowed for wires connected to this reference + */ + SCA_API Multiplicity getMultiplicity() const { return multiplicity; } + + /** + * Returns the binding supported by the reference. + * @return The binding supported by the reference. + */ + SCA_API Binding* getBinding() const; + + /** + * Sets the binding supported by the reference. + * @param binding The binding supported by the reference. + */ + SCA_API void setBinding(Binding* binding); + + /** + * Get the multiplicity corresponding to the given + * string. + */ + static Multiplicity getMultiplicityFromString(const std::string& multip); + + private: + + /** + * The component type on which this reference is defined. + */ + ComponentType *componentType; + + /** + * The name of the reference type. + */ + std::string name; + + /** + * The multiplicity allowed for wires connected to this reference. + */ + Multiplicity multiplicity; + + /** + * The binding supported by this reference type. + */ + Binding* binding; + + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_referencetype_h + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Service.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Service.cpp new file mode 100644 index 0000000000..4df1d1efc6 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Service.cpp @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/model/Service.h" + +namespace tuscany +{ + namespace sca + { + namespace model + { + + // Constructor + Service::Service(Component* component, ServiceType* serviceType) + : component(component), type(serviceType), binding(0) + { + logentry(); + } + + // Destructor + Service::~Service() + { + logentry(); + } + + void Service::setBinding(ServiceBinding* binding) + { + this->binding = binding; + } + + ServiceBinding* Service::getBinding() const + { + return binding; + } + + } // End namespace model + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Service.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Service.h new file mode 100644 index 0000000000..a1f2c5d672 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Service.h @@ -0,0 +1,101 @@ +/* + * 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_model_service_h +#define tuscany_sca_model_service_h + + +namespace tuscany +{ + namespace sca + { + namespace model + { + class Component; + class ServiceType; + class ServiceBinding; + + /** + * An addressable instance of a service type associated with a particular component. + */ + class Service + { + public: + /** + * Constructor. + * @param component The component on which the service is defined. + * @param serviceType The service type defining the characteristics of the service. + */ + SCA_API Service(Component* component, ServiceType* serviceType); + + /** + * Destructor. + */ + SCA_API virtual ~Service(); + + /** + * Returns the component on which this service is defined. + * @return The component on which this service is defined. + */ + SCA_API Component* getComponent() const { return component; } + + /** + * Returns the service type defining the characteristics of the service. + * @return The service type defining the characteristics of the service. + */ + SCA_API ServiceType* getType() const { return type; } + + /** + * Returns the binding supported by the service. + * @return The binding supported by the service. + */ + SCA_API ServiceBinding* getBinding() const; + + /** + * Sets the binding supported by the service. + * @param binding The binding supported by the service. + */ + SCA_API void setBinding(ServiceBinding* binding); + + private: + + /** + * The component on which this service is defined. + */ + Component* component; + + /** + * The service type defining the characteristics of the service. + */ + ServiceType* type; + + /** + * The binding supported by this service + */ + ServiceBinding* binding; + + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_service_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ServiceBinding.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ServiceBinding.cpp new file mode 100644 index 0000000000..ddc5e6a711 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ServiceBinding.cpp @@ -0,0 +1,51 @@ +/* + * 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/model/ServiceBinding.h" + +using namespace std; + + +namespace tuscany +{ + namespace sca + { + + namespace model + { + + // Constructor + ServiceBinding::ServiceBinding(Service* service, const string& uri) : + Binding(uri), service(service) + { + logentry(); + } + + // Destructor + ServiceBinding::~ServiceBinding() + { + logentry(); + } + + } // End namespace model + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ServiceBinding.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ServiceBinding.h new file mode 100644 index 0000000000..4e68f492a3 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ServiceBinding.h @@ -0,0 +1,89 @@ +/* + * 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_model_servicebinding_h +#define tuscany_sca_model_servicebinding_h + +#include + +#include "tuscany/sca/model/Binding.h" + + +namespace tuscany +{ + namespace sca + { + class ServiceWrapper; + + namespace model + { + class Service; + + /** + * Represents a service binding. + * Bindings are used by services and references. References use bindings + * to describe the access mechanism used to call an external service (which can + * be a service provided by another SCA composite). Services use bindings to describe + * the access mechanism that clients (which can be a client from another SCA composite) + * have to use to call the service. + * This interface will typically be extended by binding implementations to allow + * specification of binding/transport specific information. + */ + class ServiceBinding : public Binding + { + public: + + /** + * Constructor to create a new binding. + */ + SCA_API ServiceBinding(Service* service, const std::string& uri); + + /** + * Destructor. + */ + SCA_API virtual ~ServiceBinding(); + + /** + * Create a service wrapper handling the interaction + * with the service configured with this binding. + */ + SCA_API virtual ServiceWrapper* getServiceWrapper() = 0; + + /** + * Returns the service + * @return The service. + */ + SCA_API Service* getService() const { return service; }; + + private: + + /** + * The service configured with the binding. + */ + Service* service; + + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_servicebinding_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ServiceType.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ServiceType.cpp new file mode 100644 index 0000000000..819a832443 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ServiceType.cpp @@ -0,0 +1,62 @@ +/* + * 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/model/ServiceType.h" + +using namespace std; + +namespace tuscany +{ + namespace sca + { + namespace model + { + + + // Constructor + ServiceType::ServiceType(ComponentType* componentType, const string& name, + Interface* intface, Interface* callbackInterface) + : Contract(intface, callbackInterface), + componentType(componentType), name(name) + { + logentry(); + } + + // Destructor + ServiceType::~ServiceType() + { + logentry(); + } + + void ServiceType::setBinding(Binding* binding) + { + this->binding = binding; + } + + Binding* ServiceType::getBinding() const + { + return binding; + } + + } // End namespace model + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ServiceType.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ServiceType.h new file mode 100644 index 0000000000..08a76e3b3f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/ServiceType.h @@ -0,0 +1,108 @@ +/* + * 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_model_servicetype_h +#define tuscany_sca_model_servicetype_h + +#include + +#include "tuscany/sca/model/Contract.h" + +namespace tuscany +{ + namespace sca + { + namespace model + { + class ComponentType; + class Binding; + class Interface; + + /** + * Represents a service type. Services are used to publish services provided by + * implementations, so that they are addressable by other components. + */ + class ServiceType : public Contract + { + public: + + /** + * Constructor. + * @param componentType The component type on which this service is defined. + * @param name The name of the service. + */ + SCA_API ServiceType(ComponentType* componentType, const std::string& name, + Interface* intface, Interface* callbackInterface); + + /** + * Destructor. + */ + SCA_API virtual ~ServiceType(); + + /** + * Returns the component type on which this service is defined. + * @return The component type on which this service is defined. + */ + SCA_API ComponentType* getComponentType() const { return componentType; } + + /** + * Returns the name of the service type. + * @return The name of the service type + */ + SCA_API const std::string& getName() const { return name; } + + /** + * Returns the binding supported by this service type. + * @return The binding supported by this service type + */ + SCA_API Binding* getBinding() const; + + /** + * Sets the binding supported by this service type. + * @param binding the binding supported by this service type + */ + SCA_API void setBinding(Binding* binding); + + private: + + /** + * The component type on which this service is defined. + */ + ComponentType* componentType; + + /** + * The name of the service type. + */ + std::string name; + + /** + * The binding supported by this service + */ + Binding* binding; + + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_servicetype_h + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp new file mode 100644 index 0000000000..53971b5a17 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp @@ -0,0 +1,633 @@ +/* + * 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 + +#include "tuscany/sca/model/WSDLDefinition.h" +#include "tuscany/sca/model/WSDLOperation.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/core/Exceptions.h" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::util; + +namespace tuscany +{ + namespace sca + { + namespace model + { + + // Constructor + WSDLDefinition::WSDLDefinition(DataObjectPtr wsdlModel) + { + logentry(); + + wsdlModels.insert(wsdlModels.end(), wsdlModel); + mapOperations( wsdlModel ); + } + + WSDLDefinition::~WSDLDefinition() + { + logentry(); + } + + /// + /// The namespace of the service and other definitions defined in this wsdl definition + string WSDLDefinition::getNamespace() + { + logentry(); + return wsdlModels[0]->getCString("targetNamespace"); + } + + void WSDLDefinition::addWSDLModel(DataObjectPtr wsdlModel) + { + logentry(); + wsdlModels.insert(wsdlModels.end(), wsdlModel); + mapOperations( wsdlModel ); + } + + /// + /// Find the operation defined in this wsdl + /// + const WSDLOperation& WSDLDefinition::findOperation(const string& serviceName, + const string& portName, + const string& operationName) + { + logentry(); + + string operationKey = serviceName+"#"+portName; + STR_OPERATION_MAP::const_iterator spIter = servicePortMap.find(operationKey); + if( spIter == servicePortMap.end() ) + { + stringstream errMessage; + errMessage + << "Unable to find Service and Port: \"" + << serviceName << "," << portName + << "\" in the WSDL definition"; + throwException(SystemConfigurationException, errMessage.str().c_str()); + } + + OPERATION_MAP::const_iterator opIter = spIter->second.find(operationName); + + if (opIter != spIter->second.end()) + { + return opIter->second; + } + else + { + stringstream errMessage; + errMessage + << "Unable to find operation \"" + << serviceName << ":" << portName << ":" << operationName + << "\" in the WSDL definition"; + + throwException(SystemConfigurationException, errMessage.str().c_str()); + } + } + + /// + /// Find the operation defined in this wsdl + /// + const WSDLOperation& WSDLDefinition::findOperation(const string& portTypeName, + const string& operationName) + { + logentry(); + + STR_OPERATION_MAP::const_iterator ptIter = portTypeMap.find(portTypeName); + if( ptIter == portTypeMap.end() ) + { + stringstream errMessage; + errMessage + << "Unable to find PortType: \"" + << portTypeName + << "\" in the WSDL definition"; + throwException(SystemConfigurationException, errMessage.str().c_str()); + } + + OPERATION_MAP::const_iterator opIter = ptIter->second.find(operationName); + + if (opIter != ptIter->second.end()) + { + return opIter->second; + } + else + { + stringstream errMessage; + errMessage + << "Unable to find Operation \"" + << portTypeName << ":" << operationName + << "\" in the WSDL definition"; + throwException(SystemConfigurationException, errMessage.str().c_str()); + } + } + + std::list WSDLDefinition::getPortTypes() + { + logentry(); + + std::list ptList; + STR_OPERATION_MAP::const_iterator ptIter = portTypeMap.begin(); + STR_OPERATION_MAP::const_iterator ptIterEnd = portTypeMap.end(); + + for( ; ptIter != ptIterEnd; ++ptIter ) + { + ptList.push_back( ptIter->first ); + } + + return ptList; + } + + std::list WSDLDefinition::getOperations( const std::string &portTypeName ) + { + logentry(); + + std::list ptOpList; + STR_OPERATION_MAP::const_iterator ptIter = portTypeMap.find( portTypeName ); + + if( ptIter == portTypeMap.end() ) + { + stringstream errMessage; + errMessage + << "Unable to find PortType: \"" + << portTypeName + << "\" in the WSDL definition"; + throwException(SystemConfigurationException, errMessage.str().c_str()); + } + + OPERATION_MAP::const_iterator opIter = ptIter->second.begin(); + OPERATION_MAP::const_iterator opIterEnd = ptIter->second.end(); + + for( ; opIter != opIterEnd; ++opIter ) + { + ptOpList.push_back( opIter->first ); + } + + return ptOpList; + } + + /// + /// Find a service + /// + DataObjectPtr WSDLDefinition::findService(const string& serviceName) + { + logentry(); + + DataObjectPtr service = 0; + + // Find the binding + for (unsigned int m = 0; m < wsdlModels.size(); m++) + { + DataObjectList& serviceList = wsdlModels[m]->getList("service"); + for (unsigned int i=0; igetCString("name")); + + if (name.compare(serviceName) == 0) + { + return serviceList[i]; + } + } + } + + return service; + } + + + /// + /// Find a named binding + /// + DataObjectPtr WSDLDefinition::findBinding(const string& bindingName) + { + logentry(); + + DataObjectPtr binding = 0; + string uri; + string name; + + Utils::rTokeniseString("#", bindingName, uri, name); + + // Find the binding + for (unsigned int m = 0; m < wsdlModels.size(); m++) + { + DataObjectList& bindingList = wsdlModels[m]->getList("binding"); + for (unsigned int i=0; igetCString("name")); + + if (nameBinding.compare(name) == 0) + { + return bindingList[i]; + } + } + } + + return binding; + } + + /// + /// Find a named portType + /// + DataObjectPtr WSDLDefinition::findPortType(const string& portTypeName) + { + logentry(); + + DataObjectPtr portType = 0; + string uri; + string name; + + Utils::rTokeniseString("#", portTypeName, uri, name); + + // Find the binding + for (unsigned int m = 0; m < wsdlModels.size(); m++) + { + DataObjectList& portTypeList = wsdlModels[m]->getList("portType"); + for (unsigned int i=0; igetCString("name")); + + if (namePortType.compare(name) == 0) + { + return portTypeList[i]; + } + } + } + + return portType; + } + + /// + /// Find a named message + /// + DataObjectPtr WSDLDefinition::findMessage(const string& messageName) + { + logentry(); + + DataObjectPtr message = 0; + string uri; + string name; + + Utils::rTokeniseString("#", messageName, uri, name); + + // Find the binding + for (unsigned int m = 0; m < wsdlModels.size(); m++) + { + DataObjectList& messageList = wsdlModels[m]->getList("message"); + for (unsigned int i=0; igetCString("name")); + + if (nameMessage.compare(name) == 0) + { + return messageList[i]; + } + } + } + + return message; + } + + /// + /// Traverse the WSDL SDO and insert operations into the operationMap + /// + void WSDLDefinition::mapOperations( DataObjectPtr wsdlModel ) + { + logentry(); + + // check for duplicate message/binding/PortType/Service + // with equal name attributes. This cant be enforced by + // the schema, so it has to be enforced at the app level + checkForDuplicates( wsdlModel ); + + DataObjectList& serviceList = wsdlModel->getList("service"); + + // Iterate through the WSDL services + for (unsigned int i=0; i < serviceList.size(); i++) + { + string serviceName( serviceList[i]->getCString("name") ); + + // Iterate through the WSDL service ports + DataObjectList& portList = serviceList[i]->getList("port"); + for (unsigned int j=0; j < portList.size();j++) + { + string portName( portList[j]->getCString("name") ); + string wsBindingName(portList[j]->getCString("binding")); + + // There can only be one soap address and the check must be made + // at the application level since it cant be specified in the xsd +/* + DataObjectList& soapAddressList = portList[j]->getList("address"); + if( soapAddressList.size() != 1 ) + { + // Invalid WSDL + stringstream errMessage; + errMessage + << "service/port/address: \"" + << portName + << "\" cannot be duplicated in the WSDL definition"; + throwException(SystemConfigurationException, errMessage.str().c_str()); + } +*/ + + string targetAddress(portList[j]->getCString("address/location")); + + // get the binding specified in the WSDL service port + DataObjectPtr wsBinding = findBinding(wsBindingName); + if (!wsBinding) + { + // Invalid WSDL + stringstream errMessage; + errMessage + << "Unable to find binding \"" + << wsBindingName + << "\" in the WSDL definition"; + throwException(SystemConfigurationException, errMessage.str().c_str()); + } + + // Check if its a SOAP binding, if not go on to the next binding + // doing a find like this will work for SOAP11 and SOAP12 + DataObjectPtr wsBindingSubBinding = wsBinding->getDataObject("binding"); + string bindingURI(wsBindingSubBinding->getType().getURI()); + if (bindingURI.find("http://schemas.xmlsoap.org/wsdl/soap") == string::npos) + { + loginfo("Discarding non-SOAP Binding %s", wsBindingName.c_str() ); + continue; + } + + // Get the port type specified the WSDL binding + string wsBindingPortTypeName(wsBinding->getCString("type")); + DataObjectPtr portType = findPortType(wsBindingPortTypeName); + if (!portType) + { + // Invalid WSDL + stringstream errMessage; + errMessage + << "Unable to find PortType \"" + << wsBindingPortTypeName + << "\" in the WSDL definition"; + throwException(SystemConfigurationException, errMessage.str().c_str()); + } + string portTypeName( portType->getCString("name") ); + + // Fill in this map with operation names to WSDLOperations + // then after iterating through the operations, add the map + // to the portTypeMap, keyed off of the portTypeName + OPERATION_MAP operationMap; + + // For each binding and portType operation: + // - get the soap action, style, and use from the binding + // - get the input and/or output message types + // its ok if not all of the PortType operations are not defined in the binding + DataObjectList& bindingOperationList = wsBinding->getList("operation"); + DataObjectList& portTypeOperationList = portType->getList("operation"); + for (unsigned int k=0; k < bindingOperationList.size(); k++) + { + DataObjectPtr bindingOp = bindingOperationList[k]; + string operationName = bindingOp->getCString("name"); + + // Get the corresponding PortType operation + // I know this may not be very efficient, but its a necessary evil + bool foundPortType = false; + DataObjectPtr portTypeOp; + for (unsigned int l=0; + (!foundPortType && l < portTypeOperationList.size()); + l++) + { + //portTypeOp = portTypeOperationList[l]->getDataObject("operation"); + portTypeOp = portTypeOperationList[l]; + if (operationName == portTypeOp->getCString("name") ) + { + foundPortType = true; + } + } + + if( !foundPortType ) + { + // Invalid WSDL + stringstream errMessage; + errMessage + << "Unable to find PortType operation for binding operation: \"" + << operationName + << "\" in the WSDL definition"; + throwException(SystemConfigurationException, errMessage.str().c_str()); + } + + string soapAction = ""; + bool documentStyle = true; + bool wrappedStyle = true; + bool useEncodedInput = false; + bool useEncodedOutput = false; + WSDLOperation::soapVersion soapVer = WSDLOperation::SOAP11; + + string opType = bindingOp->getType().getURI(); + if (opType == "http://schemas.xmlsoap.org/wsdl/soap12/") + { + soapVer = WSDLOperation::SOAP12; + } + + // Get the soapAction + soapAction = bindingOp->getCString("operation/soapAction"); + + // Get the style + string style = bindingOp->getCString("operation/style"); + if (style == "") + { + style = wsBinding->getCString("binding/style"); + } + if (style != "document") + { + documentStyle = false; + wrappedStyle = false; + } + + // get the use + string use = bindingOp->getCString("input/body/use"); + if (use == "encoded") + { + useEncodedInput = true; + } + + use = bindingOp->getCString("output/body/use"); + if (use == "encoded") + { + useEncodedOutput = true; + } + + // Get the request message type from the PortType + DataObjectPtr wsMessageIn = + findMessage(portTypeOp->getCString("input/message")); + if (!wsMessageIn) + { + stringstream errMessage; + errMessage + << "unable to find PortType input message \"" + << portTypeOp->getCString("input/message") + << "\" in the wsdl definition"; + throwException(SystemConfigurationException, errMessage.str().c_str()); + } + string inputMessageType( wsMessageIn->getCString("name") ); + // If it doesnt have a namespace prefix, add the target namespace + if (inputMessageType.find("#") == string::npos) + { + inputMessageType.insert(0, (getNamespace() + "#") ); + } + + // Get the response message type from the PortType + DataObjectPtr wsMessageOut = + findMessage(portTypeOp->getCString("output/message")); + if (!wsMessageOut) + { + // TODO this is ok for one way operations, right? + stringstream errMessage; + errMessage + << "unable to find PortType output message \"" + << portTypeOp->getCString("output/message") + << "\" in the wsdl definition"; + throwException(SystemConfigurationException, errMessage.str().c_str()); + } + string outputMessageType( wsMessageOut->getCString("name") ); + // If it doesnt have a namespace prefix, add the target namespace + if (outputMessageType.find("#") == string::npos) + { + outputMessageType.insert(0, (getNamespace() + "#") ); + } + + WSDLOperation wsdlOp; + wsdlOp.setOperationName(operationName); + wsdlOp.setSoapAction(soapAction); + wsdlOp.setEndpoint(targetAddress); + wsdlOp.setSoapVersion(soapVer); + wsdlOp.setDocumentStyle(documentStyle); + wsdlOp.setWrappedStyle(wrappedStyle); + wsdlOp.setInputEncoded(useEncodedInput); + wsdlOp.setOutputEncoded(useEncodedOutput); + wsdlOp.setInputMessageType(inputMessageType); + wsdlOp.setOutputMessageType(outputMessageType); + wsdlOp.setInputMessage(wsMessageIn); + wsdlOp.setOutputMessage(wsMessageOut); + + operationMap[ operationName ] = wsdlOp; + + } // end bindingOperationList + + portTypeMap[portTypeName] = operationMap; + servicePortMap[(serviceName+"#"+portName)] = operationMap; + + } // end portTypeList + } // end serviceList + } // end method mapOperations + + void WSDLDefinition::checkForDuplicates( DataObjectPtr wsdlModel ) + { + logentry(); + + // check for duplicate message/binding/PortType/service + // with equal name attributes. This cant be enforced by + // the schema, so it has to be enforced at the app level + + std::set namesSet; + + DataObjectList &messageList = wsdlModel->getList("message"); + for( unsigned int i = 0; i < messageList.size(); i++ ) + { + if( namesSet.find( messageList[i]->getCString("name") ) == namesSet.end() ) + { + namesSet.insert( messageList[i]->getCString("name") ); + } + else + { + // Invalid WSDL + stringstream errMessage; + errMessage + << "message/name: \"" + << messageList[i]->getCString("name") + << "\" cannot be duplicated in the WSDL definition"; + throwException(SystemConfigurationException, errMessage.str().c_str()); + } + } + + namesSet.clear(); + DataObjectList &bindingList = wsdlModel->getList("binding"); + for( unsigned int i = 0; i < bindingList.size(); i++ ) + { + if( namesSet.find( bindingList[i]->getCString("name") ) == namesSet.end() ) + { + namesSet.insert( bindingList[i]->getCString("name") ); + } + else + { + // Invalid WSDL + stringstream errMessage; + errMessage + << "binding/name: \"" + << bindingList[i]->getCString("name") + << "\" cannot be duplicated in the WSDL definition"; + throwException(SystemConfigurationException, errMessage.str().c_str()); + } + } + + namesSet.clear(); + DataObjectList &portTypeList = wsdlModel->getList("portType"); + for( unsigned int i = 0; i < portTypeList.size(); i++ ) + { + if( namesSet.find( portTypeList[i]->getCString("name") ) == namesSet.end() ) + { + namesSet.insert( portTypeList[i]->getCString("name") ); + } + else + { + // Invalid WSDL + stringstream errMessage; + errMessage + << "portType/name: \"" + << portTypeList[i]->getCString("name") + << "\" cannot be duplicated in the WSDL definition"; + throwException(SystemConfigurationException, errMessage.str().c_str()); + } + } + + namesSet.clear(); + DataObjectList &serviceList = wsdlModel->getList("service"); + for( unsigned int i = 0; i < serviceList.size(); i++ ) + { + if( namesSet.find( serviceList[i]->getCString("name") ) == namesSet.end() ) + { + namesSet.insert( serviceList[i]->getCString("name") ); + } + else + { + // Invalid WSDL + stringstream errMessage; + errMessage + << "service/name: \"" + << serviceList[i]->getCString("name") + << "\" cannot be duplicated in the WSDL definition"; + throwException(SystemConfigurationException, errMessage.str().c_str()); + } + } + } + + } // end namespace model + } // end namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLDefinition.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLDefinition.h new file mode 100644 index 0000000000..baf14fcd6d --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLDefinition.h @@ -0,0 +1,180 @@ +/* + * 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_model_wsdldefinition_h +#define tuscany_sca_model_wsdldefinition_h + +#include +#include +#include + +#include "commonj/sdo/SDO.h" + +#include "tuscany/sca/export.h" +#include "tuscany/sca/model/WSDLOperation.h" + + +namespace tuscany +{ + namespace sca + { + namespace model + { + + class WSDLOperation; + + /** + * Holds information about a WSDL definition loaded into the runtime. + */ + class WSDLDefinition + { + public: + /** + * Constructor. + * @param wsdlModel The data object representing the WSDL document + * defining a web service. + */ + SCA_API WSDLDefinition(commonj::sdo::DataObjectPtr wsdlModel); + + /** + * Destructor. + */ + SCA_API virtual ~WSDLDefinition(); + + /** + * Returns the target namespace of the WSDL definitions. + * @return The target namespace. + */ + SCA_API std::string getNamespace(void); + + /** + * Add a WSDL model. + */ + SCA_API void addWSDLModel(commonj::sdo::DataObjectPtr wsdlModel); + + /** + * Find an operation in the WSDL definitions. + * @param serviceName The name of the service on which this + * operation is defined. + * @param portName The name of the port in the service to + * use. + * @param operationName The name of the operation to find. + * @return The operation if found. Exception thrown if not found. + */ + SCA_API const WSDLOperation& findOperation(const std::string& serviceName, + const std::string& portName, + const std::string& operationName); + + /** + * Find an operation in the WSDL definitions. + * @param portTypeName The name of the portType on which this + * operation is defined. + * @param operationName The name of the operation to find. + * @return The operation if found. Exception thrown if not found. + */ + SCA_API const WSDLOperation& findOperation(const std::string& portTypeName, + const std::string& operationName); + + /** + * Get all of the PortTypes in this WSDL definition. + * @return A standard list of standard strings, each being a different PortType + */ + SCA_API std::list getPortTypes(); + + /** + * Get all of the Operations for a particular PortType in this WSDL definition. + * @param portTypeName Get all of the operations for this portTypeName + * @return A standard list of standard strings, each of which is a different operation + */ + SCA_API std::list getOperations( const std::string &portTypeName ); + + private: + + /** + * Find a service in the wsdl definition. + * @param serviceName The name of the service. + * @return A data object describing the service if found, otherwise + * a 0 if not found. + */ + commonj::sdo::DataObjectPtr findService(const std::string& serviceName); + + /** + * Find a binding in the wsdl definition. + * @param bindingName The name of the binding to find. + * @return A data object describing the binding if found, otherwise + * a 0 if not found. + */ + commonj::sdo::DataObjectPtr findBinding(const std::string& bindingName); + + /** + * Find a portType in the wsdl definition. + * @param portTypeName The name of the portType. + * @return A data object describing the portType if found, otherwise + * a 0 if not found. + */ + commonj::sdo::DataObjectPtr findPortType(const std::string& portTypeName); + + /** + * Find a message in the wsdl definition. + * @param messageName The name of the message. + * @return A data object describing the message if found, otherwise + * a 0 if not found. + */ + commonj::sdo::DataObjectPtr findMessage(const std::string& messageName); + + /** + * Given a wsdl represented by an SDO, traverse the SDO and + * extract all of the necessary information to populate the + * operationMap with WSDLOperation objects. + * This method is called each time a wsdl model is added: so + * that would be be in the constructor and in addWSDLModel(). + * @param wsdlModel A wsdl represented by an SDO + */ + void mapOperations( commonj::sdo::DataObjectPtr wsdlModel ); + + /** + * Given a wsdl represented by an SDO, check for duplicate + * message/binding/PortType/service with equal name attributes. + * This cant be enforced by the schema, so it has to be enforced + * at the app level. If a duplicate is found, a + * SystemConfigurationException exception is thrown. + * @param wsdlModel A wsdl represented by an SDO + */ + void checkForDuplicates( commonj::sdo::DataObjectPtr wsdlModel ); + + /** + * The data object representation of the WSDL document. + */ + typedef std::vector MODEL_VECTOR; + MODEL_VECTOR wsdlModels; + + typedef std::map OPERATION_MAP; + typedef std::map STR_OPERATION_MAP; + STR_OPERATION_MAP portTypeMap; + STR_OPERATION_MAP servicePortMap; + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_wsdldefinition_h + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLInterface.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLInterface.cpp new file mode 100644 index 0000000000..5fa45a9967 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLInterface.cpp @@ -0,0 +1,107 @@ +/* + * 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/model/WSDLInterface.h" + +using namespace std; + +namespace tuscany +{ + namespace sca + { + namespace model + { + + const string WSDLInterface::typeQName("http://www.osoa.org/xmlns/sca/1.0#WSDLPortType"); + + // Constructor + WSDLInterface::WSDLInterface( + const string& qname, bool remotable, bool conversational) + : Interface(remotable, conversational) + { + logentry(); + parse(qname); + } + + void WSDLInterface::parse(const string& qname) + { + logentry(); + + // PortType is of the form: #wsdl.interface() + string::size_type hash = qname.find("#"); + if (hash != string::npos) + { + // Found a hash + + // Namepace is the part before the # + namespaceURI = qname.substr(0, hash); + + if ( (hash+1) < qname.length()) + { + // Check the next part is wsdl.interface( + int ending = hash+16; + string check = qname.substr(hash+1, 15); + if (check.compare("wsdl.interface(") == 0) + { + // Find the matching ) + int endBracket = qname.find(")",ending); + if (endBracket-1 > ending+1) + { + name = qname.substr(ending, endBracket-ending); + } + else + { + // Nothing between the () + name = ""; + } + } + else + { + // not the correct characters after the #, ignore the rest + name = ""; + } + + } + else + { + // Nothing after the hash + name = ""; + } + } + else + { + // No hash at all + namespaceURI = qname; + name = ""; + } + } + + + WSDLInterface::~WSDLInterface() + { + logentry(); + } + + } // End namespace model + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLInterface.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLInterface.h new file mode 100644 index 0000000000..b071dd221e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLInterface.h @@ -0,0 +1,99 @@ +/* + * 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_model_wsdlinterface_h +#define tuscany_sca_model_wsdlinterface_h + +#include + +#include "tuscany/sca/model/Interface.h" + +namespace tuscany +{ + namespace sca + { + namespace model + { + /** + * Holds information about an interface described using a WSDL + * port type. + */ + class WSDLInterface : public Interface + { + + public: + /** + * Constuctor. + * @param interfaceName Name of the WSDL interface. + */ + WSDLInterface(const std::string& qname, bool remotable, bool conversational); + + /** + * Destructor. + */ + virtual ~WSDLInterface(); + + /** + * Returns the WSDL namespace + */ + std::string getNamespaceURI() const { return namespaceURI; } + + /** + * Returns the interface name + */ + std::string getName() const { return name; } + + /** + * 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 std::string& getInterfaceTypeQName() { return typeQName; }; + + /** + * The QName of the schema type for this interface type. + */ + SCA_API static const std::string typeQName; + + private: + + /** + * Parse the WSDL qname + */ + void parse(const std::string& qname); + + /** + * WSDL namespace. + */ + std::string namespaceURI; + + /** + * Name of the WSDL interface. + */ + std::string name; + + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_cpp_wsdlinterface_h + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLMessagePart.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLMessagePart.cpp new file mode 100644 index 0000000000..957d7ab3c1 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLMessagePart.cpp @@ -0,0 +1,70 @@ +/* + * 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/model/WSDLMessagePart.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/util/Utils.h" + +using namespace std; +using namespace tuscany::sca::util; + +namespace tuscany +{ + namespace sca + { + namespace model + { + + + // Default Constructor + WSDLMessagePart::WSDLMessagePart() + { + logentry(); + } + + // Constructor + WSDLMessagePart::WSDLMessagePart(std::string partName, + std::string partType, + std::string partUri) : + partName_(partName), + partType_(partType), + partUri_(partUri) + { + logentry(); + } + + WSDLMessagePart::~WSDLMessagePart() + { + logentry(); + } + + + void WSDLMessagePart::setMessagePartType(const string& inputType) + { + logentry(); + Utils::tokeniseQName(inputType, partUri_, partName_); + } + + } // End namespace model + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLMessagePart.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLMessagePart.h new file mode 100644 index 0000000000..2c381011ba --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLMessagePart.h @@ -0,0 +1,113 @@ +/* + * 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_model_wsdlmessagepart_h +#define tuscany_sca_model_wsdlmessagepart_h + +#include +#include +#include + +#include "tuscany/sca/export.h" + +namespace tuscany +{ + namespace sca + { + namespace model + { + + /** + * Represents a single WSDL defined message part. + */ + class WSDLMessagePart + { + public: + /** + * Default Constructor + */ + SCA_API WSDLMessagePart(); + + /** + * Constructor. + * @param partName The name of the message part. + * @param partType The type of this message part. + * @param partUri The namespace URI for the message part type. + */ + SCA_API WSDLMessagePart( std::string partName, + std::string partType, + std::string partUri ); + + /** + * Destructor. + */ + SCA_API ~WSDLMessagePart(); + + /** + * Return the name of the WSDL Message part + * @return The name of the WSDL Message part + */ + SCA_API const std::string& getPartName() const {return partName_;} + SCA_API void setPartName(const std::string& partName) {partName_ = partName;} + + /** + * The type of this WSDL Message part + * @return The type of this WSDL Message part + */ + SCA_API const std::string& getPartType() const {return partType_;} + SCA_API void setPartType(const std::string& partType) {partType_ = partType;} + + /** + * Set the WSDL message part type and namespace URI + * @return A prefixed namespace and type of the form prefix:type + */ + SCA_API void setMessagePartType(const std::string& partType); + + /** + * Return the namespace URI of the WSDL Message part + * @return The namespace URI of the WSDL Message part + */ + SCA_API const std::string& getPartUri() const {return partUri_;} + SCA_API void setPartUri(const std::string& partUri) {partUri_ = partUri;} + + private: + /** + * The name of this message part + */ + std::string partName_; + + /** + * The type of this message part + */ + std::string partType_; + + /** + * The namespace URI of the message part type + */ + std::string partUri_; + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_wsdlmessagepart_h + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLOperation.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLOperation.cpp new file mode 100644 index 0000000000..a61d122a72 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLOperation.cpp @@ -0,0 +1,193 @@ +/* + * 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 +#include +#include + +#include "tuscany/sca/model/WSDLOperation.h" +#include "tuscany/sca/model/WSDLMessagePart.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/core/Exceptions.h" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::util; + +namespace tuscany +{ + namespace sca + { + namespace model + { + + + // Constructor + WSDLOperation::WSDLOperation() + { + logentry(); + } + + WSDLOperation::~WSDLOperation() + { + logentry(); + } + + + void WSDLOperation::setInputMessageType(const string& inputType) + { + logentry(); + Utils::tokeniseQName(inputType, inputMessageUri, inputMessageName); + } + + void WSDLOperation::setOutputMessageType(const string& outputType) + { + logentry(); + Utils::tokeniseQName(outputType, outputMessageUri, outputMessageName); + } + + void WSDLOperation::setInputMessage( commonj::sdo::DataObjectPtr inputMsg ) + { + logentry(); + + DataObjectList &partList = inputMsg->getList("part"); + for( unsigned int i=0; i < partList.size(); i++) + { + string partUri; + string partType; + string partName = partList[0]->getCString("name"); + + Utils::tokeniseQName(partList[0]->getCString("element"), partUri, partType); + WSDLMessagePart part(partName, partType, partUri); + + inputPartMap[partName] = part; + } + } + + void WSDLOperation::setOutputMessage( commonj::sdo::DataObjectPtr outputMsg ) + { + logentry(); + + DataObjectList &partList = outputMsg->getList("part"); + for( unsigned int i=0; i < partList.size(); i++) + { + string partUri; + string partType; + string partName = partList[0]->getCString("name"); + + Utils::tokeniseQName(partList[0]->getCString("element"), partUri, partType); + WSDLMessagePart part(partName, partType, partUri); + + outputPartMap[partName] = part; + } + } + + const std::list WSDLOperation::getInputMessagePartNames() const + { + logentry(); + + std::list inputPartNames; + + PART_MAP::const_iterator iter = inputPartMap.begin(); + PART_MAP::const_iterator iterEnd = inputPartMap.end(); + + for( ; iter != iterEnd; ++iter ) + { + inputPartNames.push_back( iter->first ); + } + + return inputPartNames; + } + + const std::list WSDLOperation::getOutputMessagePartNames() const + { + logentry(); + + std::list outputPartNames; + + PART_MAP::const_iterator iter = outputPartMap.begin(); + PART_MAP::const_iterator iterEnd = outputPartMap.end(); + + for( ; iter != iterEnd; ++iter ) + { + outputPartNames.push_back( iter->first ); + } + + return outputPartNames; + } + + const WSDLMessagePart& + WSDLOperation::getInputMessagePart( const std::string &name ) const + { + logentry(); + + PART_MAP::const_iterator iter = inputPartMap.find( name ); + if( iter == inputPartMap.end() ) + { + stringstream errMessage; + errMessage + << "Unable to find input WSDLMessagePart for partName: " << name; + + throwException(SystemConfigurationException, errMessage.str().c_str()); + } + + return iter->second; + } + + const WSDLMessagePart& + WSDLOperation::getOutputMessagePart( const std::string &name ) const + { + logentry(); + + PART_MAP::const_iterator iter = outputPartMap.find( name ); + if( iter == outputPartMap.end() ) + { + stringstream errMessage; + errMessage + << "Unable to find output WSDLMessagePart for partName: " << name; + + throwException(SystemConfigurationException, errMessage.str().c_str()); + } + + return iter->second; + } + + void WSDLOperation::setInputMessagePart( const std::string &partName, + WSDLMessagePart part ) + { + logentry(); + + inputPartMap[partName] = part; + } + + void WSDLOperation::setOutputMessagePart( const std::string &partName, + WSDLMessagePart part ) + { + logentry(); + + outputPartMap[partName] = part; + } + + } // End namespace model + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLOperation.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLOperation.h new file mode 100644 index 0000000000..48d848170a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/WSDLOperation.h @@ -0,0 +1,196 @@ +/* + * 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_model_wsdloperation_h +#define tuscany_sca_model_wsdloperation_h + +#include +#include +#include + +#include "commonj/sdo/SDO.h" + +#include "tuscany/sca/export.h" +#include "tuscany/sca/model/WSDLMessagePart.h" + + +namespace tuscany +{ + namespace sca + { + namespace model + { + + /** + * Represents a single.,bound WSDL defined operation. + * This class includes information from the soapBinding + * in addition to the WSDL definition of the operation. + */ + class WSDLOperation + { + public: + /** + * Constructor. + */ + SCA_API WSDLOperation(); + + /** + * Destructor. + */ + SCA_API virtual ~WSDLOperation(); + + /** + * Return the name of the operation for use when serializing an + * outgoing message. + * @return The name of the element in the request message. + */ + SCA_API const std::string& getOperationName() const {return operationName;} + SCA_API void setOperationName(const std::string& opName) {operationName = opName;} + + /** + * The soap action string for this operation. + * @return The soap action. + */ + SCA_API const std::string& getSoapAction() const {return soapAction;} + SCA_API void setSoapAction(const std::string& soapAct) {soapAction = soapAct;} + + /** + * Return the endpoint address for the target web service. + * @return The endpoint address. + */ + SCA_API const std::string& getEndpoint() const {return endpoint;} + SCA_API void setEndpoint(const std::string& ep) {endpoint = ep;} + + enum soapVersion + { + SOAP11, + SOAP12 + }; + + SCA_API void setSoapVersion(soapVersion ver) {soapVer = ver;} + SCA_API soapVersion getSoapVersion() const {return soapVer;} + + SCA_API void setDocumentStyle(bool docStyle) {documentStyle = docStyle;} + SCA_API bool isDocumentStyle() const {return documentStyle;} + + SCA_API void setWrappedStyle(bool wrapStyle) {wrappedStyle = wrapStyle;} + SCA_API bool isWrappedStyle() const {return wrappedStyle;} + + SCA_API void setInputEncoded(bool enc) {inputEncoded = enc;} + SCA_API bool isInputEncoded() const {return inputEncoded;} + + SCA_API void setOutputEncoded(bool enc) {outputEncoded = enc;} + SCA_API bool isOutputEncoded() const {return outputEncoded;} + + /** + * Input Message URI and Name. To get the message part URI and name, you + * will have to get the WSDLMessagePart by calling getInputMessagePart() + */ + SCA_API void setInputMessageType(const std::string& inputMessageType); + SCA_API const std::string& getInputMessageUri() const {return inputMessageUri;} + SCA_API const std::string& getInputMessageName() const {return inputMessageName;} + + /** + * Output Message URI and Name. To get the message part URI and name, you + * will have to get the WSDLMessagePart by calling getOutputMessagePart() + */ + SCA_API void setOutputMessageType(const std::string& outputMessageType); + SCA_API const std::string& getOutputMessageUri() const {return outputMessageUri;} + SCA_API const std::string& getOutputMessageName() const {return outputMessageName;} + + // TODO We should add an enum for REQUEST_ONLY, RESPONSE_ONLY, REQUEST_RESPONSE + // and a setter/getter. The enum would be checked by getOutputXXX + + /** + * Parse a WSDL message represented by an SDO into the input/outputPartMap + * @param inputMsg a data object which contains the WSDL message + * ie. + * + * + */ + SCA_API void setInputMessage( commonj::sdo::DataObjectPtr inputMsg ); + SCA_API void setOutputMessage( commonj::sdo::DataObjectPtr outputMsg ); + + /** + * Manually set the input/outputPartMap, as opposed to passing in an SDO WSDL message. + * Populates the input/outputPartMap, setInput/OutputMessageType must still be called. + * @param partName the name of the message part + * @param part the message part + */ + SCA_API void setInputMessagePart( const std::string &partName, WSDLMessagePart part ); + SCA_API void setOutputMessagePart( const std::string &partName, WSDLMessagePart part ); + + /** + * Return a message part keyed off of the message part name + * @param name the message part name + * @return the message part in a WSDLMessagePart object + */ + SCA_API const WSDLMessagePart &getInputMessagePart( const std::string &name ) const; + SCA_API const WSDLMessagePart &getOutputMessagePart( const std::string &name ) const; + + /** + * Get all of the message part names + * @return a list of strings, each being a different message part name + */ + SCA_API const std::list getInputMessagePartNames() const; + SCA_API const std::list getOutputMessagePartNames() const; + + private: + /** + * The name of the operation for use when serializing an + * outgoing message. + */ + std::string operationName; + + /** + * The soap action string for this operation. + */ + std::string soapAction; + + /** + * The endpoint address of the target web service. + */ + std::string endpoint; + + bool documentStyle; + bool wrappedStyle; + bool inputEncoded; + bool outputEncoded; + soapVersion soapVer; + + std::string inputMessageUri; + std::string inputMessageName; + + std::string outputMessageUri; + std::string outputMessageName; + + typedef std::map PART_MAP; + PART_MAP inputPartMap; + PART_MAP outputPartMap; + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_wsdloperation_h + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Wire.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Wire.cpp new file mode 100644 index 0000000000..03f475af09 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Wire.cpp @@ -0,0 +1,53 @@ +/* + * 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/model/Wire.h" + +using namespace tuscany::sca::util; + +namespace tuscany +{ + namespace sca + { + namespace model + { + + // Constructor + Wire::Wire(const std::string& source, const std::string& targ) + { + logentry(); + + Utils::tokeniseUri(source, sourceComponent, sourceReference); + target = targ; + } + + Wire::~Wire() + { + logentry(); + } + + } // End namespace model + + + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Wire.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Wire.h new file mode 100644 index 0000000000..ab136e9109 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/model/Wire.h @@ -0,0 +1,94 @@ +/* + * 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_model_wire_h +#define tuscany_sca_model_wire_h + +#include + +namespace tuscany +{ + namespace sca + { + namespace model + { + /** + * Information about a wire in the model. + */ + class Wire + { + public: + + /** + * Constructor. + * @param source The source of the wire. Either the component and + * reference name (optional) or an entry point. + * @param target The target of the wire. Either a component and service + * service name (optional) or an external sevice. + */ + SCA_API Wire(const std::string& source, const std::string& target); + + /** + * Destructor. + */ + SCA_API virtual ~Wire(); + + /** + * Get the component name defined by the source of the wire. + * @return The component name which is the source of the wire. + */ + SCA_API const std::string& getSourceComponent() const { return sourceComponent; } + + /** + * Get the reference name defined by the source of the wire. + * @return The reference name which is the source of the wire. + */ + SCA_API const std::string& getSourceReference() const { return sourceReference; } + + /** + * Get the target uri defined by the target of the wire. + * @return The target uri which is the source of the wire. + */ + SCA_API const std::string& getTarget() { return target; } + + private: + /** + * The source component of the wire. + */ + std::string sourceComponent; + + /** + * The source reference of the wire. + */ + std::string sourceReference; + + /** + * The target uri of the wire. + */ + std::string target; + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_model_wire_h + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/DefaultLogWriter.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/DefaultLogWriter.cpp new file mode 100644 index 0000000000..48cc0aa1e6 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/DefaultLogWriter.cpp @@ -0,0 +1,51 @@ +/* + * 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/util/DefaultLogWriter.h" + +using namespace std; + +namespace tuscany +{ + namespace sca + { + namespace util + { + DefaultLogWriter::~DefaultLogWriter() + { + } + + void DefaultLogWriter::log(int level, const char* tid, const char* msg) + { + cout << tid << " "; + for (int i=0; i < level; i++) + { + cout << " "; + } + cout << msg < +#include + +#if defined(WIN32) || defined (_WINDOWS) +#include +#else +#include +#include +#include +#endif + +#include "tuscany/sca/util/File.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/util/Logging.h" + +using namespace std; + +namespace tuscany +{ + namespace sca + { + namespace util + { + File::File(const string& dir, const string& file, bool isDirectory) + : directory(dir), fileName(file), isDir(isDirectory) + { + } + File::~File() + { + } + + + Files::Files(const string& rootDir, const string& pattern, bool subdirectories, bool directories) + : rootDirectory(rootDir) + { + findFiles(rootDirectory, pattern, subdirectories, directories); + } + + Files::~Files() + { + } + + unsigned int Files::size() + { + return files.size(); + } + + const File& Files::operator[] (unsigned int index) + { + if (size() <= index) + { + throwException(SystemConfigurationException, "Index of of bounds"); + } + + FILES::iterator iter = files.begin(); + for (unsigned int i=0; id_name; + struct stat statbuf; + if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) + continue; + if (stat(entryName.c_str(), &statbuf) != 0) + { + logwarning("Unable to stat entry: %s", entryName.c_str()); + } + else + { + string filename = entry->d_name; + + if ((exactMatch && filename == pattern) || + (!exactMatch && + ((filename.find(token1) == 0) + && (filename.length() >= token2.length()) + && (filename.rfind(token2) == (filename.length() - token2.length())) ))) + { + if (S_ISDIR(statbuf.st_mode)) + { + if (directories) + { + files.push_back(File(rootDir, filename, true)); + } + } + else if (S_ISREG(statbuf.st_mode)) + { + if (!directories) + { + // Add the file to our list + files.push_back(File(rootDir, filename)); + } + } + } // end - matching filename + + // recurse if necessary + if (subdirectories && S_ISDIR(statbuf.st_mode)) + { + findFiles(entryName, pattern, subdirectories, directories); + } + } + } + + closedir(root); +#endif + } + + } // End namespace util + } // End namespace sca +} // End namespace tuscany + + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/File.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/File.h new file mode 100644 index 0000000000..944a192cf6 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/File.h @@ -0,0 +1,160 @@ +/* + * 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_util_file_h +#define tuscany_sca_util_file_h + +#include +#include + +namespace tuscany +{ + namespace sca + { + namespace util + { + /** + * File access methods. Provides platform independent + * access to files. + */ + class File + { + public: + /** + * Constructor. + * @param directory Name of the directory in which this file is located. + * Either / or \ can be used interchangeably for separating directory elements. + * @param fileName Name of the file in the dirctory. + */ + File(const std::string& directory, const std::string& fileName, bool isDirectory = false); + + /** + * Destructor. + */ + virtual ~File(); + + /** + * Return the directory in which this file is located. + * @return Name of the parent directory. + */ + const std::string& getDirectory() const {return directory;} + + /** + * Return the name of the file. + * @return Name of the file/directory. + */ + const std::string& getFileName() const {return fileName;} + + /** + * Return if this is a directory + * @return true if a directory + */ + bool isDirectory() const {return isDir;} + + /** + * Return if this is a file + * @return true if a file + */ + bool isFile() const {return !isDir;} + + private: + /** + * Name of the parent directory. + */ + std::string directory; + + /** + * Name of the file/directory + */ + std::string fileName; + + /** + * Is this a directory + */ + bool isDir; + }; + + /** + * Collection of File to provide platform independent access + * to files and directories. + */ + class Files + { + public: + /** + * Constructor which will search a given directory with a pattern and return a + * new instance of this collection class. + * @param rootDirectory The directory in which to search. + * @param pattern A pattern for matching file names. Can include * and ?. + * @param subdirectories Whether subdirectories should be searched too. + * @param directories Whether to directories or files. + */ + Files(const std::string& rootDirectory, + const std::string& pattern, + bool subdirectories = false, + bool directories = false); + + /** + * Destructor. + */ + virtual ~Files(); + + /** + * Return the number of files found. + * @return The number of files found. + */ + unsigned int size(); + + /** + * Return a File at this position in the collection. + * @param index The index into the collection. + * @return The File at this index in the collection. + */ + const File& operator[] (unsigned int index); + + private: + /** + * Search the given directory and pattern for matching files. + * @param rootDirectory The directory in which to search. + * @param pattern A pattern for matching file names. Can include * and ?. + * @param subdirectories Whether subdirectories should be searched too. + * @param directories Whether to directories or files. + */ + void findFiles(const std::string& rootDirectory, const std::string& pattern, + bool subdirectories, bool directories); + + /** + * The top level directory to search. + */ + std::string rootDirectory; + + typedef std::vector FILES; + + /** + * Vector of File. + */ + FILES files; + }; + + } // End namespace util + } // End namespace sca +} // End namespace tuscany +#endif // tuscany_sca_util_file_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/FileLogWriter.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/FileLogWriter.cpp new file mode 100644 index 0000000000..56eb3146dd --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/FileLogWriter.cpp @@ -0,0 +1,57 @@ +/* + * 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/util/FileLogWriter.h" + +using namespace std; + +namespace tuscany +{ + namespace sca + { + namespace util + { + FileLogWriter::FileLogWriter(const char* logfile) + { + logFile.open(logfile, ios_base::app); + } + + FileLogWriter::~FileLogWriter() + { + logFile.close(); + } + + void FileLogWriter::log(int level, const char*tid, const char* msg) + { + logFile << tid << " "; + for (int i=0; i < level; i++) + { + logFile << " "; + } + logFile << msg < +#include + +#include "tuscany/sca/util/LogWriter.h" + +namespace tuscany +{ + namespace sca + { + namespace util + { + /** + * Log writer to write out to standard out. + */ + class FileLogWriter : public LogWriter + { + public: + FileLogWriter(const char* logfile); + + virtual ~FileLogWriter(); + + /** + * Will write to the console. + * See LogWriter#log. + */ + virtual void log(int level, const char* tid, const char* msg); + private: + std::ofstream logFile; + }; + + } // End namespace util + } // End namespace sca +} // End namespace tuscany +#endif // tuscany_sca_util_defaultlogwriter_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Library.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Library.cpp new file mode 100644 index 0000000000..619205ab7e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Library.cpp @@ -0,0 +1,175 @@ +/* + * 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/util/Library.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/util/Logging.h" + +using namespace std; + +namespace tuscany +{ + namespace sca + { + namespace util + { + Library::Library() + : hDLL(NULL) + { + } + + Library::Library(const string& libraryName) + : name(libraryName), hDLL(NULL) + { + logentry(); + load(); + } + + Library::Library(const Library& lib) + : name(lib.name), hDLL(NULL) + { + logentry(); + if (lib.hDLL) + { + load(); + } + } + + Library& Library::operator=(const Library& lib) + { + logentry(); + if (&lib != this) + { + unload(); + name = lib.name; + load(); + } + return *this; + } + + Library::~Library() + { + logentry(); + unload(); + } + + + void Library::load() + { + logentry(); + loginfo("Library: %s", name.c_str()); + + string msg; +#if defined(WIN32) || defined (_WINDOWS) + int l = name.length(); + string dllName; + if (l>=4 && name.substr(l-4, 4)==".dll") + { + dllName = name; + } + else + { + dllName = name+".dll"; + } + SetErrorMode(SEM_FAILCRITICALERRORS); + hDLL = LoadLibrary(dllName.c_str()); + if (hDLL == NULL) + { + ostringstream msgs; + msgs << "Unable to load library: " + dllName << ", error: "; + Utils::printLastError(msgs); + msg = msgs.str(); + } +#else + int l = name.length(); + string libName; +#ifdef IS_DARWIN + string suffix = ".dylib"; +#else + string suffix = ".so"; +#endif + unsigned int suffixLength = suffix.length(); + if (l>=suffixLength && name.substr(l-suffixLength, suffixLength)==suffix) + { + libName = name; + } + else + { + int s = name.rfind("/"); + if (s == name.length()) + { + libName = name + suffix; + } + else + { + s++; + libName = name.substr(0, s) + "lib" + name.substr(s, name.length()-s) + suffix; + } + } + hDLL = dlopen(libName.c_str(), RTLD_NOW); + if (hDLL == NULL) + { + msg = "Unable to load library: " + libName + ": " + dlerror(); + } +#endif + if (hDLL == NULL) + { + throwException(SystemConfigurationException, msg.c_str()); + } + } + + void Library::unload() + { + logentry(); + loginfo("Library: %s", name.c_str()); + + if (hDLL != NULL) + { +#if defined(WIN32) || defined (_WINDOWS) + FreeLibrary(hDLL); +#else + dlclose(hDLL); +#endif + hDLL = NULL; + } + } + + void* Library::getSymbol(const string& symbol) + { + logentry(); + loginfo("Symbol: %s", symbol.c_str()); + if (!hDLL) + { + return 0; + } +#if defined(WIN32) || defined (_WINDOWS) + return GetProcAddress(hDLL, symbol.c_str()); +#else + return dlsym(hDLL, symbol.c_str()); +#endif + } + + } // End namespace util + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Library.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Library.h new file mode 100644 index 0000000000..6b0a17d2b7 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Library.h @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#ifndef tuscany_sca_util_library_h +#define tuscany_sca_util_library_h + +#if defined(WIN32) || defined (_WINDOWS) +#include +#else +#include +#include +#endif + +#include + +#include "tuscany/sca/export.h" + + +namespace tuscany +{ + namespace sca + { + namespace util + { + /** + * Information about shared libraries and methods to + * access these shared libraries. + */ + class SCA_API Library + { + public: + Library(); + + /** + * Constructor. Will load the library. + * @param libraryName Fully qualified name of the library. + */ + Library(const std::string& libraryName); + + /** + * Destructor. Will unload the library. + */ + virtual ~Library(); + + Library(const Library& lib); + Library& operator=(const Library& lib); + + /** + * Find an externalized symbol in the library. + * @param symbol The name of the symbol to be found. + * @return The pointer to the symbol if found, otherwise 0. + */ + void* getSymbol(const std::string& symbol); + private: + /** + * Name of the library. + */ + std::string name; + + /** + * Handle to the loaded library. + */ +#if defined(WIN32) || defined (_WINDOWS) + HINSTANCE hDLL; +#else + void* hDLL; +#endif + + /** + * Load the library. + */ + void load(); + + /** + * Unload the library, if successfully loaded. + */ + void unload(); + + }; + + } // End namespace util + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_util_library_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/LogWriter.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/LogWriter.cpp new file mode 100644 index 0000000000..e551d04eda --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/LogWriter.cpp @@ -0,0 +1,37 @@ +/* + * 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/LogWriter.h" + +namespace tuscany +{ + namespace sca + { + namespace util + { + LogWriter::~LogWriter() + { + } + + } // End namespace util + } // End namespace sca +} // End namespace tuscany + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/LogWriter.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/LogWriter.h new file mode 100644 index 0000000000..5a6a5c38f7 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/LogWriter.h @@ -0,0 +1,53 @@ +/* + * 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_util_logwriter_h +#define tuscany_sca_util_logwriter_h + +#include "tuscany/sca/export.h" + +namespace tuscany +{ + namespace sca + { + namespace util + { + /** + * Abstract class for extending logging to other destinations. + */ + class SCA_API LogWriter + { + public: + virtual ~LogWriter(); + + /** + * Log a message. + * @param level The level of logging for this message. + * @param tid The current thread id. + * @param msg The message to log. + */ + virtual void log(int level, const char* tid, const char* msg) = 0; + }; + + } // End namespace util + } // End namespace sca +} // End namespace tuscany +#endif // tuscany_sca_util_logwriter_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Logger.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Logger.cpp new file mode 100644 index 0000000000..5745982f42 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Logger.cpp @@ -0,0 +1,276 @@ +/* + * 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 + +#if defined(WIN32) || defined (_WINDOWS) +#include +#include +#else +#include +#include +#endif + +#include "tuscany/sca/util/Logger.h" +#include "tuscany/sca/util/DefaultLogWriter.h" +#include "tuscany/sca/util/FileLogWriter.h" + +using namespace std; + +namespace tuscany +{ + namespace sca + { + namespace util + { + LogWriter* Logger::logWriter = getLogWriter(); + + LogWriter* Logger::getLogWriter() + { + if (logWriter == 0) + { + setLogWriter(0); + + } + return logWriter; + } + + void Logger::setLogWriter(LogWriter* writer) + { + if (logWriter != writer + && logWriter != 0) + { + delete logWriter; + } + + if (writer == 0) + { + char* loggingVar = 0; + loggingVar = getenv("TUSCANY_SCACPP_LOG"); + if (loggingVar == 0) + logWriter = new DefaultLogWriter; + else + logWriter = new FileLogWriter(loggingVar); + } + else + { + logWriter = writer; + } + } + + int Logger::loggingLevel = setLogging(); + + int Logger::setLogging() + { + char* loggingVar = 0; + loggingVar = getenv("TUSCANY_SCACPP_LOGGING"); + if (loggingVar == 0) + return 0; + else + return atoi(loggingVar); + } + + void Logger::setLogging(int level) + { + loggingLevel = level; + } + + void Logger::log(int level, const char* msg) + { + if (level <= loggingLevel) + { + char tid[21]; + formatThreadID(tid); + logWriter->log(level, tid, msg); + } + } + + void Logger::formatThreadID(char* tid) + { +#if defined(WIN32) || defined (_WINDOWS) + sprintf(tid, "%lu:%lu", (unsigned long)_getpid(), (unsigned long)GetCurrentThreadId()); +#else + sprintf(tid, "%lu:%lu", (unsigned long)getpid(), (unsigned long)pthread_self()); +#endif + } + + void Logger::logArgs(int level, const char* msg, ...) + { + if (level <= loggingLevel) + { + va_list variableArguments; + va_start(variableArguments, msg); + char tid[21]; + formatThreadID(tid); + char messageBuffer[256]; +#if defined(WIN32) || defined (_WINDOWS) + int size = _vsnprintf(messageBuffer, 255, msg, variableArguments); + if (size == -1) + { + size = _vscprintf(msg, variableArguments); + char* bigMessageBuffer = new char[size+1]; + _vsnprintf(bigMessageBuffer, size, msg, variableArguments); + bigMessageBuffer[size] = '\0'; + logWriter->log(level, tid, bigMessageBuffer); + delete bigMessageBuffer; + } +#else + int size = vsnprintf(messageBuffer, 255, msg, variableArguments); + if (size > 255) + { + char* bigMessageBuffer = new char[size+1]; + vsnprintf(bigMessageBuffer, size, msg, variableArguments); + bigMessageBuffer[size] = '\0'; + logWriter->log(level, tid, bigMessageBuffer); + delete bigMessageBuffer; + } +#endif + else + { + messageBuffer[255] = '\0'; + logWriter->log(level, tid, messageBuffer); + } + va_end(variableArguments); + } + } + + void Logger::logArgs0(const char* msg, ...) + { + if (0 <= loggingLevel) + { + va_list variableArguments; + va_start(variableArguments, msg); + char tid[21]; + formatThreadID(tid); + char messageBuffer[256]; +#if defined(WIN32) || defined (_WINDOWS) + int size = _vsnprintf(messageBuffer, 255, msg, variableArguments); + if (size == -1) + { + size = _vscprintf(msg, variableArguments); + char* bigMessageBuffer = new char[size+1]; + _vsnprintf(bigMessageBuffer, size, msg, variableArguments); + bigMessageBuffer[size] = '\0'; + logWriter->log(0, tid, bigMessageBuffer); + delete bigMessageBuffer; + } +#else + int size = vsnprintf(messageBuffer, 255, msg, variableArguments); + if (size > 255) + { + char* bigMessageBuffer = new char[size+1]; + vsnprintf(bigMessageBuffer, size, msg, variableArguments); + bigMessageBuffer[size] = '\0'; + logWriter->log(0, tid, bigMessageBuffer); + delete bigMessageBuffer; + } +#endif + else + { + messageBuffer[255] = '\0'; + logWriter->log(0, tid, messageBuffer); + } + va_end(variableArguments); + } + } + void Logger::logArgs1(const char* msg, ...) + { + if (1 <= loggingLevel) + { + va_list variableArguments; + va_start(variableArguments, msg); + char tid[21]; + formatThreadID(tid); + char messageBuffer[256]; +#if defined(WIN32) || defined (_WINDOWS) + int size = _vsnprintf(messageBuffer, 255, msg, variableArguments); + if (size == -1) + { + size = _vscprintf(msg, variableArguments); + char* bigMessageBuffer = new char[size+1]; + _vsnprintf(bigMessageBuffer, size, msg, variableArguments); + bigMessageBuffer[size] = '\0'; + logWriter->log(1, tid, bigMessageBuffer); + delete bigMessageBuffer; + } +#else + int size = vsnprintf(messageBuffer, 255, msg, variableArguments); + if (size > 255) + { + char* bigMessageBuffer = new char[size+1]; + vsnprintf(bigMessageBuffer, size, msg, variableArguments); + bigMessageBuffer[size] = '\0'; + logWriter->log(1, tid, bigMessageBuffer); + delete bigMessageBuffer; + } +#endif + else + { + messageBuffer[255] = '\0'; + logWriter->log(1, tid, messageBuffer); + } + va_end(variableArguments); + } + } + void Logger::logArgs2(const char* msg, ...) + { + if (2 <= loggingLevel) + { + va_list variableArguments; + va_start(variableArguments, msg); + char tid[21]; + formatThreadID(tid); + char messageBuffer[256]; +#if defined(WIN32) || defined (_WINDOWS) + int size = _vsnprintf(messageBuffer, 255, msg, variableArguments); + if (size == -1) + { + size = _vscprintf(msg, variableArguments); + char* bigMessageBuffer = new char[size+1]; + _vsnprintf(bigMessageBuffer, size, msg, variableArguments); + bigMessageBuffer[size] = '\0'; + logWriter->log(2, tid, bigMessageBuffer); + delete bigMessageBuffer; + } +#else + int size = vsnprintf(messageBuffer, 255, msg, variableArguments); + if (size > 255) + { + char* bigMessageBuffer = new char[size+1]; + vsnprintf(bigMessageBuffer, size, msg, variableArguments); + bigMessageBuffer[size] = '\0'; + logWriter->log(2, tid, bigMessageBuffer); + delete bigMessageBuffer; + } +#endif + else + { + messageBuffer[255] = '\0'; + logWriter->log(2, tid, messageBuffer); + } + va_end(variableArguments); + } + } + + } // End namespace util + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Logger.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Logger.h new file mode 100644 index 0000000000..eccf3cf02f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Logger.h @@ -0,0 +1,136 @@ +/* + * 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_util_logger_h +#define tuscany_sca_util_logger_h + +#include "tuscany/sca/export.h" +#include "tuscany/sca/util/LogWriter.h" + +namespace tuscany +{ + namespace sca + { + namespace util + { + /** + * Provide a logging interface. + */ + class Logger { + + public: + /** + * Set the log writer to use. + * @param writer The writer to use for all subsequent logging. + */ + SCA_API static void setLogWriter(LogWriter* writer); + + /** + * Set or reset the logging level. Any message with a higher logging + * level than this value will be filtered (i.e. not shown). + * @param level The level of logging to use for all subsequent logging. + */ + SCA_API static void setLogging(int level); + + /** + * Log a message. + * @param level The log level of this message. + * @param msg The message to be logged. + */ + SCA_API static void log(int level, const char* msg); + + /** + * Log a message with variable arguments. + * @param level The log level of this message. + * @param msg The message to be logged. Must include template + * characters as described in printf. + * @param ... Variable arguments. + */ + SCA_API static void logArgs(int level, const char* msg, ...); + SCA_API static void logArgs0(const char* msg, ...); + SCA_API static void logArgs1(const char* msg, ...); + SCA_API static void logArgs2(const char* msg, ...); + + /** + * The currently set logging level + */ + SCA_API static int loggingLevel; + + private: + /** + * The current log writer. + */ + static LogWriter* logWriter; + + /** + * Get the current log writer. + * @return The current log writer. + */ + static LogWriter* getLogWriter(); + + /** + * Retrieves the logging level set as an environment variable. + */ + static int setLogging(); + + /** + * Print the current thread id into the given char buffer. + */ + static void formatThreadID(char* tid); + + /** + * Message buffer + */ + static char messageBuffer[4096]; + + }; + + class LogEntry + { + public: + + LogEntry(const char* func) + : funcName(func) + { + if (Logger::loggingLevel >= 2) + { + Logger::logArgs(2, ">> %s", funcName); + } + } + + ~LogEntry() + { + if (Logger::loggingLevel >= 2) + { + Logger::logArgs(2, "<< %s", funcName); + } + } + + private: + const char *funcName; + + }; + + } // End namespace util + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_util_logger_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Logging.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Logging.h new file mode 100644 index 0000000000..bf1419faa8 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Logging.h @@ -0,0 +1,44 @@ +/* + * 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_util_logging_h +#define tuscany_sca_util_logging_h + +#include "tuscany/sca/util/Logger.h" + +#if defined(WIN32) || defined (_WINDOWS) +#define logentry() \ +const tuscany::sca::util::LogEntry __LOGENTRY__(__FUNCTION__) +#else +#define logentry() \ +const tuscany::sca::util::LogEntry __LOGENTRY__(__PRETTY_FUNCTION__) +#endif + +#define loginfo \ +if (tuscany::sca::util::Logger::loggingLevel >= 2) tuscany::sca::util::Logger::logArgs2 + +#define logwarning \ +if (tuscany::sca::util::Logger::loggingLevel >= 1) tuscany::sca::util::Logger::logArgs1 + +#define logerror \ +if (tuscany::sca::util::Logger::loggingLevel >= 0) tuscany::sca::util::Logger::logArgs0 + +#endif // tuscany_sca_util_logging_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Mutex.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Mutex.cpp new file mode 100644 index 0000000000..7b62000717 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Mutex.cpp @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#include + +#include + +#include "tuscany/sca/util/Mutex.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/Exceptions.h" + +using namespace std; + + +namespace tuscany +{ + namespace sca + { + namespace util + { + Mutex::Mutex() + { + logentry(); +#if defined(WIN32) || defined (_WINDOWS) + InitializeCriticalSection(§ion); +#else + int rc = pthread_mutex_init(&mutex, NULL); + if (rc) + { + ostringstream msg; + msg << "Failed to create mutex, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } +#endif + } + + Mutex::~Mutex() + { + logentry(); +#if defined(WIN32) || defined (_WINDOWS) + DeleteCriticalSection(§ion); +#else + int rc = pthread_mutex_destroy(&mutex); + if (rc) { + ostringstream msg; + msg << "Failed to destroy mutex, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } +#endif + } + + void Mutex::lock() + { + logentry(); +#if defined(WIN32) || defined (_WINDOWS) + EnterCriticalSection(§ion); +#else + int rc = pthread_mutex_lock(&mutex); + if (rc) { + ostringstream msg; + msg << "Failed to lock mutex, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } +#endif + } + + void Mutex::unlock() + { + logentry(); +#if defined(WIN32) || defined (_WINDOWS) + LeaveCriticalSection(§ion); +#else + int rc = pthread_mutex_unlock(&mutex); + if (rc) { + ostringstream msg; + msg << "Failed to unlock mutex, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } +#endif + } + + } // End namespace util + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Mutex.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Mutex.h new file mode 100644 index 0000000000..d509ba6d73 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Mutex.h @@ -0,0 +1,84 @@ +/* + * 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_util_mutex_h +#define tuscany_sca_util_mutex_h + +#if defined(WIN32) || defined (_WINDOWS) +#include +#else +#include +#endif + +#include "tuscany/sca/export.h" + + +namespace tuscany +{ + namespace sca + { + namespace util + { + /** + * Information about shared libraries and methods to + * access these shared libraries. + */ + class SCA_API Mutex + { + public: + /** + * Constructor. + */ + Mutex(); + + /** + * Destructor. + */ + virtual ~Mutex(); + + /** + * Lock the mutex. + */ + void lock(); + + /** + * Unlock the mutex. + */ + void unlock(); + + private: + + /** + * Handle to the mutex. + */ +#if defined(WIN32) || defined (_WINDOWS) + CRITICAL_SECTION section; +#else + pthread_mutex_t mutex; +#endif + + }; + + } // End namespace util + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_util_mutex_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Queue.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Queue.cpp new file mode 100644 index 0000000000..c124be572c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Queue.cpp @@ -0,0 +1,222 @@ +/* + * 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: 491752 $ $Date: 2007-01-01 22:22:23 -0800 (Mon, 01 Jan 2007) $ */ + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#pragma warning(disable: 4251) +#endif + +#include + +#include + +#include "tuscany/sca/util/Queue.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/Exceptions.h" + +using namespace std; + + +namespace tuscany +{ + namespace sca + { + namespace util + { + Queue::Queue() + { + logentry(); +#if defined(WIN32) || defined (_WINDOWS) + InitializeCriticalSection(§ion); + hevent = CreateEvent (NULL, TRUE, FALSE, NULL); +#else + int rc = pthread_mutex_init(&mutex, NULL); + if (rc) + { + ostringstream msg; + msg << "Failed to create mutex, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } + + rc = pthread_cond_init(&cond, NULL); + if (rc) + { + ostringstream msg; + msg << "Failed to create condition variable, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } +#endif + } + + Queue::~Queue() + { + logentry(); +#if defined(WIN32) || defined (_WINDOWS) + DeleteCriticalSection(§ion); + CloseHandle(hevent); +#else + int rc = pthread_mutex_destroy(&mutex); + if (rc) { + ostringstream msg; + msg << "Failed to destroy mutex, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } + + rc = pthread_cond_destroy(&cond); + if (rc) { + ostringstream msg; + msg << "Failed to destroy condition variable, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } +#endif + } + + void Queue::enqueue(void* element) + { + logentry(); +#if defined(WIN32) || defined (_WINDOWS) + EnterCriticalSection(§ion); + + try + { + queue.push(element); + + if (queue.size() == 1) + { + SetEvent(hevent); + } + } + catch (...) + { + LeaveCriticalSection(§ion); + throw; + } + LeaveCriticalSection(§ion); +#else + int rc = pthread_mutex_lock(&mutex); + if (rc) { + ostringstream msg; + msg << "Failed to lock mutex, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } + try + { + queue.push(element); + + if (queue.size() == 1) + { + rc = pthread_cond_signal(&cond); + if (rc) { + ostringstream msg; + msg << "Failed to broadcast condition variable, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } + } + + } + catch(...) + { + pthread_mutex_unlock(&mutex); + throw; + } + rc = pthread_mutex_unlock(&mutex); + if (rc) { + ostringstream msg; + msg << "Failed to unlock mutex, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } +#endif + } + + void* Queue::dequeue() + { + logentry(); + + void* element = NULL; + +#if defined(WIN32) || defined (_WINDOWS) + + EnterCriticalSection(§ion); + try + { + while (queue.size() == 0) { + LeaveCriticalSection(§ion); + WaitForSingleObject(hevent, INFINITE); + EnterCriticalSection(§ion); + } + + element = queue.front(); + queue.pop(); + + if (queue.size() == 0) + { + ResetEvent(hevent); + } + } + catch(...) + { + LeaveCriticalSection(§ion); + throw; + } + LeaveCriticalSection(§ion); + +#else + int rc = pthread_mutex_lock(&mutex); + if (rc) { + ostringstream msg; + msg << "Failed to lock mutex, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } + try + { + while (queue.size() == 0) { + rc = pthread_cond_wait(&cond, &mutex); + if (rc) { + ostringstream msg; + msg << "Failed to wait for condition variable, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } + } + + element = queue.front(); + queue.pop(); + } + catch(...) + { + pthread_mutex_unlock(&mutex); + throw; + } + rc = pthread_mutex_unlock(&mutex); + if (rc) { + ostringstream msg; + msg << "Failed to unlock mutex, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } + +#endif + + return element; + } + + } // End namespace util + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Queue.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Queue.h new file mode 100644 index 0000000000..e2ff104631 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Queue.h @@ -0,0 +1,93 @@ +/* + * 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: 492011 $ $Date: 2007-01-02 18:15:11 -0800 (Tue, 02 Jan 2007) $ */ + +#ifndef tuscany_sca_util_queue_h +#define tuscany_sca_util_queue_h + +#if defined(WIN32) || defined (_WINDOWS) +#include +#else +#include +#endif + +#include + +#include "tuscany/sca/export.h" + + +namespace tuscany +{ + namespace sca + { + namespace util + { + /** + * A thread safe FIFO queue. + */ + class SCA_API Queue + { + public: + /** + * Constructor. + */ + Queue(); + + /** + * Destructor. + */ + virtual ~Queue(); + + /** + * Dequeue an element + */ + void* dequeue(); + + /** + * Enqueue an element + */ + void enqueue(void* element); + + private: + + /** + * The STL queue used to hold elements. + */ + std::queue queue; + + /** + * Handles to the mutex and condition variable + * used to synchronize access to the queue. + */ +#if defined(WIN32) || defined (_WINDOWS) + CRITICAL_SECTION section; + HANDLE hevent; +#else + pthread_mutex_t mutex; + pthread_cond_t cond; +#endif + + }; + + } // End namespace util + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_util_queue_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/SDOUtils.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/SDOUtils.cpp new file mode 100644 index 0000000000..513409db6a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/SDOUtils.cpp @@ -0,0 +1,438 @@ +/* + * 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) +#endif + +#include "tuscany/sca/util/SDOUtils.h" + +using namespace std; +using namespace commonj::sdo; + +namespace tuscany +{ + namespace sca + { + namespace util + { + + /** + * Constructor + */ + SDOVisitor::SDOVisitor() + { + } + + /** + * Destructor + */ + SDOVisitor::~SDOVisitor() + { + } + + SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, bool boolData) + { + return SDOVisitor::RESULT_NOT_SUPPORTED; + } + + SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, char byteData) + { + return SDOVisitor::RESULT_NOT_SUPPORTED; + } + + SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, const char* bytesData) + { + return SDOVisitor::RESULT_NOT_SUPPORTED; + } + + SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, wchar_t charData) + { + return SDOVisitor::RESULT_NOT_SUPPORTED; + } + + SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, const SDODate& dateData) + { + return SDOVisitor::RESULT_NOT_SUPPORTED; + } + + SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, long double doubleData) + { + return SDOVisitor::RESULT_NOT_SUPPORTED; + } + + SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, float floatData) + { + return SDOVisitor::RESULT_NOT_SUPPORTED; + } + + SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, long intData) + { + return SDOVisitor::RESULT_NOT_SUPPORTED; + } + + SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, short shortData) + { + return SDOVisitor::RESULT_NOT_SUPPORTED; + } + + SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, const string& stringData) + { + return SDOVisitor::RESULT_CONTINUE; + } + + SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, DataObjectPtr dataObjectData) + { + return SDOVisitor::RESULT_CONTINUE; + } + + const char* SDOUtils::sdoURI = "commonj.sdo"; + + SDOVisitor::RESULT SDOUtils::accept(DataObjectPtr dataObject, SDOVisitor& visitor, SDOVisitor::DEPTH depth) + { + SDOVisitor::RESULT result = SDOVisitor::RESULT_CONTINUE; + + const Type& type = dataObject->getType(); + if (type.isSequencedType()) + { + SequencePtr sequence = dataObject->getSequence(); + int size = sequence->size(); + for (int i = 0; i < size; i++) + { + if (sequence->isText(i)) + { + const string text(sequence->getCStringValue(i)); + result = visitor.visit(dataObject, *(Property*)NULL, (const string&)text); + } + else + { + const Property& seqProperty = sequence->getProperty(i); + const Type& seqType = seqProperty.getType(); + if (seqType.isDataObjectType()) + { + DataObjectPtr dob; + if (seqProperty.isMany()) + { + int index = sequence->getListIndex(i); + dob = dataObject->getList(seqProperty)[index]; + } + else + { + dob = dataObject->getDataObject(seqProperty); + } + + if (dob) + { + result = visitor.visit(dataObject, seqProperty, (DataObjectPtr)dob); + } + } + else + { + Type::Types t = seqProperty.getTypeEnum(); + switch (t) + { + case Type::BooleanType: + { + result = visitor.visit(dataObject, seqProperty, (bool)sequence->getBooleanValue(i)); + } + break; + case Type::ByteType: + { + result = visitor.visit(dataObject, seqProperty, (char)sequence->getByteValue(i)); + } + break; + case Type::CharacterType: + { + result = visitor.visit(dataObject, seqProperty, (wchar_t)sequence->getCharacterValue(i)); + } + break; + case Type::IntType: + { + result = visitor.visit(dataObject, seqProperty, (long)sequence->getIntValue(i)); + } + break; + case Type::ShortType: + { + result = visitor.visit(dataObject, seqProperty, (short)sequence->getShortValue(i)); + } + break; + case Type::DoubleType: + { + result = visitor.visit(dataObject, seqProperty, (long double)sequence->getDoubleValue(i)); + } + break; + case Type::FloatType: + { + result = visitor.visit(dataObject, seqProperty, (float)sequence->getFloatValue(i)); + } + break; + case Type::LongType: + { + result = visitor.visit(dataObject, seqProperty, (long)sequence->getLongValue(i)); + } + break; + case Type::DateType: + { + const SDODate date = sequence->getDateValue(i); + result = visitor.visit(dataObject, seqProperty, (long)(const time_t)date.getTime()); + } + break; + case Type::BigDecimalType: + case Type::BigIntegerType: + case Type::UriType: + case Type::StringType: + { + ; + const string stringData(sequence->getCStringValue(i)); + result = visitor.visit(dataObject, seqProperty, (const string&)stringData); + } + break; + case Type::BytesType: + { + unsigned int len = sequence->getLength(i); + char* byteData = new char[len]; + sequence->getBytesValue(i, byteData, len); + result = visitor.visit(dataObject, seqProperty, byteData); + delete byteData; + } + break; + default: + result = SDOVisitor::RESULT_NOT_SUPPORTED; + break; + } + if (result == SDOVisitor::RESULT_NOT_SUPPORTED) + { + ; + const string stringData(sequence->getCStringValue(i)); + result = visitor.visit(dataObject, seqProperty, (const string&)stringData); + } + } + } + if (result == SDOVisitor::RESULT_STOP) + return result; + } + } + else + { + PropertyList pl = dataObject->getInstanceProperties(); + for (unsigned int i = 0; i < pl.size(); i++) + { + if (dataObject->isSet(pl[i])) + { + if (pl[i].getType().isDataObjectType()) + { + if (pl[i].isMany()) + { + DataObjectList& doList = dataObject->getList(pl[i]); + for (unsigned int li = 0; li < doList.size(); li++) + { + DataObjectPtr dob = doList[li]; + result = visitor.visit(dataObject, pl[i], (DataObjectPtr)dob); + if (result == SDOVisitor::RESULT_STOP) + return result; + } + } + else + { + DataObjectPtr dob = dataObject->getDataObject(pl[i]); + result = visitor.visit(dataObject, pl[i], (DataObjectPtr)dob); + } + } + else + { + if (pl[i].isMany()) + { + Type::Types t = pl[i].getTypeEnum(); + DataObjectList& doList = dataObject->getList(pl[i]); + for (unsigned int li = 0; li < doList.size(); li++) + { + switch (t) + { + case Type::BooleanType: + { + result = visitor.visit(dataObject, pl[i], (bool)doList.getBoolean(li)); + } + break; + case Type::ByteType: + { + result = visitor.visit(dataObject, pl[i], (char)doList.getByte(li)); + } + break; + case Type::CharacterType: + { + result = visitor.visit(dataObject, pl[i], (wchar_t)doList.getCharacter(li)); + } + break; + case Type::IntType: + { + result = visitor.visit(dataObject, pl[i], (long)doList.getInt(li)); + } + break; + case Type::ShortType: + { + result = visitor.visit(dataObject, pl[i], (short)doList.getShort(li)); + } + break; + case Type::DoubleType: + { + result = visitor.visit(dataObject, pl[i], (long double)doList.getDouble(li)); + } + break; + case Type::FloatType: + { + result = visitor.visit(dataObject, pl[i], (float)doList.getFloat(li)); + } + break; + case Type::LongType: + { + result = visitor.visit(dataObject, pl[i], (long)doList.getLong(li)); + } + break; + case Type::DateType: + { + const SDODate date = doList.getDate(li); + result = visitor.visit(dataObject, pl[i], (long)(const time_t)date.getTime()); + } + break; + case Type::BigDecimalType: + case Type::BigIntegerType: + case Type::UriType: + case Type::StringType: + { + const string stringData(doList.getCString(li)); + result = visitor.visit(dataObject, pl[i], (const string&)stringData); + } + break; + case Type::BytesType: + { + unsigned int len = doList.getLength(li); + char* byteData = new char[len]; + doList.getBytes(li, byteData, len); + result = visitor.visit(dataObject, pl[i], byteData); + delete byteData; + } + break; + default: + result = SDOVisitor::RESULT_NOT_SUPPORTED; + break; + } + if (result == SDOVisitor::RESULT_NOT_SUPPORTED) + { + const string stringData(doList.getCString(li)); + result = visitor.visit(dataObject, pl[i], (const string&)stringData); + } + if (result == SDOVisitor::RESULT_STOP) + return result; + } + } + else + { + Type::Types t = pl[i].getTypeEnum(); + switch (t) + { + case Type::BooleanType: + { + result = visitor.visit(dataObject, pl[i], (bool)dataObject->getBoolean(pl[i])); + } + break; + case Type::ByteType: + { + result = visitor.visit(dataObject, pl[i], (char)dataObject->getByte(pl[i])); + } + break; + case Type::CharacterType: + { + result = visitor.visit(dataObject, pl[i], (wchar_t)dataObject->getCharacter(pl[i])); + } + break; + case Type::IntType: + { + result = visitor.visit(dataObject, pl[i], (long)dataObject->getInt(pl[i])); + } + break; + case Type::ShortType: + { + result = visitor.visit(dataObject, pl[i], (short)dataObject->getShort(pl[i])); + } + break; + case Type::DoubleType: + { + result = visitor.visit(dataObject, pl[i], (long double)dataObject->getDouble(pl[i])); + } + break; + case Type::FloatType: + { + result = visitor.visit(dataObject, pl[i], (float)dataObject->getFloat(pl[i])); + } + break; + case Type::LongType: + { + result = visitor.visit(dataObject, pl[i], (long)dataObject->getLong(pl[i])); + } + break; + case Type::DateType: + { + const SDODate date = dataObject->getDate(pl[i]); + result = visitor.visit(dataObject, pl[i], (long)(const time_t)date.getTime()); + } + break; + case Type::BigDecimalType: + case Type::BigIntegerType: + case Type::UriType: + case Type::StringType: + { + const string stringData(dataObject->getCString(pl[i])); + result = visitor.visit(dataObject, pl[i], (const string&)stringData); + } + break; + case Type::BytesType: + { + unsigned int len = dataObject->getLength(pl[i]); + char* byteData = new char[len]; + dataObject->getBytes(pl[i], byteData, len); + result = visitor.visit(dataObject, pl[i], byteData); + delete byteData; + } + break; + default: + result = SDOVisitor::RESULT_NOT_SUPPORTED; + break; + } + if (result == SDOVisitor::RESULT_NOT_SUPPORTED) + { + const string stringData(dataObject->getCString(pl[i])); + result = visitor.visit(dataObject, pl[i], (const string&)stringData); + } + } + } + } + if (result == SDOVisitor::RESULT_STOP) + return result; + } + } + + return SDOVisitor::RESULT_CONTINUE; + } + + } // End namespace util + } // End namespace sca +} // End namespace tuscany + diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/SDOUtils.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/SDOUtils.h new file mode 100644 index 0000000000..5be65c355a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/SDOUtils.h @@ -0,0 +1,106 @@ +/* + * 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_util_sdovisitor_h +#define tuscany_sca_util_sdovisitor_h + +#include +#include +#include + +#include "commonj/sdo/SDO.h" + +#include "tuscany/sca/export.h" + +namespace tuscany +{ + namespace sca + { + namespace util + { + /** + * An SDO visitor interface + */ + class SCA_API SDOVisitor + { + public: + /** + * Constructor. + */ + SDOVisitor(); + + /** + * Destructor. + */ + virtual ~SDOVisitor(); + + /** + * Visit depth + */ + enum DEPTH + { + DEPTH_ZERO = 0, + DEPTH_ONE, + DEPTH_INFINITE + }; + + /** + * Visit status + */ + enum RESULT + { + RESULT_CONTINUE = 0, + RESULT_STOP, + RESULT_NOT_SUPPORTED + }; + + /** + * Visit an SDO. + */ + virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, bool boolData); + virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, char byteData); + virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, const char* bytesData); + virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, wchar_t charData); + virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, const commonj::sdo::SDODate& dateData); + virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, long double doubleData); + virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, float floatData); + virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, long intData); + virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, short shortData); + virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, const std::string& stringData); + virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, commonj::sdo::DataObjectPtr dataObjectData); + }; + + /** + * SDO utilities. + */ + class SCA_API SDOUtils + { + public: + + static SDOVisitor::RESULT accept(commonj::sdo::DataObjectPtr dataObject, SDOVisitor& visitor, SDOVisitor::DEPTH depth); + static const char* sdoURI; + + }; + + } // End namespace util + } // End namespace sca +} // End namespace tuscany +#endif // tuscany_sca_sdovisitor_file_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Thread.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Thread.cpp new file mode 100644 index 0000000000..064a91409b --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Thread.cpp @@ -0,0 +1,124 @@ +/* + * 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: 491752 $ $Date: 2007-01-01 22:22:23 -0800 (Mon, 01 Jan 2007) $ */ + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#include +#endif + +#include + +#include + +#include "tuscany/sca/util/Thread.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/Exceptions.h" + +using namespace std; + + +namespace tuscany +{ + namespace sca + { + namespace util + { + +#if defined(WIN32) || defined (_WINDOWS) + unsigned int __stdcall runThread(void *args) + { + Thread* thread = (Thread*)args; + thread->run(); + return 0; + } +#else + void* runThread(void* args) + { + Thread* thread = (Thread*)args; + thread->run(); + return NULL; + } +#endif + + Thread::Thread() +#if defined(WIN32) || defined (_WINDOWS) + : hthread(0) +#else +#endif + { + logentry(); + } + + Thread::~Thread() + { + logentry(); +#if defined(WIN32) || defined (_WINDOWS) + if (hthread != 0) + { + CloseHandle(hthread); + } +#else +#endif + } + + void Thread::start() + { + logentry(); +#if defined(WIN32) || defined (_WINDOWS) + hthread = (HANDLE)_beginthreadex(NULL, 0, runThread, this, 0, NULL); + if (hthread == 0) + { + ostringstream msg; + msg << "Failed to create thread, errno: " << __doserrno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } +#else + int rc =pthread_create(&thread, NULL, runThread, this); + if (rc) + { + ostringstream msg; + msg << "Failed to create thread, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } +#endif + } + + void Thread::join() + { + logentry(); + +#if defined(WIN32) || defined (_WINDOWS) + WaitForSingleObject(hthread, INFINITE); +#else + int rc =pthread_join(thread, NULL); + if (rc) + { + ostringstream msg; + msg << "Failed to join thread, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } +#endif + } + + } // End namespace util + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Thread.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Thread.h new file mode 100644 index 0000000000..2ca9142994 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Thread.h @@ -0,0 +1,90 @@ +/* + * 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: 492011 $ $Date: 2007-01-02 18:15:11 -0800 (Tue, 02 Jan 2007) $ */ + +#ifndef tuscany_sca_util_thread_h +#define tuscany_sca_util_thread_h + +#if defined(WIN32) || defined (_WINDOWS) +#include +#else +#include +#endif + +#include + +#include "tuscany/sca/export.h" + + +namespace tuscany +{ + namespace sca + { + namespace util + { + /** + * A portable wrapper for native threads. + */ + class SCA_API Thread + { + public: + /** + * Constructor. + */ + Thread(); + + /** + * Destructor. + */ + virtual ~Thread(); + + /** + * The method that will be run in the thread. + */ + virtual void run() = 0; + + /** + * Start the thread. + */ + void start(); + + /** + * Join the thread. + */ + void join(); + + private: + + /** + * Native thread handle. + */ +#if defined(WIN32) || defined (_WINDOWS) + HANDLE hthread; +#else + pthread_t thread; +#endif + + }; + + } // End namespace util + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_util_thread_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/ThreadLocal.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/ThreadLocal.cpp new file mode 100644 index 0000000000..07c99b3cb1 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/ThreadLocal.cpp @@ -0,0 +1,114 @@ +/* + * 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 + +#include "tuscany/sca/util/ThreadLocal.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/Exceptions.h" + +using namespace std; + + +namespace tuscany +{ + namespace sca + { + namespace util + { + ThreadLocal::ThreadLocal() + { + logentry(); +#if defined(WIN32) || defined (_WINDOWS) + index = TlsAlloc(); + if (index == TLS_OUT_OF_INDEXES) + { + ostringstream msg; + msg << "Failed to create thread local index, error: " << GetLastError(); + throwException(TuscanyRuntimeException, msg.str().c_str()); + } +#else + int rc = pthread_key_create(&key, NULL); + if (rc) + { + ostringstream msg; + msg << "Failed to create thread local key, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } +#endif + } + + ThreadLocal::~ThreadLocal() + { + logentry(); +#if defined(WIN32) || defined (_WINDOWS) + if (!TlsFree(index)) + { + ostringstream msg; + msg << "Failed to destroy thread local index, error: " << GetLastError(); + throwException(TuscanyRuntimeException, msg.str().c_str()); + } +#else + int rc = pthread_key_delete(key); + if (rc) { + ostringstream msg; + msg << "Failed to destroy thread local key, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } +#endif + } + + void ThreadLocal::setValue(void* value) + { + logentry(); +#if defined(WIN32) || defined (_WINDOWS) + if (!TlsSetValue(index, value)) + { + ostringstream msg; + msg << "Failed to set thread local value, error: " << GetLastError(); + throwException(TuscanyRuntimeException, msg.str().c_str()); + } +#else + int rc = pthread_setspecific(key, value); + if (rc) { + ostringstream msg; + msg << "Failed to set thread local value, errno: " << errno; + throwException(TuscanyRuntimeException, msg.str().c_str()); + } +#endif + } + + void* ThreadLocal::getValue() const + { + logentry(); +#if defined(WIN32) || defined (_WINDOWS) + return TlsGetValue(index); +#else + return pthread_getspecific(key); +#endif + } + + } // End namespace util + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/ThreadLocal.h b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/ThreadLocal.h new file mode 100644 index 0000000000..556055f183 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/ThreadLocal.h @@ -0,0 +1,84 @@ +/* + * 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_util_threadlocal_h +#define tuscany_sca_util_threadlocal_h + +#if defined(WIN32) || defined (_WINDOWS) +#include +#else +#include +#endif + +#include "tuscany/sca/export.h" + + +namespace tuscany +{ + namespace sca + { + namespace util + { + /** + * Information about shared libraries and methods to + * access these shared libraries. + */ + class SCA_API ThreadLocal + { + public: + /** + * Constructor. + */ + ThreadLocal(); + + /** + * Destructor. + */ + virtual ~ThreadLocal(); + + /** + * Set the ThreadLocal value. + */ + void setValue(void *value); + + /** + * Get the ThreadLocal value. + */ + void* getValue() const; + + private: + + /** + * Handle to the thread local key. + */ +#if defined(WIN32) || defined (_WINDOWS) + DWORD index; +#else + pthread_key_t key; +#endif + + }; + + } // End namespace util + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_util_threadlocal_h diff --git a/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Utils.cpp b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Utils.cpp new file mode 100644 index 0000000000..98a929392d --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/src/tuscany/sca/util/Utils.cpp @@ -0,0 +1,598 @@ +/* + * 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) +#endif + +#if defined(WIN32) || defined (_WINDOWS) +#include +#else +#include +#endif + +#include "tuscany/sca/util/Utils.h" + +using namespace std; +using namespace commonj::sdo; + +namespace tuscany +{ + namespace sca + { + namespace util + { + void Utils::tokeniseUri(const string& uri, string& token1, string& token2) + { + tokeniseString("/", uri, token1, token2); + } + + void Utils::tokeniseQName(const string& qname, string& uri, string& name) + { + tokeniseString("#", qname, uri, name); + if (name == "") + { + name = uri; + uri = ""; + } + } + + void Utils::tokeniseString( + const string& separator, + const string& str, + string& token1, + string& token2) + { + string::size_type sep = str.find(separator); + if (sep != string::npos) + { + int l = separator.length(); + token1 = str.substr(0, sep); + if ( (sep+l) < str.length()) + { + token2 = str.substr(sep+l); + } + else + { + token2 = ""; + } + } + else + { + token1 = str; + token2 = ""; + } + } + + void Utils::rTokeniseString( + const string& separator, + const string& str, + string& token1, + string& token2) + { + string::size_type sep = str.rfind(separator); + if (sep != string::npos) + { + int l = separator.length(); + token1 = str.substr(0, sep); + if ( (sep+l) < str.length()) + { + token2 = str.substr(sep+l); + } + else + { + token2 = ""; + } + } + else + { + token1 = ""; + token2 = str; + } + } + + void Utils::breakpoint() { + // dummy method used to set breakpoints + } + + ////////////////////////////////////////////////////////////////////////// + // Print a DatObject tree + ////////////////////////////////////////////////////////////////////////// + void Utils::tabs(int inc) + { + for (int ind=0; ind isSet(prop1) != dataObject2->isSet(prop2)) + { + diff.append("Property "); + diff.append(prop1.getName()); + diff.append(" is set on one DataObject but not the other"); + return false; + } + + if (dataObject1->isSet(prop1)) + { + + if (prop1.isMany() != prop2.isMany()) + { + diff.append("Property "); + diff.append(prop1.getName()); + diff.append(" is many on one DataObject but not the other"); + return false; + } + if (propertyType1.isDataType() != propertyType2.isDataType()) + { + diff.append("Property "); + diff.append(prop1.getName()); + diff.append(" is dataType on one DataObject but not the other"); + return false; + } + + ////////////////////////////////////////////////////////////////////// + // For a many-valued property get the list of values + ////////////////////////////////////////////////////////////////////// + if (prop1.isMany()) + { + DataObjectList& dol1 = dataObject1->getList(prop1); + DataObjectList& dol2 = dataObject2->getList(prop2); + if (dol1.size() != dol2.size()) + { + diff.append("Property "); + diff.append(prop1.getName()); + diff.append(" is many but has differing number of elements"); + return false; + } + + for (unsigned int j = 0; j getCString(prop1), dataObject2->getCString(prop2)) != 0) + { + diff.append("Differing value for Property "); + diff.append(prop1.getName()); + diff.append(":\n"); + diff.append(dataObject1->getCString(prop1)); + diff.append("\n"); + diff.append(dataObject2->getCString(prop2)); + return false; + } + } + + ////////////////////////////////////////////////////////////////////// + // For a dataobject compare the DOs + ////////////////////////////////////////////////////////////////////// + else + { + if(!compareDataObjects(dataObject1->getDataObject(prop1), dataObject2->getDataObject(prop2), diff)) + { + return false; + } + } + } + return true; + } + + const bool Utils::compareDataObjects(DataObjectPtr dataObject1, DataObjectPtr dataObject2, string& diff) + { + if (!dataObject1 || !dataObject2) + { + diff.append("Cannot compare null DataObjects"); + return false; + } + + const Type& dataObject1Type = dataObject1->getType(); + const Type& dataObject2Type = dataObject2->getType(); + + if( strcmp(dataObject1Type.getURI(), dataObject2Type.getURI()) != 0 || + strcmp(dataObject1Type.getName(), dataObject2Type.getName()) != 0 ) + { + diff.append("DataObject Types differ:\n"); + diff.append(dataObject1Type.getURI()); + diff.append("#"); + diff.append(dataObject1Type.getName()); + diff.append("\n"); + diff.append(dataObject2Type.getURI()); + diff.append("#"); + diff.append(dataObject2Type.getName()); + return false; + } + + ////////////////////////////////////////////////////////////////////////// + // Iterate over all the properties + ////////////////////////////////////////////////////////////////////////// + PropertyList pl1 = dataObject1->getInstanceProperties(); + PropertyList pl2 = dataObject2->getInstanceProperties(); + if (pl1.size() != pl2.size()) + { + diff.append("Differing number of properties"); + return false; + } + + if (pl1.size() != 0) + { + for (unsigned int i = 0; i < pl1.size(); i++) + { + if(!compareProperties(dataObject1, pl1[i], dataObject2, pl2[i], diff)) + { + return false; + } + } + } + else + { + if(dataObject1->getType().isOpenType() != dataObject2->getType().isOpenType() && + dataObject1->getType().isDataObjectType() != dataObject2->getType().isDataObjectType()) + { + diff.append("DataObject is open & DO type on one but not the other"); + return false; + } + + // Compare elements under an open DataObject + if(dataObject1->getType().isOpenType() && dataObject1->getType().isDataObjectType()) + { + SequencePtr sequence1 = dataObject1->getSequence(); + SequencePtr sequence2 = dataObject2->getSequence(); + + if (sequence1 != NULL && sequence2 != NULL) + { + if (sequence1->size() != sequence1->size()) + { + diff.append("Open DataObjects have differing number of elements"); + return false; + } + + for (unsigned int i = 0; i < sequence1->size(); i++) + { + if (sequence1->isText(i) != sequence2->isText(i)) + { + diff.append("Open DataObjects have differing element types at position "); + diff += ((int) i); + return false; + } + if (sequence1->isText(i)) + { + if( strcmp(sequence1->getCStringValue(i), sequence2->getCStringValue(i)) != 0) + { + diff.append("Differing value for element at position "); + diff += ((int) i); + diff.append(":\n"); + diff.append(sequence1->getCStringValue(i)); + diff.append("\n"); + diff.append(sequence2->getCStringValue(i)); + return false; + } + } + else + { + const Property& p1 = sequence1->getProperty(i); + const Property& p2 = sequence2->getProperty(i); + + if(!compareProperties(dataObject1, p1, dataObject2, p2, diff)) + { + return false; + } + } + } + } + } + } + + return true; + } + + void Utils::printDO(DataObjectPtr dataObject, int increment) + { + int inc=increment; + if (!dataObject) + return; + const Type& dataObjectType = dataObject->getType(); + tabs(inc); + cout << "DataObject type: " << dataObjectType.getURI()<< "#" << dataObjectType.getName() << endl; + inc++; + + ////////////////////////////////////////////////////////////////////////// + // Iterate over all the properties + ////////////////////////////////////////////////////////////////////////// + PropertyList pl = dataObject->getInstanceProperties(); + if (pl.size() != 0) + { + for (unsigned int i = 0; i < pl.size(); i++) + { + tabs(inc); + cout << "Property: " << pl[i].getName() << endl; + + const Type& propertyType = pl[i].getType(); + + tabs(inc); + cout << "Property Type: " << propertyType.getURI()<< "#" << propertyType.getName() << endl; + + if (dataObject->isSet(pl[i])) + { + + ////////////////////////////////////////////////////////////////////// + // For a many-valued property get the list of values + ////////////////////////////////////////////////////////////////////// + if (pl[i].isMany()) + { + inc++; + DataObjectList& dol = dataObject->getList(pl[i]); + for (unsigned int j = 0; j getCString(pl[i]) <getDataObject(pl[i]), inc); + inc--; + } + } + else + { + tabs(inc); + cout<< "Property Value: not set" <getType().isOpenType() && dataObject->getType().isDataObjectType()) + { + SequencePtr sequence = dataObject->getSequence(); + if (sequence != NULL) + { + for (unsigned int i = 0; i < sequence->size(); i++) + { + if (sequence->isText(i)) + { + tabs(inc); + cout<< "Text Value: " << sequence->getCStringValue(i) <getProperty(i); + + tabs(inc); + cout << "Property: " << p.getName() << endl; + + const Type& propertyType = p.getType(); + + tabs(inc); + cout << "Property Type: " << propertyType.getURI()<< "#" << propertyType.getName() << endl; + + if (dataObject->isSet(p)) + { + + ////////////////////////////////////////////////////////////////////// + // For a many-valued property get the list of values + ////////////////////////////////////////////////////////////////////// + if (p.isMany()) + { + inc++; + DataObjectList& dol = dataObject->getList(p); + for (unsigned int j = 0; j getCString(p) <getDataObject(p), inc); + inc--; + } + } + else + { + tabs(inc); + cout<< "Property Value: not set" <getTypes(); + for (unsigned int i = 0; i < tl.size(); i++) + { + cout << "Type: " << tl[i].getURI()<< "#" << tl[i].getName() << endl; + PropertyList pl = tl[i].getProperties(); + for (unsigned int j = 0; j < pl.size(); j++) + { + cout << "\tProperty: " << pl[j].getName() + << " type: " < +#include + +#include "commonj/sdo/SDO.h" + +#include "tuscany/sca/export.h" + +namespace tuscany +{ + namespace sca + { + namespace util + { + /** + * Utility methods to parse strings and provide debugging information. + */ + class SCA_API Utils { + + public: + static void tokeniseUri(const std::string& uri, std::string& token1, std::string& token2); + static void tokeniseQName(const std::string& sdoname, std::string& uri, std::string& name); + static void tokeniseString( + const std::string& separator, + const std::string& str, + std::string& token1, + std::string& token2); + + static void rTokeniseString( + const std::string& separator, + const std::string& str, + std::string& token1, + std::string& token2); + + static void breakpoint(); + + static void printLastError(std::ostream& os); + + static void printDO(commonj::sdo::DataObjectPtr dataObject, int increment=0); + static void printTypes(commonj::sdo::DataFactoryPtr df); + static void printType(const commonj::sdo::Type& type, int increment=0); + + static const bool compareDataObjects(commonj::sdo::DataObjectPtr dataObject1, commonj::sdo::DataObjectPtr dataObject2, std::string& diff); + static const bool compareProperties(commonj::sdo::DataObjectPtr dataObject1, const commonj::sdo::Property& prop1, commonj::sdo::DataObjectPtr dataObject2, const commonj::sdo::Property& prop2, std::string& diff); + + private: + static void tabs(int increment=0); + }; + + } // End namespace util + } // End namespace sca +} // End namespace tuscany +#endif // tuscany_sca_util_utils_h diff --git a/sca-cpp/trunk/contrib/runtime/core/test/Makefile.am b/sca-cpp/trunk/contrib/runtime/core/test/Makefile.am new file mode 100644 index 0000000000..de5c2d1b1e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/Makefile.am @@ -0,0 +1,17 @@ +# 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. + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/SCATestMacros.h b/sca-cpp/trunk/contrib/runtime/core/test/SCATestMacros.h new file mode 100644 index 0000000000..58c640f8a6 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/SCATestMacros.h @@ -0,0 +1,84 @@ +/* + * 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 sca_tests_macros_h_ +#define sca_tests_macros_h_ + +#include + +#define TEST_TRACE( message ) \ + std::cout << "\tTRACE: " << message << std::endl; + +#define TEST_ASSERT( val ) \ + if( ! val ) { \ + std::cout << "Test failed in: " << __FILE__ << ": " << __LINE__ << std::endl; \ + return false; \ + } + +#define TEST_ASSERT_EQUALS( val1, val2 ) \ + if( val1 != val2 ) { \ + std::cout << "Test failed in: " << __FILE__ << ": " << __LINE__ << std::endl; \ + return false; \ + } + +#define TEST_ASSERT_NOT_EQUALS( val1, val2 ) \ + if( val1 == val2 ) { \ + std::cout << "Test failed in: " << __FILE__ << ": " << __LINE__ << std::endl; \ + return false; \ + } + +#define TEST_FAIL( message ) \ + std::cout << "Test failed in: " << __FILE__ << ":" << __LINE__ << ": " << message << std::endl; \ + return false; + +// For this macro, you must have the following variables defined: +// int testsPassed = 0; +// int testsTotal = 0; +// bool retval = false; +// The macro calls the test and increments the total and passed +// tests and logs accordingly +// +#define TEST(testName) \ + ++testsTotal; \ + try { \ + std::cout << "\nTest " << testsTotal << ": " << #testName << " ..... " << std::endl; \ + retval = testName; \ + if (retval) { \ + std::cout << "PASSED" << std::endl; \ + ++testsPassed; \ + } \ + else { \ + std::cout << "FAILED" << std::endl; \ + } \ + } \ + catch(const tuscany::sca::TuscanyRuntimeException &scaE) { \ + std::cout << "FAILED (unexpected SCA exception): " << scaE.getMessageText() \ + << std::endl; \ + } \ + catch(const commonj::sdo::SDORuntimeException &sdoE) { \ + std::cout << "FAILED (unexpected SDO exception): " << sdoE.getMessageText() \ + << std::endl; \ + } \ + catch(...) { \ + std::cout << "FAILED (unexpected unknown exception)" << std::endl; \ + } + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/core/test/main.cpp b/sca-cpp/trunk/contrib/runtime/core/test/main.cpp new file mode 100644 index 0000000000..9f9f733b49 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/main.cpp @@ -0,0 +1,95 @@ +/* + * 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: 583039 $ $Date: 2007-10-08 20:49:57 -0700 (Mon, 08 Oct 2007) $ */ + +#pragma warning(disable:4786) + +#include + +#include "tuscany/sca/core/Exceptions.h" + +#include "SCATestMacros.h" +#include "wsdlTests/wsdlTests.h" +//#include "compositeTests/compositeTests.h" + +using namespace std; + +extern "C"{ + +int main (int argc, char** argv) +{ + // These variables are used and set by the TEST macro + int testsPassed = 0; + int testsTotal = 0; + bool retval = false; + + try + { + WSDLDefinitionTest wsdlTest; + TEST( wsdlTest.testSimple() ); + + WSDLErrorsTest wsdlErrorsTest; +// TEST( wsdlErrorsTest.testDuplicateWSDLInputOutputBinding() ); // fails, JIRA 1900 +// TEST( wsdlErrorsTest.testDuplicateWSDLMessagePartNames() ); // fails, JIRA 1900 + + TEST( wsdlErrorsTest.testDuplicateWSDLBindings() ); + TEST( wsdlErrorsTest.testDuplicateWSDLMessages() ); + TEST( wsdlErrorsTest.testDuplicateWSDLServices() ); + TEST( wsdlErrorsTest.testDuplicateWSDLPortTypes() ); + + // The following 4 tests fail due to an SDO SPEC limitation: + // According to XSD rules, if a global element xsd:any has + // maxOccurs > 1 you can only have a single valued property + // The multiple SOAP addresses/bindings/bodies/operations should load + // and I should be able to get the list and throw if list.size() > 1 + // but I cant because SDO says its a single value element +// TEST( wsdlErrorsTest.testDuplicateSOAPAddress() ); +// TEST( wsdlErrorsTest.testDuplicateSOAPBinding() ); +// TEST( wsdlErrorsTest.testDuplicateSOAPBody() ); +// TEST( wsdlErrorsTest.testDuplicateSOAPOperation() ); + + TEST( wsdlErrorsTest.testMissingPortBinding() ); + TEST( wsdlErrorsTest.testMissingOperation() ); + TEST( wsdlErrorsTest.testMissingPortType() ); + TEST( wsdlErrorsTest.testMissingMessage() ); + +// TEST( wsdlErrorsTest.testMissingMessagePartName() ); // fails, JIRA 1901 +// TEST( wsdlErrorsTest.testMissingPortName() ); // fails, JIRA 1901 +// TEST( wsdlErrorsTest.testMissingMessagePartType() ); // fails, JIRA 1901 + } + catch(...) + { + // All exceptions should be caught by the TEST macro + + cout << "Unexpected exception caught" << endl; + } + + cout + << "---------------------" + << "\nTest Results" + << "\n\tTotal tests: " << testsTotal + << "\n\tTests passed: " << testsPassed + << "\n\tTests failed: " << testsTotal - testsPassed + << endl; + + return testsTotal - testsPassed; +} + +} diff --git a/sca-cpp/trunk/contrib/runtime/core/test/sca_test.bat b/sca-cpp/trunk/contrib/runtime/core/test/sca_test.bat new file mode 100755 index 0000000000..b082dd19ee --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/sca_test.bat @@ -0,0 +1,43 @@ +@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 "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) + +if "%AXIS2C_HOME%" == "" ( +echo "AXIS2C_HOME not set" +goto end +) + +rem Run the client +set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% + +.\sca_test.exe + +:end +endlocal diff --git a/sca-cpp/trunk/contrib/runtime/core/test/sca_test.sh b/sca-cpp/trunk/contrib/runtime/core/test/sca_test.sh new file mode 100755 index 0000000000..99d268af8e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/sca_test.sh @@ -0,0 +1,40 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi + +if [ x$AXIS2C_HOME = x ]; then +echo "AXIS2C_HOME not set" +exit; +fi + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH + +./sca_test + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/BaseWsdlTest.cpp b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/BaseWsdlTest.cpp new file mode 100755 index 0000000000..88563e5dfa --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/BaseWsdlTest.cpp @@ -0,0 +1,127 @@ +/* + * 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: 583039 $ $Date: 2007-10-08 20:49:57 -0700 (Mon, 08 Oct 2007) $ */ + +#include "BaseWsdlTest.h" + +#include +#include + +BaseWsdlTest::BaseWsdlTest() +{ + // TODO: Should we possibly make this an arg to this class instead? + char *installRootVar = getenv( "TUSCANY_SCACPP" ); + installRoot_ = installRootVar; +} + +BaseWsdlTest::~BaseWsdlTest() +{ +} + +void BaseWsdlTest::loadXsdHelper() +{ + if( ! (xsdHelper_ == 0) ) + { + return; + } + + try + { + xsdHelper_ = commonj::sdo::HelperProvider::getXSDHelper(); + + std::string filename = installRoot_ + "/xsd/wsdl_11.xsd"; + xsdHelper_->defineFile(filename.c_str()); + + filename = installRoot_ + "/xsd/wsdl_11_http.xsd"; + xsdHelper_->defineFile(filename.c_str()); + + filename = installRoot_ + "/xsd/wsdl_11_mime.xsd"; + xsdHelper_->defineFile(filename.c_str()); + + filename = installRoot_ + "/xsd/wsdl_11_soap.xsd"; + xsdHelper_->defineFile(filename.c_str()); + + filename = installRoot_ + "/xsd/wsdl_11_soap12.xsd"; + xsdHelper_->defineFile(filename.c_str()); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + std::cerr + << "BaseWsdlTest::loadXsdHelper() SDO runtime Exception: " + << sdoE.getMessageText() + << std::endl; + + throw; + } +} + +void BaseWsdlTest::loadXmlHelper() +{ + if( ! (xmlHelper_ == 0) ) + { + return; + } + + if( xsdHelper_ == 0 ) + { + loadXsdHelper(); + } + + try + { + xmlHelper_ = commonj::sdo::HelperProvider::getXMLHelper( xsdHelper_->getDataFactory() ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + std::cerr + << "BaseWsdlTest::loadXmlHelper() SDO runtime Exception: " + << sdoE.getMessageText() + << std::endl; + + throw; + } +} + +tuscany::sca::model::WSDLDefinition * +BaseWsdlTest::loadWsdl( const std::string &wsdlPath ) +{ + loadXmlHelper(); + + tuscany::sca::model::WSDLDefinition *wsdl = 0; + + try + { + commonj::sdo::XMLDocumentPtr doc = xmlHelper_->loadFile( wsdlPath ); + wsdl = new tuscany::sca::model::WSDLDefinition( doc->getRootDataObject() ); +//tuscany::sca::util::Utils::printDO(doc->getRootDataObject()); // TODO remove this + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + std::cerr + << "BaseWsdlTest::loadWsdl() SDO runtime Exception: " + << sdoE.getMessageText() + << std::endl; + + throw; + } + + return wsdl; +} + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/BaseWsdlTest.h b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/BaseWsdlTest.h new file mode 100755 index 0000000000..7a2be5db5f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/BaseWsdlTest.h @@ -0,0 +1,50 @@ +#ifndef sca_tests_wsdl_BaseWsdlTest_h_ +#define sca_tests_wsdl_BaseWsdlTest_h_ + +/* + * 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: 583039 $ $Date: 2007-10-08 20:49:57 -0700 (Mon, 08 Oct 2007) $ */ + +#include + +#include +#include + +class BaseWsdlTest +{ + public: + + BaseWsdlTest(); + ~BaseWsdlTest(); + + tuscany::sca::model::WSDLDefinition *loadWsdl( const std::string &wsdlPath ); + + private: + void loadXmlHelper(); + void loadXsdHelper(); + + std::string installRoot_; + commonj::sdo::XMLHelperPtr xmlHelper_; + commonj::sdo::XSDHelperPtr xsdHelper_; + +}; + +#endif + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/WSDLDefinitionTest.cpp b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/WSDLDefinitionTest.cpp new file mode 100755 index 0000000000..df5e22bd68 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/WSDLDefinitionTest.cpp @@ -0,0 +1,67 @@ +/* + * 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: 583039 $ $Date: 2007-10-08 20:49:57 -0700 (Mon, 08 Oct 2007) $ */ + +#include + +#include "SCATestMacros.h" +#include "WSDLDefinitionTest.h" + +WSDLDefinitionTest::WSDLDefinitionTest() +{ +} + +WSDLDefinitionTest::~WSDLDefinitionTest() +{ +} + +bool WSDLDefinitionTest::testSimple() +{ + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_correct/simple.wsdl" ); + + TEST_ASSERT_EQUALS( + "http://www.tuscany.com/tests/simple.wsdl", + wsdl->getNamespace() ); + + // Get the operation based on portType, operName + tuscany::sca::model::WSDLOperation wsdlOp1 = + wsdl->findOperation( "simplePortType", "simpleOperation" ); + TEST_ASSERT_EQUALS( "simpleOperation", wsdlOp1.getOperationName() ); + + // Get the operation based on service, portName, operName + tuscany::sca::model::WSDLOperation wsdlOp2 = + wsdl->findOperation( "simpleService", "simplePort", "simpleOperation" ); + TEST_ASSERT_EQUALS( "simpleOperation", wsdlOp2.getOperationName() ); + + // Check the operation names + std::list operNames = wsdl->getOperations( "simplePortType" ); + TEST_ASSERT_EQUALS( 1, operNames.size() ); + TEST_ASSERT_EQUALS( "simpleOperation", operNames.front() ); + + // Check the port type names + std::list portTypeNames = wsdl->getPortTypes(); + TEST_ASSERT_EQUALS( 1, portTypeNames.size() ); + TEST_ASSERT_EQUALS( "simplePortType", portTypeNames.front() ); + + // Everything passed + return true; +} + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/WSDLDefinitionTest.h b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/WSDLDefinitionTest.h new file mode 100755 index 0000000000..fb536b2153 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/WSDLDefinitionTest.h @@ -0,0 +1,40 @@ +#ifndef sca_tests_wsdl_WSDLDefinitionTest_h_ +#define sca_tests_wsdl_WSDLDefinitionTest_h_ + +/* + * 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: 583039 $ $Date: 2007-10-08 20:49:57 -0700 (Mon, 08 Oct 2007) $ */ + +#include "BaseWsdlTest.h" + +class WSDLDefinitionTest : public BaseWsdlTest +{ + + public: + + WSDLDefinitionTest(); + ~WSDLDefinitionTest(); + + bool testSimple(); + +}; + +#endif + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/WSDLErrorsTest.cpp b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/WSDLErrorsTest.cpp new file mode 100755 index 0000000000..573c88d7ad --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/WSDLErrorsTest.cpp @@ -0,0 +1,545 @@ + +#include +#include + +#include "SCATestMacros.h" +#include "WSDLErrorsTest.h" + +#include +#include +#include + +WSDLErrorsTest::WSDLErrorsTest() +{ +} + +WSDLErrorsTest::~WSDLErrorsTest() +{ +} + + + // Each wsdl in the wsdls_erroneous directory will throw a different + // exception, so we need to check for each individual exception + +bool WSDLErrorsTest::testDuplicateWSDLInputOutputBinding() +{ + TEST_TRACE( "Testing erroneous wsdl: duplicate_binding_input.wsdl" ); + + // This test fails because of JIRA 1900 + + try + { + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_binding_input.wsdl" ); + TEST_FAIL( "Wsdl should have thrown an exception" ); + } + catch( const tuscany::sca::TuscanyRuntimeException &scaE ) + { + TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); + } + catch( ... ) + { + TEST_FAIL( "Caught unexpected unknown Exception: " ); + } + + TEST_TRACE( "Testing erroneous wsdl: duplicate_binding_output.wsdl" ); + + try + { + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_binding_output.wsdl" ); + TEST_FAIL( "Wsdl should have thrown an exception" ); + } + catch( const tuscany::sca::TuscanyRuntimeException &scaE ) + { + TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); + } + catch( ... ) + { + TEST_FAIL( "Caught unexpected unknown Exception: " ); + } + + return true; +} + + +bool WSDLErrorsTest::testDuplicateWSDLMessagePartNames() +{ + TEST_TRACE( "Testing erroneous wsdl: duplicate_partNames.wsdl" ); + + // This test fails because of JIRA 1900 + + try + { + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_partNames.wsdl" ); + TEST_FAIL( "Wsdl should have thrown an exception" ); + } + catch( const tuscany::sca::TuscanyRuntimeException &scaE ) + { + TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); + } + catch( ... ) + { + TEST_FAIL( "Caught unexpected unknown Exception: " ); + } + + return true; +} + +bool WSDLErrorsTest::testDuplicateWSDLMessages() +{ + TEST_TRACE( "Testing erroneous wsdl: duplicate_messages.wsdl" ); + + try + { + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_messages.wsdl" ); + TEST_FAIL( "Wsdl should have thrown an exception" ); + } + catch( const tuscany::sca::TuscanyRuntimeException &scaE ) + { + TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + scaE.getMessageText() ); + std::string errorText( scaE.getMessageText() ); + TEST_ASSERT_NOT_EQUALS( errorText.find( "message/name" ), std::string::npos ); + TEST_ASSERT_NOT_EQUALS( errorText.find( "cannot be duplicated" ), std::string::npos ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); + } + catch( ... ) + { + TEST_FAIL( "Caught unexpected unknown Exception: " ); + } + + return true; +} + +bool WSDLErrorsTest::testDuplicateWSDLPortTypes() +{ + TEST_TRACE( "Testing erroneous wsdl: duplicate_portTypes.wsdl" ); + + try + { + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_portTypes.wsdl" ); + TEST_FAIL( "Wsdl should have thrown an exception" ); + } + catch( const tuscany::sca::TuscanyRuntimeException &scaE ) + { + TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + scaE.getMessageText() ); + std::string errorText( scaE.getMessageText() ); + TEST_ASSERT_NOT_EQUALS( errorText.find( "portType/name" ), std::string::npos ); + TEST_ASSERT_NOT_EQUALS( errorText.find( "cannot be duplicated" ), std::string::npos ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); + } + catch( ... ) + { + TEST_FAIL( "Caught unexpected unknown Exception: " ); + } + + return true; +} + +bool WSDLErrorsTest::testDuplicateWSDLBindings() +{ + TEST_TRACE( "Testing erroneous wsdl: duplicate_bindings.wsdl" ); + + try + { + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_bindings.wsdl" ); + TEST_FAIL( "Wsdl should have thrown an exception" ); + } + catch( const tuscany::sca::TuscanyRuntimeException &scaE ) + { + TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + scaE.getMessageText() ); + std::string errorText( scaE.getMessageText() ); + TEST_ASSERT_NOT_EQUALS( errorText.find( "binding/name" ), std::string::npos ); + TEST_ASSERT_NOT_EQUALS( errorText.find( "cannot be duplicated" ), std::string::npos ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); + } + catch( ... ) + { + TEST_FAIL( "Caught unexpected unknown Exception: " ); + } + + return true; +} + +bool WSDLErrorsTest::testDuplicateWSDLServices() +{ + TEST_TRACE( "Testing erroneous wsdl: duplicate_services.wsdl" ); + + try + { + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_services.wsdl" ); + TEST_FAIL( "Wsdl should have thrown an exception" ); + } + catch( const tuscany::sca::TuscanyRuntimeException &scaE ) + { + TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + scaE.getMessageText() ); + std::string errorText( scaE.getMessageText() ); + TEST_ASSERT_NOT_EQUALS( errorText.find( "service/name" ), std::string::npos ); + TEST_ASSERT_NOT_EQUALS( errorText.find( "cannot be duplicated" ), std::string::npos ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); + } + catch( ... ) + { + TEST_FAIL( "Caught unexpected unknown Exception: " ); + } + + return true; +} + +bool WSDLErrorsTest::testDuplicateSOAPAddress() +{ + TEST_TRACE( "Testing erroneous wsdl: duplicate_soap_address.wsdl" ); + + // This test fails due to an SDO SPEC limitation: + // According to XSD rules, if a global element xsd:any has + // maxOccurs > 1 you can only have a single valued property + // The multiple SOAP addresses/bindings/bodies/operations should load + // and I should be able to get the list and throw if list.size() > 1 + // but I cant because SDO says its a single value element + + try + { + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_soap_address.wsdl" ); + TEST_FAIL( "Wsdl should have thrown an exception" ); + } + catch( const tuscany::sca::TuscanyRuntimeException &scaE ) + { + TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); + } + catch( ... ) + { + TEST_FAIL( "Caught unexpected unknown Exception: " ); + } + + return true; +} + +bool WSDLErrorsTest::testDuplicateSOAPBinding() +{ + TEST_TRACE( "Testing erroneous wsdl: duplicate_soap_binding.wsdl" ); + + // This test fails due to an SDO SPEC limitation: + // According to XSD rules, if a global element xsd:any has + // maxOccurs > 1 you can only have a single valued property + // The multiple SOAP addresses/bindings/bodies/operations should load + // and I should be able to get the list and throw if list.size() > 1 + // but I cant because SDO says its a single value element + + try + { + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_soap_binding.wsdl" ); + TEST_FAIL( "Wsdl should have thrown an exception" ); + } + catch( const tuscany::sca::TuscanyRuntimeException &scaE ) + { + TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); + } + catch( ... ) + { + TEST_FAIL( "Caught unexpected unknown Exception: " ); + } + + return true; +} + +bool WSDLErrorsTest::testDuplicateSOAPBody() +{ + TEST_TRACE( "Testing erroneous wsdl: duplicate_soap_body.wsdl" ); + + // This test fails due to an SDO SPEC limitation: + // According to XSD rules, if a global element xsd:any has + // maxOccurs > 1 you can only have a single valued property + // The multiple SOAP addresses/bindings/bodies/operations should load + // and I should be able to get the list and throw if list.size() > 1 + // but I cant because SDO says its a single value element + + try + { + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_soap_body.wsdl" ); + TEST_FAIL( "Wsdl should have thrown an exception" ); + } + catch( const tuscany::sca::TuscanyRuntimeException &scaE ) + { + TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); + } + catch( ... ) + { + TEST_FAIL( "Caught unexpected unknown Exception: " ); + } + + return true; +} + +bool WSDLErrorsTest::testDuplicateSOAPOperation() +{ + TEST_TRACE( "Testing erroneous wsdl: duplicate_soap_operation.wsdl" ); + + // This test fails due to an SDO SPEC limitation: + // According to XSD rules, if a global element xsd:any has + // maxOccurs > 1 you can only have a single valued property + // The multiple SOAP addresses/bindings/bodies/operations should load + // and I should be able to get the list and throw if list.size() > 1 + // but I cant because SDO says its a single value element + + try + { + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_soap_operation.wsdl" ); + TEST_FAIL( "Wsdl should have thrown an exception" ); + } + catch( const tuscany::sca::TuscanyRuntimeException &scaE ) + { + TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); + } + catch( ... ) + { + TEST_FAIL( "Caught unexpected unknown Exception: " ); + } + + return true; +} + +bool WSDLErrorsTest::testMissingPortBinding() +{ + TEST_TRACE( "Testing erroneous wsdl: missing_binding_for_port.wsdl" ); + + try + { + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_erroneous/missing_binding_for_port.wsdl" ); + TEST_FAIL( "Wsdl should have thrown an exception" ); + } + catch( const tuscany::sca::TuscanyRuntimeException &scaE ) + { + TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + scaE.getMessageText() ); + std::string errorText( scaE.getMessageText() ); + TEST_ASSERT_NOT_EQUALS( errorText.find( "Unable to find binding" ), std::string::npos ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); + } + catch( ... ) + { + TEST_FAIL( "Caught unexpected unknown Exception" ); + } + + return true; +} + +bool WSDLErrorsTest::testMissingOperation() +{ + TEST_TRACE( "Testing erroneous wsdl: missing_operation.wsdl" ); + + try + { + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_erroneous/missing_operation.wsdl" ); + TEST_FAIL( "Wsdl should have thrown an exception" ); + } + catch( const tuscany::sca::TuscanyRuntimeException &scaE ) + { + TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + scaE.getMessageText() ); + std::string errorText( scaE.getMessageText() ); + TEST_ASSERT_NOT_EQUALS( errorText.find( "Unable to find PortType operation" ), std::string::npos ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); + } + catch( ... ) + { + TEST_FAIL( "Caught unexpected unknown Exception" ); + } + + return true; +} + +bool WSDLErrorsTest::testMissingPortType() +{ + TEST_TRACE( "Testing erroneous wsdl: missing_portType.wsdl" ); + + try + { + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_erroneous/missing_portType.wsdl" ); + TEST_FAIL( "Wsdl should have thrown an exception" ); + } + catch( const tuscany::sca::TuscanyRuntimeException &scaE ) + { + TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + scaE.getMessageText() ); + std::string errorText( scaE.getMessageText() ); + TEST_ASSERT_NOT_EQUALS( errorText.find( "Unable to find PortType" ), std::string::npos ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); + } + catch( ... ) + { + TEST_FAIL( "Caught unexpected unknown Exception" ); + } + + return true; +} + +bool WSDLErrorsTest::testMissingMessage() +{ + TEST_TRACE( "Testing erroneous wsdl: missing_message.wsdl" ); + + try + { + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_erroneous/missing_message.wsdl" ); + TEST_FAIL( "Wsdl should have thrown an exception" ); + } + catch( const tuscany::sca::TuscanyRuntimeException &scaE ) + { + TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + scaE.getMessageText() ); + std::string errorText( scaE.getMessageText() ); + TEST_ASSERT_NOT_EQUALS( errorText.find( "unable to find PortType input message" ), std::string::npos ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); + } + catch( ... ) + { + TEST_FAIL( "Caught unexpected unknown Exception" ); + } + + return true; +} + +bool WSDLErrorsTest::testMissingMessagePartName() +{ + TEST_TRACE( "Testing erroneous wsdl: missing_name_for_part.wsdl" ); + + // This test fails because of JIRA 1901 + + try + { + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_erroneous/missing_name_for_part.wsdl" ); + TEST_FAIL( "Wsdl should have thrown an exception" ); + } + catch( const tuscany::sca::TuscanyRuntimeException &scaE ) + { + TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); + } + catch( ... ) + { + TEST_FAIL( "Caught unexpected unknown Exception: " ); + } + + return true; +} + +bool WSDLErrorsTest::testMissingPortName() +{ + TEST_TRACE( "Testing erroneous wsdl: missing_name_for_port.wsdl" ); + + // This test fails because of JIRA 1901 + + try + { + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_erroneous/missing_name_for_port.wsdl" ); + TEST_FAIL( "Wsdl should have thrown an exception" ); + } + catch( const tuscany::sca::TuscanyRuntimeException &scaE ) + { + TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); + } + catch( ... ) + { + TEST_FAIL( "Caught unexpected unknown Exception: " ); + } + + return true; +} + +bool WSDLErrorsTest::testMissingMessagePartType() +{ + TEST_TRACE( "Testing erroneous wsdl: missing_type_for_part.wsdl" ); + + // This test fails because of JIRA 1901 + + try + { + tuscany::sca::model::WSDLDefinition *wsdl = + loadWsdl( "wsdlTests/wsdls_erroneous/missing_type_for_part.wsdl" ); + TEST_FAIL( "Wsdl should have thrown an exception" ); + } + catch( const tuscany::sca::TuscanyRuntimeException &scaE ) + { + TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); + } + catch( const commonj::sdo::SDORuntimeException &sdoE ) + { + TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); + } + catch( ... ) + { + TEST_FAIL( "Caught unexpected unknown Exception: " ); + } + + return true; +} + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/WSDLErrorsTest.h b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/WSDLErrorsTest.h new file mode 100755 index 0000000000..e17d0edd28 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/WSDLErrorsTest.h @@ -0,0 +1,34 @@ +#ifndef sca_tests_wsdl_WSDLErrorsTest_h_ +#define sca_tests_wsdl_WSDLErrorsTest_h_ + +#include "BaseWsdlTest.h" + +class WSDLErrorsTest : public BaseWsdlTest +{ + public: + + WSDLErrorsTest(); + ~WSDLErrorsTest(); + + bool testDuplicateWSDLInputOutputBinding(); + bool testDuplicateWSDLMessagePartNames(); + bool testDuplicateWSDLMessages(); + bool testDuplicateWSDLPortTypes(); + bool testDuplicateWSDLBindings(); + bool testDuplicateWSDLServices(); + bool testDuplicateSOAPAddress(); + bool testDuplicateSOAPBinding(); + bool testDuplicateSOAPBody(); + bool testDuplicateSOAPOperation(); + + bool testMissingPortBinding(); + bool testMissingOperation(); + bool testMissingPortName(); + bool testMissingPortType(); + bool testMissingMessage(); + bool testMissingMessagePartName(); + bool testMissingMessagePartType(); +}; + +#endif + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdlTests.h b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdlTests.h new file mode 100755 index 0000000000..f8d86133c1 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdlTests.h @@ -0,0 +1,34 @@ +#ifndef sca_tests_wsdl_wsdlTests_h_ +#define sca_tests_wsdl_wsdlTests_h_ + +/* + * 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: 583039 $ $Date: 2007-10-08 20:49:57 -0700 (Mon, 08 Oct 2007) $ */ + +// This file is included by the main test program +// it just includes all the necessary wsdl headers, +// so the main doesnt have to know about all of them + +#include "wsdlTests/BaseWsdlTest.h" +#include "wsdlTests/WSDLErrorsTest.h" +#include "wsdlTests/WSDLDefinitionTest.h" + +#endif + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_correct/simple.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_correct/simple.wsdl new file mode 100644 index 0000000000..c9fe542dbd --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_correct/simple.wsdl @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_binding_input.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_binding_input.wsdl new file mode 100755 index 0000000000..07423d3556 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_binding_input.wsdl @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_binding_output.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_binding_output.wsdl new file mode 100755 index 0000000000..4c295bf0f5 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_binding_output.wsdl @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_bindings.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_bindings.wsdl new file mode 100755 index 0000000000..39932da219 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_bindings.wsdl @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_messages.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_messages.wsdl new file mode 100755 index 0000000000..e0388f19d6 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_messages.wsdl @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_partnames.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_partnames.wsdl new file mode 100755 index 0000000000..6b5b1630e0 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_partnames.wsdl @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_portTypes.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_portTypes.wsdl new file mode 100755 index 0000000000..1bbe57bbad --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_portTypes.wsdl @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_services.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_services.wsdl new file mode 100755 index 0000000000..e16d04a5ec --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_services.wsdl @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_address.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_address.wsdl new file mode 100755 index 0000000000..01af450396 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_address.wsdl @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_binding.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_binding.wsdl new file mode 100755 index 0000000000..a2dac5e15e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_binding.wsdl @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_body.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_body.wsdl new file mode 100755 index 0000000000..3918b9e6f1 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_body.wsdl @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_operation.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_operation.wsdl new file mode 100755 index 0000000000..542d60b7cb --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_operation.wsdl @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_binding_for_port.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_binding_for_port.wsdl new file mode 100755 index 0000000000..cfcb65f149 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_binding_for_port.wsdl @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_message.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_message.wsdl new file mode 100755 index 0000000000..ec2d17204d --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_message.wsdl @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_name_for_part.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_name_for_part.wsdl new file mode 100755 index 0000000000..4e927e222f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_name_for_part.wsdl @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_name_for_port.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_name_for_port.wsdl new file mode 100755 index 0000000000..f182c01cb6 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_name_for_port.wsdl @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_operation.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_operation.wsdl new file mode 100755 index 0000000000..f1fd4eba9c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_operation.wsdl @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_portType.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_portType.wsdl new file mode 100755 index 0000000000..bdfac4d13d --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_portType.wsdl @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_type_for_part.wsdl b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_type_for_part.wsdl new file mode 100755 index 0000000000..1706ac2f13 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/test/wsdlTests/wsdls_erroneous/missing_type_for_part.wsdl @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/xsd/sca-core.xsd b/sca-cpp/trunk/contrib/runtime/core/xsd/sca-core.xsd new file mode 100644 index 0000000000..d7661e3994 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/xsd/sca-core.xsd @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/xsd/sca-implementation-composite.xsd b/sca-cpp/trunk/contrib/runtime/core/xsd/sca-implementation-composite.xsd new file mode 100644 index 0000000000..4bcc6747ba --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/xsd/sca-implementation-composite.xsd @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/xsd/sca-implementation-java.xsd b/sca-cpp/trunk/contrib/runtime/core/xsd/sca-implementation-java.xsd new file mode 100644 index 0000000000..e20f0a9b50 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/xsd/sca-implementation-java.xsd @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/xsd/sca-interface-java.xsd b/sca-cpp/trunk/contrib/runtime/core/xsd/sca-interface-java.xsd new file mode 100644 index 0000000000..a6028c1434 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/xsd/sca-interface-java.xsd @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/xsd/sca-interface-wsdl.xsd b/sca-cpp/trunk/contrib/runtime/core/xsd/sca-interface-wsdl.xsd new file mode 100644 index 0000000000..a3de838b7e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/xsd/sca-interface-wsdl.xsd @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/xsd/sca.xsd b/sca-cpp/trunk/contrib/runtime/core/xsd/sca.xsd new file mode 100644 index 0000000000..8853f25c11 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/xsd/sca.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/xsd/tuscany.xsd b/sca-cpp/trunk/contrib/runtime/core/xsd/tuscany.xsd new file mode 100644 index 0000000000..8bad940782 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/xsd/tuscany.xsd @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11.xsd b/sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11.xsd new file mode 100644 index 0000000000..7cfdc5b58b --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11.xsd @@ -0,0 +1,307 @@ + + + + + + + + + + + + + + This type is extended by component types to allow them to be documented + + + + + + + + + + + + + This type is extended by component types to allow attributes from other namespaces to be added. + + + + + + + + + + + + + This type is extended by component types to allow elements from other namespaces to be added. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Any top level optional element allowed to appear more then once - any child of definitions element except wsdl:types. Any extensibility element is allowed in any place. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11_http.xsd b/sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11_http.xsd new file mode 100644 index 0000000000..7003bf29d8 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11_http.xsd @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11_mime.xsd b/sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11_mime.xsd new file mode 100644 index 0000000000..46c62c822c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11_mime.xsd @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11_soap.xsd b/sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11_soap.xsd new file mode 100644 index 0000000000..800059d6b0 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11_soap.xsd @@ -0,0 +1,146 @@ + + + + + + + + + + "encodingStyle" indicates any canonicalization conventions followed in the contents of the containing element. For example, the value "http://schemas.xmlsoap.org/soap/encoding/" indicates the pattern described in SOAP specification + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11_soap12.xsd b/sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11_soap12.xsd new file mode 100644 index 0000000000..281f2c0deb --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/core/xsd/wsdl_11_soap12.xsd @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/Makefile.am new file mode 100644 index 0000000000..1cc28fe80e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/Makefile.am @@ -0,0 +1,45 @@ +# 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 + WSBINDING_EXTENSION = ws + SCABINDING_EXTENSION = sca + RESTBINDING_EXTENSION = rest +endif +if WANT_CPP + CPP_EXTENSION = cpp +endif +if WANT_PYTHON + PYTHON_EXTENSION = python +endif +if WANT_RUBY + RUBY_EXTENSION = ruby +endif + +if WANT_WSBINDING + WSBINDING_EXTENSION = ws +endif +if WANT_SCABINDING + SCABINDING_EXTENSION = sca +endif +if WANT_RESTBINDING + RESTBINDING_EXTENSION = rest +endif +SUBDIRS = ${CPP_EXTENSION} ${WSBINDING_EXTENSION} ${SCABINDING_EXTENSION} ${RESTBINDING_EXTENSION} ${PYTHON_EXTENSION} ${RUBY_EXTENSION} diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/cpp/Makefile.am new file mode 100644 index 0000000000..3ef2b728b3 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/Makefile.am @@ -0,0 +1,24 @@ +# 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 tools + +datadir=$(prefix)/extensions/cpp + +nobase_data_DATA = xsd/*.xsd + +EXTRA_DIST = xsd diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/Makefile.am new file mode 100644 index 0000000000..f234261f5b --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/Makefile.am @@ -0,0 +1,55 @@ +# 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/TuscanyRuntime.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 + +moduledir=$(prefix)/extensions/cpp/module +extension = libtuscany_sca_cpp$(libsuffix) + +install-exec-hook: + test -z $(moduledir) || $(mkdir_p) $(moduledir); + -rm -f $(moduledir)/$(extension) + $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/ComponentContext.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/ComponentContext.cpp new file mode 100644 index 0000000000..d686c4c09f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/ComponentContext.cpp @@ -0,0 +1,150 @@ +/* + * 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 "commonj/sdo/SDO.h" + +#include "osoa/sca/ComponentContext.h" +#include "osoa/sca/ServiceRuntimeException.h" + +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/cpp/ComponentContextImpl.h" +#include "tuscany/sca/core/SCARuntime.h" + +using namespace commonj::sdo; +using namespace tuscany::sca; +using namespace tuscany::sca::cpp; +using namespace tuscany::sca::model; + +namespace osoa +{ + namespace sca + { + + // ======================================================= + // getCurrent: create a context from the current component + // ======================================================= + ComponentContext ComponentContext::getCurrent() + { + logentry(); + try + { + Component* component = tuscany::sca::SCARuntime::getCurrentRuntime()->getCurrentComponent(); + if (!component) + { + throwException(ComponentContextException, "No current component"); + } + ComponentContext* cci = new ComponentContextImpl(component); + return ComponentContext(cci); + } + catch (ServiceRuntimeException&) + { + throw; + } + catch (TuscanyRuntimeException& e) + { + throwException(ServiceRuntimeException, e); + } + } + + // =========== + // Constructor + // =========== + ComponentContext::ComponentContext(ComponentContext* implementation) + : impl(implementation) + { + logentry(); + } + + // ========== + // Destructor + // ========== + ComponentContext::~ComponentContext() + { + logentry(); + delete impl; + } + + // =================================== + // Copy constructor: create a new impl + // =================================== + ComponentContext::ComponentContext(const ComponentContext& ctx) + { + logentry(); + Component* component = ((ComponentContextImpl*)impl)->getComponent(); + impl = new ComponentContextImpl(component); + } + + // ============================= + // operator= : create a new impl + // ============================= + ComponentContext& ComponentContext::operator=(const ComponentContext& ctx) + { + logentry(); + if (this != &ctx) + { + Component* component = ((ComponentContextImpl*)impl)->getComponent(); + impl = new ComponentContextImpl(component); + } + return *this; + } + + // ========== + // getService + // ========== + void* ComponentContext::getService(const std::string& referenceName) + { + logentry(); + void* service = impl->getService(referenceName); + return service; + } + + // =========== + // getServices + // =========== + std::list ComponentContext::getServices(const std::string& referenceName) + { + logentry(); + return impl->getServices(referenceName); + } + + // ============ + // getProperties + // ============= + DataObjectPtr ComponentContext::getProperties() + { + logentry(); + DataObjectPtr properties = impl->getProperties(); + return properties; + } + + // ============ + // getDataFactory + // ============= + DataFactoryPtr ComponentContext::getDataFactory() + { + logentry(); + DataFactoryPtr dataFactory = impl->getDataFactory(); + return dataFactory; + } + + + } // End namespace sca +} // End namespace osoa diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/ComponentContext.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/ComponentContext.h new file mode 100644 index 0000000000..2c305c5161 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/ComponentContext.h @@ -0,0 +1,117 @@ +/* + * 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 +#include + +#include "commonj/sdo/SDO.h" + +#include "osoa/sca/export.h" + +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/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/CompositeContext.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/CompositeContext.cpp new file mode 100644 index 0000000000..d3f06e1b12 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/CompositeContext.cpp @@ -0,0 +1,127 @@ +/* + * 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 "commonj/sdo/SDO.h" + +#include "osoa/sca/CompositeContext.h" +#include "osoa/sca/ServiceRuntimeException.h" + +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/cpp/CompositeContextImpl.h" +#include "tuscany/sca/core/SCARuntime.h" + +using namespace commonj::sdo; +using namespace tuscany::sca; +using namespace tuscany::sca::cpp; + + +namespace osoa +{ + namespace sca + { + // =========== + // Constructor + // =========== + CompositeContext::CompositeContext(CompositeContext* implementation) + : impl(implementation) + { + logentry(); + } + + // =================================== + // Copy constructor: create a new impl + // =================================== + CompositeContext::CompositeContext(const CompositeContext& ctx) + { + logentry(); + impl = new CompositeContextImpl( + tuscany::sca::SCARuntime::getCurrentRuntime()->getDefaultComponent()); + } + + // ============================= + // operator= : create a new impl + // ============================= + CompositeContext& CompositeContext::operator=(const CompositeContext& ctx) + { + logentry(); + if (this != &ctx) + { + impl = new CompositeContextImpl( + tuscany::sca::SCARuntime::getCurrentRuntime()->getDefaultComponent()); + } + return *this; + } + + // ========== + // Destructor + // ========== + CompositeContext::~CompositeContext() + { + logentry(); + delete impl; + } + + // ==================================================== + // getCurrent: create a context from the current composite + // ==================================================== + CompositeContext CompositeContext::getCurrent() + { + logentry(); + try + { + CompositeContext* cci = new CompositeContextImpl( + tuscany::sca::SCARuntime::getCurrentRuntime()->getDefaultComponent()); + + return CompositeContext(cci); + } + catch (ServiceRuntimeException&) + { + throw; + } + catch (TuscanyRuntimeException& e) + { + throwException(ServiceRuntimeException, e); + } + } + + // ============= + // locateService + // ============= + void* CompositeContext::locateService(const std::string& serviceName) + { + logentry(); + void* sp = impl->locateService(serviceName); + return sp; + } + + // ============= + // getDataFactory + // ============= + DataFactoryPtr CompositeContext::getDataFactory() + { + logentry(); + DataFactoryPtr df = impl->getDataFactory(); + return df; + } + + + } // End namespace sca +} // End namespace osoa diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/CompositeContext.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/CompositeContext.h new file mode 100644 index 0000000000..a047f82e46 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/CompositeContext.h @@ -0,0 +1,99 @@ +/* + * 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 "commonj/sdo/SDO.h" + +#include "osoa/sca/export.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/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/ServiceRuntimeException.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/ServiceRuntimeException.h new file mode 100644 index 0000000000..6d64a32dd6 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/ServiceRuntimeException.h @@ -0,0 +1,105 @@ +/* + * 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/core/Exceptions.h" + +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 tuscany::sca::TuscanyRuntimeException + { + public: + ServiceRuntimeException( + const char *name="ServiceRuntimeException", + severity_level sev=Severe, + const char* msg_text="") + : tuscany::sca::TuscanyRuntimeException(name, sev, msg_text) + { + } + + ServiceRuntimeException(const tuscany::sca::TuscanyRuntimeException& e) + : tuscany::sca::TuscanyRuntimeException(e) + { + } + }; // 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/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/export.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/export.h new file mode 100644 index 0000000000..8a69913be4 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/export.h @@ -0,0 +1,42 @@ +/* + * 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/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/sca.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/sca.h new file mode 100644 index 0000000000..6cce9453d7 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/osoa/sca/sca.h @@ -0,0 +1,31 @@ +/* + * 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/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.cpp new file mode 100644 index 0000000000..74a30fb772 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.cpp @@ -0,0 +1,72 @@ +/* + * 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_cpp_initialize() + { + tuscany::sca::cpp::CPPExtension::initialize(); + } +} + +namespace tuscany +{ + namespace sca + { + namespace cpp + { + // =================================================================== + // Constructor for the CPPExtension class. + // =================================================================== + CPPExtension::CPPExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the CPPExtension class. + // =================================================================== + CPPExtension::~CPPExtension() + { + logentry(); + } + + void CPPExtension::initialize() + { + logentry(); + SCARuntime* runtime = SCARuntime::getCurrentRuntime(); + runtime->registerImplementationExtension(new CPPImplementationExtension()); + runtime->registerInterfaceExtension(new CPPInterfaceExtension()); + } + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.h new file mode 100644 index 0000000000..d6c872629d --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.h @@ -0,0 +1,57 @@ +/* + * 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/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp new file mode 100644 index 0000000000..b5312ab243 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp @@ -0,0 +1,101 @@ +/* + * 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" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::util; +using namespace tuscany::sca::model; + + +namespace tuscany +{ + namespace sca + { + namespace cpp + { + // =================================================================== + // Constructor for the CPPImplementationExtension class. + // =================================================================== + CPPImplementationExtension::CPPImplementationExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the CPPImplementationExtension class. + // =================================================================== + CPPImplementationExtension::~CPPImplementationExtension() + { + logentry(); + } + + 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) + { + logentry(); + 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; + } + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.h new file mode 100644 index 0000000000..8eb7b88691 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.h @@ -0,0 +1,74 @@ +/* + * 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 std::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 std::string& getExtensionTypeQName() {return typeQName;} + + virtual tuscany::sca::model::ComponentType* getImplementation( + tuscany::sca::model::Composite* composite, + commonj::sdo::DataObjectPtr scdlImplementation); + + private: + static const std::string extensionName; + static const std::string typeQName; + + }; + + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_cpp_cppimplementationextension_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.cpp new file mode 100644 index 0000000000..7bb84a7673 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.cpp @@ -0,0 +1,71 @@ +/* + * 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" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace cpp + { + // =================================================================== + // Constructor for the CPPInterfaceExtension class. + // =================================================================== + CPPInterfaceExtension::CPPInterfaceExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the CPPInterfaceExtension class. + // =================================================================== + CPPInterfaceExtension::~CPPInterfaceExtension() + { + logentry(); + } + + 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) + { + logentry(); + + string header = scdlInterface->getCString("header"); + string className = scdlInterface->getCString("class"); + bool remotable = scdlInterface->getBoolean("remotable"); + + return new CPPInterface(header, className, remotable, false); + } + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.h new file mode 100644 index 0000000000..04ac9f6970 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.h @@ -0,0 +1,74 @@ +/* + * 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 std::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 std::string& getExtensionTypeQName() {return typeQName;} + + virtual tuscany::sca::model::Interface* getInterface( + tuscany::sca::model::Composite* composite, + commonj::sdo::DataObjectPtr scdlInterface); + + private: + static const std::string extensionName; + static const std::string typeQName; + + }; + + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_cpp_cppinterfaceextension_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.cpp new file mode 100644 index 0000000000..cc45ea9fb8 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.cpp @@ -0,0 +1,192 @@ +/* + * 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/ServiceRuntimeException.h" + +#include "tuscany/sca/cpp/CPPServiceProxy.h" +#include "tuscany/sca/util/Logging.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 std; +using namespace osoa::sca; +using namespace tuscany::sca::model; +using namespace tuscany::sca::util; + +namespace tuscany +{ + namespace sca + { + namespace cpp + { + + // ============================ + // Constructor: Create a proxy + // ============================ + CPPServiceProxy::CPPServiceProxy(Reference* reference) + : ServiceProxy(reference) + { + logentry(); + + // ---------------------- + // 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); + } + + // ============================ + // Constructor: Create a proxy + // ============================ + CPPServiceProxy::CPPServiceProxy(Service* service) + : ServiceProxy(0) + { + logentry(); + + // ---------------------- + // 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); + } + + void CPPServiceProxy::createProxy(Component* component, const string& name, ServiceWrapper* serviceWrapper) + { + logentry(); + + ComponentType* componentType = component->getType(); + if (!componentType) + { + string msg = "Component " + component->getName() + " has no implementation defined"; + throwException(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("Unable to locate %s in library %s", + proxyFactoryName.c_str(), fullLibraryName.c_str()); + string msg = "Unable to locate " + proxyFactoryName + " in library " + fullLibraryName; + throwException(ServiceNotFoundException, msg.c_str()); + } + + // ----------------------------------- + // Now create an instance of the proxy + // ----------------------------------- + void* proxy = proxyFactory(serviceWrapper); + if (!proxy) + { + logerror("Factory method %s in library %s returned null", + proxyFactoryName.c_str(), fullLibraryName.c_str()); + string msg = "Factory method " + proxyFactoryName + " in library " + fullLibraryName + " returned null"; + throwException(ServiceNotFoundException, msg.c_str()); + } + else + { + proxies.push_back(proxy); + } + + // ------------------------- + // Get the destructor method + // ------------------------- + destructor = (PROXYDESTRUCTOR)proxyLibrary.getSymbol(proxyDestructorName); + } + + // ========== + // Destructor + // ========== + CPPServiceProxy::~CPPServiceProxy() + { + logentry(); + + // Delete the proxies + if (destructor != NULL && proxies.size() != 0) + { + destructor(*proxies.begin()); + } + } + + CPPServiceProxy::PROXIES CPPServiceProxy::getProxies() + { + return proxies; + } + + void* CPPServiceProxy::getProxy() + { + logentry(); + + if (proxies.size() != 0) + { + return *proxies.begin(); + } + else + { + return NULL; + } + } + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.h new file mode 100644 index 0000000000..8406e9bc44 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.h @@ -0,0 +1,117 @@ +/* + * 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" + + +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(tuscany::sca::model::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(tuscany::sca::model::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(tuscany::sca::model::Component* component, + const std::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. + */ + tuscany::sca::util::Library proxyLibrary; + + }; + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_cpp_cppserviceproxy_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp new file mode 100644 index 0000000000..1304ab92a0 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp @@ -0,0 +1,194 @@ +/* + * 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/ServiceRuntimeException.h" + +#include "tuscany/sca/cpp/CPPServiceWrapper.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 std; +using namespace osoa::sca; +using namespace tuscany::sca::model; +using namespace tuscany::sca::util; + +namespace tuscany +{ + namespace sca + { + namespace cpp + { + + // =========== + // Constructor + // =========== + CPPServiceWrapper::CPPServiceWrapper(Service* service) + : ServiceWrapper(service) + { + logentry(); + + component = service->getComponent(); + interf = service->getType()->getInterface(); + implementation = (CPPImplementation*)component->getType(); + } + + // ========== + // Destructor + // ========== + CPPServiceWrapper::~CPPServiceWrapper() + { + logentry(); + } + + + // ====================================================================== + // getImplementation: get an implementation for this scope + // ====================================================================== + void* CPPServiceWrapper::getImplementation() + { + logentry(); + if (implementation->getScope() == CPPImplementation::COMPOSITE) + { + // fill the cache if needed + if ( !implementation->getStaticImplementation() ) + { + implementation->setStaticImplementation(newImplementation()); + } + return implementation->getStaticImplementation(); + } + else // (scope == CPPInterface::STATELESS) + { + return newImplementation(); + } + } + + // ====================================================================== + // releaseImplementation: release the implementation for this scope + // ====================================================================== + void CPPServiceWrapper::releaseImplementation() + { + logentry(); + if (implementation->getScope() == CPPImplementation::STATELESS) + { + deleteImplementation(); + } + } + + // ====================================================================== + // invoke: wrapper call to service with setting the component context + // ====================================================================== + void CPPServiceWrapper::invoke(Operation& operation) + { + logentry(); + + SCARuntime* runtime = SCARuntime::getCurrentRuntime(); + runtime->setCurrentComponent(component); + + try + { + invokeService(operation); + } + catch (...) + { + runtime->unsetCurrentComponent(); + throw; + } + runtime->unsetCurrentComponent(); + } + + void CPPServiceWrapper::setLibrary(Library* lib) + { + wrapperLibrary = lib; + } + + // ====================================================================== + // getServiceWrapper: create a wrapper for the target ComponentService + // ====================================================================== + CPPServiceWrapper* CPPServiceWrapper::getServiceWrapper(Service* service) + { + logentry(); + + 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"; + throwException(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("Unable to locate %s in library %s", + wrapperFactoryName.c_str(), fullLibraryName.c_str()); + string msg = "Unable to locate " + wrapperFactoryName + " in library " + fullLibraryName; + throwException(ServiceNotFoundException, msg.c_str()); + } + + // ------------------------------------- + // Now create an instance of the wrapper + // ------------------------------------- + serviceWrapper = wrapperFactory(service); + if (!serviceWrapper) + { + logerror("Factory method %s in library %s returned null", + wrapperFactoryName.c_str(), fullLibraryName.c_str()); + string msg = "Factory method " + wrapperFactoryName + " in library " + fullLibraryName + " returned null"; + throwException(ServiceNotFoundException, msg.c_str()); + } + serviceWrapper->setLibrary(wrapperLib); + + return serviceWrapper; + } + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h new file mode 100644 index 0000000000..899deca07a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h @@ -0,0 +1,155 @@ +/* + * 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" + +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(tuscany::sca::model::Service* service); + + /** + * Constructor. + * @param target The component service to which this wrapper refers. + */ + CPPServiceWrapper(tuscany::sca::model::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. + */ + tuscany::sca::util::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: + /** + * The component to which this wrapper refers. + */ + tuscany::sca::model::Component* component; + + /** + * A pointer to the interface which the service exposes. + */ + tuscany::sca::model::Interface* interf; + + /** + * The component implementation + */ + CPPImplementation* implementation; + + /** + * Pointer to the loaded library which contains the component + * implementation. + */ + tuscany::sca::util::Library* wrapperLibrary; + + /** + * Set the loaded library which contains the component + * implementation. + * @param lib The library. + */ + void setLibrary(tuscany::sca::util::Library* lib); + }; + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_cpp_cppservicewrapper_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.cpp new file mode 100644 index 0000000000..3de0cb968c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.cpp @@ -0,0 +1,208 @@ +/* + * 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/ServiceRuntimeException.h" + +#include "tuscany/sca/util/Logging.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" + +using namespace std; +using namespace osoa::sca; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace cpp + { + + // =========== + // Constructor + // =========== + ComponentContextImpl::ComponentContextImpl(Component* comp) + : ComponentContext(0), component(comp) + { + logentry(); + } + + // ========== + // Destructor + // ========== + ComponentContextImpl::~ComponentContextImpl() + { + logentry(); + } + + + // ========================================================================== + // getServices: return a list of Proxies for services wired to this reference + // ========================================================================== + std::list ComponentContextImpl::getServices(const std::string& referenceName) + { + logentry(); + try + { + // -------------------------------------------------------------- + // locate reference in the current component and determine target + // -------------------------------------------------------------- + Reference* reference = component->findReference(referenceName); + if (!reference) + { + string message = "Reference not defined: "; + message = message + referenceName; + throwException(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"; + throwException(ServiceNotFoundException, message.c_str()); + } + + return serviceProxy->getProxies(); + } + catch (ServiceRuntimeException&) + { + throw; + } + catch (TuscanyRuntimeException& e) + { + throwException(ServiceRuntimeException, e); + } + + } // End getServices() + + + // =================================================================== + // getService: return a Proxy for the services wired to this reference + // =================================================================== + void* ComponentContextImpl::getService(const std::string& referenceName) + { + logentry(); + try + { + // -------------------------------------------------------------- + // locate reference in the current component and determine target + // -------------------------------------------------------------- + Reference* reference = component->findReference(referenceName); + if (!reference) + { + string message = "Reference not defined: "; + message = message + referenceName; + throwException(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; + throwException(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"; + throwException(ServiceNotFoundException, message.c_str()); + } + + void* service = serviceProxy->getProxy(); + + return service; + } + catch (ServiceRuntimeException&) + { + throw; + } + catch (TuscanyRuntimeException& e) + { + throwException(ServiceRuntimeException, e); + } + + } // End getService() + + // ============================================== + // getProperties: return the component properties + // ============================================== + DataObjectPtr ComponentContextImpl::getProperties() + { + logentry(); + try + { + DataObjectPtr properties = component->getProperties(); + return properties; + } + catch (ServiceRuntimeException&) + { + throw; + } + catch (TuscanyRuntimeException& e) + { + throwException(ServiceRuntimeException, e); + } + } + + // ============================================== + // getDataFactory: return the data factory for the composite in which + // this component resides + // ============================================== + commonj::sdo::DataFactoryPtr ComponentContextImpl::getDataFactory() + { + logentry(); + try + { + commonj::sdo::DataFactoryPtr dataFactory = component->getComposite()->getDataFactory(); + return dataFactory; + } + catch (ServiceRuntimeException&) + { + throw; + } + catch (TuscanyRuntimeException& e) + { + throwException(ServiceRuntimeException, e); + } + } + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.h new file mode 100644 index 0000000000..412c276d8c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.h @@ -0,0 +1,119 @@ +/* + * 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 "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" + + +namespace tuscany +{ + namespace sca + { + namespace cpp + { + + /** + * Contains the actual implementation of a ComponentContext interface. + */ + class ComponentContextImpl : public osoa::sca::ComponentContext + { + + public: + /** + * Constructor that takes a Component which represents the runtime + * model for this context. + */ + ComponentContextImpl(tuscany::sca::model::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 commonj::sdo::DataObjectPtr getProperties(); + + /** + * See ComponentContext. + */ + virtual commonj::sdo::DataFactoryPtr getDataFactory(); + + /** + * Returns the contained Component. + * @return The Component to which this context refers. + */ + virtual tuscany::sca::model::Component* getComponent() {return component;} + + private: + ComponentContextImpl(const ComponentContextImpl&); + ComponentContextImpl& operator=(const ComponentContextImpl&); + + /** + * Pointer to the runtime model Component to which this + * context refers. + */ + tuscany::sca::model::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( + tuscany::sca::model::Reference* serviceReference, + tuscany::sca::model::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(tuscany::sca::model::Service* target); + + }; + + } // End namespaca cpp + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_cpp_componentcontextimpl_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.cpp new file mode 100644 index 0000000000..ae8183231e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.cpp @@ -0,0 +1,128 @@ +/* + * 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 "commonj/sdo/SDO.h" + +#include "osoa/sca/ServiceRuntimeException.h" + +#include "tuscany/sca/util/Logging.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" + +using namespace std; +using namespace commonj::sdo; +using namespace osoa::sca; +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace cpp + { + + // =========== + // Constructor + // =========== + CompositeContextImpl::CompositeContextImpl(Component* component) + : CompositeContext(0), component(component), composite((Composite*)component->getType()) + { + logentry(); + } + + // ========== + // Destructor + // ========== + CompositeContextImpl::~CompositeContextImpl() + { + logentry(); + } + + // =========================================================================== + // locateService: return a proxy connected to a wrapper for the target service + // =========================================================================== + void* CompositeContextImpl::locateService(const std::string& serviceName) + { + logentry(); + try + { + // ---------------------------- + // Locate the component service + // ---------------------------- + Service* service = composite->findComponentService(serviceName); + string msg; + if (!service) + { + msg = "Service not found: "; + msg = msg + serviceName; + throwException(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); + return serviceProxy->getProxy(); + } + catch (ServiceRuntimeException&) + { + throw; + } + catch (TuscanyRuntimeException& e) + { + throwException(ServiceRuntimeException, e); + } + } + + // ============================================== + // getDataFactory: return the data factory for the current composite + // ============================================== + DataFactoryPtr CompositeContextImpl::getDataFactory() + { + logentry(); + try + { + DataFactoryPtr dataFactory = composite->getDataFactory(); + return dataFactory; + } + catch (ServiceRuntimeException&) + { + throw; + } + catch (TuscanyRuntimeException& e) + { + throwException(ServiceRuntimeException, e); + } + } + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.h new file mode 100644 index 0000000000..ed0bb8b51c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.h @@ -0,0 +1,89 @@ +/* + * 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 "osoa/sca/CompositeContext.h" + +#include "tuscany/sca/model/Composite.h" +#include "tuscany/sca/model/Component.h" +#include "tuscany/sca/cpp/CPPServiceProxy.h" + +namespace tuscany +{ + namespace sca + { + + namespace cpp + { + + /** + * Contains the actual implementation of a CompositeContext interface. + */ + class CompositeContextImpl : public osoa::sca::CompositeContext + { + + public: + /** + * Constructor that takes a Composite which represents the runtime + * model for this context. + */ + CompositeContextImpl(tuscany::sca::model::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. + */ + tuscany::sca::model::Composite* composite; + + /** + * Pointer to the runtime model Component object to which this + * context refers. + */ + tuscany::sca::model::Component* component; + + }; + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_cpp_compositecontextimpl_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.cpp new file mode 100644 index 0000000000..f8aad90f7a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.cpp @@ -0,0 +1,83 @@ +/* + * 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/TuscanyRuntime.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/core/SCARuntime.h" + +using namespace std; + +namespace tuscany +{ + namespace sca + { + namespace cpp + { + + // =================================================================== + // Constructor for the TuscanyRuntime class. + // =================================================================== + TuscanyRuntime::TuscanyRuntime(const string& componentName, const string& root, const string& path) + { + logentry(); + loginfo("System root: %s", root.c_str()); + systemRoot = root; + loginfo("System path: %s", path.c_str()); + systemPath = path; + loginfo("Default component name: %s", componentName.c_str()); + defaultComponentName = componentName; + + runtime = new SCARuntime("", systemRoot, systemPath, "", defaultComponentName); + } + + // =================================================================== + // Destructor for the TuscanyRuntime class. + // =================================================================== + TuscanyRuntime::~TuscanyRuntime() + { + logentry(); + + delete (SCARuntime*)runtime; + } + + // =================================================================== + // Start the runtime. + // =================================================================== + void TuscanyRuntime::start() + { + logentry(); + SCARuntime::setCurrentRuntime((SCARuntime*)runtime); + } + + // =================================================================== + // Stop the runtime. + // =================================================================== + void TuscanyRuntime::stop() + { + logentry(); + SCARuntime::setCurrentRuntime(NULL); + } + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.h new file mode 100644 index 0000000000..b4cf31220a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.h @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#ifndef tuscany_sca_cpp_tuscanyruntime_h +#define tuscany_sca_cpp_tuscanyruntime_h + +#include + +#include "osoa/sca/export.h" + +namespace tuscany +{ + namespace sca + { + namespace cpp + { + + /** + * A singleton which represents the executing SCA runtime. + */ + class SCA_CPP_API TuscanyRuntime + { + public: + /** + * Default constructor + */ + TuscanyRuntime(const std::string& defaultComponentName = "", + const std::string& root = "", const std::string& path = ""); + + /** + * Destructor + */ + virtual ~TuscanyRuntime(); + + /** + * start the runtime + */ + void start(); + + /** + * stop the runtime + */ + void stop(); + + + private: + std::string systemRoot; + std::string systemPath; + std::string defaultComponentName; + + void* defaultComponent; + void* runtime; + }; + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_cpp_tuscanyruntime_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp new file mode 100644 index 0000000000..56098ced93 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp @@ -0,0 +1,90 @@ +/* + * 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" + +using namespace std; +using namespace tuscany::sca::model; + +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), staticImpl(0) + { + } + + 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 (unsigned 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 (unsigned int ri=0; ri< references.size(); ri++) + { + Reference *reference = refiter->second; + CPPReferenceBinding* binding = new CPPReferenceBinding(reference); + reference->setBinding(binding); + refiter++; + } + } + + void CPPImplementation::setStaticImplementation(void* staticImpl) + { + this->staticImpl = staticImpl; + } + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h new file mode 100644 index 0000000000..2dfdac616e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h @@ -0,0 +1,163 @@ +/* + * 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 +#include + +#include "tuscany/sca/model/ComponentType.h" + +namespace tuscany +{ + namespace sca + { + namespace cpp + { + /** + * Holds information about an SCA implementation written in C++ + */ + class CPPImplementation : public tuscany::sca::model::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(tuscany::sca::model::Composite* composite, + const std::string& library, const std::string& header, const std::string&headerPath, + const std::string& headerStub, const std::string& className, Scope scope); + + /** + * Destructor + */ + virtual ~CPPImplementation(); + + /** + * Initialize a component of this type. + * @param component The component to initialize. + */ + virtual void initializeComponent(tuscany::sca::model::Component* component); + + /** + * Returns the name of the shared library. + * @return The name of the shared library. + */ + const std::string& getLibrary() const { return library; } + + /** + * Get the name of the header file. + * @return Name of the header file. + */ + const std::string& getHeader() const { return header; } + + /** + * Get the header file name without the extension. + * @return The name of the header file without any extension. + */ + const std::string& getHeaderStub() const { return headerStub; } + + /** + * Get the header path. + * @return The pathe element of the header. + */ + const std::string& getHeaderPath() const { return headerPath; } + + /** + * Get the name of the class. + * @return The class name if specified. + */ + const std::string& getClass() const { return className; } + + /** + * Returns the implementation scope + */ + Scope getScope() { return scope; } + + /** + * Returns the implementation instance (to be used if the scope is set to composite) + */ + void* getStaticImplementation() { return staticImpl; } + + /** + * Sets the implementation instance (to be used if the scope is set to composite) + */ + void setStaticImplementation(void* staticImpl); + + private: + + /** + * Name of the shared library. + */ + std::string library; + + /** + * Name of the header file describing the interface. + */ + std::string header; + + /** + * Name of the header file without the extension. + */ + std::string headerStub; + + /** + * Path element of the header. + */ + std::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. + */ + std::string className; + + /** + * Scope of the implementation + */ + Scope scope; + + /** + * Holds the implementation instance if the scope is set to composite. + */ + void* staticImpl; + }; + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_cpp_model_cppimplementation_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp new file mode 100644 index 0000000000..2322d1bdf5 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp @@ -0,0 +1,63 @@ +/* + * 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" + +using namespace std; + +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/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h new file mode 100644 index 0000000000..fdbf314d3d --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h @@ -0,0 +1,117 @@ +/* + * 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 + +#include "tuscany/sca/model/Interface.h" + + +namespace tuscany +{ + namespace sca + { + namespace cpp + { + /** + * Holds information about an interface described using a C++ + * header file. + */ + class CPPInterface : public tuscany::sca::model::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 std::string& header, + const std::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 std::string& getHeader() { return header; } + + /** + * Return the name of the header file without the extension. + * @return Header file name without any extension. + */ + const std::string& getHeaderStub() { return headerStub; } + + /** + * Get the name of the class. + * @return The name of the class defining the interface. + */ + const std::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 std::string& getInterfaceTypeQName() { return typeQName; }; + + private: + + /** + * Name of the header file containing the definition of the interface. + */ + std::string header; + + /** + * Name of the header file without the extension. + */ + std::string headerStub; + + /** + * Name of the class in the header file. + */ + std::string className; + + /** + * The QName of the schema type for this interface type. + */ + static const std::string typeQName; + }; + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_cpp_model_cppinterface_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.cpp new file mode 100644 index 0000000000..0c12b7af43 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.cpp @@ -0,0 +1,61 @@ +/* + * 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" + +using namespace tuscany::sca::model; + + +namespace tuscany +{ + namespace sca + { + namespace cpp + { + + // Constructor + CPPReferenceBinding::CPPReferenceBinding(Reference* reference) + : ReferenceBinding(reference, ""), serviceProxy(NULL) + { + } + + // Destructor + CPPReferenceBinding::~CPPReferenceBinding() + { + } + + ServiceProxy* CPPReferenceBinding::getServiceProxy() + { + return serviceProxy; + } + + void CPPReferenceBinding::configure(ServiceBinding* binding) + { + setTargetServiceBinding(binding); + + serviceProxy = new CPPServiceProxy(getReference()); + } + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.h new file mode 100644 index 0000000000..9860f14765 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.h @@ -0,0 +1,87 @@ +/* + * 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 + +#include "tuscany/sca/model/ReferenceBinding.h" + + +namespace tuscany +{ + namespace sca + { + namespace cpp + { + /** + * Information about a CPP service binding for service or a reference. + */ + class CPPReferenceBinding : public tuscany::sca::model::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(tuscany::sca::model::Reference* reference); + + /** + * Destructor. + */ + virtual ~CPPReferenceBinding(); + + /** + * Returns the type of binding. + */ + virtual std::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(tuscany::sca::model::ServiceBinding* serviceBinding); + + private: + + /** + * The proxy representing the reference to the client + * component. + */ + ServiceProxy* serviceProxy; + + }; + + } // End namespace cpp + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_cpp_model_cppreferencebinding_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.cpp new file mode 100644 index 0000000000..45afea8375 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.cpp @@ -0,0 +1,54 @@ +/* + * 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" + +using namespace tuscany::sca::model; + +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/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.h new file mode 100644 index 0000000000..13b88a84dd --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.h @@ -0,0 +1,81 @@ +/* + * 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 + +#include "tuscany/sca/model/ServiceBinding.h" + + +namespace tuscany +{ + namespace sca + { + namespace cpp + { + /** + * Information about a CPP service binding for service or a reference. + */ + class CPPServiceBinding : public tuscany::sca::model::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(tuscany::sca::model::Service* service); + + /** + * Destructor. + */ + virtual ~CPPServiceBinding(); + + /** + * Returns the type of binding. + */ + virtual std::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/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/Makefile.am new file mode 100644 index 0000000000..3a97f02513 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/Makefile.am @@ -0,0 +1,25 @@ +# 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_TOOLS = scagen +endif +if WANT_CPP + CPP_TOOLS = scagen +endif + +SUBDIRS = ${CPP_TOOLS} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/META-INF/LICENSE b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/META-INF/LICENSE new file mode 100644 index 0000000000..f433b1a53f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/META-INF/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/META-INF/NOTICE b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/META-INF/NOTICE new file mode 100644 index 0000000000..44befbee63 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/META-INF/NOTICE @@ -0,0 +1,5 @@ +Apache Tuscany SCA Native +Copyright 2005, 2007 The Apache Software Foundation + +This product includes software developed by +The Apache Software Foundation (http://www.apache.org/) \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/META-INF/README b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/META-INF/README new file mode 100644 index 0000000000..2831dadd94 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/META-INF/README @@ -0,0 +1,19 @@ +Apache Tuscany C++ M1 build (July, 2006) +=================================== + +http://incubator.apache.org/tuscany + +Tuscany is an effort undergoing incubation at the Apache Software Foundation +(ASF), sponsored by the Web Services PMC. + +Incubation is required of all newly accepted projects until a further review +indicates that the infrastructure, communications, and decision making process +have stabilized in a manner consistent with other successful ASF projects. + +While incubation status is not necessarily a reflection of the completeness or +stability of the code, it does indicate that the project has yet to be fully +endorsed by the ASF. + +Thank you for using Tuscany! + +The Tuscany Team. diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/Makefile.am new file mode 100644 index 0000000000..59b4d2095f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/Makefile.am @@ -0,0 +1,35 @@ +# 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 = + +BUILT_SOURCES = scagen_build +EXTRA_DIST = build.xml scagen.sh src META-INF +bin_SCRIPTS = scagen.sh + +scagen_build: + ant + touch scagen_build + +clean: + rm -rf build + rm -rf docs + rm -f scagen_build + +install-exec-hook: + cp build/scagen.jar $(bindir) + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/build.xml b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/build.xml new file mode 100644 index 0000000000..23e825a1b4 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/build.xml @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SCA for C++ Tools]]> + + + Copyright 2005 The Apache Software Foundation or its licensors, as applicable.]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/CalculatorTest.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/CalculatorTest.java new file mode 100644 index 0000000000..13c1273983 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/CalculatorTest.java @@ -0,0 +1,33 @@ +/** + * + * 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. + */ + +package org.apache.tuscany.sca.cpp.tools.junit; + +import org.apache.tuscany.sca.cpp.tools.junit.TuscanyTestCase; + +/** + * This test case tests a simple Calculator service tools generation + */ +public class CalculatorTest extends TuscanyTestCase { + + public void testCalculatorCompositeAndComponent() { + testComposite("CalculatorCompositeAndComponent", check_results); + } +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/EnvHandlerTest.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/EnvHandlerTest.java new file mode 100644 index 0000000000..48d415dd8e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/EnvHandlerTest.java @@ -0,0 +1,48 @@ +/** + * + * 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. + */ + +package org.apache.tuscany.sca.cpp.tools.junit; + +/** + * This is a "run this first" testcase that just tests some simple operations of + * the scagen tools it uses the + * Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite SCA composite as + * input data. + */ +public class EnvHandlerTest extends TuscanyTestCase { + + /** + * Constructor for CustomerInfoTestOLD. + * + * @param arg0 + */ + public EnvHandlerTest(String arg0) { + super(arg0); + } + + /** + * Test the Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite + * proxy and wrapper generation. + */ + public void testEnvHandler() { + testComposite("MyValueServiceComposite", check_results); + } + +} diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/ImplClassWithNameSpaceButNotInClassAttrTest.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/ImplClassWithNameSpaceButNotInClassAttrTest.java new file mode 100644 index 0000000000..ca7d50ae48 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/ImplClassWithNameSpaceButNotInClassAttrTest.java @@ -0,0 +1,48 @@ +/** + * + * 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. + */ + +package org.apache.tuscany.sca.cpp.tools.junit; + +/** + * This is a "run this first" testcase that just tests some simple operations of + * the scagen tools it uses the + * Hydra.sca.core\test\testSCASystem\composites\MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr SCA composite as + * input data. + */ +public class ImplClassWithNameSpaceButNotInClassAttrTest extends TuscanyTestCase { + + /** + * Constructor for CustomerInfoTestOLD. + * + * @param arg0 + */ + public ImplClassWithNameSpaceButNotInClassAttrTest(String arg0) { + super(arg0); + } + + /** + * Test the Hydra.sca.core\test\testSCASystem\composites\MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr + * proxy and wrapper generation. + */ + public void testEnvHandler() { + testComposite("MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr", check_results); + } + +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/ImplClassWithNameSpaceTest.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/ImplClassWithNameSpaceTest.java new file mode 100644 index 0000000000..e019873489 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/ImplClassWithNameSpaceTest.java @@ -0,0 +1,48 @@ +/** + * + * 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. + */ + +package org.apache.tuscany.sca.cpp.tools.junit; + +/** + * This is a "run this first" testcase that just tests some simple operations of + * the scagen tools it uses the + * Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite SCA composite as + * input data. + */ +public class ImplClassWithNameSpaceTest extends TuscanyTestCase { + + /** + * Constructor for CustomerInfoTestOLD. + * + * @param arg0 + */ + public ImplClassWithNameSpaceTest(String arg0) { + super(arg0); + } + + /** + * Test the Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite + * proxy and wrapper generation. + */ + public void testEnvHandler() { + testComposite("MyValueServiceCompositeImplClassWithNamespace", check_results); + } + +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/IntfClassWithNameSpaceButNotInClassAttrTest.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/IntfClassWithNameSpaceButNotInClassAttrTest.java new file mode 100644 index 0000000000..11cab070b2 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/IntfClassWithNameSpaceButNotInClassAttrTest.java @@ -0,0 +1,48 @@ +/** + * + * 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. + */ + +package org.apache.tuscany.sca.cpp.tools.junit; + +/** + * This is a "run this first" testcase that just tests some simple operations of + * the scagen tools it uses the + * Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite SCA composite as + * input data. + */ +public class IntfClassWithNameSpaceButNotInClassAttrTest extends TuscanyTestCase { + + /** + * Constructor for CustomerInfoTestOLD. + * + * @param arg0 + */ + public IntfClassWithNameSpaceButNotInClassAttrTest(String arg0) { + super(arg0); + } + + /** + * Test the Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite + * proxy and wrapper generation. + */ + public void testEnvHandler() { + testComposite("MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr", check_results); + } + +} diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/IntfClassWithNameSpaceTest.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/IntfClassWithNameSpaceTest.java new file mode 100644 index 0000000000..a26321d2a3 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/IntfClassWithNameSpaceTest.java @@ -0,0 +1,48 @@ +/** + * + * 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. + */ + +package org.apache.tuscany.sca.cpp.tools.junit; + +/** + * This is a "run this first" testcase that just tests some simple operations of + * the scagen tools it uses the + * Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite SCA composite as + * input data. + */ +public class IntfClassWithNameSpaceTest extends TuscanyTestCase { + + /** + * Constructor for CustomerInfoTestOLD. + * + * @param arg0 + */ + public IntfClassWithNameSpaceTest(String arg0) { + super(arg0); + } + + /** + * Test the Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite + * proxy and wrapper generation. + */ + public void testEnvHandler() { + testComposite("MyValueServiceCompositeIntfClassWithNamespace", check_results); + } + +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/MissingCompositeAndFragmentTest.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/MissingCompositeAndFragmentTest.java new file mode 100644 index 0000000000..e529af0dd0 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/MissingCompositeAndFragmentTest.java @@ -0,0 +1,48 @@ +/** + * + * 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. + */ + +package org.apache.tuscany.sca.cpp.tools.junit; + +/** + * This is a "run this first" testcase that just tests some simple operations of + * the scagen tools it uses the + * Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite SCA composite as + * input data. + */ +public class MissingCompositeAndFragmentTest extends TuscanyTestCase { + + /** + * Constructor for CustomerInfoTestOLD. + * + * @param arg0 + */ + public MissingCompositeAndFragmentTest(String arg0) { + super(arg0); + } + + /** + * Test the Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite + * proxy and wrapper generation. + */ + public void testEnvHandler() { + testComposite("MyValueServiceCompositeMissingScaComposite",false); + } + +} diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/SimplePublicPrivateProtectedTest.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/SimplePublicPrivateProtectedTest.java new file mode 100644 index 0000000000..3743a1f1f9 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/SimplePublicPrivateProtectedTest.java @@ -0,0 +1,49 @@ +/** + * + * 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. + */ + +package org.apache.tuscany.sca.cpp.tools.junit; + +/** + * This is a "run this first" testcase that just tests some simple operations of + * the scagen tools it uses the + * Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite SCA composite as + * input data. + */ +public class SimplePublicPrivateProtectedTest extends TuscanyTestCase { + + /** + * Constructor for CustomerInfoTestOLD. + * + * @param arg0 + */ + public SimplePublicPrivateProtectedTest(String arg0) { + super(arg0); + } + + /** + * Test the Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite + * proxy and wrapper generation. + */ + public void testEnvHandler() { + + testComposite("SimplePublicPrivateProtectedTest", check_results); + } + +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TestAllCompositesTest.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TestAllCompositesTest.java new file mode 100644 index 0000000000..1f1d2108e5 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TestAllCompositesTest.java @@ -0,0 +1,89 @@ +/** + * + * 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. + */ + +package org.apache.tuscany.sca.cpp.tools.junit; + +import java.io.File; +import java.util.HashSet; +import java.util.Set; + +import org.apache.tuscany.sca.cpp.tools.junit.TuscanyTestCase; + +/** + * This test case will test all the composites placed in the "composites" directory + * against the results in their repectice "expected_results" folders. + */ +public class TestAllCompositesTest extends TuscanyTestCase { + + String testsDir = TuscanyTestCase.junit_composites; + + Set excludes = new HashSet(); + + public TestAllCompositesTest(String arg0) { + super(arg0); + excludes.add("MyValueServiceCompositeMissingScaComposite"); + excludes.add("CVS"); + excludes.add(".svn"); + } + + + /* main exists to allow running from the java ant task */ + public static void main(String[] args) { + TestAllCompositesTest test = new TestAllCompositesTest(""); + test.testAllCompositesRegression(); + } + + public void testAllCompositesRegression() { + File dir = new File(testsDir); + + if (dir.isDirectory()) { + System.out.println("Testing all composites under " + + dir.getAbsolutePath()); + String[] test_composites = dir.list(); + + for (int i = 0; i < test_composites.length; i++) { + File test_composite = new File(testsDir, test_composites[i]); + + String composite_name = null; + if (test_composite.isDirectory()) { + composite_name = test_composite.getName(); + if (!excludes.contains(composite_name.intern())) { + testComposite(composite_name, check_results); + System.out.println("Test of composite \"" + composite_name + + "\" passed."); + continue; + } else { + System.out + .println("Ignoring excluded composite subdirectory \"" + + composite_name + "\""); + } + } + } + + } else { + + fail("Test directory is not a directory! \r The variable org.apache.tuscany.sca.cpp.tools.junit.TuscanyTestCase.root sets the location of the junit input data,\r it is currently set as " + + TuscanyTestCase.root + "\rand we expect to find a testinput\\composites directory under there."); + } + + System.out.println("testAllComposites test passed."); + } + +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TestDeployAssistTool.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TestDeployAssistTool.java new file mode 100644 index 0000000000..0d845e1b1e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TestDeployAssistTool.java @@ -0,0 +1,97 @@ +/** + * + * 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. + */ + +package org.apache.tuscany.sca.cpp.tools.junit; + +import java.io.File; +import java.util.HashSet; +import java.util.Set; + +/** + * This test case will test all the composites placed in the "composites" directory + * against the results in their repectice "expected_results" folders. + */ +public class TestDeployAssistTool extends TuscanyTestCase { + + String testsDir = TuscanyTestCase.junit_composites; + + Set excludes = new HashSet(); + + public TestDeployAssistTool(String arg0) { + super(arg0); + excludes.add("MyValueServiceCompositeMissingScaComposite"); + excludes.add("CVS"); + } + + /* main exists to allow running from the test script which will + * wrap this test case and pipe the satandard output to somewhere + * for checking. + */ + + public static void main(String[] args) { + TestDeployAssistTool test = new TestDeployAssistTool(""); + test.testDeployToolNullParms(); + } + + public void testDeployTool() { + //Utils.setReportArtefacts(true); + TestAllCompositesTest t = new TestAllCompositesTest(""); + File dir = new File(testsDir); + + if (dir.isDirectory()) { + String[] test_composites = dir.list(); + + for (int i = 0; i < test_composites.length; i++) { + File test_composite = new File(testsDir, test_composites[i]); + String composite_name = null; + if (test_composite.isDirectory()) { + composite_name = test_composite.getName(); + if (!excludes.contains(composite_name.intern())) { + t.testCompositeDeploy(composite_name, create_results, "c:\\colin", "cp"); + } + } + System.out.println(""); + } + } + } + + public void testDeployToolNullParms() { + //Utils.setReportArtefacts(true); + TestAllCompositesTest t = new TestAllCompositesTest(""); + File dir = new File(testsDir); + + if (dir.isDirectory()) { + String[] test_composites = dir.list(); + + for (int i = 0; i < test_composites.length; i++) { + File test_composite = new File(testsDir, test_composites[i]); + String composite_name = null; + if (test_composite.isDirectory()) { + composite_name = test_composite.getName(); + if (!excludes.contains(composite_name.intern())) { + t.testCompositeDeploy(composite_name, create_results, null, null); + } + } + System.out.println(""); + } + } + } +} + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TuscanyTestCase.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TuscanyTestCase.java new file mode 100644 index 0000000000..5d1fa568d1 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TuscanyTestCase.java @@ -0,0 +1,341 @@ +/** + * + * 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. + */ + +package org.apache.tuscany.sca.cpp.tools.junit; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; + +import junit.framework.TestCase; + +import org.apache.tuscany.sca.cpp.tools.common.Options; +import org.apache.tuscany.sca.cpp.tools.services.Scagen; + +/** + * A superclass for testcases that can be used to store common functions. + */ +public abstract class TuscanyTestCase extends TestCase { + + public static String root = "d:\\tuscany\\cpp\\sca\\tools\\scagen\\junit\\"; + + public static String junit_composites = root + "testinput\\composites\\"; + + public static String junit_output = root + "testoutput\\"; + + private String testcase = "TESTCASE NOT SET BY SUBCLASS"; + + String input = null; + + String output = null; + + /** + * Check the resulting files with the contents of the expected_results + * folder in the testComposite method + */ + public final static boolean check_results = true; + + /** + * Create test output but do not check it (useful for setting up new + * expected test output + */ + public final static boolean create_results = false; + + /** + * + */ + public TuscanyTestCase() { + super(); + } + + /** + * @param arg0 + */ + public TuscanyTestCase(String arg0) { + super(arg0); + } + + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + /** + * Tests to see if two files are the same - this is just a scratch method at + * the moment that flags up testcase output files not matching expected + * results rather than needing to be a fully robust implementation and needs + * a little further work. + * + * @param file1 + * the first file to compare + * @param file2 + * the second file to compare + * + */ + protected boolean areFilesEqual(String file1, String file2) { + + try { + FileInputStream fis1 = new java.io.FileInputStream(file1); + FileInputStream fis2 = new java.io.FileInputStream(file2); + + BufferedReader br1 = new BufferedReader(new InputStreamReader(fis1)); + BufferedReader br2 = new BufferedReader(new InputStreamReader(fis2)); + + String line1 = br1.readLine(); + String line2 = br2.readLine(); + boolean moretodo = (line1 != null) && (line2 != null); + + for (int line = 1; moretodo; line++) { + + if (line1.equals(line2)) { + + line1 = br1.readLine(); + line2 = br2.readLine(); + + } else { + + int l1i, l2i; + + if ((l1i = line1.lastIndexOf("$Id")) > 0) { + //allow CVS strings + line1 = br1.readLine(); + } + + if ((l2i = line2.lastIndexOf("$Id")) > 0) { + //allow CVS strings + line2 = br2.readLine(); + } + + if (l1i == -1 && l2i == -1) { + + // they don't match + System.out.println("file " + file1 + " and file " + + file2); + System.out.println(" don't match at line " + line); + System.out.println("1 is :" + line1); + System.out.println("2 is :" + line2); + + return false; + } + } + + moretodo = (line1 != null) && (line2 != null); + } + + System.out.println("MATCH FOR: file " + file1 + " and file " + + file2); + return true; + + } catch (Throwable t) { + t.printStackTrace(); + return true; + } + + } + + /** + * @param outputDir + */ + protected void clearDirButNotExpectedOutputSubDir(String outputDir) { + File dir = new File(outputDir); + if (dir.isDirectory()) { + String[] files = dir.list(); + for (int i = 0; i < files.length; i++) { + File child = new File(dir, files[i]); + if (child.isDirectory()) { + if (!(child.getName().equals("expected_output") || child.getName().equals(".svn"))) { + clearDirButNotExpectedOutputSubDir(dir + .getAbsolutePath() + + File.separator + files[i]); + } + } + else + { + if( !child.delete() ) + { + System.out.println("File "+outputDir+"/"+child.getName()+" could not be deleted"); + } + } + } + } + + } + + public void testComposite(String composite, boolean check) { + + Options.reset(); + setTestcase(composite); + clearDirButNotExpectedOutputSubDir(output); + + String[] commandLine = new String[] { "-dir", input, "-output", output }; + try { + Scagen.main(commandLine); + } catch (Exception e) { + fail(e.getMessage()); + } + + if (check) { + checkDirWithExpected(output); + } + } + + public void testCompositeDeploy(String composite, boolean check, + String deployDir, String command) { + + Options.reset(); + setTestcase(composite); + clearDirButNotExpectedOutputSubDir(output); + + String[] commandLine; + if (null == deployDir) { + commandLine = new String[] { "-dir", input, "-output", + output, "-deploy"}; + } else { + commandLine = new String[] { "-dir", input, "-output", + output, "-deploy", deployDir, "-command", command }; + } + try { + Scagen.main(commandLine); + } catch (Exception e) { + fail(e.getMessage()); + } + + if (check) { + checkDirWithExpected(output); + } + } + + /** + * @param outputDirName + */ + private void checkDirWithExpected(String outputDirName) { + + File actualDir = new File(outputDirName); + if (actualDir == null || !actualDir.isDirectory()) { + fail("result directory does not exist"); + } + + File expectedDir = new File(outputDirName + File.separator + + "expected_output"); + if (expectedDir == null || !actualDir.isDirectory()) { + fail("can't check results as expected directory does not exist"); + } + + //Check every file in the expected output directory is present + //in the actual directory + + String[] expectedFiles = expectedDir.list(); + + if (expectedFiles == null) { + fail("no expected results for " + expectedDir.getPath()); + } + for (int i = 0; expectedFiles != null && i < expectedFiles.length; i++) { + File expectedFile = new File(expectedDir, expectedFiles[i]); + if (expectedFile.isDirectory()) { + // we can't check subdirectories yet + // and it conveniently skips over "CVS" + } else { + File actualFile = checkFileExistsFailIfNot(actualDir, + expectedFile.getName()); + checkFileHasNoTabsAndEndsInNewline(actualDir, expectedFile + .getName()); + if (!areFilesEqual(expectedFile.getAbsolutePath(), actualFile + .getAbsolutePath())) { + fail("odd output for " + expectedFile.getPath()); + } + + } + + } + + } + + /** + * @param actualDir + * @param name + */ + private File checkFileExistsFailIfNot(File dir, String name) { + + File f = new File(dir, name); + if (f == null || !f.exists() || !f.isFile()) { + fail("Expected result file " + f + " does not exist"); + } + return f; + + } + + /** + * @param actualDir + * @param name + */ + private void checkFileHasNoTabsAndEndsInNewline(File dir, String name) { + + try { + File f = new File(dir, name); + FileInputStream fis = new FileInputStream(f); + InputStreamReader isr = new InputStreamReader(fis); + Reader br = new BufferedReader(isr); + int ch, charBeforeMinusOne = -1; + while ((ch = br.read()) > -1) { + if (ch == '\t') { + fail("found tab in output " + f.getPath()); + } + charBeforeMinusOne = ch; + } + //The last char must be newline; + if (charBeforeMinusOne != '\n') { + fail("last char in file is not a newline in " + "(char is:" + + ch + " " + dir.getName() + File.separator + name); + } + + br.close(); + } catch (IOException e) { + e.printStackTrace(); + fail("io exception in tab/newline checker for " + dir.getName() + + File.separator + name); + return; + } + + } + + /** + * @param testcase + * The testcase to set. + */ + void setTestcase(String testcase) { + this.testcase = testcase; + input = TuscanyTestCase.junit_composites + testcase; + output = TuscanyTestCase.junit_output + testcase; + } + + /** + * @return Returns the testcase. + */ + String getTestcase() { + return testcase; + } + +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/Calculator.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/Calculator.h new file mode 100644 index 0000000000..99c4158d1a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/Calculator.h @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#ifndef CALCULATOR_H +#define CALCULATOR_H + + +class Calculator { + +private: + virtual long add(long a, long b) = 0; +public: + + virtual long subtract(long a, long b) = 0; +}; + + +#endif // CALCULATOR_H diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/CalculatorImpl.componentType b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/CalculatorImpl.componentType new file mode 100644 index 0000000000..a1accb0fda --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/CalculatorImpl.componentType @@ -0,0 +1,25 @@ + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/CalculatorImpl.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/CalculatorImpl.h new file mode 100644 index 0000000000..3f97eacef2 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/CalculatorImpl.h @@ -0,0 +1,37 @@ +/* + * 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 CALCULATORIMPL_H +#define CALCULATORIMPL_H + +#include "Calculator.h" + +class CalculatorImpl : public Calculator +{ +public: + CalculatorImpl(); + virtual ~CalculatorImpl(); + virtual long add(long a, long b); + virtual long subtract(long a, long b); + +}; + +#endif // diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/sca.composite b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/sca.composite new file mode 100644 index 0000000000..f2a8e56c58 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/sca.composite @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/otherSubFolder/CalculatorBack.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/otherSubFolder/CalculatorBack.h new file mode 100644 index 0000000000..bc14167841 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/otherSubFolder/CalculatorBack.h @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#ifndef CALCULATOR_H +#define CALCULATOR_H + + +class CalculatorBack { + + + +public: + virtual long subtractBack(long a, long b) = 0; + virtual long addBack(long a, long b) = 0; +}; + + +#endif // CALCULATOR_H diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/otherSubFolder/CalculatorForward.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/otherSubFolder/CalculatorForward.h new file mode 100644 index 0000000000..af140f9575 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/otherSubFolder/CalculatorForward.h @@ -0,0 +1,35 @@ +/* + * 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 CALCULATOR_H +#define CALCULATOR_H + + +class CalculatorForward { + +public: + + virtual long subtractForward(long a, long b) = 0; + virtual long addForward(long a, long b) = 0; +}; + + +#endif // CALCULATOR_H diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/sca.composite b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/sca.composite new file mode 100644 index 0000000000..b3c5778b36 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/sca.composite @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorBackImpl.componentType b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorBackImpl.componentType new file mode 100644 index 0000000000..715a4dfc6c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorBackImpl.componentType @@ -0,0 +1,26 @@ + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorBackImpl.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorBackImpl.h new file mode 100644 index 0000000000..d10bfb4b1a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorBackImpl.h @@ -0,0 +1,37 @@ +/* + * 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 CALCULATORIMPL_H +#define CALCULATORIMPL_H + +#include "Calculator.h" + +class CalculatorBackImpl : public Calculator +{ +public: + CalculatorImpl(); + virtual ~CalculatorImpl(); + virtual long addBack(long a, long b); + virtual long subtractBack(long a, long b); + +}; + +#endif // diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorForwardImpl.componentType b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorForwardImpl.componentType new file mode 100644 index 0000000000..0000086167 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorForwardImpl.componentType @@ -0,0 +1,25 @@ + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorForwardImpl.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorForwardImpl.h new file mode 100644 index 0000000000..182d9d89f2 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorForwardImpl.h @@ -0,0 +1,37 @@ +/* + * 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 CALCULATORIMPL_H +#define CALCULATORIMPL_H + +#include "Calculator.h" + +class CalculatorForwardImpl : public Calculator +{ +public: + CalculatorImpl(); + virtual ~CalculatorImpl(); + virtual long addForward(long a, long b); + virtual long subtractForward(long a, long b); + +}; + +#endif // diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfo.fragment b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfo.fragment new file mode 100644 index 0000000000..733b4700e7 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfo.fragment @@ -0,0 +1,39 @@ + + + + + + + + + + x + 23 + 42 + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfo.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfo.h new file mode 100644 index 0000000000..d1a634999c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfo.h @@ -0,0 +1,98 @@ +/* + * 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 CustomerInfo_h +#define CustomerInfo_h + +class CustomerInfo +{ +public: +//char (simple extra type) + virtual const char* getCustomerInformationChar(char * p1, const char* customerID ) = 0; + virtual const char* getCustomerInfoAChar(char * p1,const char*) = 0; + virtual const char* getCustomerInfoBChar(char * p1, char* customerID ) = 0; + virtual const char* getCustomerInfoCChar(char * p1, char customerID ) = 0; + virtual const char* getCustomerInfoDChar(char * p1,char) = 0; + virtual const char* getCustomerInfoEChar(char * p1 , char *) = 0; + virtual const char* getCustomerInfoFChar(char * p1, char * p1, char *customerID ) = 0; + virtual const char* getCustomerInfoGChar(char * p1, char *, char * p1,signed char *customerID ) = 0; + virtual const char* getCustomerInfoHChar(unsigned char *customerID, const char, ) = 0; + virtual const char* getCustomerInfoHChar(unsigned char *customerID, const char*) = 0; + +//long (duplicate the types) + virtual const long* getCustomerInformationLong(const long* customerID, const long* customerID ) = 0; + virtual const long* getCustomerInfoALong(const long*,const long*) = 0; + virtual const long* getCustomerInfoBLong(long* customerID, long* customerID2 ) = 0; + virtual const long* getCustomerInfoCLong(long customerID , long customerID2 ) = 0; + virtual const long* getCustomerInfoDLong(long,long) = 0; + virtual const long* getCustomerInfoELong(long *, long*) = 0; + virtual const long* getCustomerInfoFLong(long *customerID, long* customerID2 ) = 0; + virtual const long* getCustomerInfoGLong(signed long *customerID, signed long *customerID2 ) = 0; + virtual const long* getCustomerInfoHLong(signed long *customerID, signed long *customerID2 ) = 0; + +//int + virtual const int* getCustomerInformationInt(char*, const int* customerID ) = 0; + virtual const int* getCustomerInfoAInt(char*,const int*) = 0; + virtual const int* getCustomerInfoBInt(char*,int* customerID ) = 0; + virtual const int* getCustomerInfoCInt(char*,int customerID ) = 0; + virtual const int* getCustomerInfoDInt(char*,int) = 0; + virtual const int* getCustomerInfoEInt(char*,int *) = 0; + virtual const int* getCustomerInfoFInt(char*,int *customerID ) = 0; + virtual const int* getCustomerInfoGInt(char*,signed int *customerID ) = 0; + virtual const int* getCustomerInfoHInt(char*,unsigned int *customerID ) = 0; + + +//__int64 + virtual const __int64* getCustomerInformationint64(Diamond&,const __int64* customerID ) = 0; + virtual const __int64* getCustomerInfoAint64(Diamond&, const __int64*) = 0; + virtual const __int64* getCustomerInfoBint64( Diamond&, __int64* customerID ) = 0; + virtual const __int64* getCustomerInfoCint64(Diamond&,__int64 customerID ) = 0; + virtual const __int64* getCustomerInfoDint64(Diamond& myDiamond,__int64) = 0; + virtual const __int64* getCustomerInfoEint64(Diamond& myDiamond, __int64 *) = 0; + virtual const __int64* getCustomerInfoFint64(Diamond& myDiamond, __int64 *customerID ) = 0; + virtual const __int64* getCustomerInfoGint64(Diamond& myDiamond, signed __int64 *customerID ) = 0; + virtual const __int64* getCustomerInfoHint64(const Diamond& myDiamond, unsigned int64 *customerID ) = 0; + +//void + virtual const void* getCustomerInformationVoid(float& f, const __int64* customerID ) = 0; + virtual void getCustomerInfoAVoid(const float& f, const __int64*) = 0; + virtual void getCustomerInfoBVoid( ) = 0; + virtual void getCustomerInfoCVoid() = 0; + virtual void getCustomerInfoDVoid(void) = 0; + virtual char getCustomerInfoEVoid(void) = 0; + virtual char getCustomerInfoFVoid() = 0; + virtual char getCustomerInfoGVoid( void ) = 0; + +//inline + virtual inline const char * getCustomerInfoAInline(int,int,int,int, char* customer id) = 0; + inline int getCustomerInfoBInline(int*,int* f, int* g, char* customer id) = 0; + virtual inline friend const unsigned int * getCustomerInfoCInline(char* customer id) = 0; + +//tricky examples + int getCustomerInfoTrickyA(const char, const char) = 0; + int getCustomerInfoTrickyB(int myInt, int myInt) = 0; + + + + +}; + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfoImpl.componentType b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfoImpl.componentType new file mode 100644 index 0000000000..c2cfd3b399 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfoImpl.componentType @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfoImpl.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfoImpl.h new file mode 100644 index 0000000000..c325a90b1e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfoImpl.h @@ -0,0 +1,38 @@ +/* + * 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 CustomerInfoImpl_h +#define CustomerInfoImpl_h + +#include "CustomerInfo.h" + + + +class CustomerInfoImpl : public CustomerInfo +{ +public: + CustomerInfoImpl(); + virtual ~CustomerInfoImpl(); + virtual const char* getCustomerInformation(const char* customerID); + +}; + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfo.fragment b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfo.fragment new file mode 100644 index 0000000000..cb63dd1f06 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfo.fragment @@ -0,0 +1,39 @@ + + + + + + + + + + x + 23 + 42 + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfo.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfo.h new file mode 100644 index 0000000000..85fac59da8 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfo.h @@ -0,0 +1,94 @@ +/* + * 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 CustomerInfo_h +#define CustomerInfo_h + +class CustomerInfo +{ +public: +//char + virtual const char* getCustomerInformationChar(const char* customerID ) = 0; + virtual const char* getCustomerInfoAChar(const char*) = 0; + virtual const char* getCustomerInfoBChar(char* customerID ) = 0; + virtual const char* getCustomerInfoCChar(char customerID ) = 0; + virtual const char* getCustomerInfoDChar(char) = 0; + virtual const char* getCustomerInfoEChar(char *) = 0; + virtual const char* getCustomerInfoFChar(char *customerID ) = 0; + virtual const char* getCustomerInfoGChar(signed char *customerID ) = 0; + virtual const char* getCustomerInfoHChar(unsigned char *customerID ) = 0; + +//long + virtual const long* getCustomerInformationLong(const long* customerID ) = 0; + virtual const long* getCustomerInfoALong(const long*) = 0; + virtual const long* getCustomerInfoBLong(long* customerID ) = 0; + virtual const long* getCustomerInfoCLong(long customerID ) = 0; + virtual const long* getCustomerInfoDLong(long) = 0; + virtual const long* getCustomerInfoELong(long *) = 0; + virtual const long* getCustomerInfoFLong(long *customerID ) = 0; + virtual const long* getCustomerInfoGLong(signed long *customerID ) = 0; + virtual const long* getCustomerInfoHLong(unsigned long *customerID ) = 0; + +//int + virtual const int* getCustomerInformationInt(const int* customerID ) = 0; + virtual const int* getCustomerInfoAInt(const int*) = 0; + virtual const int* getCustomerInfoBInt(int* customerID ) = 0; + virtual const int* getCustomerInfoCInt(int customerID ) = 0; + virtual const int* getCustomerInfoDInt(int) = 0; + virtual const int* getCustomerInfoEInt(int *) = 0; + virtual const int* getCustomerInfoFInt(int *customerID ) = 0; + virtual const int* getCustomerInfoGInt(signed int *customerID ) = 0; + virtual const int* getCustomerInfoHInt(unsigned int *customerID ) = 0; + + +//__int64 + virtual const __int64* getCustomerInformationint64(const __int64* customerID ) = 0; + virtual const __int64* getCustomerInfoAint64(const __int64*) = 0; + virtual const __int64* getCustomerInfoBint64(__int64* customerID ) = 0; + virtual const __int64* getCustomerInfoCint64(__int64 customerID ) = 0; + virtual const __int64* getCustomerInfoDint64(__int64) = 0; + virtual const __int64* getCustomerInfoEint64(__int64 *) = 0; + virtual const __int64* getCustomerInfoFint64(__int64 *customerID ) = 0; + virtual const __int64* getCustomerInfoGint64(signed __int64 *customerID ) = 0; + virtual const __int64* getCustomerInfoHint64(unsigned int64 *customerID ) = 0; + +//void + virtual const void* getCustomerInformationVoid(const __int64* customerID ) = 0; + virtual void getCustomerInfoAVoid(const __int64*) = 0; + virtual void getCustomerInfoBVoid( ) = 0; + virtual void getCustomerInfoCVoid() = 0; + virtual void getCustomerInfoDVoid(void) = 0; + +//inline + virtual inline const char * getCustomerInfoAInline(char* customer id) = 0; + inline int getCustomerInfoBInline(char* customer id) = 0; + virtual inline friend const unsigned int * getCustomerInfoCInline(char* customer id) = 0; + +//tricky examples + int getCustomerInfoTrickyA(const char) = 0; + int getCustomerInfoTrickyB(int myInt) = 0; + + + + +}; + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfoImpl.componentType b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfoImpl.componentType new file mode 100644 index 0000000000..c2cfd3b399 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfoImpl.componentType @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfoImpl.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfoImpl.h new file mode 100644 index 0000000000..95b70c3017 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfoImpl.h @@ -0,0 +1,47 @@ +/* + * 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 CustomerInfoImpl_h +#define CustomerInfoImpl_h + +#include "CustomerInfo.h" + + + +class CustomerInfoImpl : public CustomerInfo +{ +public: + CustomerInfoImpl(); + virtual ~CustomerInfoImpl(); + virtual const char* getCustomerInformation(const char* customerID); + +}; + +class CustomerInfoImpl2 : public CustomerInfo +{ +public: + CustomerInfoImpl(); + virtual ~CustomerInfoImpl(); + virtual const char* getCustomerInformation2(const char* customerID); + +}; + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfo.fragment b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfo.fragment new file mode 100644 index 0000000000..5c5cb78b87 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfo.fragment @@ -0,0 +1,39 @@ + + + + + + + + + + x + 23 + 42 + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfo.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfo.h new file mode 100644 index 0000000000..7bd355b3ab --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfo.h @@ -0,0 +1,36 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef CustomerInfo_h +#define CustomerInfo_h + +class CustomerInfo +{ +public: + virtual const char* getCustomerInformation(const char* customerID) = 0; + +}; + + +class CustomerInfoSecond +{ +public: + virtual const char* getCustomerInformationSecond(const char* customerID) = 0; + +}; + + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfoImpl.componentType b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfoImpl.componentType new file mode 100644 index 0000000000..c2cfd3b399 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfoImpl.componentType @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfoImpl.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfoImpl.h new file mode 100644 index 0000000000..540873174b --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfoImpl.h @@ -0,0 +1,49 @@ +/* + * 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$ */ + +// Class definition for the implementation + +#ifndef CustomerInfoImpl_h +#define CustomerInfoImpl_h + +#include "CustomerInfo.h" + + + +class CustomerInfoImpl : public CustomerInfo +{ +public: + CustomerInfoImpl(); + virtual ~CustomerInfoImpl(); + virtual const char* getCustomerInformation(const char* customerID); + +}; + +class CustomerInfoImpl2 : public CustomerInfo +{ +public: + CustomerInfoImpl(); + virtual ~CustomerInfoImpl(); + virtual const char* getCustomerInformation2(const char* customerID); + +}; + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValue.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValue.h new file mode 100644 index 0000000000..4334c82eca --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValue.h @@ -0,0 +1,40 @@ +/* + * 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$ */ + +// MyValue.h: interface for the MyValueImpl class. +// +////////////////////////////////////////////////////////////////////// + +#ifndef MyValue_h +#define MyValue_h +#include +using std::string; +class MyValue +{ +public: + virtual float getMyValue(const char* customerID) = 0; + virtual float getMyValueS(const string& customerID) = 0; + virtual string getCustname(string& customerID) = 0; + virtual const string& getCustnamecs(string customerID) = 0; + +}; + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl.componentType b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl.componentType new file mode 100644 index 0000000000..c4e3b35675 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl.componentType @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl.hpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl.hpp new file mode 100644 index 0000000000..98a342fcb0 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl.hpp @@ -0,0 +1,43 @@ +/* + * 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$ */ + +// Class definition for the implementation + +#ifndef MyValueImpl_h +#define MyValueImpl_h + +#include "MyValue.h" + + + +class MyValueImpl : public MyValue +{ +public: + MyValueImpl(); + virtual ~MyValueImpl(); + virtual float getMyValue(const char* customerID); + virtual float getMyValueS(const string& customerID); + virtual string getCustname(string& customerID); + virtual const string& getCustnamecs(string customerID); + +}; + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl_stockQuote_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl_stockQuote_Proxy.h new file mode 100644 index 0000000000..3f9feeed30 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl_stockQuote_Proxy.h @@ -0,0 +1,38 @@ +/* + * 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 MyValueImpl_stockQuote_Proxy_h +#define MyValueImpl_stockQuote_Proxy_h + +#include "StockQuoteService.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class MyValueImpl_stockQuote_Proxy : public StockQuoteService +{ +public: + MyValueImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~MyValueImpl_stockQuote_Proxy(); + virtual commonj::sdo::DataObjectPtr GetStockQuotes(commonj::sdo::DataObjectPtr); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // MyValueImpl_stockQuote_Proxy_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/StockQuoteService.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/StockQuoteService.h new file mode 100644 index 0000000000..6a8fd51534 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/StockQuoteService.h @@ -0,0 +1,37 @@ +/* + * 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 StockQuoteService_h +#define StockQuoteService_h +#include +#include "commonj/sdo/sdo.h" +using std::string; +class StockQuoteService +{ +public: + virtual commonj::sdo::DataObjectPtr GetStockQuotes(commonj::sdo::DataObjectPtr request) = 0; + +}; + +#endif // StockQuoteService_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/sca.composite b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/sca.composite new file mode 100644 index 0000000000..9a5cfd8da5 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/sca.composite @@ -0,0 +1,60 @@ + + + + + + + + + + MyValueServiceComponent + + + + + + + + CustomerInfoComponent + StockQuoteService + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfo.fragment b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfo.fragment new file mode 100644 index 0000000000..48d34f7957 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfo.fragment @@ -0,0 +1,39 @@ + + + + + + + + + + x + 23 + 42 + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfo.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfo.h new file mode 100644 index 0000000000..928480df1f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfo.h @@ -0,0 +1,41 @@ +/* + * 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 CustomerInfo_h +#define CustomerInfo_h + +class CustomerInfo +{ +public: + virtual const char* getCustomerInformation(const char* customerID) = 0; + +}; + + +class CustomerInfoSecond +{ +public: + virtual const char* getCustomerInformationSecond(const char* customerID) = 0; + +}; + + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfoImpl.componentType b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfoImpl.componentType new file mode 100644 index 0000000000..c2cfd3b399 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfoImpl.componentType @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfoImpl.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfoImpl.h new file mode 100644 index 0000000000..8d2f810db0 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfoImpl.h @@ -0,0 +1,52 @@ +/* + * 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$ */ + +// Class definition for the implementation + +#ifndef CustomerInfoImpl_h +#define CustomerInfoImpl_h + +#include "CustomerInfo.h" + + +/* +class CustomerInfoImpl : public CustomerInfo +{ +public: + CustomerInfoImpl(); + virtual ~CustomerInfoImpl(); + virtual const char* getCustomerInformation(const char* customerID); + +}; + +*/ +namespace Other { + class CustomerInfoImpl : public CustomerInfo + { + public: + CustomerInfoImpl(); + virtual ~CustomerInfoImpl(); + virtual const char* getCustomerInformationOther(const char* customerID); + + }; +} + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValue.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValue.h new file mode 100644 index 0000000000..4334c82eca --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValue.h @@ -0,0 +1,40 @@ +/* + * 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$ */ + +// MyValue.h: interface for the MyValueImpl class. +// +////////////////////////////////////////////////////////////////////// + +#ifndef MyValue_h +#define MyValue_h +#include +using std::string; +class MyValue +{ +public: + virtual float getMyValue(const char* customerID) = 0; + virtual float getMyValueS(const string& customerID) = 0; + virtual string getCustname(string& customerID) = 0; + virtual const string& getCustnamecs(string customerID) = 0; + +}; + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl.componentType b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl.componentType new file mode 100644 index 0000000000..c4e3b35675 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl.componentType @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl.hpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl.hpp new file mode 100644 index 0000000000..98a342fcb0 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl.hpp @@ -0,0 +1,43 @@ +/* + * 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$ */ + +// Class definition for the implementation + +#ifndef MyValueImpl_h +#define MyValueImpl_h + +#include "MyValue.h" + + + +class MyValueImpl : public MyValue +{ +public: + MyValueImpl(); + virtual ~MyValueImpl(); + virtual float getMyValue(const char* customerID); + virtual float getMyValueS(const string& customerID); + virtual string getCustname(string& customerID); + virtual const string& getCustnamecs(string customerID); + +}; + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl_stockQuote_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl_stockQuote_Proxy.h new file mode 100644 index 0000000000..3f9feeed30 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl_stockQuote_Proxy.h @@ -0,0 +1,38 @@ +/* + * 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 MyValueImpl_stockQuote_Proxy_h +#define MyValueImpl_stockQuote_Proxy_h + +#include "StockQuoteService.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class MyValueImpl_stockQuote_Proxy : public StockQuoteService +{ +public: + MyValueImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~MyValueImpl_stockQuote_Proxy(); + virtual commonj::sdo::DataObjectPtr GetStockQuotes(commonj::sdo::DataObjectPtr); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // MyValueImpl_stockQuote_Proxy_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/StockQuoteService.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/StockQuoteService.h new file mode 100644 index 0000000000..6a8fd51534 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/StockQuoteService.h @@ -0,0 +1,37 @@ +/* + * 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 StockQuoteService_h +#define StockQuoteService_h +#include +#include "commonj/sdo/sdo.h" +using std::string; +class StockQuoteService +{ +public: + virtual commonj::sdo::DataObjectPtr GetStockQuotes(commonj::sdo::DataObjectPtr request) = 0; + +}; + +#endif // StockQuoteService_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/sca.composite b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/sca.composite new file mode 100644 index 0000000000..9a5cfd8da5 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/sca.composite @@ -0,0 +1,60 @@ + + + + + + + + + + MyValueServiceComponent + + + + + + + + CustomerInfoComponent + StockQuoteService + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValue.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValue.h new file mode 100644 index 0000000000..90835ca4af --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValue.h @@ -0,0 +1,40 @@ +/* + * 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$ */ + +// MyValue.h: interface for the MyValueImpl class. +// +////////////////////////////////////////////////////////////////////// + +#ifndef MyValue_h +#define MyValue_h +#include +using std::string; + +class MyValue +{ + public: + virtual float getMyValueOther(const char* customerID) = 0; + virtual float getMyValueSOther(const string& customerID) = 0; + virtual string getCustnameOther(string& customerID) = 0; + virtual const string& getCustnamecsOther(string customerID) = 0; +} + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValueImpl.componentType b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValueImpl.componentType new file mode 100644 index 0000000000..785be08b72 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValueImpl.componentType @@ -0,0 +1,30 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValueImpl.hpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValueImpl.hpp new file mode 100644 index 0000000000..04a785cd26 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValueImpl.hpp @@ -0,0 +1,47 @@ +/* + * 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$ */ +// Class definition for the implementation + +#ifndef MyValueImpl_h +#define MyValueImpl_h + +#include "MyValue.h" + + +namespace myvaluecorp +{ + namespace implns + { + + class MyValueImpl : public MyValue + { + public: + MyValueImpl(); + virtual ~MyValueImpl(); + virtual float getMyValue(const char* customerID); + virtual float getMyValueS(const string& customerID); + virtual string getCustname(string& customerID); + virtual const string& getCustnamecs(string customerID); + + }; + } +} +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/sca.composite b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/sca.composite new file mode 100644 index 0000000000..3e3c22a07b --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/sca.composite @@ -0,0 +1,48 @@ + + + + + + + + + + MyValueServiceComponent + + + + + + + + CustomerInfoComponent + StockQuoteService + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValue.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValue.h new file mode 100644 index 0000000000..bbfcf15ed1 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValue.h @@ -0,0 +1,43 @@ +/* + * 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$ */ + +// MyValue.h: interface for the MyValueImpl class. +// +////////////////////////////////////////////////////////////////////// + +#ifndef MyValue_h +#define MyValue_h +#include +using std::string; + +namespace Other { + class MyValue + { + public: + virtual float getMyValueOther(const char* customerID) = 0; + virtual float getMyValueSOther(const string& customerID) = 0; + virtual string getCustnameOther(string& customerID) = 0; + virtual const string& getCustnamecsOther(string customerID) = 0; + } +} + + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValueImpl.componentType b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValueImpl.componentType new file mode 100644 index 0000000000..42cc4e9827 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValueImpl.componentType @@ -0,0 +1,29 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValueImpl.hpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValueImpl.hpp new file mode 100644 index 0000000000..98a342fcb0 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValueImpl.hpp @@ -0,0 +1,43 @@ +/* + * 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$ */ + +// Class definition for the implementation + +#ifndef MyValueImpl_h +#define MyValueImpl_h + +#include "MyValue.h" + + + +class MyValueImpl : public MyValue +{ +public: + MyValueImpl(); + virtual ~MyValueImpl(); + virtual float getMyValue(const char* customerID); + virtual float getMyValueS(const string& customerID); + virtual string getCustname(string& customerID); + virtual const string& getCustnamecs(string customerID); + +}; + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/sca.composite b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/sca.composite new file mode 100644 index 0000000000..510bf36337 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/sca.composite @@ -0,0 +1,49 @@ + + + + + + + + + + MyValueServiceComponent + + + + + + + + CustomerInfoComponent + StockQuoteService + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValue.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValue.h new file mode 100644 index 0000000000..10c59480a8 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValue.h @@ -0,0 +1,41 @@ +/* + * 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$ */ + +// MyValue.h: interface for the MyValueImpl class. +// +////////////////////////////////////////////////////////////////////// + +#ifndef MyValue_h +#define MyValue_h +#include +using std::string; + +namespace Other { + class MyValue + { + public: + virtual float getMyValueOther(const char* customerID) = 0; + virtual float getMyValueSOther(const string& customerID) = 0; + virtual string getCustnameOther(string& customerID) = 0; + virtual const string& getCustnamecsOther(string customerID) = 0; + } +} +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValueImpl.componentType b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValueImpl.componentType new file mode 100644 index 0000000000..ddb463e3d7 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValueImpl.componentType @@ -0,0 +1,29 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValueImpl.hpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValueImpl.hpp new file mode 100644 index 0000000000..98a342fcb0 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValueImpl.hpp @@ -0,0 +1,43 @@ +/* + * 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$ */ + +// Class definition for the implementation + +#ifndef MyValueImpl_h +#define MyValueImpl_h + +#include "MyValue.h" + + + +class MyValueImpl : public MyValue +{ +public: + MyValueImpl(); + virtual ~MyValueImpl(); + virtual float getMyValue(const char* customerID); + virtual float getMyValueS(const string& customerID); + virtual string getCustname(string& customerID); + virtual const string& getCustnamecs(string customerID); + +}; + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/sca.composite b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/sca.composite new file mode 100644 index 0000000000..510bf36337 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/sca.composite @@ -0,0 +1,49 @@ + + + + + + + + + + MyValueServiceComponent + + + + + + + + CustomerInfoComponent + StockQuoteService + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeMissingScaComposite/CustomerInfo.fragmentX b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeMissingScaComposite/CustomerInfo.fragmentX new file mode 100644 index 0000000000..717ce02ede --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeMissingScaComposite/CustomerInfo.fragmentX @@ -0,0 +1,38 @@ + + + + + + + + + x + 23 + 42 + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeMissingScaComposite/sca.compositeX b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeMissingScaComposite/sca.compositeX new file mode 100644 index 0000000000..bbda577c28 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeMissingScaComposite/sca.compositeX @@ -0,0 +1,60 @@ + + + + + + + + + + MyValueServiceComponent + + + + + + + + CustomerInfoComponent + StockQuoteService + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfo.fragment b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfo.fragment new file mode 100644 index 0000000000..5c5cb78b87 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfo.fragment @@ -0,0 +1,39 @@ + + + + + + + + + + x + 23 + 42 + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfo.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfo.h new file mode 100644 index 0000000000..928480df1f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfo.h @@ -0,0 +1,41 @@ +/* + * 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 CustomerInfo_h +#define CustomerInfo_h + +class CustomerInfo +{ +public: + virtual const char* getCustomerInformation(const char* customerID) = 0; + +}; + + +class CustomerInfoSecond +{ +public: + virtual const char* getCustomerInformationSecond(const char* customerID) = 0; + +}; + + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfoImpl.componentType b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfoImpl.componentType new file mode 100644 index 0000000000..c2cfd3b399 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfoImpl.componentType @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfoImpl.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfoImpl.h new file mode 100644 index 0000000000..c275383ab4 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfoImpl.h @@ -0,0 +1,49 @@ +/* + * 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$ */ + +// Class definition for the implementation + +#ifndef CustomerInfoImpl_h +#define CustomerInfoImpl_h + +#include "CustomerInfo.h" + + + +class CustomerInfoImpl : public CustomerInfo +{ +public: + CustomerInfoImpl(); + virtual ~CustomerInfoImpl(); + virtual const char* getCustomerInformation(const char* customerID); + +}; + +class CustomerInfoImpl2 : public CustomerInfo +{ +public: + CustomerInfoImpl(); + virtual ~CustomerInfoImpl(); + virtual const char* getCustomerInformation(const char* customerID); + +}; + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValue.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValue.h new file mode 100644 index 0000000000..4334c82eca --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValue.h @@ -0,0 +1,40 @@ +/* + * 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$ */ + +// MyValue.h: interface for the MyValueImpl class. +// +////////////////////////////////////////////////////////////////////// + +#ifndef MyValue_h +#define MyValue_h +#include +using std::string; +class MyValue +{ +public: + virtual float getMyValue(const char* customerID) = 0; + virtual float getMyValueS(const string& customerID) = 0; + virtual string getCustname(string& customerID) = 0; + virtual const string& getCustnamecs(string customerID) = 0; + +}; + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl.componentType b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl.componentType new file mode 100644 index 0000000000..c4e3b35675 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl.componentType @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl.hpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl.hpp new file mode 100644 index 0000000000..98a342fcb0 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl.hpp @@ -0,0 +1,43 @@ +/* + * 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$ */ + +// Class definition for the implementation + +#ifndef MyValueImpl_h +#define MyValueImpl_h + +#include "MyValue.h" + + + +class MyValueImpl : public MyValue +{ +public: + MyValueImpl(); + virtual ~MyValueImpl(); + virtual float getMyValue(const char* customerID); + virtual float getMyValueS(const string& customerID); + virtual string getCustname(string& customerID); + virtual const string& getCustnamecs(string customerID); + +}; + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl_stockQuote_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl_stockQuote_Proxy.h new file mode 100644 index 0000000000..3f9feeed30 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl_stockQuote_Proxy.h @@ -0,0 +1,38 @@ +/* + * 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 MyValueImpl_stockQuote_Proxy_h +#define MyValueImpl_stockQuote_Proxy_h + +#include "StockQuoteService.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class MyValueImpl_stockQuote_Proxy : public StockQuoteService +{ +public: + MyValueImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~MyValueImpl_stockQuote_Proxy(); + virtual commonj::sdo::DataObjectPtr GetStockQuotes(commonj::sdo::DataObjectPtr); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // MyValueImpl_stockQuote_Proxy_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/StockQuoteService.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/StockQuoteService.h new file mode 100644 index 0000000000..6a8fd51534 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/StockQuoteService.h @@ -0,0 +1,37 @@ +/* + * 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 StockQuoteService_h +#define StockQuoteService_h +#include +#include "commonj/sdo/sdo.h" +using std::string; +class StockQuoteService +{ +public: + virtual commonj::sdo::DataObjectPtr GetStockQuotes(commonj::sdo::DataObjectPtr request) = 0; + +}; + +#endif // StockQuoteService_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/sca.composite b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/sca.composite new file mode 100644 index 0000000000..9a5cfd8da5 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/sca.composite @@ -0,0 +1,60 @@ + + + + + + + + + + MyValueServiceComponent + + + + + + + + CustomerInfoComponent + StockQuoteService + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfo.fragment b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfo.fragment new file mode 100644 index 0000000000..27d28368f5 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfo.fragment @@ -0,0 +1,40 @@ + + + + + + + + + + + x + 23 + 42 + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfo.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfo.h new file mode 100644 index 0000000000..32bf7572dc --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfo.h @@ -0,0 +1,45 @@ +/* + * 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 CustomerInfo_h +#define CustomerInfo_h + +class CustomerInfo +{ +public: + virtual const char* getCustomerInformationCharPublic(char * p1, const char* customerID ) = 0; + virtual const char* getCustomerInfoACharPublic(char * p1,const char*) = 0; + virtual const char* getCustomerInfoBCharPublic(char * p1, char* customerID ) = 0; + +private: + virtual const char* getCustomerInformationCharPrivate(char * p1, const char* customerID ) = 0; + virtual const char* getCustomerInfoACharPrivate(char * p1,const char*) = 0; + virtual const char* getCustomerInfoBCharPrivate(char * p1, char* customerID ) = 0; + +protected: + virtual const char* getCustomerInformationCharProtected(char * p1, const char* customerID ) = 0; + virtual const char* getCustomerInfoACharProtected(char * p1,const char*) = 0; + virtual const char* getCustomerInfoBCharProtected(char * p1, char* customerID ) = 0; + + +}; + +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfoImpl.componentType b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfoImpl.componentType new file mode 100644 index 0000000000..c2cfd3b399 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfoImpl.componentType @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfoImpl.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfoImpl.h new file mode 100644 index 0000000000..55f5813303 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfoImpl.h @@ -0,0 +1,39 @@ +/* + * 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$ */ + +// Class definition for the implementation + +#ifndef CustomerInfoImpl_h +#define CustomerInfoImpl_h + +#include "CustomerInfo.h" + + + +class CustomerInfoImpl : public CustomerInfo +{ +public: + CustomerInfoImpl(); + virtual ~CustomerInfoImpl(); + virtual const char* getCustomerInformation(const char* customerID); + +}; +#endif diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Proxy.cpp new file mode 100644 index 0000000000..14bafd9ce7 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Proxy.cpp @@ -0,0 +1,65 @@ +/* + * 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. + */ + +#include "CalculatorImpl_CalculatorService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CalculatorImpl_CalculatorService_Proxy* CalculatorImpl_CalculatorService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new CalculatorImpl_CalculatorService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void CalculatorImpl_CalculatorService_Proxy_Destructor(void* proxy) + { + delete (CalculatorImpl_CalculatorService_Proxy*)proxy; + } +} + +CalculatorImpl_CalculatorService_Proxy::CalculatorImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +CalculatorImpl_CalculatorService_Proxy::~CalculatorImpl_CalculatorService_Proxy() +{ + if (target) + delete target; +} + +long CalculatorImpl_CalculatorService_Proxy::subtract( long arg0, long arg1) +{ + tuscany::sca::Operation operation("subtract"); + operation.addParameter("a", &arg0); + operation.addParameter("b", &arg1); + long ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(long*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Proxy.h new file mode 100644 index 0000000000..00b163ba76 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Proxy.h @@ -0,0 +1,41 @@ +/* + * 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. + */ + +#ifndef CalculatorImpl_CalculatorService_Proxy_h +#define CalculatorImpl_CalculatorService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "Calculator.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class CalculatorImpl_CalculatorService_Proxy : public Calculator +{ +public: + CalculatorImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~CalculatorImpl_CalculatorService_Proxy(); + virtual long subtract( long a, long b); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // CalculatorImpl_CalculatorService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Wrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Wrapper.cpp new file mode 100644 index 0000000000..b6e5c8a9f0 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Wrapper.cpp @@ -0,0 +1,84 @@ +/* + * 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. + */ + +#include "CalculatorImpl_CalculatorService_Wrapper.h" + +#include "osoa/sca/sca.h" + + + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CalculatorImpl_CalculatorService_Wrapper* CalculatorImpl_CalculatorService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new CalculatorImpl_CalculatorService_Wrapper(target); + } +} + +CalculatorImpl_CalculatorService_Wrapper::CalculatorImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (CalculatorImpl*)getImplementation(); +} + +CalculatorImpl_CalculatorService_Wrapper::~CalculatorImpl_CalculatorService_Wrapper() +{ + releaseImplementation(); +} + +void* CalculatorImpl_CalculatorService_Wrapper::newImplementation() +{ + return new CalculatorImpl; +} + +void CalculatorImpl_CalculatorService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void CalculatorImpl_CalculatorService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "subtract") + { + long& p0 = *( long*)operation.getParameterValue(0); + long& p1 = *( long*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(long*)operation.getReturnValue() = impl->subtract(p0, p1); + } + else + { + long* ret = new long; + *ret = impl->subtract(p0, p1); + operation.setReturnValue((const long*)ret); + } + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Wrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Wrapper.h new file mode 100644 index 0000000000..63bae2f75c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef CalculatorImpl_CalculatorService_Wrapper_h +#define CalculatorImpl_CalculatorService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "CalculatorImpl.h" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class CalculatorImpl_CalculatorService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + CalculatorImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target); + virtual ~CalculatorImpl_CalculatorService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + CalculatorImpl* impl; +}; + +#endif // CalculatorImpl_CalculatorService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Proxy.cpp new file mode 100644 index 0000000000..79bfdbedbb --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Proxy.cpp @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "CalculatorBackImpl_CalculatorService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CalculatorBackImpl_CalculatorService_Proxy* CalculatorBackImpl_CalculatorService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new CalculatorBackImpl_CalculatorService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void CalculatorBackImpl_CalculatorService_Proxy_Destructor(void* proxy) + { + delete (CalculatorBackImpl_CalculatorService_Proxy*)proxy; + } +} + +CalculatorBackImpl_CalculatorService_Proxy::CalculatorBackImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +CalculatorBackImpl_CalculatorService_Proxy::~CalculatorBackImpl_CalculatorService_Proxy() +{ + if (target) + delete target; +} + +long CalculatorBackImpl_CalculatorService_Proxy::subtractBack( long arg0, long arg1) +{ + tuscany::sca::Operation operation("subtractBack"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + long ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(long*)operation.getReturnValue(); +} + +long CalculatorBackImpl_CalculatorService_Proxy::addBack( long arg0, long arg1) +{ + tuscany::sca::Operation operation("addBack"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + long ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(long*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Proxy.h new file mode 100644 index 0000000000..277a3afb06 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Proxy.h @@ -0,0 +1,42 @@ +/* + * 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. + */ + +#ifndef CalculatorBackImpl_CalculatorService_Proxy_h +#define CalculatorBackImpl_CalculatorService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "otherSubFolder/CalculatorBack.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class CalculatorBackImpl_CalculatorService_Proxy : public CalculatorBack +{ +public: + CalculatorBackImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~CalculatorBackImpl_CalculatorService_Proxy(); + virtual long subtractBack( long a, long b); + virtual long addBack( long a, long b); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // CalculatorBackImpl_CalculatorService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Wrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Wrapper.cpp new file mode 100644 index 0000000000..09dd09c01c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Wrapper.cpp @@ -0,0 +1,101 @@ +/* + * 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. + */ + +#include "CalculatorBackImpl_CalculatorService_Wrapper.h" + +#include "osoa/sca/sca.h" + + + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CalculatorBackImpl_CalculatorService_Wrapper* CalculatorBackImpl_CalculatorService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new CalculatorBackImpl_CalculatorService_Wrapper(target); + } +} + +CalculatorBackImpl_CalculatorService_Wrapper::CalculatorBackImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (CalculatorBackImpl*)getImplementation(); +} + +CalculatorBackImpl_CalculatorService_Wrapper::~CalculatorBackImpl_CalculatorService_Wrapper() +{ + releaseImplementation(); +} + +void* CalculatorBackImpl_CalculatorService_Wrapper::newImplementation() +{ + return new CalculatorBackImpl; +} + +void CalculatorBackImpl_CalculatorService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void CalculatorBackImpl_CalculatorService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "subtractBack") + { + long& p0 = *( long*)operation.getParameterValue(0); + long& p1 = *( long*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(long*)operation.getReturnValue() = impl->subtractBack(p0, p1); + } + else + { + long* ret = new long; + *ret = impl->subtractBack(p0, p1); + operation.setReturnValue((const long*)ret); + } + return; + } + if (operationName == "addBack") + { + long& p0 = *( long*)operation.getParameterValue(0); + long& p1 = *( long*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(long*)operation.getReturnValue() = impl->addBack(p0, p1); + } + else + { + long* ret = new long; + *ret = impl->addBack(p0, p1); + operation.setReturnValue((const long*)ret); + } + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Wrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Wrapper.h new file mode 100644 index 0000000000..bfa203598c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef CalculatorBackImpl_CalculatorService_Wrapper_h +#define CalculatorBackImpl_CalculatorService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "subFolder/CalculatorBackImpl.h" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class CalculatorBackImpl_CalculatorService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + CalculatorBackImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target); + virtual ~CalculatorBackImpl_CalculatorService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + CalculatorBackImpl* impl; +}; + +#endif // CalculatorBackImpl_CalculatorService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Proxy.cpp new file mode 100644 index 0000000000..19056e836d --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Proxy.cpp @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "CalculatorForwardImpl_CalculatorService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CalculatorForwardImpl_CalculatorService_Proxy* CalculatorForwardImpl_CalculatorService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new CalculatorForwardImpl_CalculatorService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void CalculatorForwardImpl_CalculatorService_Proxy_Destructor(void* proxy) + { + delete (CalculatorForwardImpl_CalculatorService_Proxy*)proxy; + } +} + +CalculatorForwardImpl_CalculatorService_Proxy::CalculatorForwardImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +CalculatorForwardImpl_CalculatorService_Proxy::~CalculatorForwardImpl_CalculatorService_Proxy() +{ + if (target) + delete target; +} + +long CalculatorForwardImpl_CalculatorService_Proxy::subtractForward( long arg0, long arg1) +{ + tuscany::sca::Operation operation("subtractForward"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + long ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(long*)operation.getReturnValue(); +} + +long CalculatorForwardImpl_CalculatorService_Proxy::addForward( long arg0, long arg1) +{ + tuscany::sca::Operation operation("addForward"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + long ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(long*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Proxy.h new file mode 100644 index 0000000000..9213ec625b --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Proxy.h @@ -0,0 +1,42 @@ +/* + * 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. + */ + +#ifndef CalculatorForwardImpl_CalculatorService_Proxy_h +#define CalculatorForwardImpl_CalculatorService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "otherSubFolder/CalculatorForward.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class CalculatorForwardImpl_CalculatorService_Proxy : public CalculatorForward +{ +public: + CalculatorForwardImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~CalculatorForwardImpl_CalculatorService_Proxy(); + virtual long subtractForward( long a, long b); + virtual long addForward( long a, long b); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // CalculatorForwardImpl_CalculatorService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Wrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Wrapper.cpp new file mode 100644 index 0000000000..7b1cad7770 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Wrapper.cpp @@ -0,0 +1,101 @@ +/* + * 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. + */ + +#include "CalculatorForwardImpl_CalculatorService_Wrapper.h" + +#include "osoa/sca/sca.h" + + + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CalculatorForwardImpl_CalculatorService_Wrapper* CalculatorForwardImpl_CalculatorService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new CalculatorForwardImpl_CalculatorService_Wrapper(target); + } +} + +CalculatorForwardImpl_CalculatorService_Wrapper::CalculatorForwardImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (CalculatorForwardImpl*)getImplementation(); +} + +CalculatorForwardImpl_CalculatorService_Wrapper::~CalculatorForwardImpl_CalculatorService_Wrapper() +{ + releaseImplementation(); +} + +void* CalculatorForwardImpl_CalculatorService_Wrapper::newImplementation() +{ + return new CalculatorForwardImpl; +} + +void CalculatorForwardImpl_CalculatorService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void CalculatorForwardImpl_CalculatorService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "subtractForward") + { + long& p0 = *( long*)operation.getParameterValue(0); + long& p1 = *( long*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(long*)operation.getReturnValue() = impl->subtractForward(p0, p1); + } + else + { + long* ret = new long; + *ret = impl->subtractForward(p0, p1); + operation.setReturnValue((const long*)ret); + } + return; + } + if (operationName == "addForward") + { + long& p0 = *( long*)operation.getParameterValue(0); + long& p1 = *( long*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(long*)operation.getReturnValue() = impl->addForward(p0, p1); + } + else + { + long* ret = new long; + *ret = impl->addForward(p0, p1); + operation.setReturnValue((const long*)ret); + } + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Wrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Wrapper.h new file mode 100644 index 0000000000..0cb8404ca3 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef CalculatorForwardImpl_CalculatorService_Wrapper_h +#define CalculatorForwardImpl_CalculatorService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "subFolder/CalculatorForwardImpl.h" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class CalculatorForwardImpl_CalculatorService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + CalculatorForwardImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target); + virtual ~CalculatorForwardImpl_CalculatorService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + CalculatorForwardImpl* impl; +}; + +#endif // CalculatorForwardImpl_CalculatorService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp new file mode 100644 index 0000000000..85291cd069 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp @@ -0,0 +1,594 @@ +/* + * 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. + */ + +#include "CustomerInfoImpl_CustomerInfoService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CustomerInfoImpl_CustomerInfoService_Proxy* CustomerInfoImpl_CustomerInfoService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new CustomerInfoImpl_CustomerInfoService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void CustomerInfoImpl_CustomerInfoService_Proxy_Destructor(void* proxy) + { + delete (CustomerInfoImpl_CustomerInfoService_Proxy*)proxy; + } +} + +CustomerInfoImpl_CustomerInfoService_Proxy::CustomerInfoImpl_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +CustomerInfoImpl_CustomerInfoService_Proxy::~CustomerInfoImpl_CustomerInfoService_Proxy() +{ + if (target) + delete target; +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationChar( char* arg0, const char* arg1) +{ + tuscany::sca::Operation operation("getCustomerInformationChar"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAChar( char* arg0, const char* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoAChar"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBChar( char* arg0, char* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoBChar"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCChar( char* arg0, char arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoCChar"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDChar( char* arg0, char arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoDChar"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoEChar( char* arg0, char* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoEChar"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoFChar( char* arg0, char* arg1, char* arg2) +{ + tuscany::sca::Operation operation("getCustomerInfoFChar"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + operation.addParameter(&arg2); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoGChar( char* arg0, char* arg1, char* arg2, signed char* arg3) +{ + tuscany::sca::Operation operation("getCustomerInfoGChar"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + operation.addParameter(&arg2); + operation.addParameter(&arg3); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoHChar( unsigned char* arg0, const char arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoHChar"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoHChar( unsigned char* arg0, const char* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoHChar"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationLong(const long* arg0, const long* arg1) +{ + tuscany::sca::Operation operation("getCustomerInformationLong"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const long* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const long**)operation.getReturnValue(); +} + +const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoALong(const long* arg0, const long* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoALong"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const long* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const long**)operation.getReturnValue(); +} + +const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBLong( long* arg0, long* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoBLong"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const long* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const long**)operation.getReturnValue(); +} + +const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCLong( long arg0, long arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoCLong"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const long* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const long**)operation.getReturnValue(); +} + +const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDLong( long arg0, long arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoDLong"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const long* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const long**)operation.getReturnValue(); +} + +const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoELong( long* arg0, long* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoELong"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const long* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const long**)operation.getReturnValue(); +} + +const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoFLong( long* arg0, long* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoFLong"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const long* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const long**)operation.getReturnValue(); +} + +const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoGLong( signed long* arg0, signed long* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoGLong"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const long* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const long**)operation.getReturnValue(); +} + +const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoHLong( signed long* arg0, signed long* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoHLong"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const long* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const long**)operation.getReturnValue(); +} + +const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationInt( char* arg0, const int* arg1) +{ + tuscany::sca::Operation operation("getCustomerInformationInt"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const int**)operation.getReturnValue(); +} + +const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAInt( char* arg0, const int* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoAInt"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const int**)operation.getReturnValue(); +} + +const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBInt( char* arg0, int* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoBInt"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const int**)operation.getReturnValue(); +} + +const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCInt( char* arg0, int arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoCInt"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const int**)operation.getReturnValue(); +} + +const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDInt( char* arg0, int arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoDInt"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const int**)operation.getReturnValue(); +} + +const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoEInt( char* arg0, int* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoEInt"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const int**)operation.getReturnValue(); +} + +const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoFInt( char* arg0, int* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoFInt"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const int**)operation.getReturnValue(); +} + +const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoGInt( char* arg0, signed int* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoGInt"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const int**)operation.getReturnValue(); +} + +const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoHInt( char* arg0, unsigned int* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoHInt"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const int**)operation.getReturnValue(); +} + +const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationint64( Diamond& arg0, const __int64* arg1) +{ + tuscany::sca::Operation operation("getCustomerInformationint64"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const __int64* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const __int64**)operation.getReturnValue(); +} + +const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAint64( Diamond& arg0, const __int64* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoAint64"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const __int64* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const __int64**)operation.getReturnValue(); +} + +const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBint64( Diamond& arg0, __int64* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoBint64"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const __int64* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const __int64**)operation.getReturnValue(); +} + +const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCint64( Diamond& arg0, __int64 arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoCint64"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const __int64* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const __int64**)operation.getReturnValue(); +} + +const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDint64( Diamond& arg0, __int64 arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoDint64"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const __int64* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const __int64**)operation.getReturnValue(); +} + +const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoEint64( Diamond& arg0, __int64* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoEint64"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const __int64* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const __int64**)operation.getReturnValue(); +} + +const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoFint64( Diamond& arg0, __int64* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoFint64"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const __int64* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const __int64**)operation.getReturnValue(); +} + +const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoGint64( Diamond& arg0, signed __int64* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoGint64"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const __int64* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const __int64**)operation.getReturnValue(); +} + +const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoHint64(const Diamond& arg0, unsigned int64* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoHint64"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const __int64* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const __int64**)operation.getReturnValue(); +} + +const void* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationVoid( float& arg0, const __int64* arg1) +{ + tuscany::sca::Operation operation("getCustomerInformationVoid"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + const void* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const void**)operation.getReturnValue(); +} + +void CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAVoid(const float& arg0, const __int64* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoAVoid"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + target->invoke(operation); + return; +} + +void CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBVoid() +{ + tuscany::sca::Operation operation("getCustomerInfoBVoid"); + target->invoke(operation); + return; +} + +void CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCVoid() +{ + tuscany::sca::Operation operation("getCustomerInfoCVoid"); + target->invoke(operation); + return; +} + +void CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDVoid() +{ + tuscany::sca::Operation operation("getCustomerInfoDVoid"); + operation.addParameter(&arg0); + target->invoke(operation); + return; +} + +char CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoEVoid() +{ + tuscany::sca::Operation operation("getCustomerInfoEVoid"); + operation.addParameter(&arg0); + char ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(char*)operation.getReturnValue(); +} + +char CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoFVoid() +{ + tuscany::sca::Operation operation("getCustomerInfoFVoid"); + char ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(char*)operation.getReturnValue(); +} + +char CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoGVoid() +{ + tuscany::sca::Operation operation("getCustomerInfoGVoid"); + operation.addParameter(&arg0); + char ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(char*)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAInline( int arg0, int arg1, int arg2, int arg3, char* customer arg4) +{ + tuscany::sca::Operation operation("getCustomerInfoAInline"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + operation.addParameter(&arg2); + operation.addParameter(&arg3); + operation.addParameter(&arg4); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +int CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBInline( int* arg0, int* arg1, int* arg2, char* customer arg3) +{ + tuscany::sca::Operation operation("getCustomerInfoBInline"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + operation.addParameter(&arg2); + operation.addParameter(&arg3); + int ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(int*)operation.getReturnValue(); +} + +friend const unsigned int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCInline( char* customer arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoCInline"); + operation.addParameter(&arg0); + friend const unsigned int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(friend const unsigned int**)operation.getReturnValue(); +} + +int CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoTrickyA(const char arg0, const char arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoTrickyA"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + int ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(int*)operation.getReturnValue(); +} + +int CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoTrickyB( int arg0, int arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoTrickyB"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + int ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(int*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h new file mode 100644 index 0000000000..cb9e4e6e2a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h @@ -0,0 +1,90 @@ +/* + * 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. + */ + +#ifndef CustomerInfoImpl_CustomerInfoService_Proxy_h +#define CustomerInfoImpl_CustomerInfoService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "/CustomerInfo.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class CustomerInfoImpl_CustomerInfoService_Proxy : public CustomerInfo +{ +public: + CustomerInfoImpl_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~CustomerInfoImpl_CustomerInfoService_Proxy(); + virtual const char* getCustomerInformationChar( char* p1, const char* customerID); + virtual const char* getCustomerInfoAChar( char* p1, const char* ); + virtual const char* getCustomerInfoBChar( char* p1, char* customerID); + virtual const char* getCustomerInfoCChar( char* p1, char customerID); + virtual const char* getCustomerInfoDChar( char* p1, char ); + virtual const char* getCustomerInfoEChar( char* p1, char* ); + virtual const char* getCustomerInfoFChar( char* p1, char* p1, char* customerID); + virtual const char* getCustomerInfoGChar( char* p1, char* , char* p1, signed char* customerID); + virtual const char* getCustomerInfoHChar( unsigned char* customerID, const char ); + virtual const char* getCustomerInfoHChar( unsigned char* customerID, const char* ); + virtual const long* getCustomerInformationLong(const long* customerID, const long* customerID); + virtual const long* getCustomerInfoALong(const long* , const long* ); + virtual const long* getCustomerInfoBLong( long* customerID, long* customerID2); + virtual const long* getCustomerInfoCLong( long customerID, long customerID2); + virtual const long* getCustomerInfoDLong( long , long ); + virtual const long* getCustomerInfoELong( long* , long* ); + virtual const long* getCustomerInfoFLong( long* customerID, long* customerID2); + virtual const long* getCustomerInfoGLong( signed long* customerID, signed long* customerID2); + virtual const long* getCustomerInfoHLong( signed long* customerID, signed long* customerID2); + virtual const int* getCustomerInformationInt( char* , const int* customerID); + virtual const int* getCustomerInfoAInt( char* , const int* ); + virtual const int* getCustomerInfoBInt( char* , int* customerID); + virtual const int* getCustomerInfoCInt( char* , int customerID); + virtual const int* getCustomerInfoDInt( char* , int ); + virtual const int* getCustomerInfoEInt( char* , int* ); + virtual const int* getCustomerInfoFInt( char* , int* customerID); + virtual const int* getCustomerInfoGInt( char* , signed int* customerID); + virtual const int* getCustomerInfoHInt( char* , unsigned int* customerID); + virtual const __int64* getCustomerInformationint64( Diamond& , const __int64* customerID); + virtual const __int64* getCustomerInfoAint64( Diamond& , const __int64* ); + virtual const __int64* getCustomerInfoBint64( Diamond& , __int64* customerID); + virtual const __int64* getCustomerInfoCint64( Diamond& , __int64 customerID); + virtual const __int64* getCustomerInfoDint64( Diamond& myDiamond, __int64 ); + virtual const __int64* getCustomerInfoEint64( Diamond& myDiamond, __int64* ); + virtual const __int64* getCustomerInfoFint64( Diamond& myDiamond, __int64* customerID); + virtual const __int64* getCustomerInfoGint64( Diamond& myDiamond, signed __int64* customerID); + virtual const __int64* getCustomerInfoHint64(const Diamond& myDiamond, unsigned int64* customerID); + virtual const void* getCustomerInformationVoid( float& f, const __int64* customerID); + virtual void getCustomerInfoAVoid(const float& f, const __int64* ); + virtual void getCustomerInfoBVoid(); + virtual void getCustomerInfoCVoid(); + virtual void getCustomerInfoDVoid( void ); + virtual char getCustomerInfoEVoid( void ); + virtual char getCustomerInfoFVoid(); + virtual char getCustomerInfoGVoid( void ); + virtual const char* getCustomerInfoAInline( int , int , int , int , char* customer id); + virtual int getCustomerInfoBInline( int* , int* f, int* g, char* customer id); + virtual friend const unsigned int* getCustomerInfoCInline( char* customer id); + virtual int getCustomerInfoTrickyA(const char , const char ); + virtual int getCustomerInfoTrickyB( int myInt, int myInt); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // CustomerInfoImpl_CustomerInfoService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp new file mode 100644 index 0000000000..be09a57919 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp @@ -0,0 +1,872 @@ +/* + * 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. + */ + +#include "CustomerInfoImpl_CustomerInfoService_Wrapper.h" + +#include "osoa/sca/sca.h" + + + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CustomerInfoImpl_CustomerInfoService_Wrapper* CustomerInfoImpl_CustomerInfoService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new CustomerInfoImpl_CustomerInfoService_Wrapper(target); + } +} + +CustomerInfoImpl_CustomerInfoService_Wrapper::CustomerInfoImpl_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (CustomerInfoImpl*)getImplementation(); +} + +CustomerInfoImpl_CustomerInfoService_Wrapper::~CustomerInfoImpl_CustomerInfoService_Wrapper() +{ + releaseImplementation(); +} + +void* CustomerInfoImpl_CustomerInfoService_Wrapper::newImplementation() +{ + return new CustomerInfoImpl; +} + +void CustomerInfoImpl_CustomerInfoService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void CustomerInfoImpl_CustomerInfoService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "getCustomerInformationChar") + { + char* p0 = *( char**)operation.getParameterValue(0); + const char* p1 = *(const char**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInformationChar(p0, p1); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInformationChar(p0, p1); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoAChar") + { + char* p0 = *( char**)operation.getParameterValue(0); + const char* p1 = *(const char**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoAChar(p0, p1); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoAChar(p0, p1); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoBChar") + { + char* p0 = *( char**)operation.getParameterValue(0); + char* p1 = *( char**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoBChar(p0, p1); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoBChar(p0, p1); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoCChar") + { + char* p0 = *( char**)operation.getParameterValue(0); + char& p1 = *( char*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoCChar(p0, p1); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoCChar(p0, p1); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoDChar") + { + char* p0 = *( char**)operation.getParameterValue(0); + char& p1 = *( char*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoDChar(p0, p1); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoDChar(p0, p1); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoEChar") + { + char* p0 = *( char**)operation.getParameterValue(0); + char* p1 = *( char**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoEChar(p0, p1); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoEChar(p0, p1); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoFChar") + { + char* p0 = *( char**)operation.getParameterValue(0); + char* p1 = *( char**)operation.getParameterValue(1); + char* p2 = *( char**)operation.getParameterValue(2); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoFChar(p0, p1, p2); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoFChar(p0, p1, p2); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoGChar") + { + char* p0 = *( char**)operation.getParameterValue(0); + char* p1 = *( char**)operation.getParameterValue(1); + char* p2 = *( char**)operation.getParameterValue(2); + signed char* p3 = *( signed char**)operation.getParameterValue(3); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoGChar(p0, p1, p2, p3); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoGChar(p0, p1, p2, p3); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoHChar") + { + unsigned char* p0 = *( unsigned char**)operation.getParameterValue(0); + const char& p1 = *(const char*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoHChar(p0, p1); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoHChar(p0, p1); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoHChar") + { + unsigned char* p0 = *( unsigned char**)operation.getParameterValue(0); + const char* p1 = *(const char**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoHChar(p0, p1); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoHChar(p0, p1); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInformationLong") + { + const long* p0 = *(const long**)operation.getParameterValue(0); + const long* p1 = *(const long**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const long**)operation.getReturnValue() = impl->getCustomerInformationLong(p0, p1); + } + else + { + const long** ret = new const long*; + *ret = impl->getCustomerInformationLong(p0, p1); + operation.setReturnValue((const const long**)ret); + } + return; + } + if (operationName == "getCustomerInfoALong") + { + const long* p0 = *(const long**)operation.getParameterValue(0); + const long* p1 = *(const long**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const long**)operation.getReturnValue() = impl->getCustomerInfoALong(p0, p1); + } + else + { + const long** ret = new const long*; + *ret = impl->getCustomerInfoALong(p0, p1); + operation.setReturnValue((const const long**)ret); + } + return; + } + if (operationName == "getCustomerInfoBLong") + { + long* p0 = *( long**)operation.getParameterValue(0); + long* p1 = *( long**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const long**)operation.getReturnValue() = impl->getCustomerInfoBLong(p0, p1); + } + else + { + const long** ret = new const long*; + *ret = impl->getCustomerInfoBLong(p0, p1); + operation.setReturnValue((const const long**)ret); + } + return; + } + if (operationName == "getCustomerInfoCLong") + { + long& p0 = *( long*)operation.getParameterValue(0); + long& p1 = *( long*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const long**)operation.getReturnValue() = impl->getCustomerInfoCLong(p0, p1); + } + else + { + const long** ret = new const long*; + *ret = impl->getCustomerInfoCLong(p0, p1); + operation.setReturnValue((const const long**)ret); + } + return; + } + if (operationName == "getCustomerInfoDLong") + { + long& p0 = *( long*)operation.getParameterValue(0); + long& p1 = *( long*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const long**)operation.getReturnValue() = impl->getCustomerInfoDLong(p0, p1); + } + else + { + const long** ret = new const long*; + *ret = impl->getCustomerInfoDLong(p0, p1); + operation.setReturnValue((const const long**)ret); + } + return; + } + if (operationName == "getCustomerInfoELong") + { + long* p0 = *( long**)operation.getParameterValue(0); + long* p1 = *( long**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const long**)operation.getReturnValue() = impl->getCustomerInfoELong(p0, p1); + } + else + { + const long** ret = new const long*; + *ret = impl->getCustomerInfoELong(p0, p1); + operation.setReturnValue((const const long**)ret); + } + return; + } + if (operationName == "getCustomerInfoFLong") + { + long* p0 = *( long**)operation.getParameterValue(0); + long* p1 = *( long**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const long**)operation.getReturnValue() = impl->getCustomerInfoFLong(p0, p1); + } + else + { + const long** ret = new const long*; + *ret = impl->getCustomerInfoFLong(p0, p1); + operation.setReturnValue((const const long**)ret); + } + return; + } + if (operationName == "getCustomerInfoGLong") + { + signed long* p0 = *( signed long**)operation.getParameterValue(0); + signed long* p1 = *( signed long**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const long**)operation.getReturnValue() = impl->getCustomerInfoGLong(p0, p1); + } + else + { + const long** ret = new const long*; + *ret = impl->getCustomerInfoGLong(p0, p1); + operation.setReturnValue((const const long**)ret); + } + return; + } + if (operationName == "getCustomerInfoHLong") + { + signed long* p0 = *( signed long**)operation.getParameterValue(0); + signed long* p1 = *( signed long**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const long**)operation.getReturnValue() = impl->getCustomerInfoHLong(p0, p1); + } + else + { + const long** ret = new const long*; + *ret = impl->getCustomerInfoHLong(p0, p1); + operation.setReturnValue((const const long**)ret); + } + return; + } + if (operationName == "getCustomerInformationInt") + { + char* p0 = *( char**)operation.getParameterValue(0); + const int* p1 = *(const int**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const int**)operation.getReturnValue() = impl->getCustomerInformationInt(p0, p1); + } + else + { + const int** ret = new const int*; + *ret = impl->getCustomerInformationInt(p0, p1); + operation.setReturnValue((const const int**)ret); + } + return; + } + if (operationName == "getCustomerInfoAInt") + { + char* p0 = *( char**)operation.getParameterValue(0); + const int* p1 = *(const int**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const int**)operation.getReturnValue() = impl->getCustomerInfoAInt(p0, p1); + } + else + { + const int** ret = new const int*; + *ret = impl->getCustomerInfoAInt(p0, p1); + operation.setReturnValue((const const int**)ret); + } + return; + } + if (operationName == "getCustomerInfoBInt") + { + char* p0 = *( char**)operation.getParameterValue(0); + int* p1 = *( int**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const int**)operation.getReturnValue() = impl->getCustomerInfoBInt(p0, p1); + } + else + { + const int** ret = new const int*; + *ret = impl->getCustomerInfoBInt(p0, p1); + operation.setReturnValue((const const int**)ret); + } + return; + } + if (operationName == "getCustomerInfoCInt") + { + char* p0 = *( char**)operation.getParameterValue(0); + int& p1 = *( int*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const int**)operation.getReturnValue() = impl->getCustomerInfoCInt(p0, p1); + } + else + { + const int** ret = new const int*; + *ret = impl->getCustomerInfoCInt(p0, p1); + operation.setReturnValue((const const int**)ret); + } + return; + } + if (operationName == "getCustomerInfoDInt") + { + char* p0 = *( char**)operation.getParameterValue(0); + int& p1 = *( int*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const int**)operation.getReturnValue() = impl->getCustomerInfoDInt(p0, p1); + } + else + { + const int** ret = new const int*; + *ret = impl->getCustomerInfoDInt(p0, p1); + operation.setReturnValue((const const int**)ret); + } + return; + } + if (operationName == "getCustomerInfoEInt") + { + char* p0 = *( char**)operation.getParameterValue(0); + int* p1 = *( int**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const int**)operation.getReturnValue() = impl->getCustomerInfoEInt(p0, p1); + } + else + { + const int** ret = new const int*; + *ret = impl->getCustomerInfoEInt(p0, p1); + operation.setReturnValue((const const int**)ret); + } + return; + } + if (operationName == "getCustomerInfoFInt") + { + char* p0 = *( char**)operation.getParameterValue(0); + int* p1 = *( int**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const int**)operation.getReturnValue() = impl->getCustomerInfoFInt(p0, p1); + } + else + { + const int** ret = new const int*; + *ret = impl->getCustomerInfoFInt(p0, p1); + operation.setReturnValue((const const int**)ret); + } + return; + } + if (operationName == "getCustomerInfoGInt") + { + char* p0 = *( char**)operation.getParameterValue(0); + signed int* p1 = *( signed int**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const int**)operation.getReturnValue() = impl->getCustomerInfoGInt(p0, p1); + } + else + { + const int** ret = new const int*; + *ret = impl->getCustomerInfoGInt(p0, p1); + operation.setReturnValue((const const int**)ret); + } + return; + } + if (operationName == "getCustomerInfoHInt") + { + char* p0 = *( char**)operation.getParameterValue(0); + unsigned int* p1 = *( unsigned int**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const int**)operation.getReturnValue() = impl->getCustomerInfoHInt(p0, p1); + } + else + { + const int** ret = new const int*; + *ret = impl->getCustomerInfoHInt(p0, p1); + operation.setReturnValue((const const int**)ret); + } + return; + } + if (operationName == "getCustomerInformationint64") + { + Diamond& p0 = *(Diamond*)operation.getParameterValue(0); + const __int64* p1 = *(const __int64**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const __int64**)operation.getReturnValue() = impl->getCustomerInformationint64(p0, p1); + } + else + { + const __int64** ret = new const __int64*; + *ret = impl->getCustomerInformationint64(p0, p1); + operation.setReturnValue((const const __int64**)ret); + } + return; + } + if (operationName == "getCustomerInfoAint64") + { + Diamond& p0 = *(Diamond*)operation.getParameterValue(0); + const __int64* p1 = *(const __int64**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoAint64(p0, p1); + } + else + { + const __int64** ret = new const __int64*; + *ret = impl->getCustomerInfoAint64(p0, p1); + operation.setReturnValue((const const __int64**)ret); + } + return; + } + if (operationName == "getCustomerInfoBint64") + { + Diamond& p0 = *(Diamond*)operation.getParameterValue(0); + __int64* p1 = *( __int64**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoBint64(p0, p1); + } + else + { + const __int64** ret = new const __int64*; + *ret = impl->getCustomerInfoBint64(p0, p1); + operation.setReturnValue((const const __int64**)ret); + } + return; + } + if (operationName == "getCustomerInfoCint64") + { + Diamond& p0 = *(Diamond*)operation.getParameterValue(0); + __int64& p1 = *( __int64*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoCint64(p0, p1); + } + else + { + const __int64** ret = new const __int64*; + *ret = impl->getCustomerInfoCint64(p0, p1); + operation.setReturnValue((const const __int64**)ret); + } + return; + } + if (operationName == "getCustomerInfoDint64") + { + Diamond& p0 = *(Diamond*)operation.getParameterValue(0); + __int64& p1 = *( __int64*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoDint64(p0, p1); + } + else + { + const __int64** ret = new const __int64*; + *ret = impl->getCustomerInfoDint64(p0, p1); + operation.setReturnValue((const const __int64**)ret); + } + return; + } + if (operationName == "getCustomerInfoEint64") + { + Diamond& p0 = *(Diamond*)operation.getParameterValue(0); + __int64* p1 = *( __int64**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoEint64(p0, p1); + } + else + { + const __int64** ret = new const __int64*; + *ret = impl->getCustomerInfoEint64(p0, p1); + operation.setReturnValue((const const __int64**)ret); + } + return; + } + if (operationName == "getCustomerInfoFint64") + { + Diamond& p0 = *(Diamond*)operation.getParameterValue(0); + __int64* p1 = *( __int64**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoFint64(p0, p1); + } + else + { + const __int64** ret = new const __int64*; + *ret = impl->getCustomerInfoFint64(p0, p1); + operation.setReturnValue((const const __int64**)ret); + } + return; + } + if (operationName == "getCustomerInfoGint64") + { + Diamond& p0 = *(Diamond*)operation.getParameterValue(0); + signed __int64* p1 = *( signed __int64**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoGint64(p0, p1); + } + else + { + const __int64** ret = new const __int64*; + *ret = impl->getCustomerInfoGint64(p0, p1); + operation.setReturnValue((const const __int64**)ret); + } + return; + } + if (operationName == "getCustomerInfoHint64") + { + Diamond& p0 = *(Diamond*)operation.getParameterValue(0); + unsigned int64* p1 = *( unsigned int64**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoHint64(p0, p1); + } + else + { + const __int64** ret = new const __int64*; + *ret = impl->getCustomerInfoHint64(p0, p1); + operation.setReturnValue((const const __int64**)ret); + } + return; + } + if (operationName == "getCustomerInformationVoid") + { + float& p0 = *(float*)operation.getParameterValue(0); + const __int64* p1 = *(const __int64**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const void**)operation.getReturnValue() = impl->getCustomerInformationVoid(p0, p1); + } + else + { + const void** ret = new const void*; + *ret = impl->getCustomerInformationVoid(p0, p1); + operation.setReturnValue((const const void**)ret); + } + return; + } + if (operationName == "getCustomerInfoAVoid") + { + float& p0 = *(float*)operation.getParameterValue(0); + const __int64* p1 = *(const __int64**)operation.getParameterValue(1); + impl->getCustomerInfoAVoid(p0, p1); + return; + } + if (operationName == "getCustomerInfoBVoid") + { + impl->getCustomerInfoBVoid(); + return; + } + if (operationName == "getCustomerInfoCVoid") + { + impl->getCustomerInfoCVoid(); + return; + } + if (operationName == "getCustomerInfoDVoid") + { + impl->getCustomerInfoDVoid(); + return; + } + if (operationName == "getCustomerInfoEVoid") + { + + if(operation.getReturnValue() != NULL) + { + *(char*)operation.getReturnValue() = impl->getCustomerInfoEVoid(); + } + else + { + char* ret = new char; + *ret = impl->getCustomerInfoEVoid(); + operation.setReturnValue((const char*)ret); + } + return; + } + if (operationName == "getCustomerInfoFVoid") + { + + if(operation.getReturnValue() != NULL) + { + *(char*)operation.getReturnValue() = impl->getCustomerInfoFVoid(); + } + else + { + char* ret = new char; + *ret = impl->getCustomerInfoFVoid(); + operation.setReturnValue((const char*)ret); + } + return; + } + if (operationName == "getCustomerInfoGVoid") + { + + if(operation.getReturnValue() != NULL) + { + *(char*)operation.getReturnValue() = impl->getCustomerInfoGVoid(); + } + else + { + char* ret = new char; + *ret = impl->getCustomerInfoGVoid(); + operation.setReturnValue((const char*)ret); + } + return; + } + if (operationName == "getCustomerInfoAInline") + { + int& p0 = *( int*)operation.getParameterValue(0); + int& p1 = *( int*)operation.getParameterValue(1); + int& p2 = *( int*)operation.getParameterValue(2); + int& p3 = *( int*)operation.getParameterValue(3); + char* customer p4 = *( char* customer*)operation.getParameterValue(4); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoAInline(p0, p1, p2, p3, p4); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoAInline(p0, p1, p2, p3, p4); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoBInline") + { + int* p0 = *( int**)operation.getParameterValue(0); + int* p1 = *( int**)operation.getParameterValue(1); + int* p2 = *( int**)operation.getParameterValue(2); + char* customer p3 = *( char* customer*)operation.getParameterValue(3); + + if(operation.getReturnValue() != NULL) + { + *(int*)operation.getReturnValue() = impl->getCustomerInfoBInline(p0, p1, p2, p3); + } + else + { + int* ret = new int; + *ret = impl->getCustomerInfoBInline(p0, p1, p2, p3); + operation.setReturnValue((const int*)ret); + } + return; + } + if (operationName == "getCustomerInfoCInline") + { + char* customer p0 = *( char* customer*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(friend const unsigned int**)operation.getReturnValue() = impl->getCustomerInfoCInline(p0); + } + else + { + friend const unsigned int** ret = new friend const unsigned int*; + *ret = impl->getCustomerInfoCInline(p0); + operation.setReturnValue((const friend const unsigned int**)ret); + } + return; + } + if (operationName == "getCustomerInfoTrickyA") + { + const char& p0 = *(const char*)operation.getParameterValue(0); + const char& p1 = *(const char*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(int*)operation.getReturnValue() = impl->getCustomerInfoTrickyA(p0, p1); + } + else + { + int* ret = new int; + *ret = impl->getCustomerInfoTrickyA(p0, p1); + operation.setReturnValue((const int*)ret); + } + return; + } + if (operationName == "getCustomerInfoTrickyB") + { + int& p0 = *( int*)operation.getParameterValue(0); + int& p1 = *( int*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(int*)operation.getReturnValue() = impl->getCustomerInfoTrickyB(p0, p1); + } + else + { + int* ret = new int; + *ret = impl->getCustomerInfoTrickyB(p0, p1); + operation.setReturnValue((const int*)ret); + } + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h new file mode 100644 index 0000000000..94b1d5cb4d --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef CustomerInfoImpl_CustomerInfoService_Wrapper_h +#define CustomerInfoImpl_CustomerInfoService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "CustomerInfoImpl.h" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class CustomerInfoImpl_CustomerInfoService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + CustomerInfoImpl_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target); + virtual ~CustomerInfoImpl_CustomerInfoService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + CustomerInfoImpl* impl; +}; + +#endif // CustomerInfoImpl_CustomerInfoService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp new file mode 100644 index 0000000000..f3b2540ba8 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp @@ -0,0 +1,504 @@ +/* + * 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. + */ + +#include "CustomerInfoImpl_CustomerInfoService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CustomerInfoImpl_CustomerInfoService_Proxy* CustomerInfoImpl_CustomerInfoService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new CustomerInfoImpl_CustomerInfoService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void CustomerInfoImpl_CustomerInfoService_Proxy_Destructor(void* proxy) + { + delete (CustomerInfoImpl_CustomerInfoService_Proxy*)proxy; + } +} + +CustomerInfoImpl_CustomerInfoService_Proxy::CustomerInfoImpl_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +CustomerInfoImpl_CustomerInfoService_Proxy::~CustomerInfoImpl_CustomerInfoService_Proxy() +{ + if (target) + delete target; +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationChar(const char* arg0) +{ + tuscany::sca::Operation operation("getCustomerInformationChar"); + operation.addParameter(&arg0); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAChar(const char* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoAChar"); + operation.addParameter(&arg0); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBChar( char* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoBChar"); + operation.addParameter(&arg0); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCChar( char arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoCChar"); + operation.addParameter(&arg0); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDChar( char arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoDChar"); + operation.addParameter(&arg0); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoEChar( char* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoEChar"); + operation.addParameter(&arg0); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoFChar( char* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoFChar"); + operation.addParameter(&arg0); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoGChar( signed char* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoGChar"); + operation.addParameter(&arg0); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoHChar( unsigned char* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoHChar"); + operation.addParameter(&arg0); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationLong(const long* arg0) +{ + tuscany::sca::Operation operation("getCustomerInformationLong"); + operation.addParameter(&arg0); + const long* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const long**)operation.getReturnValue(); +} + +const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoALong(const long* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoALong"); + operation.addParameter(&arg0); + const long* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const long**)operation.getReturnValue(); +} + +const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBLong( long* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoBLong"); + operation.addParameter(&arg0); + const long* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const long**)operation.getReturnValue(); +} + +const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCLong( long arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoCLong"); + operation.addParameter(&arg0); + const long* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const long**)operation.getReturnValue(); +} + +const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDLong( long arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoDLong"); + operation.addParameter(&arg0); + const long* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const long**)operation.getReturnValue(); +} + +const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoELong( long* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoELong"); + operation.addParameter(&arg0); + const long* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const long**)operation.getReturnValue(); +} + +const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoFLong( long* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoFLong"); + operation.addParameter(&arg0); + const long* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const long**)operation.getReturnValue(); +} + +const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoGLong( signed long* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoGLong"); + operation.addParameter(&arg0); + const long* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const long**)operation.getReturnValue(); +} + +const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoHLong( unsigned long* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoHLong"); + operation.addParameter(&arg0); + const long* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const long**)operation.getReturnValue(); +} + +const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationInt(const int* arg0) +{ + tuscany::sca::Operation operation("getCustomerInformationInt"); + operation.addParameter(&arg0); + const int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const int**)operation.getReturnValue(); +} + +const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAInt(const int* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoAInt"); + operation.addParameter(&arg0); + const int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const int**)operation.getReturnValue(); +} + +const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBInt( int* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoBInt"); + operation.addParameter(&arg0); + const int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const int**)operation.getReturnValue(); +} + +const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCInt( int arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoCInt"); + operation.addParameter(&arg0); + const int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const int**)operation.getReturnValue(); +} + +const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDInt( int arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoDInt"); + operation.addParameter(&arg0); + const int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const int**)operation.getReturnValue(); +} + +const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoEInt( int* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoEInt"); + operation.addParameter(&arg0); + const int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const int**)operation.getReturnValue(); +} + +const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoFInt( int* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoFInt"); + operation.addParameter(&arg0); + const int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const int**)operation.getReturnValue(); +} + +const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoGInt( signed int* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoGInt"); + operation.addParameter(&arg0); + const int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const int**)operation.getReturnValue(); +} + +const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoHInt( unsigned int* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoHInt"); + operation.addParameter(&arg0); + const int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const int**)operation.getReturnValue(); +} + +const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationint64(const __int64* arg0) +{ + tuscany::sca::Operation operation("getCustomerInformationint64"); + operation.addParameter(&arg0); + const __int64* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const __int64**)operation.getReturnValue(); +} + +const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAint64(const __int64* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoAint64"); + operation.addParameter(&arg0); + const __int64* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const __int64**)operation.getReturnValue(); +} + +const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBint64( __int64* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoBint64"); + operation.addParameter(&arg0); + const __int64* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const __int64**)operation.getReturnValue(); +} + +const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCint64( __int64 arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoCint64"); + operation.addParameter(&arg0); + const __int64* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const __int64**)operation.getReturnValue(); +} + +const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDint64( __int64 arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoDint64"); + operation.addParameter(&arg0); + const __int64* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const __int64**)operation.getReturnValue(); +} + +const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoEint64( __int64* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoEint64"); + operation.addParameter(&arg0); + const __int64* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const __int64**)operation.getReturnValue(); +} + +const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoFint64( __int64* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoFint64"); + operation.addParameter(&arg0); + const __int64* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const __int64**)operation.getReturnValue(); +} + +const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoGint64( signed __int64* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoGint64"); + operation.addParameter(&arg0); + const __int64* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const __int64**)operation.getReturnValue(); +} + +const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoHint64( unsigned int64* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoHint64"); + operation.addParameter(&arg0); + const __int64* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const __int64**)operation.getReturnValue(); +} + +const void* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationVoid(const __int64* arg0) +{ + tuscany::sca::Operation operation("getCustomerInformationVoid"); + operation.addParameter(&arg0); + const void* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const void**)operation.getReturnValue(); +} + +void CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAVoid(const __int64* arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoAVoid"); + operation.addParameter(&arg0); + target->invoke(operation); + return; +} + +void CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBVoid() +{ + tuscany::sca::Operation operation("getCustomerInfoBVoid"); + target->invoke(operation); + return; +} + +void CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCVoid() +{ + tuscany::sca::Operation operation("getCustomerInfoCVoid"); + target->invoke(operation); + return; +} + +void CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDVoid() +{ + tuscany::sca::Operation operation("getCustomerInfoDVoid"); + operation.addParameter(&arg0); + target->invoke(operation); + return; +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAInline( char* customer arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoAInline"); + operation.addParameter(&arg0); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +int CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBInline( char* customer arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoBInline"); + operation.addParameter(&arg0); + int ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(int*)operation.getReturnValue(); +} + +friend const unsigned int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCInline( char* customer arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoCInline"); + operation.addParameter(&arg0); + friend const unsigned int* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(friend const unsigned int**)operation.getReturnValue(); +} + +int CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoTrickyA(const char arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoTrickyA"); + operation.addParameter(&arg0); + int ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(int*)operation.getReturnValue(); +} + +int CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoTrickyB( int arg0) +{ + tuscany::sca::Operation operation("getCustomerInfoTrickyB"); + operation.addParameter(&arg0); + int ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(int*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h new file mode 100644 index 0000000000..75f912d3ae --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h @@ -0,0 +1,86 @@ +/* + * 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. + */ + +#ifndef CustomerInfoImpl_CustomerInfoService_Proxy_h +#define CustomerInfoImpl_CustomerInfoService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "/CustomerInfo.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class CustomerInfoImpl_CustomerInfoService_Proxy : public CustomerInfo +{ +public: + CustomerInfoImpl_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~CustomerInfoImpl_CustomerInfoService_Proxy(); + virtual const char* getCustomerInformationChar(const char* customerID); + virtual const char* getCustomerInfoAChar(const char* ); + virtual const char* getCustomerInfoBChar( char* customerID); + virtual const char* getCustomerInfoCChar( char customerID); + virtual const char* getCustomerInfoDChar( char ); + virtual const char* getCustomerInfoEChar( char* ); + virtual const char* getCustomerInfoFChar( char* customerID); + virtual const char* getCustomerInfoGChar( signed char* customerID); + virtual const char* getCustomerInfoHChar( unsigned char* customerID); + virtual const long* getCustomerInformationLong(const long* customerID); + virtual const long* getCustomerInfoALong(const long* ); + virtual const long* getCustomerInfoBLong( long* customerID); + virtual const long* getCustomerInfoCLong( long customerID); + virtual const long* getCustomerInfoDLong( long ); + virtual const long* getCustomerInfoELong( long* ); + virtual const long* getCustomerInfoFLong( long* customerID); + virtual const long* getCustomerInfoGLong( signed long* customerID); + virtual const long* getCustomerInfoHLong( unsigned long* customerID); + virtual const int* getCustomerInformationInt(const int* customerID); + virtual const int* getCustomerInfoAInt(const int* ); + virtual const int* getCustomerInfoBInt( int* customerID); + virtual const int* getCustomerInfoCInt( int customerID); + virtual const int* getCustomerInfoDInt( int ); + virtual const int* getCustomerInfoEInt( int* ); + virtual const int* getCustomerInfoFInt( int* customerID); + virtual const int* getCustomerInfoGInt( signed int* customerID); + virtual const int* getCustomerInfoHInt( unsigned int* customerID); + virtual const __int64* getCustomerInformationint64(const __int64* customerID); + virtual const __int64* getCustomerInfoAint64(const __int64* ); + virtual const __int64* getCustomerInfoBint64( __int64* customerID); + virtual const __int64* getCustomerInfoCint64( __int64 customerID); + virtual const __int64* getCustomerInfoDint64( __int64 ); + virtual const __int64* getCustomerInfoEint64( __int64* ); + virtual const __int64* getCustomerInfoFint64( __int64* customerID); + virtual const __int64* getCustomerInfoGint64( signed __int64* customerID); + virtual const __int64* getCustomerInfoHint64( unsigned int64* customerID); + virtual const void* getCustomerInformationVoid(const __int64* customerID); + virtual void getCustomerInfoAVoid(const __int64* ); + virtual void getCustomerInfoBVoid(); + virtual void getCustomerInfoCVoid(); + virtual void getCustomerInfoDVoid( void ); + virtual const char* getCustomerInfoAInline( char* customer id); + virtual int getCustomerInfoBInline( char* customer id); + virtual friend const unsigned int* getCustomerInfoCInline( char* customer id); + virtual int getCustomerInfoTrickyA(const char ); + virtual int getCustomerInfoTrickyB( int myInt); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // CustomerInfoImpl_CustomerInfoService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp new file mode 100644 index 0000000000..896a129145 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp @@ -0,0 +1,760 @@ +/* + * 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. + */ + +#include "CustomerInfoImpl_CustomerInfoService_Wrapper.h" + +#include "osoa/sca/sca.h" + + + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CustomerInfoImpl_CustomerInfoService_Wrapper* CustomerInfoImpl_CustomerInfoService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new CustomerInfoImpl_CustomerInfoService_Wrapper(target); + } +} + +CustomerInfoImpl_CustomerInfoService_Wrapper::CustomerInfoImpl_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (CustomerInfoImpl*)getImplementation(); +} + +CustomerInfoImpl_CustomerInfoService_Wrapper::~CustomerInfoImpl_CustomerInfoService_Wrapper() +{ + releaseImplementation(); +} + +void* CustomerInfoImpl_CustomerInfoService_Wrapper::newImplementation() +{ + return new CustomerInfoImpl; +} + +void CustomerInfoImpl_CustomerInfoService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void CustomerInfoImpl_CustomerInfoService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "getCustomerInformationChar") + { + const char* p0 = *(const char**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInformationChar(p0); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInformationChar(p0); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoAChar") + { + const char* p0 = *(const char**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoAChar(p0); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoAChar(p0); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoBChar") + { + char* p0 = *( char**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoBChar(p0); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoBChar(p0); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoCChar") + { + char& p0 = *( char*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoCChar(p0); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoCChar(p0); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoDChar") + { + char& p0 = *( char*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoDChar(p0); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoDChar(p0); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoEChar") + { + char* p0 = *( char**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoEChar(p0); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoEChar(p0); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoFChar") + { + char* p0 = *( char**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoFChar(p0); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoFChar(p0); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoGChar") + { + signed char* p0 = *( signed char**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoGChar(p0); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoGChar(p0); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoHChar") + { + unsigned char* p0 = *( unsigned char**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoHChar(p0); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoHChar(p0); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInformationLong") + { + const long* p0 = *(const long**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const long**)operation.getReturnValue() = impl->getCustomerInformationLong(p0); + } + else + { + const long** ret = new const long*; + *ret = impl->getCustomerInformationLong(p0); + operation.setReturnValue((const const long**)ret); + } + return; + } + if (operationName == "getCustomerInfoALong") + { + const long* p0 = *(const long**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const long**)operation.getReturnValue() = impl->getCustomerInfoALong(p0); + } + else + { + const long** ret = new const long*; + *ret = impl->getCustomerInfoALong(p0); + operation.setReturnValue((const const long**)ret); + } + return; + } + if (operationName == "getCustomerInfoBLong") + { + long* p0 = *( long**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const long**)operation.getReturnValue() = impl->getCustomerInfoBLong(p0); + } + else + { + const long** ret = new const long*; + *ret = impl->getCustomerInfoBLong(p0); + operation.setReturnValue((const const long**)ret); + } + return; + } + if (operationName == "getCustomerInfoCLong") + { + long& p0 = *( long*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const long**)operation.getReturnValue() = impl->getCustomerInfoCLong(p0); + } + else + { + const long** ret = new const long*; + *ret = impl->getCustomerInfoCLong(p0); + operation.setReturnValue((const const long**)ret); + } + return; + } + if (operationName == "getCustomerInfoDLong") + { + long& p0 = *( long*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const long**)operation.getReturnValue() = impl->getCustomerInfoDLong(p0); + } + else + { + const long** ret = new const long*; + *ret = impl->getCustomerInfoDLong(p0); + operation.setReturnValue((const const long**)ret); + } + return; + } + if (operationName == "getCustomerInfoELong") + { + long* p0 = *( long**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const long**)operation.getReturnValue() = impl->getCustomerInfoELong(p0); + } + else + { + const long** ret = new const long*; + *ret = impl->getCustomerInfoELong(p0); + operation.setReturnValue((const const long**)ret); + } + return; + } + if (operationName == "getCustomerInfoFLong") + { + long* p0 = *( long**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const long**)operation.getReturnValue() = impl->getCustomerInfoFLong(p0); + } + else + { + const long** ret = new const long*; + *ret = impl->getCustomerInfoFLong(p0); + operation.setReturnValue((const const long**)ret); + } + return; + } + if (operationName == "getCustomerInfoGLong") + { + signed long* p0 = *( signed long**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const long**)operation.getReturnValue() = impl->getCustomerInfoGLong(p0); + } + else + { + const long** ret = new const long*; + *ret = impl->getCustomerInfoGLong(p0); + operation.setReturnValue((const const long**)ret); + } + return; + } + if (operationName == "getCustomerInfoHLong") + { + unsigned long* p0 = *( unsigned long**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const long**)operation.getReturnValue() = impl->getCustomerInfoHLong(p0); + } + else + { + const long** ret = new const long*; + *ret = impl->getCustomerInfoHLong(p0); + operation.setReturnValue((const const long**)ret); + } + return; + } + if (operationName == "getCustomerInformationInt") + { + const int* p0 = *(const int**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const int**)operation.getReturnValue() = impl->getCustomerInformationInt(p0); + } + else + { + const int** ret = new const int*; + *ret = impl->getCustomerInformationInt(p0); + operation.setReturnValue((const const int**)ret); + } + return; + } + if (operationName == "getCustomerInfoAInt") + { + const int* p0 = *(const int**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const int**)operation.getReturnValue() = impl->getCustomerInfoAInt(p0); + } + else + { + const int** ret = new const int*; + *ret = impl->getCustomerInfoAInt(p0); + operation.setReturnValue((const const int**)ret); + } + return; + } + if (operationName == "getCustomerInfoBInt") + { + int* p0 = *( int**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const int**)operation.getReturnValue() = impl->getCustomerInfoBInt(p0); + } + else + { + const int** ret = new const int*; + *ret = impl->getCustomerInfoBInt(p0); + operation.setReturnValue((const const int**)ret); + } + return; + } + if (operationName == "getCustomerInfoCInt") + { + int& p0 = *( int*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const int**)operation.getReturnValue() = impl->getCustomerInfoCInt(p0); + } + else + { + const int** ret = new const int*; + *ret = impl->getCustomerInfoCInt(p0); + operation.setReturnValue((const const int**)ret); + } + return; + } + if (operationName == "getCustomerInfoDInt") + { + int& p0 = *( int*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const int**)operation.getReturnValue() = impl->getCustomerInfoDInt(p0); + } + else + { + const int** ret = new const int*; + *ret = impl->getCustomerInfoDInt(p0); + operation.setReturnValue((const const int**)ret); + } + return; + } + if (operationName == "getCustomerInfoEInt") + { + int* p0 = *( int**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const int**)operation.getReturnValue() = impl->getCustomerInfoEInt(p0); + } + else + { + const int** ret = new const int*; + *ret = impl->getCustomerInfoEInt(p0); + operation.setReturnValue((const const int**)ret); + } + return; + } + if (operationName == "getCustomerInfoFInt") + { + int* p0 = *( int**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const int**)operation.getReturnValue() = impl->getCustomerInfoFInt(p0); + } + else + { + const int** ret = new const int*; + *ret = impl->getCustomerInfoFInt(p0); + operation.setReturnValue((const const int**)ret); + } + return; + } + if (operationName == "getCustomerInfoGInt") + { + signed int* p0 = *( signed int**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const int**)operation.getReturnValue() = impl->getCustomerInfoGInt(p0); + } + else + { + const int** ret = new const int*; + *ret = impl->getCustomerInfoGInt(p0); + operation.setReturnValue((const const int**)ret); + } + return; + } + if (operationName == "getCustomerInfoHInt") + { + unsigned int* p0 = *( unsigned int**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const int**)operation.getReturnValue() = impl->getCustomerInfoHInt(p0); + } + else + { + const int** ret = new const int*; + *ret = impl->getCustomerInfoHInt(p0); + operation.setReturnValue((const const int**)ret); + } + return; + } + if (operationName == "getCustomerInformationint64") + { + const __int64* p0 = *(const __int64**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const __int64**)operation.getReturnValue() = impl->getCustomerInformationint64(p0); + } + else + { + const __int64** ret = new const __int64*; + *ret = impl->getCustomerInformationint64(p0); + operation.setReturnValue((const const __int64**)ret); + } + return; + } + if (operationName == "getCustomerInfoAint64") + { + const __int64* p0 = *(const __int64**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoAint64(p0); + } + else + { + const __int64** ret = new const __int64*; + *ret = impl->getCustomerInfoAint64(p0); + operation.setReturnValue((const const __int64**)ret); + } + return; + } + if (operationName == "getCustomerInfoBint64") + { + __int64* p0 = *( __int64**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoBint64(p0); + } + else + { + const __int64** ret = new const __int64*; + *ret = impl->getCustomerInfoBint64(p0); + operation.setReturnValue((const const __int64**)ret); + } + return; + } + if (operationName == "getCustomerInfoCint64") + { + __int64& p0 = *( __int64*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoCint64(p0); + } + else + { + const __int64** ret = new const __int64*; + *ret = impl->getCustomerInfoCint64(p0); + operation.setReturnValue((const const __int64**)ret); + } + return; + } + if (operationName == "getCustomerInfoDint64") + { + __int64& p0 = *( __int64*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoDint64(p0); + } + else + { + const __int64** ret = new const __int64*; + *ret = impl->getCustomerInfoDint64(p0); + operation.setReturnValue((const const __int64**)ret); + } + return; + } + if (operationName == "getCustomerInfoEint64") + { + __int64* p0 = *( __int64**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoEint64(p0); + } + else + { + const __int64** ret = new const __int64*; + *ret = impl->getCustomerInfoEint64(p0); + operation.setReturnValue((const const __int64**)ret); + } + return; + } + if (operationName == "getCustomerInfoFint64") + { + __int64* p0 = *( __int64**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoFint64(p0); + } + else + { + const __int64** ret = new const __int64*; + *ret = impl->getCustomerInfoFint64(p0); + operation.setReturnValue((const const __int64**)ret); + } + return; + } + if (operationName == "getCustomerInfoGint64") + { + signed __int64* p0 = *( signed __int64**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoGint64(p0); + } + else + { + const __int64** ret = new const __int64*; + *ret = impl->getCustomerInfoGint64(p0); + operation.setReturnValue((const const __int64**)ret); + } + return; + } + if (operationName == "getCustomerInfoHint64") + { + unsigned int64* p0 = *( unsigned int64**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoHint64(p0); + } + else + { + const __int64** ret = new const __int64*; + *ret = impl->getCustomerInfoHint64(p0); + operation.setReturnValue((const const __int64**)ret); + } + return; + } + if (operationName == "getCustomerInformationVoid") + { + const __int64* p0 = *(const __int64**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const void**)operation.getReturnValue() = impl->getCustomerInformationVoid(p0); + } + else + { + const void** ret = new const void*; + *ret = impl->getCustomerInformationVoid(p0); + operation.setReturnValue((const const void**)ret); + } + return; + } + if (operationName == "getCustomerInfoAVoid") + { + const __int64* p0 = *(const __int64**)operation.getParameterValue(0); + impl->getCustomerInfoAVoid(p0); + return; + } + if (operationName == "getCustomerInfoBVoid") + { + impl->getCustomerInfoBVoid(); + return; + } + if (operationName == "getCustomerInfoCVoid") + { + impl->getCustomerInfoCVoid(); + return; + } + if (operationName == "getCustomerInfoDVoid") + { + impl->getCustomerInfoDVoid(); + return; + } + if (operationName == "getCustomerInfoAInline") + { + char* customer p0 = *( char* customer*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoAInline(p0); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoAInline(p0); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoBInline") + { + char* customer p0 = *( char* customer*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(int*)operation.getReturnValue() = impl->getCustomerInfoBInline(p0); + } + else + { + int* ret = new int; + *ret = impl->getCustomerInfoBInline(p0); + operation.setReturnValue((const int*)ret); + } + return; + } + if (operationName == "getCustomerInfoCInline") + { + char* customer p0 = *( char* customer*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(friend const unsigned int**)operation.getReturnValue() = impl->getCustomerInfoCInline(p0); + } + else + { + friend const unsigned int** ret = new friend const unsigned int*; + *ret = impl->getCustomerInfoCInline(p0); + operation.setReturnValue((const friend const unsigned int**)ret); + } + return; + } + if (operationName == "getCustomerInfoTrickyA") + { + const char& p0 = *(const char*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(int*)operation.getReturnValue() = impl->getCustomerInfoTrickyA(p0); + } + else + { + int* ret = new int; + *ret = impl->getCustomerInfoTrickyA(p0); + operation.setReturnValue((const int*)ret); + } + return; + } + if (operationName == "getCustomerInfoTrickyB") + { + int& p0 = *( int*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(int*)operation.getReturnValue() = impl->getCustomerInfoTrickyB(p0); + } + else + { + int* ret = new int; + *ret = impl->getCustomerInfoTrickyB(p0); + operation.setReturnValue((const int*)ret); + } + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h new file mode 100644 index 0000000000..94b1d5cb4d --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef CustomerInfoImpl_CustomerInfoService_Wrapper_h +#define CustomerInfoImpl_CustomerInfoService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "CustomerInfoImpl.h" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class CustomerInfoImpl_CustomerInfoService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + CustomerInfoImpl_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target); + virtual ~CustomerInfoImpl_CustomerInfoService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + CustomerInfoImpl* impl; +}; + +#endif // CustomerInfoImpl_CustomerInfoService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.cpp new file mode 100644 index 0000000000..6f2c95f45b --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.cpp @@ -0,0 +1,64 @@ +/* + * 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. + */ + +#include "CustomerInfoImpl2_CustomerInfoService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CustomerInfoImpl2_CustomerInfoService_Proxy* CustomerInfoImpl2_CustomerInfoService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new CustomerInfoImpl2_CustomerInfoService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void CustomerInfoImpl2_CustomerInfoService_Proxy_Destructor(void* proxy) + { + delete (CustomerInfoImpl2_CustomerInfoService_Proxy*)proxy; + } +} + +CustomerInfoImpl2_CustomerInfoService_Proxy::CustomerInfoImpl2_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +CustomerInfoImpl2_CustomerInfoService_Proxy::~CustomerInfoImpl2_CustomerInfoService_Proxy() +{ + if (target) + delete target; +} + +const char* CustomerInfoImpl2_CustomerInfoService_Proxy::getCustomerInformation(const char* arg0) +{ + tuscany::sca::Operation operation("getCustomerInformation"); + operation.addParameter("customerID", &arg0); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.h new file mode 100644 index 0000000000..594f404d13 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.h @@ -0,0 +1,41 @@ +/* + * 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. + */ + +#ifndef CustomerInfoImpl2_CustomerInfoService_Proxy_h +#define CustomerInfoImpl2_CustomerInfoService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "/CustomerInfo.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class CustomerInfoImpl2_CustomerInfoService_Proxy : public CustomerInfo +{ +public: + CustomerInfoImpl2_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~CustomerInfoImpl2_CustomerInfoService_Proxy(); + virtual const char* getCustomerInformation(const char* customerID); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // CustomerInfoImpl2_CustomerInfoService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.cpp new file mode 100644 index 0000000000..57add811a2 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.cpp @@ -0,0 +1,83 @@ +/* + * 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. + */ + +#include "CustomerInfoImpl2_CustomerInfoService_Wrapper.h" + +#include "osoa/sca/sca.h" + + + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CustomerInfoImpl2_CustomerInfoService_Wrapper* CustomerInfoImpl2_CustomerInfoService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new CustomerInfoImpl2_CustomerInfoService_Wrapper(target); + } +} + +CustomerInfoImpl2_CustomerInfoService_Wrapper::CustomerInfoImpl2_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (CustomerInfoImpl2*)getImplementation(); +} + +CustomerInfoImpl2_CustomerInfoService_Wrapper::~CustomerInfoImpl2_CustomerInfoService_Wrapper() +{ + releaseImplementation(); +} + +void* CustomerInfoImpl2_CustomerInfoService_Wrapper::newImplementation() +{ + return new CustomerInfoImpl2; +} + +void CustomerInfoImpl2_CustomerInfoService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void CustomerInfoImpl2_CustomerInfoService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "getCustomerInformation") + { + const char* p0 = *(const char**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInformation(p0); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInformation(p0); + operation.setReturnValue((const const char**)ret); + } + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.h new file mode 100644 index 0000000000..b85533cfd4 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef CustomerInfoImpl2_CustomerInfoService_Wrapper_h +#define CustomerInfoImpl2_CustomerInfoService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "CustomerInfoImpl.h" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class CustomerInfoImpl2_CustomerInfoService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + CustomerInfoImpl2_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target); + virtual ~CustomerInfoImpl2_CustomerInfoService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + CustomerInfoImpl2* impl; +}; + +#endif // CustomerInfoImpl2_CustomerInfoService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Proxy.cpp new file mode 100644 index 0000000000..b0d9424ad4 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Proxy.cpp @@ -0,0 +1,92 @@ +/* + * 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. + */ + +#include "MyValueImpl_MyValueService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + MyValueImpl_MyValueService_Proxy* MyValueImpl_MyValueService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new MyValueImpl_MyValueService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void MyValueImpl_MyValueService_Proxy_Destructor(void* proxy) + { + delete (MyValueImpl_MyValueService_Proxy*)proxy; + } +} + +MyValueImpl_MyValueService_Proxy::MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +MyValueImpl_MyValueService_Proxy::~MyValueImpl_MyValueService_Proxy() +{ + if (target) + delete target; +} + +float MyValueImpl_MyValueService_Proxy::getMyValue(const char* arg0) +{ + tuscany::sca::Operation operation("getMyValue"); + operation.addParameter("customerID", &arg0); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + +float MyValueImpl_MyValueService_Proxy::getMyValueS(const string& arg0) +{ + tuscany::sca::Operation operation("getMyValueS"); + operation.addParameter("customerID", &arg0); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + +string MyValueImpl_MyValueService_Proxy::getCustname( string& arg0) +{ + tuscany::sca::Operation operation("getCustname"); + operation.addParameter("customerID", &arg0); + string ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(string*)operation.getReturnValue(); +} + +const string& MyValueImpl_MyValueService_Proxy::getCustnamecs( string arg0) +{ + tuscany::sca::Operation operation("getCustnamecs"); + operation.addParameter("customerID", &arg0); + target->invoke(operation); + return *(const string*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Proxy.h new file mode 100644 index 0000000000..d61c806e44 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Proxy.h @@ -0,0 +1,44 @@ +/* + * 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. + */ + +#ifndef MyValueImpl_MyValueService_Proxy_h +#define MyValueImpl_MyValueService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "MyValue.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class MyValueImpl_MyValueService_Proxy : public MyValue +{ +public: + MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~MyValueImpl_MyValueService_Proxy(); + virtual float getMyValue(const char* customerID); + virtual float getMyValueS(const string& customerID); + virtual string getCustname( string& customerID); + virtual const string& getCustnamecs( string customerID); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // MyValueImpl_MyValueService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Wrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Wrapper.cpp new file mode 100644 index 0000000000..7f38178f9c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Wrapper.cpp @@ -0,0 +1,122 @@ +/* + * 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. + */ + +#include "MyValueImpl_MyValueService_Wrapper.h" + +#include "osoa/sca/sca.h" + + + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + MyValueImpl_MyValueService_Wrapper* MyValueImpl_MyValueService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new MyValueImpl_MyValueService_Wrapper(target); + } +} + +MyValueImpl_MyValueService_Wrapper::MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (MyValueImpl*)getImplementation(); +} + +MyValueImpl_MyValueService_Wrapper::~MyValueImpl_MyValueService_Wrapper() +{ + releaseImplementation(); +} + +void* MyValueImpl_MyValueService_Wrapper::newImplementation() +{ + return new MyValueImpl; +} + +void MyValueImpl_MyValueService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void MyValueImpl_MyValueService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "getMyValue") + { + const char* p0 = *(const char**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->getMyValue(p0); + } + else + { + float* ret = new float; + *ret = impl->getMyValue(p0); + operation.setReturnValue((const float*)ret); + } + return; + } + if (operationName == "getMyValueS") + { + string& p0 = *(string*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->getMyValueS(p0); + } + else + { + float* ret = new float; + *ret = impl->getMyValueS(p0); + operation.setReturnValue((const float*)ret); + } + return; + } + if (operationName == "getCustname") + { + string& p0 = *(string*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(string*)operation.getReturnValue() = impl->getCustname(p0); + } + else + { + string* ret = new string; + *ret = impl->getCustname(p0); + operation.setReturnValue((const string*)ret); + } + return; + } + if (operationName == "getCustnamecs") + { + string& p0 = *( string*)operation.getParameterValue(0); + const string& ret = impl->getCustnamecs(p0); + operation.setReturnValue(&ret); + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Wrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Wrapper.h new file mode 100644 index 0000000000..d3eef80e8f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef MyValueImpl_MyValueService_Wrapper_h +#define MyValueImpl_MyValueService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "MyValueImpl.hpp" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class MyValueImpl_MyValueService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target); + virtual ~MyValueImpl_MyValueService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + MyValueImpl* impl; +}; + +#endif // MyValueImpl_MyValueService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_customerInfo_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_customerInfo_Proxy.cpp new file mode 100644 index 0000000000..e6800aa311 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_customerInfo_Proxy.cpp @@ -0,0 +1,64 @@ +/* + * 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. + */ + +#include "MyValueImpl_customerInfo_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + MyValueImpl_customerInfo_Proxy* MyValueImpl_customerInfo_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new MyValueImpl_customerInfo_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void MyValueImpl_customerInfo_Proxy_Destructor(void* proxy) + { + delete (MyValueImpl_customerInfo_Proxy*)proxy; + } +} + +MyValueImpl_customerInfo_Proxy::MyValueImpl_customerInfo_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +MyValueImpl_customerInfo_Proxy::~MyValueImpl_customerInfo_Proxy() +{ + if (target) + delete target; +} + +const char* MyValueImpl_customerInfo_Proxy::getCustomerInformation(const char* arg0) +{ + tuscany::sca::Operation operation("getCustomerInformation"); + operation.addParameter("customerID", &arg0); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_customerInfo_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_customerInfo_Proxy.h new file mode 100644 index 0000000000..3d1d279b7c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_customerInfo_Proxy.h @@ -0,0 +1,41 @@ +/* + * 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. + */ + +#ifndef MyValueImpl_customerInfo_Proxy_h +#define MyValueImpl_customerInfo_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "CustomerInfo.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class MyValueImpl_customerInfo_Proxy : public CustomerInfo +{ +public: + MyValueImpl_customerInfo_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~MyValueImpl_customerInfo_Proxy(); + virtual const char* getCustomerInformation(const char* customerID); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // MyValueImpl_customerInfo_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_stockQuote_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_stockQuote_Proxy.cpp new file mode 100644 index 0000000000..d3fd4fbaf0 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_stockQuote_Proxy.cpp @@ -0,0 +1,64 @@ +/* + * 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. + */ + +#include "MyValueImpl_stockQuote_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + MyValueImpl_stockQuote_Proxy* MyValueImpl_stockQuote_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new MyValueImpl_stockQuote_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void MyValueImpl_stockQuote_Proxy_Destructor(void* proxy) + { + delete (MyValueImpl_stockQuote_Proxy*)proxy; + } +} + +MyValueImpl_stockQuote_Proxy::MyValueImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +MyValueImpl_stockQuote_Proxy::~MyValueImpl_stockQuote_Proxy() +{ + if (target) + delete target; +} + +commonj::sdo::DataObjectPtr MyValueImpl_stockQuote_Proxy::GetStockQuotes( commonj::sdo::DataObjectPtr arg0) +{ + tuscany::sca::Operation operation("GetStockQuotes"); + operation.addParameter("request", &arg0); + commonj::sdo::DataObjectPtr ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(commonj::sdo::DataObjectPtr*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_stockQuote_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_stockQuote_Proxy.h new file mode 100644 index 0000000000..ad5cee3ca7 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_stockQuote_Proxy.h @@ -0,0 +1,41 @@ +/* + * 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. + */ + +#ifndef MyValueImpl_stockQuote_Proxy_h +#define MyValueImpl_stockQuote_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "StockQuoteService.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class MyValueImpl_stockQuote_Proxy : public StockQuoteService +{ +public: + MyValueImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~MyValueImpl_stockQuote_Proxy(); + virtual commonj::sdo::DataObjectPtr GetStockQuotes( commonj::sdo::DataObjectPtr request); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // MyValueImpl_stockQuote_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp new file mode 100644 index 0000000000..95c63da613 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp @@ -0,0 +1,64 @@ +/* + * 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. + */ + +#include "CustomerInfoImpl_CustomerInfoService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CustomerInfoImpl_CustomerInfoService_Proxy* CustomerInfoImpl_CustomerInfoService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new CustomerInfoImpl_CustomerInfoService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void CustomerInfoImpl_CustomerInfoService_Proxy_Destructor(void* proxy) + { + delete (CustomerInfoImpl_CustomerInfoService_Proxy*)proxy; + } +} + +CustomerInfoImpl_CustomerInfoService_Proxy::CustomerInfoImpl_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +CustomerInfoImpl_CustomerInfoService_Proxy::~CustomerInfoImpl_CustomerInfoService_Proxy() +{ + if (target) + delete target; +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformation(const char* arg0) +{ + tuscany::sca::Operation operation("getCustomerInformation"); + operation.addParameter("customerID", &arg0); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h new file mode 100644 index 0000000000..2bf1b90e87 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h @@ -0,0 +1,41 @@ +/* + * 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. + */ + +#ifndef CustomerInfoImpl_CustomerInfoService_Proxy_h +#define CustomerInfoImpl_CustomerInfoService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "/CustomerInfo.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class CustomerInfoImpl_CustomerInfoService_Proxy : public CustomerInfo +{ +public: + CustomerInfoImpl_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~CustomerInfoImpl_CustomerInfoService_Proxy(); + virtual const char* getCustomerInformation(const char* customerID); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // CustomerInfoImpl_CustomerInfoService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp new file mode 100644 index 0000000000..b32cf3863a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp @@ -0,0 +1,83 @@ +/* + * 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. + */ + +#include "CustomerInfoImpl_CustomerInfoService_Wrapper.h" + +#include "osoa/sca/sca.h" + +using Other::CustomerInfoImpl; + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CustomerInfoImpl_CustomerInfoService_Wrapper* CustomerInfoImpl_CustomerInfoService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new CustomerInfoImpl_CustomerInfoService_Wrapper(target); + } +} + +CustomerInfoImpl_CustomerInfoService_Wrapper::CustomerInfoImpl_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (CustomerInfoImpl*)getImplementation(); +} + +CustomerInfoImpl_CustomerInfoService_Wrapper::~CustomerInfoImpl_CustomerInfoService_Wrapper() +{ + releaseImplementation(); +} + +void* CustomerInfoImpl_CustomerInfoService_Wrapper::newImplementation() +{ + return new CustomerInfoImpl; +} + +void CustomerInfoImpl_CustomerInfoService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void CustomerInfoImpl_CustomerInfoService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "getCustomerInformation") + { + const char* p0 = *(const char**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInformation(p0); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInformation(p0); + operation.setReturnValue((const const char**)ret); + } + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h new file mode 100644 index 0000000000..82995c96b0 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef CustomerInfoImpl_CustomerInfoService_Wrapper_h +#define CustomerInfoImpl_CustomerInfoService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "CustomerInfoImpl.h" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class CustomerInfoImpl_CustomerInfoService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + CustomerInfoImpl_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target); + virtual ~CustomerInfoImpl_CustomerInfoService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + Other::CustomerInfoImpl* impl; +}; + +#endif // CustomerInfoImpl_CustomerInfoService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.cpp new file mode 100644 index 0000000000..b0d9424ad4 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.cpp @@ -0,0 +1,92 @@ +/* + * 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. + */ + +#include "MyValueImpl_MyValueService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + MyValueImpl_MyValueService_Proxy* MyValueImpl_MyValueService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new MyValueImpl_MyValueService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void MyValueImpl_MyValueService_Proxy_Destructor(void* proxy) + { + delete (MyValueImpl_MyValueService_Proxy*)proxy; + } +} + +MyValueImpl_MyValueService_Proxy::MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +MyValueImpl_MyValueService_Proxy::~MyValueImpl_MyValueService_Proxy() +{ + if (target) + delete target; +} + +float MyValueImpl_MyValueService_Proxy::getMyValue(const char* arg0) +{ + tuscany::sca::Operation operation("getMyValue"); + operation.addParameter("customerID", &arg0); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + +float MyValueImpl_MyValueService_Proxy::getMyValueS(const string& arg0) +{ + tuscany::sca::Operation operation("getMyValueS"); + operation.addParameter("customerID", &arg0); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + +string MyValueImpl_MyValueService_Proxy::getCustname( string& arg0) +{ + tuscany::sca::Operation operation("getCustname"); + operation.addParameter("customerID", &arg0); + string ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(string*)operation.getReturnValue(); +} + +const string& MyValueImpl_MyValueService_Proxy::getCustnamecs( string arg0) +{ + tuscany::sca::Operation operation("getCustnamecs"); + operation.addParameter("customerID", &arg0); + target->invoke(operation); + return *(const string*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.h new file mode 100644 index 0000000000..d61c806e44 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.h @@ -0,0 +1,44 @@ +/* + * 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. + */ + +#ifndef MyValueImpl_MyValueService_Proxy_h +#define MyValueImpl_MyValueService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "MyValue.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class MyValueImpl_MyValueService_Proxy : public MyValue +{ +public: + MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~MyValueImpl_MyValueService_Proxy(); + virtual float getMyValue(const char* customerID); + virtual float getMyValueS(const string& customerID); + virtual string getCustname( string& customerID); + virtual const string& getCustnamecs( string customerID); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // MyValueImpl_MyValueService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.cpp new file mode 100644 index 0000000000..ac104f9aaf --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.cpp @@ -0,0 +1,122 @@ +/* + * 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. + */ + +#include "MyValueImpl_MyValueService_Wrapper.h" + +#include "osoa/sca/sca.h" + +using Other::MyValueImpl; + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + MyValueImpl_MyValueService_Wrapper* MyValueImpl_MyValueService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new MyValueImpl_MyValueService_Wrapper(target); + } +} + +MyValueImpl_MyValueService_Wrapper::MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (MyValueImpl*)getImplementation(); +} + +MyValueImpl_MyValueService_Wrapper::~MyValueImpl_MyValueService_Wrapper() +{ + releaseImplementation(); +} + +void* MyValueImpl_MyValueService_Wrapper::newImplementation() +{ + return new MyValueImpl; +} + +void MyValueImpl_MyValueService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void MyValueImpl_MyValueService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "getMyValue") + { + const char* p0 = *(const char**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->getMyValue(p0); + } + else + { + float* ret = new float; + *ret = impl->getMyValue(p0); + operation.setReturnValue((const float*)ret); + } + return; + } + if (operationName == "getMyValueS") + { + string& p0 = *(string*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->getMyValueS(p0); + } + else + { + float* ret = new float; + *ret = impl->getMyValueS(p0); + operation.setReturnValue((const float*)ret); + } + return; + } + if (operationName == "getCustname") + { + string& p0 = *(string*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(string*)operation.getReturnValue() = impl->getCustname(p0); + } + else + { + string* ret = new string; + *ret = impl->getCustname(p0); + operation.setReturnValue((const string*)ret); + } + return; + } + if (operationName == "getCustnamecs") + { + string& p0 = *( string*)operation.getParameterValue(0); + const string& ret = impl->getCustnamecs(p0); + operation.setReturnValue(&ret); + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.h new file mode 100644 index 0000000000..df388bf43d --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef MyValueImpl_MyValueService_Wrapper_h +#define MyValueImpl_MyValueService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "MyValueImpl.hpp" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class MyValueImpl_MyValueService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target); + virtual ~MyValueImpl_MyValueService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + Other::MyValueImpl* impl; +}; + +#endif // MyValueImpl_MyValueService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_customerInfo_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_customerInfo_Proxy.cpp new file mode 100644 index 0000000000..e6800aa311 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_customerInfo_Proxy.cpp @@ -0,0 +1,64 @@ +/* + * 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. + */ + +#include "MyValueImpl_customerInfo_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + MyValueImpl_customerInfo_Proxy* MyValueImpl_customerInfo_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new MyValueImpl_customerInfo_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void MyValueImpl_customerInfo_Proxy_Destructor(void* proxy) + { + delete (MyValueImpl_customerInfo_Proxy*)proxy; + } +} + +MyValueImpl_customerInfo_Proxy::MyValueImpl_customerInfo_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +MyValueImpl_customerInfo_Proxy::~MyValueImpl_customerInfo_Proxy() +{ + if (target) + delete target; +} + +const char* MyValueImpl_customerInfo_Proxy::getCustomerInformation(const char* arg0) +{ + tuscany::sca::Operation operation("getCustomerInformation"); + operation.addParameter("customerID", &arg0); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_customerInfo_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_customerInfo_Proxy.h new file mode 100644 index 0000000000..3d1d279b7c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_customerInfo_Proxy.h @@ -0,0 +1,41 @@ +/* + * 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. + */ + +#ifndef MyValueImpl_customerInfo_Proxy_h +#define MyValueImpl_customerInfo_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "CustomerInfo.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class MyValueImpl_customerInfo_Proxy : public CustomerInfo +{ +public: + MyValueImpl_customerInfo_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~MyValueImpl_customerInfo_Proxy(); + virtual const char* getCustomerInformation(const char* customerID); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // MyValueImpl_customerInfo_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_stockQuote_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_stockQuote_Proxy.cpp new file mode 100644 index 0000000000..d3fd4fbaf0 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_stockQuote_Proxy.cpp @@ -0,0 +1,64 @@ +/* + * 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. + */ + +#include "MyValueImpl_stockQuote_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + MyValueImpl_stockQuote_Proxy* MyValueImpl_stockQuote_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new MyValueImpl_stockQuote_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void MyValueImpl_stockQuote_Proxy_Destructor(void* proxy) + { + delete (MyValueImpl_stockQuote_Proxy*)proxy; + } +} + +MyValueImpl_stockQuote_Proxy::MyValueImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +MyValueImpl_stockQuote_Proxy::~MyValueImpl_stockQuote_Proxy() +{ + if (target) + delete target; +} + +commonj::sdo::DataObjectPtr MyValueImpl_stockQuote_Proxy::GetStockQuotes( commonj::sdo::DataObjectPtr arg0) +{ + tuscany::sca::Operation operation("GetStockQuotes"); + operation.addParameter("request", &arg0); + commonj::sdo::DataObjectPtr ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(commonj::sdo::DataObjectPtr*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_stockQuote_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_stockQuote_Proxy.h new file mode 100644 index 0000000000..ad5cee3ca7 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_stockQuote_Proxy.h @@ -0,0 +1,41 @@ +/* + * 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. + */ + +#ifndef MyValueImpl_stockQuote_Proxy_h +#define MyValueImpl_stockQuote_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "StockQuoteService.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class MyValueImpl_stockQuote_Proxy : public StockQuoteService +{ +public: + MyValueImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~MyValueImpl_stockQuote_Proxy(); + virtual commonj::sdo::DataObjectPtr GetStockQuotes( commonj::sdo::DataObjectPtr request); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // MyValueImpl_stockQuote_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.cpp new file mode 100644 index 0000000000..21d956f547 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.cpp @@ -0,0 +1,92 @@ +/* + * 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. + */ + +#include "MyValueImpl_MyValueService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + MyValueImpl_MyValueService_Proxy* MyValueImpl_MyValueService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new MyValueImpl_MyValueService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void MyValueImpl_MyValueService_Proxy_Destructor(void* proxy) + { + delete (MyValueImpl_MyValueService_Proxy*)proxy; + } +} + +MyValueImpl_MyValueService_Proxy::MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +MyValueImpl_MyValueService_Proxy::~MyValueImpl_MyValueService_Proxy() +{ + if (target) + delete target; +} + +float MyValueImpl_MyValueService_Proxy::getMyValueOther(const char* arg0) +{ + tuscany::sca::Operation operation("getMyValueOther"); + operation.addParameter("customerID", &arg0); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + +float MyValueImpl_MyValueService_Proxy::getMyValueSOther(const string& arg0) +{ + tuscany::sca::Operation operation("getMyValueSOther"); + operation.addParameter("customerID", &arg0); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + +string MyValueImpl_MyValueService_Proxy::getCustnameOther( string& arg0) +{ + tuscany::sca::Operation operation("getCustnameOther"); + operation.addParameter("customerID", &arg0); + string ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(string*)operation.getReturnValue(); +} + +const string& MyValueImpl_MyValueService_Proxy::getCustnamecsOther( string arg0) +{ + tuscany::sca::Operation operation("getCustnamecsOther"); + operation.addParameter("customerID", &arg0); + target->invoke(operation); + return *(const string*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.h new file mode 100644 index 0000000000..bb92aa0556 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.h @@ -0,0 +1,44 @@ +/* + * 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. + */ + +#ifndef MyValueImpl_MyValueService_Proxy_h +#define MyValueImpl_MyValueService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "MyValue.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class MyValueImpl_MyValueService_Proxy : public MyValue +{ +public: + MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~MyValueImpl_MyValueService_Proxy(); + virtual float getMyValueOther(const char* customerID); + virtual float getMyValueSOther(const string& customerID); + virtual string getCustnameOther( string& customerID); + virtual const string& getCustnamecsOther( string customerID); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // MyValueImpl_MyValueService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.cpp new file mode 100644 index 0000000000..de0f0a0563 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.cpp @@ -0,0 +1,122 @@ +/* + * 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. + */ + +#include "MyValueImpl_MyValueService_Wrapper.h" + +#include "osoa/sca/sca.h" + +using myvaluecorp::implns::MyValueImpl; + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + MyValueImpl_MyValueService_Wrapper* MyValueImpl_MyValueService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new MyValueImpl_MyValueService_Wrapper(target); + } +} + +MyValueImpl_MyValueService_Wrapper::MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (MyValueImpl*)getImplementation(); +} + +MyValueImpl_MyValueService_Wrapper::~MyValueImpl_MyValueService_Wrapper() +{ + releaseImplementation(); +} + +void* MyValueImpl_MyValueService_Wrapper::newImplementation() +{ + return new MyValueImpl; +} + +void MyValueImpl_MyValueService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void MyValueImpl_MyValueService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "getMyValueOther") + { + const char* p0 = *(const char**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->getMyValueOther(p0); + } + else + { + float* ret = new float; + *ret = impl->getMyValueOther(p0); + operation.setReturnValue((const float*)ret); + } + return; + } + if (operationName == "getMyValueSOther") + { + string& p0 = *(string*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->getMyValueSOther(p0); + } + else + { + float* ret = new float; + *ret = impl->getMyValueSOther(p0); + operation.setReturnValue((const float*)ret); + } + return; + } + if (operationName == "getCustnameOther") + { + string& p0 = *(string*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(string*)operation.getReturnValue() = impl->getCustnameOther(p0); + } + else + { + string* ret = new string; + *ret = impl->getCustnameOther(p0); + operation.setReturnValue((const string*)ret); + } + return; + } + if (operationName == "getCustnamecsOther") + { + string& p0 = *( string*)operation.getParameterValue(0); + const string& ret = impl->getCustnamecsOther(p0); + operation.setReturnValue(&ret); + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.h new file mode 100644 index 0000000000..cfc7c4c07a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef MyValueImpl_MyValueService_Wrapper_h +#define MyValueImpl_MyValueService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "MyValueImpl.hpp" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class MyValueImpl_MyValueService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target); + virtual ~MyValueImpl_MyValueService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + myvaluecorp::implns::MyValueImpl* impl; +}; + +#endif // MyValueImpl_MyValueService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.cpp new file mode 100644 index 0000000000..21d956f547 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.cpp @@ -0,0 +1,92 @@ +/* + * 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. + */ + +#include "MyValueImpl_MyValueService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + MyValueImpl_MyValueService_Proxy* MyValueImpl_MyValueService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new MyValueImpl_MyValueService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void MyValueImpl_MyValueService_Proxy_Destructor(void* proxy) + { + delete (MyValueImpl_MyValueService_Proxy*)proxy; + } +} + +MyValueImpl_MyValueService_Proxy::MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +MyValueImpl_MyValueService_Proxy::~MyValueImpl_MyValueService_Proxy() +{ + if (target) + delete target; +} + +float MyValueImpl_MyValueService_Proxy::getMyValueOther(const char* arg0) +{ + tuscany::sca::Operation operation("getMyValueOther"); + operation.addParameter("customerID", &arg0); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + +float MyValueImpl_MyValueService_Proxy::getMyValueSOther(const string& arg0) +{ + tuscany::sca::Operation operation("getMyValueSOther"); + operation.addParameter("customerID", &arg0); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + +string MyValueImpl_MyValueService_Proxy::getCustnameOther( string& arg0) +{ + tuscany::sca::Operation operation("getCustnameOther"); + operation.addParameter("customerID", &arg0); + string ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(string*)operation.getReturnValue(); +} + +const string& MyValueImpl_MyValueService_Proxy::getCustnamecsOther( string arg0) +{ + tuscany::sca::Operation operation("getCustnamecsOther"); + operation.addParameter("customerID", &arg0); + target->invoke(operation); + return *(const string*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.h new file mode 100644 index 0000000000..210da9a64c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.h @@ -0,0 +1,44 @@ +/* + * 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. + */ + +#ifndef MyValueImpl_MyValueService_Proxy_h +#define MyValueImpl_MyValueService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "MyValue.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class MyValueImpl_MyValueService_Proxy : public Other::MyValue +{ +public: + MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~MyValueImpl_MyValueService_Proxy(); + virtual float getMyValueOther(const char* customerID); + virtual float getMyValueSOther(const string& customerID); + virtual string getCustnameOther( string& customerID); + virtual const string& getCustnamecsOther( string customerID); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // MyValueImpl_MyValueService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.cpp new file mode 100644 index 0000000000..f84fcf496b --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.cpp @@ -0,0 +1,122 @@ +/* + * 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. + */ + +#include "MyValueImpl_MyValueService_Wrapper.h" + +#include "osoa/sca/sca.h" + + + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + MyValueImpl_MyValueService_Wrapper* MyValueImpl_MyValueService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new MyValueImpl_MyValueService_Wrapper(target); + } +} + +MyValueImpl_MyValueService_Wrapper::MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (MyValueImpl*)getImplementation(); +} + +MyValueImpl_MyValueService_Wrapper::~MyValueImpl_MyValueService_Wrapper() +{ + releaseImplementation(); +} + +void* MyValueImpl_MyValueService_Wrapper::newImplementation() +{ + return new MyValueImpl; +} + +void MyValueImpl_MyValueService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void MyValueImpl_MyValueService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "getMyValueOther") + { + const char* p0 = *(const char**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->getMyValueOther(p0); + } + else + { + float* ret = new float; + *ret = impl->getMyValueOther(p0); + operation.setReturnValue((const float*)ret); + } + return; + } + if (operationName == "getMyValueSOther") + { + string& p0 = *(string*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->getMyValueSOther(p0); + } + else + { + float* ret = new float; + *ret = impl->getMyValueSOther(p0); + operation.setReturnValue((const float*)ret); + } + return; + } + if (operationName == "getCustnameOther") + { + string& p0 = *(string*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(string*)operation.getReturnValue() = impl->getCustnameOther(p0); + } + else + { + string* ret = new string; + *ret = impl->getCustnameOther(p0); + operation.setReturnValue((const string*)ret); + } + return; + } + if (operationName == "getCustnamecsOther") + { + string& p0 = *( string*)operation.getParameterValue(0); + const string& ret = impl->getCustnamecsOther(p0); + operation.setReturnValue(&ret); + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.h new file mode 100644 index 0000000000..d3eef80e8f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef MyValueImpl_MyValueService_Wrapper_h +#define MyValueImpl_MyValueService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "MyValueImpl.hpp" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class MyValueImpl_MyValueService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target); + virtual ~MyValueImpl_MyValueService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + MyValueImpl* impl; +}; + +#endif // MyValueImpl_MyValueService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.cpp new file mode 100644 index 0000000000..21d956f547 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.cpp @@ -0,0 +1,92 @@ +/* + * 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. + */ + +#include "MyValueImpl_MyValueService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + MyValueImpl_MyValueService_Proxy* MyValueImpl_MyValueService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new MyValueImpl_MyValueService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void MyValueImpl_MyValueService_Proxy_Destructor(void* proxy) + { + delete (MyValueImpl_MyValueService_Proxy*)proxy; + } +} + +MyValueImpl_MyValueService_Proxy::MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +MyValueImpl_MyValueService_Proxy::~MyValueImpl_MyValueService_Proxy() +{ + if (target) + delete target; +} + +float MyValueImpl_MyValueService_Proxy::getMyValueOther(const char* arg0) +{ + tuscany::sca::Operation operation("getMyValueOther"); + operation.addParameter("customerID", &arg0); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + +float MyValueImpl_MyValueService_Proxy::getMyValueSOther(const string& arg0) +{ + tuscany::sca::Operation operation("getMyValueSOther"); + operation.addParameter("customerID", &arg0); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + +string MyValueImpl_MyValueService_Proxy::getCustnameOther( string& arg0) +{ + tuscany::sca::Operation operation("getCustnameOther"); + operation.addParameter("customerID", &arg0); + string ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(string*)operation.getReturnValue(); +} + +const string& MyValueImpl_MyValueService_Proxy::getCustnamecsOther( string arg0) +{ + tuscany::sca::Operation operation("getCustnamecsOther"); + operation.addParameter("customerID", &arg0); + target->invoke(operation); + return *(const string*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.h new file mode 100644 index 0000000000..210da9a64c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.h @@ -0,0 +1,44 @@ +/* + * 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. + */ + +#ifndef MyValueImpl_MyValueService_Proxy_h +#define MyValueImpl_MyValueService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "MyValue.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class MyValueImpl_MyValueService_Proxy : public Other::MyValue +{ +public: + MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~MyValueImpl_MyValueService_Proxy(); + virtual float getMyValueOther(const char* customerID); + virtual float getMyValueSOther(const string& customerID); + virtual string getCustnameOther( string& customerID); + virtual const string& getCustnamecsOther( string customerID); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // MyValueImpl_MyValueService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.cpp new file mode 100644 index 0000000000..f84fcf496b --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.cpp @@ -0,0 +1,122 @@ +/* + * 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. + */ + +#include "MyValueImpl_MyValueService_Wrapper.h" + +#include "osoa/sca/sca.h" + + + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + MyValueImpl_MyValueService_Wrapper* MyValueImpl_MyValueService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new MyValueImpl_MyValueService_Wrapper(target); + } +} + +MyValueImpl_MyValueService_Wrapper::MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (MyValueImpl*)getImplementation(); +} + +MyValueImpl_MyValueService_Wrapper::~MyValueImpl_MyValueService_Wrapper() +{ + releaseImplementation(); +} + +void* MyValueImpl_MyValueService_Wrapper::newImplementation() +{ + return new MyValueImpl; +} + +void MyValueImpl_MyValueService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void MyValueImpl_MyValueService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "getMyValueOther") + { + const char* p0 = *(const char**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->getMyValueOther(p0); + } + else + { + float* ret = new float; + *ret = impl->getMyValueOther(p0); + operation.setReturnValue((const float*)ret); + } + return; + } + if (operationName == "getMyValueSOther") + { + string& p0 = *(string*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->getMyValueSOther(p0); + } + else + { + float* ret = new float; + *ret = impl->getMyValueSOther(p0); + operation.setReturnValue((const float*)ret); + } + return; + } + if (operationName == "getCustnameOther") + { + string& p0 = *(string*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(string*)operation.getReturnValue() = impl->getCustnameOther(p0); + } + else + { + string* ret = new string; + *ret = impl->getCustnameOther(p0); + operation.setReturnValue((const string*)ret); + } + return; + } + if (operationName == "getCustnamecsOther") + { + string& p0 = *( string*)operation.getParameterValue(0); + const string& ret = impl->getCustnamecsOther(p0); + operation.setReturnValue(&ret); + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.h new file mode 100644 index 0000000000..d3eef80e8f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef MyValueImpl_MyValueService_Wrapper_h +#define MyValueImpl_MyValueService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "MyValueImpl.hpp" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class MyValueImpl_MyValueService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target); + virtual ~MyValueImpl_MyValueService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + MyValueImpl* impl; +}; + +#endif // MyValueImpl_MyValueService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.cpp new file mode 100644 index 0000000000..543b370282 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.cpp @@ -0,0 +1,64 @@ +/* + * 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. + */ + +#include "CustomerInfoImpl2_CustomerInfoService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CustomerInfoImpl2_CustomerInfoService_Proxy* CustomerInfoImpl2_CustomerInfoService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new CustomerInfoImpl2_CustomerInfoService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void CustomerInfoImpl2_CustomerInfoService_Proxy_Destructor(void* proxy) + { + delete (CustomerInfoImpl2_CustomerInfoService_Proxy*)proxy; + } +} + +CustomerInfoImpl2_CustomerInfoService_Proxy::CustomerInfoImpl2_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +CustomerInfoImpl2_CustomerInfoService_Proxy::~CustomerInfoImpl2_CustomerInfoService_Proxy() +{ + if (target) + delete target; +} + +const char* CustomerInfoImpl2_CustomerInfoService_Proxy::getCustomerInformation(const char* arg0) +{ + tuscany::sca::Operation operation("getCustomerInformation"); + operation.addParameter(&arg0); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.h new file mode 100644 index 0000000000..594f404d13 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.h @@ -0,0 +1,41 @@ +/* + * 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. + */ + +#ifndef CustomerInfoImpl2_CustomerInfoService_Proxy_h +#define CustomerInfoImpl2_CustomerInfoService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "/CustomerInfo.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class CustomerInfoImpl2_CustomerInfoService_Proxy : public CustomerInfo +{ +public: + CustomerInfoImpl2_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~CustomerInfoImpl2_CustomerInfoService_Proxy(); + virtual const char* getCustomerInformation(const char* customerID); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // CustomerInfoImpl2_CustomerInfoService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.cpp new file mode 100644 index 0000000000..191dd3eed2 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.cpp @@ -0,0 +1,83 @@ +/* + * 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. + */ + +#include "CustomerInfoImpl2_CustomerInfoService_Wrapper.h" + +#include "osoa/sca/sca.h" + +using myvaluecorp::implns::CustomerInfoImpl2; + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CustomerInfoImpl2_CustomerInfoService_Wrapper* CustomerInfoImpl2_CustomerInfoService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new CustomerInfoImpl2_CustomerInfoService_Wrapper(target); + } +} + +CustomerInfoImpl2_CustomerInfoService_Wrapper::CustomerInfoImpl2_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (CustomerInfoImpl2*)getImplementation(); +} + +CustomerInfoImpl2_CustomerInfoService_Wrapper::~CustomerInfoImpl2_CustomerInfoService_Wrapper() +{ + releaseImplementation(); +} + +void* CustomerInfoImpl2_CustomerInfoService_Wrapper::newImplementation() +{ + return new CustomerInfoImpl2; +} + +void CustomerInfoImpl2_CustomerInfoService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void CustomerInfoImpl2_CustomerInfoService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "getCustomerInformation") + { + const char* p0 = *(const char**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInformation(p0); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInformation(p0); + operation.setReturnValue((const const char**)ret); + } + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.h new file mode 100644 index 0000000000..a57f5c4613 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef CustomerInfoImpl2_CustomerInfoService_Wrapper_h +#define CustomerInfoImpl2_CustomerInfoService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "CustomerInfoImpl.h" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class CustomerInfoImpl2_CustomerInfoService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + CustomerInfoImpl2_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target); + virtual ~CustomerInfoImpl2_CustomerInfoService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + myvaluecorp::implns::CustomerInfoImpl2* impl; +}; + +#endif // CustomerInfoImpl2_CustomerInfoService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Proxy.cpp new file mode 100644 index 0000000000..fe996eabdb --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Proxy.cpp @@ -0,0 +1,92 @@ +/* + * 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. + */ + +#include "MyValueImpl_MyValueService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + MyValueImpl_MyValueService_Proxy* MyValueImpl_MyValueService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new MyValueImpl_MyValueService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void MyValueImpl_MyValueService_Proxy_Destructor(void* proxy) + { + delete (MyValueImpl_MyValueService_Proxy*)proxy; + } +} + +MyValueImpl_MyValueService_Proxy::MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +MyValueImpl_MyValueService_Proxy::~MyValueImpl_MyValueService_Proxy() +{ + if (target) + delete target; +} + +float MyValueImpl_MyValueService_Proxy::getMyValue(const char* arg0) +{ + tuscany::sca::Operation operation("getMyValue"); + operation.addParameter(&arg0); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + +float MyValueImpl_MyValueService_Proxy::getMyValueS(const string& arg0) +{ + tuscany::sca::Operation operation("getMyValueS"); + operation.addParameter(&arg0); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + +string MyValueImpl_MyValueService_Proxy::getCustname( string& arg0) +{ + tuscany::sca::Operation operation("getCustname"); + operation.addParameter(&arg0); + string ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(string*)operation.getReturnValue(); +} + +const string& MyValueImpl_MyValueService_Proxy::getCustnamecs( string arg0) +{ + tuscany::sca::Operation operation("getCustnamecs"); + operation.addParameter(&arg0); + target->invoke(operation); + return *(const string*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Proxy.h new file mode 100644 index 0000000000..d61c806e44 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Proxy.h @@ -0,0 +1,44 @@ +/* + * 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. + */ + +#ifndef MyValueImpl_MyValueService_Proxy_h +#define MyValueImpl_MyValueService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "MyValue.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class MyValueImpl_MyValueService_Proxy : public MyValue +{ +public: + MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~MyValueImpl_MyValueService_Proxy(); + virtual float getMyValue(const char* customerID); + virtual float getMyValueS(const string& customerID); + virtual string getCustname( string& customerID); + virtual const string& getCustnamecs( string customerID); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // MyValueImpl_MyValueService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Wrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Wrapper.cpp new file mode 100644 index 0000000000..5bbd07a72a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Wrapper.cpp @@ -0,0 +1,122 @@ +/* + * 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. + */ + +#include "MyValueImpl_MyValueService_Wrapper.h" + +#include "osoa/sca/sca.h" + +using myvaluecorp::implns::MyValueImpl; + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + MyValueImpl_MyValueService_Wrapper* MyValueImpl_MyValueService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new MyValueImpl_MyValueService_Wrapper(target); + } +} + +MyValueImpl_MyValueService_Wrapper::MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (MyValueImpl*)getImplementation(); +} + +MyValueImpl_MyValueService_Wrapper::~MyValueImpl_MyValueService_Wrapper() +{ + releaseImplementation(); +} + +void* MyValueImpl_MyValueService_Wrapper::newImplementation() +{ + return new MyValueImpl; +} + +void MyValueImpl_MyValueService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void MyValueImpl_MyValueService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "getMyValue") + { + const char* p0 = *(const char**)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->getMyValue(p0); + } + else + { + float* ret = new float; + *ret = impl->getMyValue(p0); + operation.setReturnValue((const float*)ret); + } + return; + } + if (operationName == "getMyValueS") + { + string& p0 = *(string*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->getMyValueS(p0); + } + else + { + float* ret = new float; + *ret = impl->getMyValueS(p0); + operation.setReturnValue((const float*)ret); + } + return; + } + if (operationName == "getCustname") + { + string& p0 = *(string*)operation.getParameterValue(0); + + if(operation.getReturnValue() != NULL) + { + *(string*)operation.getReturnValue() = impl->getCustname(p0); + } + else + { + string* ret = new string; + *ret = impl->getCustname(p0); + operation.setReturnValue((const string*)ret); + } + return; + } + if (operationName == "getCustnamecs") + { + string& p0 = *( string*)operation.getParameterValue(0); + const string& ret = impl->getCustnamecs(p0); + operation.setReturnValue(&ret); + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Wrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Wrapper.h new file mode 100644 index 0000000000..cfc7c4c07a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef MyValueImpl_MyValueService_Wrapper_h +#define MyValueImpl_MyValueService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "MyValueImpl.hpp" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class MyValueImpl_MyValueService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target); + virtual ~MyValueImpl_MyValueService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + myvaluecorp::implns::MyValueImpl* impl; +}; + +#endif // MyValueImpl_MyValueService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_customerInfo_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_customerInfo_Proxy.cpp new file mode 100644 index 0000000000..ffcc1d0003 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_customerInfo_Proxy.cpp @@ -0,0 +1,64 @@ +/* + * 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. + */ + +#include "MyValueImpl_customerInfo_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + MyValueImpl_customerInfo_Proxy* MyValueImpl_customerInfo_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new MyValueImpl_customerInfo_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void MyValueImpl_customerInfo_Proxy_Destructor(void* proxy) + { + delete (MyValueImpl_customerInfo_Proxy*)proxy; + } +} + +MyValueImpl_customerInfo_Proxy::MyValueImpl_customerInfo_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +MyValueImpl_customerInfo_Proxy::~MyValueImpl_customerInfo_Proxy() +{ + if (target) + delete target; +} + +const char* MyValueImpl_customerInfo_Proxy::getCustomerInformation(const char* arg0) +{ + tuscany::sca::Operation operation("getCustomerInformation"); + operation.addParameter(&arg0); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_customerInfo_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_customerInfo_Proxy.h new file mode 100644 index 0000000000..3d1d279b7c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_customerInfo_Proxy.h @@ -0,0 +1,41 @@ +/* + * 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. + */ + +#ifndef MyValueImpl_customerInfo_Proxy_h +#define MyValueImpl_customerInfo_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "CustomerInfo.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class MyValueImpl_customerInfo_Proxy : public CustomerInfo +{ +public: + MyValueImpl_customerInfo_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~MyValueImpl_customerInfo_Proxy(); + virtual const char* getCustomerInformation(const char* customerID); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // MyValueImpl_customerInfo_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_stockQuote_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_stockQuote_Proxy.cpp new file mode 100644 index 0000000000..6e4d0600bd --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_stockQuote_Proxy.cpp @@ -0,0 +1,64 @@ +/* + * 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. + */ + +#include "MyValueImpl_stockQuote_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + MyValueImpl_stockQuote_Proxy* MyValueImpl_stockQuote_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new MyValueImpl_stockQuote_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void MyValueImpl_stockQuote_Proxy_Destructor(void* proxy) + { + delete (MyValueImpl_stockQuote_Proxy*)proxy; + } +} + +MyValueImpl_stockQuote_Proxy::MyValueImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +MyValueImpl_stockQuote_Proxy::~MyValueImpl_stockQuote_Proxy() +{ + if (target) + delete target; +} + +commonj::sdo::DataObjectPtr MyValueImpl_stockQuote_Proxy::GetStockQuotes( commonj::sdo::DataObjectPtr arg0) +{ + tuscany::sca::Operation operation("GetStockQuotes"); + operation.addParameter(&arg0); + commonj::sdo::DataObjectPtr ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(commonj::sdo::DataObjectPtr*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_stockQuote_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_stockQuote_Proxy.h new file mode 100644 index 0000000000..ad5cee3ca7 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_stockQuote_Proxy.h @@ -0,0 +1,41 @@ +/* + * 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. + */ + +#ifndef MyValueImpl_stockQuote_Proxy_h +#define MyValueImpl_stockQuote_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "StockQuoteService.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class MyValueImpl_stockQuote_Proxy : public StockQuoteService +{ +public: + MyValueImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~MyValueImpl_stockQuote_Proxy(); + virtual commonj::sdo::DataObjectPtr GetStockQuotes( commonj::sdo::DataObjectPtr request); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // MyValueImpl_stockQuote_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp new file mode 100644 index 0000000000..4c3d626bfb --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp @@ -0,0 +1,87 @@ +/* + * 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. + */ + +#include "CustomerInfoImpl_CustomerInfoService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CustomerInfoImpl_CustomerInfoService_Proxy* CustomerInfoImpl_CustomerInfoService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new CustomerInfoImpl_CustomerInfoService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void CustomerInfoImpl_CustomerInfoService_Proxy_Destructor(void* proxy) + { + delete (CustomerInfoImpl_CustomerInfoService_Proxy*)proxy; + } +} + +CustomerInfoImpl_CustomerInfoService_Proxy::CustomerInfoImpl_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +CustomerInfoImpl_CustomerInfoService_Proxy::~CustomerInfoImpl_CustomerInfoService_Proxy() +{ + if (target) + delete target; +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationCharPublic( char* arg0, const char* arg1) +{ + tuscany::sca::Operation operation("getCustomerInformationCharPublic"); + operation.addParameter("p1", &arg0); + operation.addParameter("customerID", &arg1); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoACharPublic( char* arg0, const char* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoACharPublic"); + operation.addParameter("p1", &arg0); + operation.addParameter("", &arg1); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + +const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBCharPublic( char* arg0, char* arg1) +{ + tuscany::sca::Operation operation("getCustomerInfoBCharPublic"); + operation.addParameter("p1", &arg0); + operation.addParameter("customerID", &arg1); + const char* ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(const char**)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h new file mode 100644 index 0000000000..a9b56bdb5c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef CustomerInfoImpl_CustomerInfoService_Proxy_h +#define CustomerInfoImpl_CustomerInfoService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "/CustomerInfo.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class CustomerInfoImpl_CustomerInfoService_Proxy : public CustomerInfo +{ +public: + CustomerInfoImpl_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~CustomerInfoImpl_CustomerInfoService_Proxy(); + virtual const char* getCustomerInformationCharPublic( char* p1, const char* customerID); + virtual const char* getCustomerInfoACharPublic( char* p1, const char* ); + virtual const char* getCustomerInfoBCharPublic( char* p1, char* customerID); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // CustomerInfoImpl_CustomerInfoService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp new file mode 100644 index 0000000000..2aa9fcbdf2 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp @@ -0,0 +1,118 @@ +/* + * 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. + */ + +#include "CustomerInfoImpl_CustomerInfoService_Wrapper.h" + +#include "osoa/sca/sca.h" + + + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CustomerInfoImpl_CustomerInfoService_Wrapper* CustomerInfoImpl_CustomerInfoService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new CustomerInfoImpl_CustomerInfoService_Wrapper(target); + } +} + +CustomerInfoImpl_CustomerInfoService_Wrapper::CustomerInfoImpl_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (CustomerInfoImpl*)getImplementation(); +} + +CustomerInfoImpl_CustomerInfoService_Wrapper::~CustomerInfoImpl_CustomerInfoService_Wrapper() +{ + releaseImplementation(); +} + +void* CustomerInfoImpl_CustomerInfoService_Wrapper::newImplementation() +{ + return new CustomerInfoImpl; +} + +void CustomerInfoImpl_CustomerInfoService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void CustomerInfoImpl_CustomerInfoService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "getCustomerInformationCharPublic") + { + char* p0 = *( char**)operation.getParameterValue(0); + const char* p1 = *(const char**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInformationCharPublic(p0, p1); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInformationCharPublic(p0, p1); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoACharPublic") + { + char* p0 = *( char**)operation.getParameterValue(0); + const char* p1 = *(const char**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoACharPublic(p0, p1); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoACharPublic(p0, p1); + operation.setReturnValue((const const char**)ret); + } + return; + } + if (operationName == "getCustomerInfoBCharPublic") + { + char* p0 = *( char**)operation.getParameterValue(0); + char* p1 = *( char**)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(const char**)operation.getReturnValue() = impl->getCustomerInfoBCharPublic(p0, p1); + } + else + { + const char** ret = new const char*; + *ret = impl->getCustomerInfoBCharPublic(p0, p1); + operation.setReturnValue((const const char**)ret); + } + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h new file mode 100644 index 0000000000..94b1d5cb4d --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef CustomerInfoImpl_CustomerInfoService_Wrapper_h +#define CustomerInfoImpl_CustomerInfoService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "CustomerInfoImpl.h" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class CustomerInfoImpl_CustomerInfoService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + CustomerInfoImpl_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target); + virtual ~CustomerInfoImpl_CustomerInfoService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + CustomerInfoImpl* impl; +}; + +#endif // CustomerInfoImpl_CustomerInfoService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/lib/readme.txt b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/lib/readme.txt new file mode 100644 index 0000000000..d99c666c6a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/lib/readme.txt @@ -0,0 +1,4 @@ +Place a junit.jar file (not shipped as part of Tuscany) +in this directory to get the scagen build.xml Ant build +file to find it and Junit classes (without setting the +property "junit.jar.folder". diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/scagen.bat b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/scagen.bat new file mode 100644 index 0000000000..8ab5e4abdf --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/scagen.bat @@ -0,0 +1,19 @@ +@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. + +@java -jar %~d0%~p0scagen.jar %* diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/scagen.sh b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/scagen.sh new file mode 100755 index 0000000000..c50f28b98f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/scagen.sh @@ -0,0 +1,21 @@ +#!/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. + + +java -jar scagen.jar -dir $2 -output $4 \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/BodyPart.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/BodyPart.java new file mode 100644 index 0000000000..4ccbe0c750 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/BodyPart.java @@ -0,0 +1,96 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + + +/* + * Branched from the original class that was also contributed to the + * org.apache.axis.tools.common package. + */ + +package org.apache.tuscany.sca.cpp.tools.common; + +/** + * A snippet of C or C++ source code. If this snippet ends with a return + * statement, this body part also contains the return value. + */ +public class BodyPart { + public final static int TRAILING = 0; + + public final static int RETURN = 1; + + public final static int CATCH = 2; + + private String codeFragment; + + private String returnValue = null; + + private Parameter caughtValue = null; + + private int type; + + BodyPart(String cf) { + codeFragment = cf; + type = TRAILING; + } + + BodyPart(String cf, String rv) { + codeFragment = cf; + if (null != rv && !Utils.isSpace(rv)) { + type = RETURN; + returnValue = rv; + } else + type = TRAILING; + } + + BodyPart(String cf, Parameter cv) { + codeFragment = cf; + caughtValue = cv; + type = CATCH; + } + + public String getCodeFragment() { + return codeFragment; + } + + public boolean isTrailing() { + return TRAILING == type; + } + + public boolean isReturn() { + return RETURN == type; + } + + public boolean isCatch() { + return CATCH == type; + } + + public String getReturnValue() { + if (returnValue != null) + return returnValue.trim(); + else + return null; + } + + public Parameter getCaughtValue() { + return caughtValue; + } +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/CParsingTool.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/CParsingTool.java new file mode 100644 index 0000000000..669901b4b5 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/CParsingTool.java @@ -0,0 +1,124 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +/* + * Branched from the original class that was also contributed to the + * org.apache.axis.tools.common package. + */ +package org.apache.tuscany.sca.cpp.tools.common; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; + +/** + * The superclass of tools that parse C/C++ code. This CParsingTool provides + * some useful common methods. + */ +public class CParsingTool { + protected boolean failed = false; + + protected Headers headers = new Headers(); + + protected CParsingTool(String[] args) throws Exception { + String text = new String(); + for (int i = 0; i < args.length; i++) + text += args[i] + " "; + Utils.outputDebugString(text); + + Options.set(args); + String config = (String) Options.getOption("-config"); + if (null != config) + Configuration.initialise(config); + } + + /** + * Read in any include files before the main processing of the tool is done. + * This constructs the Headers. + */ + protected Headers preparseHeaders(String option) throws Exception { + Headers headers = new Headers(); + Object o = Options.getOption(option); + if (null != o) { + Utils.outputDebugString("Pre-parsing headers..."); + List includeList; + if (o instanceof List) + includeList = (List) o; + else { + includeList = new ArrayList(); + includeList.add(o); + } + Iterator it = includeList.iterator(); + while (it.hasNext()) { + File include = new File((String) it.next()); + if (!include.isDirectory()) + Utils.rude("Bad include directory " + include); + + DirectoryTree tree = new DirectoryTree(headers, new HashSet( + Arrays.asList(new Object[] { "hpp", "h" }))); + tree.walkTree(include, null, 0); + } + Utils.outputDebugString("Parsing files..."); + } + + return headers; + } + + /** + * Checks the source directory looks good. + */ + protected File checkFile(String option) throws Exception { + String name = (String) Options.getOption(option); + if (null == name) { + printUsage(); + System.exit(-1); + } + + File file = new File(name); + if (!file.isFile() && !file.isDirectory()) + Utils.rude("Bad file or directory " + file); + return file; + } + + /** + * Checks the target directory and creates it if it doesn't already exist. + */ + protected File maybeCreateDirectory(String option) throws Exception { + String name = (String) Options.getOption(option); + if (null == name) { + printUsage(); + System.exit(-1); + } + + File file = new File(name); + if (!file.exists() && !file.mkdir()) + Utils.screenMessage("Failed to create directory " + file); + return file; + } + + protected void printUsage() { + System.out.println("usage: ??"); + } +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Configuration.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Configuration.java new file mode 100644 index 0000000000..246a489c9c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Configuration.java @@ -0,0 +1,132 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + + +/* + * Branched from the original class that was also contributed to the + * org.apache.axis.tools.common package. + */ +package org.apache.tuscany.sca.cpp.tools.common; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * Encapsulates the tool's configuration file + */ +public class Configuration { + private static Set files = new HashSet(); + + private static Set classes = new HashSet(); + + private static Set methods = new HashSet(); + + private static Set macros = new HashSet(); + + private static Set defines = new HashSet(); + + private static Set attributes = new HashSet(); + + private static Map others = new HashMap(); + + /** + * No one creates an instance of this class. + */ + private Configuration() { + } + + /** + * Reads in the configuration file + */ + public static void initialise(String filename) throws Exception { + File file = new File(filename); + FileReader fr = new FileReader(file); + BufferedReader br = new BufferedReader(fr); + String line = br.readLine(); + for (int lineno = 1; null != line; lineno++, line = br.readLine()) { + // Ignore lines starting with a # (comments) and blank lines + if (line.startsWith("#")) + continue; + boolean blank = true; + for (int i = 0; i < line.length() && blank; i++) + if (!Character.isWhitespace(line.charAt(i))) + blank = false; + if (blank) + continue; + + int equals = line.indexOf("="); + if (-1 == equals) + Utils.rude("Bad line in configuration file " + filename + + " lineno " + lineno); + String key = line.substring(0, equals).trim(); + String value = line.substring(equals + 1).trim(); + if ("excludefile".equals(key)) { + files.add(value); + } else if ("excludeclass".equals(key)) { + classes.add(value); + } else if ("excludemethod".equals(key)) { + methods.add(value); + } else if ("macro".equals(key)) { + macros.add(value); + } else if ("define".equals(key)) { + defines.add(value); + } else if ("attribute".equals(key)) { + attributes.add(value); + } else { + others.put(key, value); + } + } + } + + public static boolean fileExcluded(String s) { + return files.contains(s); + } + + public static boolean classExcluded(String s) { + return classes.contains(s); + } + + public static boolean methodExcluded(String className, String method) { + return methods.contains(className + "::" + method); + } + + public static boolean isMacro(String s) { + return macros.contains(s); + } + + public static boolean isDefine(String s) { + return defines.contains(s); + } + + public static boolean isAttribute(String s) { + return attributes.contains(s); + } + + public static String getConfigured(String key) { + return (String) others.get(key); + } +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/DirectoryTree.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/DirectoryTree.java new file mode 100644 index 0000000000..36d0af18b3 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/DirectoryTree.java @@ -0,0 +1,105 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +/* + * Branched from the original class that was also contributed to the + * org.apache.axis.tools.common package. + */ +package org.apache.tuscany.sca.cpp.tools.common; + +import java.io.File; +import java.util.Set; +import java.util.StringTokenizer; + +public class DirectoryTree { + private FileActor actor; + + private Set extensions; + + public DirectoryTree(FileActor actor, Set extensions) { + this.actor = actor; + this.extensions = extensions; + } + + /** + * Starts adding trace into the given file. If the given file is a directory + * then this the starting directory and all code beneath and in this + * directory will be given trace. + * + * @param source - + * either the starting directory or one file to add trace to. + */ + public void walkTree(File source, File target, int depth) throws Exception { + depth++; + boolean noTarget = (null == target); + + if (!source.canRead()) + Utils.rude("Cannot read from source directory " + source); + if (!noTarget && !target.canWrite()) + Utils.rude("Cannot write to target directory " + target); + + if (source.isDirectory()) { + File[] filesInDirectory = source.listFiles(); + for (int i = 0; i < filesInDirectory.length; i++) { + File file = filesInDirectory[i]; + String name = file.getName(); + int dot = name.lastIndexOf('.'); + String ext = null; + if (-1 != dot) + ext = name.substring(dot + 1); + + if (file.isDirectory()) { + File newTarget = null; + if (!noTarget) { + StringTokenizer st = new StringTokenizer( + file.getPath(), "\\/"); + String newdir = null; + while (st.hasMoreTokens()) + newdir = st.nextToken(); + String targetName = maybeAppendSeparator(target + .toString()); + newTarget = new File(targetName + newdir); + if (!newTarget.mkdir()) + Utils.rude("Failed to create target directory " + + newTarget); + } + + // recurse + walkTree(file, newTarget, depth); + } else if (file.isFile() + && (extensions == null || (!file.isHidden() && extensions + .contains(ext)))) { + // this is a file and we need to add trace into it ! + actor.actOnFile(file, target, depth); + } + } + } else { + actor.actOnFile(source, target, depth); + } + } + + public static String maybeAppendSeparator(String name) { + if (!name.endsWith("/") && !name.endsWith("\\")) + name += "/"; + return name; + } +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/FileActor.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/FileActor.java new file mode 100644 index 0000000000..a2bb4ba858 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/FileActor.java @@ -0,0 +1,37 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +/* + * Branched from the original class that was also contributed to the + * org.apache.axis.tools.common package. + */ +package org.apache.tuscany.sca.cpp.tools.common; + +import java.io.File; + +/** + * DirectoryTree calls this interface to allow implementations of this interface + * to act on a file in the directory tree. + */ +public interface FileActor { + public void actOnFile(File source, File target, int depth) throws Exception; +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/FilePart.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/FilePart.java new file mode 100644 index 0000000000..b6bdf92878 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/FilePart.java @@ -0,0 +1,80 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +/* + * Branched from the original class that was also contributed to the + * org.apache.axis.tools.common package. + */ + +package org.apache.tuscany.sca.cpp.tools.common; + +/** + * A piece of C++ source code + */ +public class FilePart { + public final static int UNKNOWN = 0; + + public final static int COMMENT = 1; + + public final static int METHOD = 2; + + public final static int FIELD = 3; + + public final static int BEGINSCOPE = 4; + + public final static int ENDSCOPE = 5; + + public final static int DIRECTIVE = 6; + + public final static int WHITESPACE = 7; + + public final static int MACRO = 8; + + public final static int CLASSATTRIBUTE = 9; + + public final static int ENUM = 10; + + public final static int PROTOTYPE = 11; + + public final static int TYPEDEF = 12; + + protected String cppsource; + + protected int type; + + FilePart(String s, int type) { + cppsource = s; + this.type = type; + } + + public int getType() { + return type; + } + + int length() { + return cppsource.length(); + } + + public String toString() { + return cppsource; + } +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Headers.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Headers.java new file mode 100644 index 0000000000..533e1fd14a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Headers.java @@ -0,0 +1,167 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +/* + * Branched from the original class that was also contributed to the + * org.apache.axis.tools.common package. + */ +package org.apache.tuscany.sca.cpp.tools.common; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +public class Headers implements FileActor { + private ArrayList instanceMethods = new ArrayList(); + + private ArrayList staticMethods = new ArrayList(); + + private ArrayList allMethods = new ArrayList(); + + private ArrayList classNames = new ArrayList(); + + private boolean failed = false; + + public void actOnFile(File header, File ignored, int depth) + throws Exception { + if (Configuration.fileExcluded(header.getName())) { + Utils.outputDebugString("excluding " + header + "..."); + return; + } + + Utils.outputDebugString("pre-parsing " + header + "..."); + FileReader fr = null; + try { + fr = new FileReader(header); + } catch (FileNotFoundException fnfe) { + throw fnfe; + } + BufferedReader inputFile = new BufferedReader(fr); + + try { + InputCppSourceCode code = new InputCppSourceCode(inputFile, header + .getName()); + Iterator it = code.getPartIterator(); + while (it.hasNext()) { + FilePart fp = (FilePart) (it.next()); + if (fp.getType() != FilePart.PROTOTYPE) + continue; + PrototypePart pp = (PrototypePart) fp; + String className = pp.className(); + if (null == className) + continue; + String trimClassName = className; + if (className.endsWith("::")) + trimClassName = className.substring(0, + className.length() - 2); + if (!classNames.contains(trimClassName)) + classNames.add(trimClassName); + + Signature sign = new Signature(fp.toString()); + sign.setClassName(className); + //Tuscany + sign.setScope(pp.getSignature().getScope()); + sign.setNamespace(pp.getSignature().getNamespace()); + + // "Clean" the signature by stripping off attributes, + // semicolons, etc + Signature cleaned = new Signature(sign.toStringWithoutAttrs()); + //Tuscany - problem + cleaned.setClassName(className); + cleaned.setScope(pp.getSignature().getScope()); + cleaned.setNamespace(pp.getSignature().getNamespace()); + //Tuscany - end of problem + + + if (-1 == sign.getAttributes().indexOf("static")) + instanceMethods.add(cleaned); + else + staticMethods.add(cleaned); + } + } catch (ParsingException pe) { + failed = true; + } + + inputFile.close(); + allMethods.addAll(staticMethods); + allMethods.addAll(instanceMethods); + } + + public boolean failed() { + return failed; + } + + public boolean isInstanceMethod(Signature sign) { + Iterator it = instanceMethods.iterator(); + while (it.hasNext()) { + Signature s = (Signature) it.next(); + if (s.equals(sign)) + return true; + } + return false; + } + + public boolean isStaticMethod(Signature sign) { + Iterator it = staticMethods.iterator(); + while (it.hasNext()) { + Signature s = (Signature) it.next(); + if (s.equals(sign)) + return true; + } + return false; + } + + public List getMethods(String method) { + ArrayList list = new ArrayList(); + if (null == method) + return list; + + Iterator it = allMethods.iterator(); + while (it.hasNext()) { + Signature s = (Signature) it.next(); + if (method.equals(s.getMethodName())) + list.add(s); + } + return list; + } + + /** + * Tuscany change - a method to get all the method signatures at once + */ + public List getAllMethods() { + ArrayList list = new ArrayList(); + Iterator it = allMethods.iterator(); + while (it.hasNext()) { + Signature s = (Signature) it.next(); + list.add(s); + } + return list; + } + + public boolean isClassName(String text) { + return classNames.contains(text); + } +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/InputCppSourceCode.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/InputCppSourceCode.java new file mode 100644 index 0000000000..225909e1d1 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/InputCppSourceCode.java @@ -0,0 +1,425 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +/* + * Branched from the original class that was also contributed to the + * org.apache.axis.tools.common package. + */ +package org.apache.tuscany.sca.cpp.tools.common; + +import java.io.BufferedReader; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.StringTokenizer; + +public class InputCppSourceCode { + + private ArrayList parts = new ArrayList(); + + private String name; + + public InputCppSourceCode(BufferedReader br, String name) throws Exception { + this.name = name; + + String s = null; + StringBuffer buff = new StringBuffer(); + for (int i = 1;; i++) { + try { + s = br.readLine(); + } catch (Exception e) { + System.err.println("Ignoring exception thrown parsing file " + + name + " line number " + i); + e.printStackTrace(); + break; + } + if (s == null) + break; + buff.append(s + "\n"); + } + String str = buff.toString(); + + // TODO: When checking for rest.startsWith("struct") should + // check the next letter after struct is not alphanumeric otherwise + // we'll get false matches on a function called structify() for + // instance. Also applies to enum, union, public, typedef, etc + + String rest, text = ""; + int scopedepth = 0; + String scope = "public"; + String currentClass = null; + String currentNamespace = null; + for (int idx = 0; idx < str.length(); /* No idx++ */ + ) { + rest = str.substring(idx); + if (Character.isWhitespace(rest.charAt(0))) { + int ridx = 0; + while (ridx < rest.length() + && Character.isWhitespace(rest.charAt(ridx))) + ridx++; + text = rest.substring(0, ridx); + FilePart fp = new FilePart(text, FilePart.WHITESPACE); + parts.add(fp); + idx += ridx; + + } else if (rest.startsWith("/*")) { + int ridx = rest.indexOf("*/"); // Don't use Utils here + text = str.substring(idx, idx + ridx + 2); + FilePart fp = new FilePart(text, FilePart.COMMENT); + parts.add(fp); + idx += text.length(); + + } else if (rest.startsWith("//")) { + text = str.substring(idx, idx + rest.indexOf("\n")); + FilePart fp = new FilePart(text, FilePart.COMMENT); + parts.add(fp); + idx += text.length(); + + } else if (rest.startsWith("#")) { + int ridx = rest.indexOf("\n"); + char c = rest.charAt(ridx - 1); + while (-1 != ridx && '\\' == c) { + String rest2 = rest.substring(ridx + 1); + ridx += rest2.indexOf("\n") + 1; + c = rest.charAt(ridx - 1); + } + text = str.substring(idx, idx + ridx); + FilePart fp = new FilePart(text, FilePart.DIRECTIVE); + parts.add(fp); + idx += text.length(); + + } else if (rest.startsWith("}")) { + if (scopedepth <= 0) //Tuscany need to increase scopedepth for + // namespaces? + Utils.rude("Braces do not match", name, lineNo(str, idx), + rest.substring(0, rest.indexOf("\n"))); + else + scopedepth--; + // TODO: better checking that this brace really ends the class + if (0 == scopedepth) + currentClass = null; + scope = "public"; + parts.add(new FilePart("}", FilePart.ENDSCOPE)); + idx++; + + } else if (rest.startsWith(";")) { + parts.add(new FilePart(";", FilePart.FIELD)); + idx++; + + } else if (!Character.isLetter(rest.charAt(0)) + && '~' != rest.charAt(0) && '_' != rest.charAt(0)) { + Utils.rude("Lines must start with a letter ", name, lineNo(str, + idx), rest.substring(0, rest.indexOf("\n"))); + + } else if (MacroPart.isAMacro(rest)) { + MacroPart mp = MacroPart.create(rest); + parts.add(mp); + idx += mp.length(); + + } else if (beginsScope(rest)) { + + //Tuscany a namespace comes in here + scopedepth++; + text = rest.substring(0, Utils.indexOf(rest, "{") + 1); + FilePart fp = new FilePart(text, FilePart.BEGINSCOPE); + parts.add(fp); + idx += text.length(); + if (Utils.startsWith(text, "class")) { + // TODO: cope with comments here + // TODO: split out classes into a ClassPart + StringTokenizer st = new StringTokenizer(text, + Utils.whitespace + ":{"); + st.nextToken(); // step over "class" + while (st.hasMoreTokens()) { + String word = st.nextToken(); + if (Configuration.isAttribute(word)) + continue; + currentClass = word; + break; + } + } + + //Tuscany + if (Utils.startsWith(text, "namespace")) { + // TODO: cope with comments here + StringTokenizer st = new StringTokenizer(text, + Utils.whitespace + "{"); + st.nextToken(); // step over "namespace" + String word = ""; + while (st.hasMoreTokens()) { + word = st.nextToken(); + if (word.equals("{")) { + break; + } + + } + + if(currentNamespace == null) + { + currentNamespace = word; + } + else + { + currentNamespace += "::" + word; + } + //We have not got to the class yet + //so will need ot deal with the namespace + //when we do + } + // Tuscany end + + } else if (isEnumOrUnion(rest)) { + int ridx = Utils.findMatching(rest, '{', '}') + 1; + String rest2 = rest.substring(ridx); + ridx = idx + ridx + Utils.indexOf(rest2, ';') + 1; + text = str.substring(idx, ridx); + FilePart fp = new FilePart(text, FilePart.ENUM); + parts.add(fp); + idx += text.length(); + + } else if (scopedepth > 0 + && (rest.startsWith("public") + || rest.startsWith("protected") || rest + .startsWith("private"))) { + int colon = rest.indexOf(":"); + if (-1 == colon) + Utils.rude("No colon found after public or private ", name, + lineNo(str, idx), rest.substring(0, rest + .indexOf("\n"))); + scope = str.substring(idx, idx + colon); + text = str.substring(idx, idx + colon + 1); + FilePart fp = new FilePart(text, FilePart.CLASSATTRIBUTE); + parts.add(fp); + idx += text.length(); + + } else if (Utils.startsWith(rest, "typedef")) { + int semicolon = Utils.indexOf(rest, ';'); + int brace = Utils.indexOf(rest, '{'); + + if (-1 == semicolon) + Utils.rude("No semicolon found after typedef", name, + lineNo(str, idx), rest.substring(0, rest + .indexOf("\n"))); + + if (-1 == brace || semicolon < brace) { + // Simple typedef + text = str.substring(idx, idx + semicolon + 1); + } else { + // Typedef of a struct, etc + int endbrace = Utils.findMatching(rest, '{', '}'); + String rest2 = rest.substring(endbrace); + semicolon = Utils.indexOf(rest2, ';'); + text = str.substring(idx, idx + endbrace + semicolon + 1); + } + FilePart fp = new FilePart(text, FilePart.TYPEDEF); + parts.add(fp); + idx += text.length(); + + } else { + if (isMethod(rest)) { + + int brace = Utils.indexOf(rest, '{'); + Signature signature = new Signature(str.substring(idx, idx + + brace)); + if (signature.failed()) + Utils.rude("Signature parsing failed", name, lineNo( + str, idx), signature.getOriginal()); + if (null != currentClass + && null == signature.getClassName()) + signature.setClassName(currentClass); + signature.setScope(scope); + signature.setNamespace(currentNamespace); + + String body = rest.substring(brace); + int endBrace = Utils.findMatching(body, '{', '}'); + body = body.substring(0, endBrace + 1); + int endIdx = idx + signature.originalLength() + + body.length(); + text = str.substring(idx, endIdx); + MethodPart mp = new MethodPart(text, signature, body); + parts.add(mp); + idx += text.length(); + + } else if (isField(rest)) { + int semicolon = Utils.indexOf(rest, ';'); + text = str.substring(idx, idx + semicolon + 1); + FilePart fp = new FilePart(text, FilePart.FIELD); + parts.add(fp); + idx += text.length(); + + } else if (isPrototype(rest)) { + int semicolon = Utils.indexOf(rest, ';'); + text = str.substring(idx, idx + semicolon + 1); + PrototypePart pp = new PrototypePart(text, currentClass, currentNamespace); + pp.setScope(scope); + parts.add(pp); + idx += text.length(); + + } else { + //TODO other file parts here - not sure if there are any + // others? + Utils.rude("Unrecognised file part", name, + lineNo(str, idx), rest.substring(0, rest + .indexOf("\n"))); + } // end if + } // end if + } // end for + } + + public Iterator getPartIterator() { + return parts.iterator(); + } + + private int lineNo(String s, int idx) { + int n = 0; + for (int i = 0; i < idx && i < s.length(); i++) + if ('\n' == s.charAt(i)) + n++; + return n; + } + + /** + * Find out whether we are defining a class, struct or extern "C" which may + * contain function implementations. These will have braces which begin a + * new scope. Ignore function prototypes that return a struct. struct mystr { + * int f1; }; struct mystr func(); struct mystr func() { struct mystr a; + * return a; } + */ + private static boolean beginsScope(String s) throws ParsingException { + if (isMethod(s)) + return false; + + int brace = Utils.indexOf(s, '{'); + int semicolon = Utils.indexOf(s, ';'); + + // Return false for class prototypes, but true for class definitions. + if (Utils.startsWith(s, "class")) { + if (-1 == brace) + return false; + if (-1 == semicolon) + return true; + return brace < semicolon; + } + + if (Utils.startsWith(s, "struct")) { + if (-1 == brace || -1 == semicolon) + return false; + return brace < semicolon; + } + + //Tuscany handle namespace for prototypes + //in a similar way to "class" + if (Utils.startsWith(s, "namespace")) { + if (-1 == brace || -1 == semicolon) + return false; + return brace < semicolon; + } + + return startsWithExternScope(s); + } + + /** + * There are 4 types of extern ... extern int field; extern int func(); + * extern "C" int func() { return 2; } extern "C" { int func() { return 2; } } + * This method should return true only for the last of these three examples + * since only the last one creates a new scope using braces. + */ + private static boolean startsWithExternScope(String s) + throws ParsingException { + if (!s.startsWith("extern")) + return false; + + int brace = Utils.indexOf(s, '{'); + int semicolon = Utils.indexOf(s, ';'); + int bracket = Utils.indexOf(s, '('); + + if (-1 == brace) + return false; + return (-1 == semicolon || brace < semicolon) + && (-1 == bracket || brace < bracket); + } + + /** + * Find out whether we are defining an enum or union which will contain + * braces. Ignore function prototypes that return an enum or union. enum + * colour { red, blue }; enum colour func(); enum colour func() { return + * colour.red; } + */ + private static boolean isEnumOrUnion(String s) throws ParsingException { + if ((!Utils.startsWith(s, "enum") && !Utils.startsWith(s, "union")) + || isMethod(s)) + return false; + + int brace = Utils.indexOf(s, '{'); + int semicolon = Utils.indexOf(s, ';'); + return -1 != brace && (-1 == semicolon || brace < semicolon); + } + + /** + * Rules to recognise fields and methods... + * + * Fields must contain a semicolon Methods may or may not contain a + * semicolon Prototypes must contain a semicolon Fields may or may not + * contain a brace (array initialisers do) Methods must contain a brace + * Prototypes must not contain a brace Fields may or may not contain a + * bracket (casts do) Methods must contain a bracket Prototypes must contain + * a bracket + * + * It's a method if it contains a bracket and then a brace before the first + * semicolon (if there is a semicolon). It's a prototype if it's not a + * method and it contains brackets before a semicolon. It's a field if it's + * not a method or a prototype and it contains a semicolon. If it's not a + * field, a method or a prototype and we haven't recognised it previously + * then it's an error. + */ + private static boolean isMethod(String s) throws ParsingException { + int semicolon = Utils.indexOf(s, ';'); + int brace = Utils.indexOf(s, '{'); + int bracket = Utils.indexOf(s, '('); + + return (-1 != bracket && -1 != brace && bracket < brace && (-1 == semicolon || brace < semicolon)); + } + + private static boolean isPrototype(String s) throws ParsingException { + int semicolon = Utils.indexOf(s, ';'); + int bracket = Utils.indexOf(s, '('); + return !isMethod(s) && -1 != semicolon && -1 != bracket + && bracket < semicolon; + } + + private static boolean isField(String s) throws ParsingException { + int semicolon = Utils.indexOf(s, ';'); + return !isMethod(s) && !isPrototype(s) && -1 != semicolon; + } + + public String getName() { + return name; + } + + public String toString() { + StringBuffer text = new StringBuffer(); + for (int i = 0; i < parts.size(); i++) { + text.append(((FilePart) (parts.get(i))).toString()); + } + return text.toString(); + } + +} diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/MacroPart.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/MacroPart.java new file mode 100644 index 0000000000..317ad2fc44 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/MacroPart.java @@ -0,0 +1,87 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +/* + * Branched from the original class that was also contributed to the + * org.apache.axis.tools.common package. + */ + +/* + * A C or C++ macro as it is used in the source code + */ +package org.apache.tuscany.sca.cpp.tools.common; + +class MacroPart extends FilePart { + /** + * Factory method to create a MacroPart. + * + * @param s + * unparsed source code which may start with a define or macro. + */ + static MacroPart create(String s) { + String orig = getOriginalText(s); + if (null == orig) + return null; + return new MacroPart(orig); + } + + MacroPart(String s) { + super(s, FilePart.MACRO); + } + + /** + * @param s + * unparsed source code which may start with a define or macro. + * @return all of s up to the end of the define or macro. + */ + private static String getOriginalText(String s) { + String name = getName(s); + int len = name.length(); + if (null == name) + return null; + else if (Configuration.isDefine(name)) { + return s.substring(0, len); + } else if (Configuration.isMacro(name)) { + String rest = s.substring(len); + len += Utils.findMatching(rest, '(', ')'); + return s.substring(0, len + 1); + } else + return null; + } + + static boolean isAMacro(String s) { + if (s == null || 0 == s.length()) + return false; + String name = getName(s); + return Configuration.isMacro(name) || Configuration.isDefine(name); + } + + private static String getName(String s) { + int i; + for (i = 0; i < s.length(); i++) + if (!Character.isLetterOrDigit(s.charAt(i)) && '_' != s.charAt(i)) + break; + if (s.length() == i) + return null; + return s.substring(0, i); + } +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/MethodPart.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/MethodPart.java new file mode 100644 index 0000000000..a25610c1f9 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/MethodPart.java @@ -0,0 +1,133 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +/* + * Branched from the original class that was also contributed to the + * org.apache.axis.tools.common package. + */ +package org.apache.tuscany.sca.cpp.tools.common; + +import java.util.ArrayList; + +/** + * A C or C++ method from a piece of source code. The method has a signature and + * a body (the bit between the braces). + */ +public class MethodPart extends FilePart { + private Signature signature; + + private String body; + + MethodPart(String s, Signature signature, String body) { + super(s, METHOD); + this.signature = signature; + this.body = body; + } + + public Signature getSignature() { + return signature; + } + + public String getOriginalSignature() { + return signature.getOriginal(); + } + + /** + * Returns the method body as code snippets, each ending with a place where + * a trace statement belongs. The end of the first code snippet is where the + * entry trace should go. The end of every other snippet is a return from + * the method. + */ + public BodyPart[] getBodyParts() throws ParsingException { + String b = body; // Don't alter field member + if (b.startsWith("{")) + b = b.substring(1); + + // Add in trace exit at all the return statements in the method. + ArrayList al = new ArrayList(); + int idxR = Utils.indexOf(b, "return"); + int idxC = Utils.indexOf(b, "catch"); + while (-1 != idxR || -1 != idxC) { + if (-1 == idxC || (-1 != idxR && idxR < idxC)) { + String frag = b.substring(0, idxR); + String rest = b.substring(idxR + "return".length()); + + int semicolon = Utils.indexOf(rest, ';'); + if (-1 == semicolon) + Utils.rude("Missing semicolon in " + signature); + String retVal = rest.substring(0, semicolon); + BodyPart bp = new BodyPart(frag, retVal); + al.add(bp); + b = b.substring(idxR + "return".length() + retVal.length() + 1); + } else { + String frag = b.substring(0, idxC); + String rest = b.substring(idxC); + + int brace = Utils.indexOf(rest, "{"); + if (-1 == brace) + Utils.rude("Missing open brace in " + signature); + Signature signature = new Signature(rest.substring(0, brace)); + frag = frag + rest.substring(0, brace + 1); + BodyPart bp = new BodyPart(frag, signature.getParameters()[0]); + al.add(bp); + b = rest.substring(brace + 1); + } + idxR = Utils.indexOf(b, "return"); + idxC = Utils.indexOf(b, "catch"); + } + + // Add in trace exit before the last } if there are no returns in + // the method or there is code after the last return and the method + // returns void. + // int f1(){try{return f2();}catch(Exception& e){throw;}} + // has code after the last return but having a traceexit before the + // last brace wouldn't compile since the method returns an int. We + // cope with this by only adding in a traceexit before the last brace + // if the method returns void. That may mean we add in an unreachable + // traceexit which may give a compiler warning, but that should be + // benign. + // + // TODO: Not quite good enough for + // void f(int a){if(a){printf("a");}else{printf("!a");return;}} + // as a trace exit is needed before the last } in case a>0 but + // void f(int a){if(a){printf("a");return;}else{printf("!a");return;}} + // would give compiler warnings about unreachable code if a trace + // exit is added before the last brace. This could be tricky to fix. + if ((0 == al.size() || -1 != Utils.indexOf(b, ';')) + && null == signature.getReturnType().getType()) { + + int last = b.lastIndexOf('}'); + if (-1 == last) + Utils.rude("Missing end brace in " + signature); + String b2 = b.substring(0, last); + al.add(new BodyPart(b2)); + b = b.substring(last); + } + + // The final body part is the last } + al.add(new BodyPart(b)); + + BodyPart[] bps = new BodyPart[al.size()]; + System.arraycopy(al.toArray(), 0, bps, 0, al.size()); + return bps; + } +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Options.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Options.java new file mode 100644 index 0000000000..6e951f03de --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Options.java @@ -0,0 +1,164 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +/* + * Branched from the original class that was also contributed to the + * org.apache.axis.tools.common package. + * + */ +package org.apache.tuscany.sca.cpp.tools.common; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +/** + * Command line options passed to a tool's main program. All command line + * options should begin with a dash "-". Some command line options take a value + * which is the next parameter after the option. Others do not. + */ +public class Options { + static HashMap pairs = new HashMap(); + + static List values = new ArrayList(); + + /** + * No one constructs this class. + */ + private Options() { + } + + public static void reset() { + pairs = new HashMap(); + values = new ArrayList(); + } + + /** + * Initialises the options based on the args passed to main + */ + public static void set(String args[]) { + for (int i = 0; i < args.length; i++) { + if (args[i].startsWith("-")) { + if ((i + 1 <= args.length - 1) && // next one is testable + !args[i + 1].startsWith("-") // and it starts with a "-" + ) { + String key = args[i]; + Object pairValue = pairs.get(key); + if (null == pairValue) { + pairs.put(args[i], args[i + 1]); + } else if (pairValue instanceof String) { + List l = new ArrayList(); + l.add(pairValue); + l.add(args[i + 1]); + pairs.put(key, l); + } else if (pairValue instanceof List) { + ((List) pairValue).add(args[i + 1]); + } + i++; // Step over value for this key + } else + values.add(args[i]); + } + } + } + + public static Object getOption(String key) { + return pairs.get(key); + } + + static boolean isOptionSet(String key) { + return values.contains(key) || null!=pairs.get(key); + } + + /** + * This option will cause scagen to print out messages + * about the artefacts it is processing + * @return + */ + public static boolean verbose() { + return isOptionSet("-verbose"); + } + + /** + * This option will cause scagen to print out some + * basic internal log type messages + * @return + */ + public static boolean debug() { + return isOptionSet("-debug"); + } + + /** + * This option will cause scagen to print out some + * text that can be used or pasted into a command + * file to copy all the relevant artefacts from + * where they are found or generated to a specific + * deployment location + * + * @return + */ + public static boolean deploy() { + return isOptionSet("-deploy"); + } + + /** + * This option will prevent scagen from actually writing out + * the generated files. It is useful if used in conjunction + * with the "-deploy" option. + * @return + */ + public static boolean noGenerate() { + return isOptionSet("-nogenerate"); + } + + /** + * This option is useful only when used in conjunction with + * the "-deploy" option. It changes the output to be more like the + * source code of a command script to copy the files to a + * specific place. + * @return + */ + public static boolean outputCommand() { + return isOptionSet("-outputCommand"); + } + + /** + * This option is useful only when used in conjunction with + * the "-deploy" option. It changes the output to be a simple + * list of artefacts. It has no effect if the "-outputCommand" + * option is set. + * + * @return + */ + public static boolean list() { + return isOptionSet("-list"); + } + + /** + * This option is maintained for compatibility with the + * original package source. It is not used by new scagen code. + * + * @return + */ + public static boolean quiet() { + return isOptionSet("-quiet"); + } +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Parameter.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Parameter.java new file mode 100644 index 0000000000..2d98e0a836 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Parameter.java @@ -0,0 +1,216 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +/* + * Branched from the original class that was also contributed to the + * org.apache.axis.tools.common package. + * + */ +package org.apache.tuscany.sca.cpp.tools.common; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * A parameter from a method signature. The parameter is the datatype plus its + * name but not its value. + */ +public class Parameter { + private ArrayList type = new ArrayList(); + + private String name = null; + + private boolean failed = false; + + /** + * Defaults to a parameter in a parameter list so it HAS a parameter name in + * it + */ + Parameter(List parts) { + this(parts, false); + } + + /** + * A parameter which is a return type does not have a parameter name. + * Parameters in a parameter list do have parameter names embedded in them + */ + Parameter(List parts, boolean isRetType) { + if (parts == null || parts.size() == 0) + return; + + // Tuscany: The original code below from apache axis blocks int + // getCustomer(long) + // i.e. no spaces in parameter list. + // We do not need to deal with "..." as parameters to SCS methods. + // + // if (!isRetType && parts.size() == 1) { + // if ("...".equals(parts.get(0))) { + // type.add("..."); + // name = ""; + // } else if (!"void".equals(parts.get(0))) + // failed = true; // Seems like bad C++ code here + // return; + // } + + if (isRetType) { + Iterator it = parts.iterator(); + while (it.hasNext()) + type.add(it.next()); + + // Some methods return have void on their signature and others + // have nothing. So to make them both the same, if a method + // doesn't return anything make type null. + // TODO: This assumption is wrong - methods that return nothing + // default to returning an int! + if (1 == type.size() && "void".equals(type.get(0))) + type = new ArrayList(); + + } else { + // Cope with array subscripts [] after the name + int arrIdx = -1; + for (int i = 0; i < parts.size(); i++) { + String tok = (String) parts.get(i); + if ("[".equals(tok)) { + arrIdx = i; + break; + } + } + + // Find the name + int nameIdx = parts.size() - 1; + if (-1 != arrIdx) + nameIdx = arrIdx - 1; + + // Even in real method declarations, parameters may not have a name + boolean noName = false; + name = (String) parts.get(nameIdx); + // Tuscany: The original code below from apache axis + // was updated to work with signatures of + // the form fn(int) a non-named, no-space, parameter list. + // if (Utils.cPrimitives.contains(name) || + // Utils.cTypeQualifiers.contains(name) ) + // + if (Utils.cPrimitives.contains(name) + || Utils.cTypeQualifiers.contains(name) + || parts.size() == 1) + noName = true; + + if (noName) { + name = null; + for (int i = 0; i < parts.size(); i++) + type.add(parts.get(i)); + } else { + // Construct the type + for (int i = 0; i < nameIdx; i++) + type.add(parts.get(i)); + + if (-1 != arrIdx) + for (int i = arrIdx; i < parts.size(); i++) + type.add(parts.get(i)); + } + } + } + + public boolean failed() { + return failed; + } + + public String getType() { + String s = null; + Iterator it = type.iterator(); + while (it.hasNext()) { + String next = (String) it.next(); + if (null == s) + s = next; + else if ("*".equals(next) || "&".equals(next)) + s += next; + else + s += " " + next; + } + return s; + } + + public String getTypeWithoutConst() { + String s = null; + Iterator it = type.iterator(); + while (it.hasNext()) { + String next = (String) it.next(); + if ("const".equals(next)) + continue; + else if (null == s) + s = next; + else if ("*".equals(next) || "&".equals(next)) + s += next; + else + s += " " + next; + } + return s; + } + + public String getName() { + return name; + } + + public boolean isVoid() { + return 0 == type.size(); + } + + public boolean isDotDotDot() { + return 1 == type.size() && "...".equals(type.get(0)); + } + + /** + * For two parameters to match their types must match or both be null, but + * the parameters names don't have to match. Just because a parameter is + * called something different in a header file as in the the source file + * doesn't mean it's a different parameter. + */ + public boolean equals(Object o) { + if (null == o || !(o instanceof Parameter)) + return false; + Parameter that = (Parameter) o; + if (type.size() != that.type.size()) + return false; + for (int i = 0; i < type.size(); i++) { + String s1 = (String) type.get(i); + String s2 = (String) that.type.get(i); + if (!Utils.safeEquals(s1, s2)) + return false; + } + return true; + } + + public String toString() { + if (0 == type.size()) + return "void"; + if (null == name) + return getType(); + return getType() + " " + name; + } + + public Iterator iterator() { + if (null == type) + return null; + return type.iterator(); + } +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/ParsingException.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/ParsingException.java new file mode 100644 index 0000000000..876d2dc3e0 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/ParsingException.java @@ -0,0 +1,48 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + + +/* + * Branched from the original class that was also contributed to the + * org.apache.axis.tools.common package. + * + */ +package org.apache.tuscany.sca.cpp.tools.common; + +public class ParsingException extends Exception { + + public ParsingException() { + super(); + } + + public ParsingException(String message) { + super(message); + } + + public ParsingException(String message, Throwable cause) { + super(message, cause); + } + + public ParsingException(Throwable cause) { + super(cause); + } +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/PrototypePart.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/PrototypePart.java new file mode 100644 index 0000000000..e51b2d781c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/PrototypePart.java @@ -0,0 +1,56 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +/* + * Branched from the original class that was also contributed to the + * org.apache.axis.tools.common package. + * + */ +package org.apache.tuscany.sca.cpp.tools.common; + +/** + * A function prototype in an include file and possibly in a class definition. + */ +public class PrototypePart extends FilePart { + private Signature signature; + + public PrototypePart(String s, String className, String namespace) { + super(s, PROTOTYPE); + signature = new Signature(s); + if (null != className) + signature.setClassName(className); + if (null != namespace && namespace.length()>0) + signature.setNamespace(namespace); + } + + String className() { + return signature.getClassName(); + } + + public Signature getSignature() { + return signature; + } + + public void setScope(String scope) { + signature.setScope(scope); + } +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Signature.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Signature.java new file mode 100644 index 0000000000..d7052b7843 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Signature.java @@ -0,0 +1,506 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +/* + * Branched from the original class that was also contributed to the + * org.apache.axis.tools.common package. + * + */ +package org.apache.tuscany.sca.cpp.tools.common; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +/** + * A C or C++ method signature with the ability to parse it. TODO: properly + * support variable length argument lists using "..." TODO: passing or returning + * function pointers (hopefully not needed) TODO: Cope with ~ Classname() + */ +public class Signature { + private String originalText; + + private String attributes; + + private String className = null; + + private String namespace = null; + + private String methodName = null; + + private Parameter returnType = null; + + private Parameter[] params = null; + + private String trailingAttributes; + + private String scope = "public"; + + private boolean failed = false; + + private boolean traceable = true; + + private final static Set knownAttrs = new HashSet(Arrays + .asList(new Object[] { "public", "private", "extern", "\"C\"", + "virtual", "static", "inline" })); + + private final static Set specialOperators = new HashSet( + Arrays.asList(new Object[] { "(", ")", "*", ",", "&", "]", "[", + "=", "~" })); + + /** + * Takes an unparsed signature string and parses it. + * + * TODO: Should optionally pass in the className here in case it's an inline + * method implementation inside the class{}. Just so the className comes out + * in the trace. + */ + Signature(String s) { + originalText = s; + + try { + List tokens = tokenise(s); + + ArrayList alAttrs = new ArrayList(); + ArrayList alName = new ArrayList(); + ArrayList alParms = new ArrayList(); + ArrayList alTrailAttrs = new ArrayList(); + ArrayList alInits = new ArrayList(); + if (!splitUp(tokens, alAttrs, alName, alParms, alTrailAttrs, + alInits)) { + failed = true; + return; + } + + parseAttributes(alAttrs); + parseNameAndRetType(alName); + parseParameters(alParms); + parseTrailingAttributes(alTrailAttrs); + + // Ignore any tokens after the ) since these are (hopefully) + // constructor initialisers + + traceable = !Configuration.methodExcluded(className, methodName); + } catch (NullPointerException npe) { + failed = true; + traceable = false; + } + } + + /** + * Parse the signature into tokens. This removes whitespace and comments and + * separates out "*", ",", "(", ")", "&", "[" and "]". + */ + private static List tokenise(String s) { + ArrayList tokens = new ArrayList(); + String tok = null; + boolean space = true; + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + if (Character.isWhitespace(c)) { + space = true; + continue; + } + if (space) { + if (tok != null) + tokens.add(tok); + tok = "" + c; + } else + tok += c; + space = false; + + if (tok.endsWith("/*")) { + String sub = s.substring(i); + int endcomm = sub.indexOf("*/"); + if (endcomm == -1) + break; + i += endcomm + 1; + if (tok.equals("/*")) + tok = ""; + else + tok = tok.substring(0, tok.length() - 2); + continue; + } + + if (tok.endsWith("//")) { + String sub = s.substring(i); + int endcomm = sub.indexOf("\n"); + if (endcomm == -1) + break; + i += endcomm; + if (tok.equals("//")) + tok = ""; + else + tok = tok.substring(0, tok.length() - 1); + continue; + } + + if (tok.endsWith("::")) + space = true; + + String sc = "" + c; + if (specialOperators.contains(sc)) { + if (!tok.equals(sc)) { + tokens.add(tok.substring(0, tok.length() - 1)); + tok = sc; + } + space = true; + } + } + tokens.add(tok); + return tokens; + } + + /** + * Split up a tokenised method signature into a list of attributes, a list + * of name and return type tokens, a list of parameter tokens and a list of + * initialiser tokens. + */ + private static boolean splitUp(List tokens, List attrs, List nameAndRet, + List parms, List trailAttrs, List inits) { + + // nameStart points to the start of the return type if there is one + // else the start of the method name + int nameStart; + for (nameStart = 0; nameStart < tokens.size(); nameStart++) { + String tok = (String) (tokens.get(nameStart)); + if (!knownAttrs.contains(tok) && !Configuration.isAttribute(tok)) + break; + } + if (nameStart == tokens.size()) + return false; + + // initStart points to the initialisers, or thrown exceptions after + // the parameter list. throw is a keyword so we can safely search for + // it. + int initStart = tokens.size(); + for (int i = nameStart; i < tokens.size(); i++) { + String tok = (String) tokens.get(i); + if ((tok.startsWith(":") && !tok.startsWith("::")) + || "throw".equals(tok)) + initStart = i; + } + + int parmEnd; + for (parmEnd = initStart - 1; parmEnd > nameStart; parmEnd--) + if (")".equals(tokens.get(parmEnd))) + break; + if (parmEnd == nameStart) + return false; + + int parmStart = parmEnd; + for (parmStart = parmEnd; parmStart > nameStart; parmStart--) + if ("(".equals(tokens.get(parmStart))) + break; + + for (int i = 0; i < tokens.size(); i++) { + Object tok = tokens.get(i); + if (i < nameStart || Configuration.isAttribute((String) tok)) + attrs.add(tok); + else if (i < parmStart) + nameAndRet.add(tok); + else if (i <= parmEnd) + parms.add(tok); + else if (i < initStart) + trailAttrs.add(tok); + else + inits.add(tok); + } + return true; + } + + private void parseAttributes(List list) { + attributes = new String(); + Iterator it = list.iterator(); + while (it.hasNext()) { + if (attributes.length() > 0) + attributes += " "; + String next = (String) it.next(); + + //Tuscancy + //the scope is not present in the attributes + //but is set later in the InputCppSource contructor + if ("public".equals(next) || "protected".equals(next) + || "private".equals(next)) + scope = next; + attributes += next; + } + } + + private void parseNameAndRetType(List list) { + int size = list.size(); + int idx; + // "operator" is a key word so if it's present we know we're + // dealing with operator overloading. The operator that's been + // overloaded might have been split up into multiple tokens. + for (idx = 0; idx < size; idx++) + if ("operator".equals(list.get(idx))) + break; + + if (idx < size) { + methodName = ""; + for (int i = idx; i < size; i++) + methodName += (String) list.get(i); + } else { // No operator overloading + methodName = "" + list.get(size - 1); + idx = size - 1; + } + + // If it's a destructor, the "~" will be split out into a separate + // token, so add it onto the methodName here. + if (idx > 0 && "~".equals(list.get(idx - 1))) { + methodName = "~" + methodName; + idx--; + } + + // The class name comes before the method name + while (idx > 0 && ((String) list.get(idx - 1)).endsWith("::")) { + if (null == className) + className = (String) list.get(idx - 1); + else + className = (String) list.get(idx - 1) + className; + idx--; + } + + // Whatever's left before the classname/methodname must be the + // return type + ArrayList retParm = new ArrayList(); + for (int i = 0; i < idx; i++) + retParm.add(list.get(i)); + + returnType = new Parameter(retParm, true); + } + + /** + * Constructs the parameter list + */ + private void parseParameters(List list) { + ArrayList alParams = new ArrayList(); + Iterator it = list.iterator(); + String token = (String) it.next(); // step over the ( + while (it.hasNext() && !")".equals(token)) { + token = (String) it.next(); + + int template = 0; // Depth of template scope + boolean foundEquals = false; + // Ignore default value for an optional parameter + ArrayList parm = new ArrayList(); + while (!token.equals(")") && (!token.equals(",") || template > 0)) { + if (token.equals("=")) + foundEquals = true; + if (!foundEquals) + parm.add(token); + if (contains(token, "<")) + template++; + if (contains(token, ">")) + template--; + token = (String) it.next(); + } + + // No parameters so break out + if (token.equals(")") && 0 == parm.size()) + break; + + Parameter p = new Parameter(parm); + if (p.failed()) { + failed = true; + return; + } + + // Copes with void func(void) + if (!p.isVoid()) + alParams.add(p); + } + + int size = alParams.size(); + if (size > 0) { + params = new Parameter[size]; + System.arraycopy(alParams.toArray(), 0, params, 0, size); + } + } + + private void parseTrailingAttributes(List list) { + trailingAttributes = new String(); + Iterator it = list.iterator(); + while (it.hasNext()) { + if (trailingAttributes.length() > 0) + trailingAttributes += " "; + trailingAttributes += (String) it.next(); + } + } + + public String getOriginal() { + return originalText; + } + + public int originalLength() { + return originalText.length(); + } + + public boolean failed() { + return failed; + } + + public String getAttributes() { + return attributes; + } + + public String getClassName() { + return className; + } + + /** + * @param namespace The namespace to set. + */ + public void setNamespace(String namespace) { + this.namespace = namespace; + } + + /** + * @return Returns the namespace. + */ + public String getNamespace() { + return namespace; + } + + public String getTrimClassName() { + return trimClassName(className); + } + + public String getMethodName() { + return methodName; + } + + public Parameter getReturnType() { + return returnType; + } + + public Parameter[] getParameters() { + return params; + } + + public boolean isConstructor() { + return className != null && methodName != null + && trimClassName(className).equals(methodName); + } + + public boolean isDestructor() { + return className != null && methodName != null + && methodName.startsWith("~") + && methodName.endsWith(trimClassName(className)); + } + + private static String trimClassName(String name) { + if (name.endsWith("::")) + return name.substring(0, name.length() - 2); + return name; + } + + void setClassName(String className) { + if (null == className) + return; + if (!className.endsWith("::")) + className += "::"; + this.className = className; + } + + public String getScope() { + return scope; + } + + /** + * Sets the scope, but only if the scope is not set by an explicit attribute + * in the signature. + */ + public void setScope(String scope) { + if (-1 == attributes.indexOf(this.scope)) + this.scope = scope; + } + + /** + * Should this method be traced? + */ + public boolean traceable() { + return traceable; + } + + private static boolean contains(String src, String tgt) { + if (src == null || tgt == null) + return false; + if (-1 == src.indexOf(tgt)) + return false; + return true; + } + + public boolean equals(Object obj) { + if (null == obj || !(obj instanceof Signature)) + return false; + Signature that = (Signature) obj; + if (!Utils.safeEquals(className, that.className)) + return false; + if (!Utils.safeEquals(methodName, that.methodName)) + return false; + if (!Utils.safeEquals(returnType, that.returnType)) + return false; + if (null == params && null == that.params) + return true; + if (null != params && null == that.params) + return false; + if (null == params && null != that.params) + return false; + if (params.length != that.params.length) + return false; + for (int i = 0; i < params.length; i++) + if (!Utils.safeEquals(params[i], that.params[i])) + return false; + return true; + } + + public String toStringWithoutAttrs() { + String s = new String(); + if (returnType != null) + s += returnType + " "; + if (className != null) + s += className; + s += methodName + "("; + for (int i = 0; params != null && i < params.length; i++) { + if (i > 0) + s += ", "; + s += params[i].toString(); + } + s += ")"; + return s; + } + + public String toString() { + String s = attributes; + if (attributes.length() > 0) + s += " "; + s += toStringWithoutAttrs(); + if (trailingAttributes.length() > 0) + s += " " + trailingAttributes; + return s; + } +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Utils.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Utils.java new file mode 100644 index 0000000000..d26c5ec5ae --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Utils.java @@ -0,0 +1,556 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +/* +* Branched from the original class that was also contributed to the +* org.apache.axis.tools.common package. +* +*/ +package org.apache.tuscany.sca.cpp.tools.common; + +import java.io.File; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +//Apache Common Logging +//import org.apache.commons.logging.Log; +//import org.apache.commons.logging.LogFactory; + +/** +* Static utility methods. Some of these methods are similar to the methods on +* java.lang.String except they are aware of C/C++ comments and string literals. +* +* TODO: Many of these methods would perform better using StringBuffer not +* String +*/ +public final class Utils { + // All the C primitive data types + public final static Set cPrimitives = new HashSet(Arrays + .asList(new Object[] { "void", "byte", "char", "unsigned", + "signed", "int", "short", "long", "double", "float", + "struct", "class", "enum", "union" })); + + // All the qualifiers that can affect C types + public final static Set cTypeQualifiers = new HashSet( + Arrays.asList(new Object[] { "(", ")", "*", ",", "&", "]", "[", + "const" })); + + public final static String whitespace = " \t\r\n"; + + //private static Log log = LogFactory.getLog(CLASS.class); + + /** + * Never instantiate this class + */ + private Utils() { + } + + /** + * Is this string all whitespace? + */ + static boolean isSpace(String s) { + for (int i = 0; i < s.length(); i++) + if (!Character.isWhitespace(s.charAt(i))) + return false; + return true; + } + + // TODO look for other trailing chars like { (because of class{) + static boolean startsWith(String source, String target) { + if (source == null || target == null) + return false; + if (!source.startsWith(target)) + return false; + if (source.length() == target.length()) + return true; + if (Character.isWhitespace(source.charAt(target.length()))) + return true; + return false; + } + + /** + * Performs a C-aware version of String.indexOf(char) in that it skips + * characters in string literals and comments. + */ + static int indexOf(String s, char c) throws ParsingException { + if ('"' == c) + rude("Utils.indexOf cannot be passed quotes"); + + for (int i = 0; i < s.length(); i++) { + if (s.charAt(i) == c) + return i; + + i = skip(s.substring(i), i); + if (-1 == i) + return -1; + } + return -1; + } + + /** + * Performs a C-aware version of String.indexOf(String) in that it skips + * characters in string literals and comments and makes sure that the target + * string is not embedded in a longer word. + */ + static int indexOf(String s, String t) { + char t0 = t.charAt(0); + for (int i = 0; i < s.length(); i++) { + if (s.charAt(i) == t0 + && s.substring(i).startsWith(t)) { + + + // When finding a single non-alphanumeric character + if(t.length() == 1 && !Character.isLetterOrDigit(t0)) + return i; + + // When finding an alphanumeric string + if((0 == i || !Character.isLetterOrDigit(s.charAt(i - 1))) // Check we're matching at the start of a word + && (s.length() == (i + t.length()) || !Character + .isLetterOrDigit(s.charAt(i + t.length())))) // Check we're still matching by the end of the word + return i; + } + + i = skip(s.substring(i), i); + if (-1 == i) + return -1; + } + return -1; + } + + /** + * Matches braces or quotes and is C-aware. It skips characters in string + * literals and comments. + */ + static int findMatching(String s, char c1, char c2) { + int depth = 0; + for (int i = 0; i < s.length(); i++) { + if (s.charAt(i) == c1) + depth++; + else if (s.charAt(i) == c2) { + depth--; + if (depth == 0) + return i; + } else { + i = skip(s.substring(i), i); + if (-1 == i) + return -1; + } + } + return -1; + } + + /** + * Failed to parse the source code for some reason. This method prints out a + * suitably rude message, and then what? I haven't quite decided yet. + * + * TODO: Do something sensible here like throw an Exception which will give + * up on this file completely and tidy up the output file. It may be just + * too dangerous to try to carry on. But we need to fail in such a way that + * the build system knows that we've failed for this file and can build this + * file without trace. + */ + public static void rude(String reason, String filename, int lineno, + String codefragment) throws ParsingException { + + String text = "Bad C++ code!! "; + if (reason != null) + text += reason; + if (filename != null) + text += " " + filename + " lineno=" + lineno; + if (codefragment != null) + text += " <" + codefragment + ">"; + System.err.println(text); + throw new ParsingException(); + } + + /** + * This method reports an error level problem + * + * @param reason + * why we have an error level problem + */ + public static void rude(String reason) throws ParsingException { + // Apache commons logging + // log.error(Object line, null); + // or for now.... + rude(reason, null, 0, null); + } + + /** + * This method reports an error level problem + * + * @param reason + * why we have an error level problem + */ + public static void screenMessage(String msg) { + // Apache commons logging + // log.error(Object line, null); + // or for now.... + System.out.println(msg); + } + + /** + * Escapes special characters like " so that they can be output in a C + * string literal. Also removes newlines, since C string literals can't be + * split over lines. + */ + String pretty(String s) { + StringBuffer sb = new StringBuffer(s); + for (int i = 0; i < sb.length(); i++) + switch (sb.charAt(i)) { + case '"': + sb = sb.insert(i, '\\'); + i++; + break; + case '\n': + sb = sb.deleteCharAt(i); + i--; + break; + } + return sb.toString(); + } + + private static boolean startsWithComment(String s) { + if (null == s || s.length() < 2) + return false; + if (s.startsWith("//")) + return true; + if (s.startsWith("/*")) + return true; + return false; + } + + private static int endOfComment(String s) { + int idx; + if (s.startsWith("//")) + idx = s.indexOf("\n"); + else { + idx = s.indexOf("*/"); + if (-1 != idx) + idx++; // Step over */ + } + return idx; + } + + private static boolean startsWithStringLiteral(String s) { + if (null == s || s.length() < 1) + return false; + if (s.startsWith("\"") || s.startsWith("'")) + return true; + return false; + } + + private static int endOfStringLiteral(String s) { + boolean escape = false; + char c0 = s.charAt(0); + for (int i = 1; i < s.length(); i++) { + if (!escape && s.charAt(i) == c0) + return i; + + // \" or \' does not end the literal + if ('\\' == s.charAt(i)) + // Escaping a \ should switch escape off so \\' does end + // the literal + escape = !escape; + else + escape = false; + } + return -1; + } + + /** + * If the String s starts with a string literal or a comment, return i plus + * the index of the end of the literal or comment. String literals are + * enclosed in " or ' and comments start with /* or //. + */ + private static int skip(String s, int i) { + int j = 0; + if (startsWithStringLiteral(s)) { + j = endOfStringLiteral(s); + if (-1 == j) + return -1; + } else if (startsWithComment(s)) { + j = endOfComment(s); + if (-1 == j) + return -1; + } + return i + j; + } + + /** + * A better method than .equals() because it doesn't NullPointerException + * when one of the parameters is null. + */ + public static boolean safeEquals(Object o1, Object o2) { + if (null == o1 && null == o2) + return true; + if (null == o1 && null != o2) + return false; + if (null != o1 && null == o2) + return false; + return o1.equals(o2); + } + + public static void outputDebugString(String line) { + if (!Options.quiet()) { + if (Options.debug()) + // Apache commons logging + // log.debug(Object line, null); + // or for now + System.out.println(line); + } + } + + /** + * This static method allows different parts of the code to inform about + * significant events. Code interested in specific types of event can + * register a listener against that type (not written yet) + * + * @param eventType + * An int type enum indicating the type of event. + * @param message + * A message that can be output to the user. + */ + public static final int EVENT_TYPE_XML_ITEM_PARSED = 1; + + public static final int EVENT_TYPE_FILE_PARSED = 2; + + public static final int EVENT_TYPE_FILE_CREATE = 3; + + public static final int VERBOSE_LIMIT = 1024; + + public static final int DEPLOYMENT_ARTEFACT = VERBOSE_LIMIT; + + public static final int DEPLOYMENT_ARTEFACT_ENCOUNTERED = DEPLOYMENT_ARTEFACT + 1; + + public static final int DEPLOYMENT_ARTEFACT_GENERATED = DEPLOYMENT_ARTEFACT + 2; + + public static final int DEPLOYMENT_INPUT_DIRECTORY = DEPLOYMENT_ARTEFACT + 3; + + public static final int DEPLOYMENT_OUTPUT_DIRECTORY = DEPLOYMENT_ARTEFACT + 4; + + private static boolean reportArtefacts = false; + + /** + * An easily callable method to allow tracking/reposting of events in scagen + * and other tools. + * + * @param eventType + * used for classifying event + * @param message + * a user readable message + */ + public static void postEvent(int eventType, String message) { + if (Options.verbose() && eventType < VERBOSE_LIMIT) { + screenMessage(message); + } + + if ((eventType & DEPLOYMENT_ARTEFACT) > 0) { + reportArtefact(message, eventType); + } + + } + + /** + * @param message + * The user message + * @param eventType + * The type of event (input or output). This is used to determine + * if the path name of the file starts with the COMPOSITE_ROOT + * directory or the given output directory as the one of these + * prefixes is removed from the path name in order to give the + * new (destination) path relative to the new composite root + * + * + */ + + static String scagenInputDir = "COMPOSITE_ROOT"; + + static String scagenOutputDir = "SCAGEN_OUTPUT"; + + static String newCompositeRoot = "NEW_COMPOSITE_ROOT"; + + static String generatedDirName = "$sourceDir1"; + + private static void reportArtefact(String message, int eventType) { + + if (Utils.isReportArtefacts()) { + + // Changing the value of the variable below will alter the output of + // the + // deploy assist strings: + // true will result in a "copy source NEW_COMPOSITE_ROOT\dest" output + // and + // false will result in a "inputDir c:\fred" + // "outputDir c:\bob" + // "input c:\fred\sca.composite" + // "output c:\bob\proxy.h" type output + String command = null; + + try { + newCompositeRoot = (String) Options.getOption("-deploy"); + command = (String) Options.getOption("-command"); + } catch (Exception e) { + // let it default + } + + if (null == newCompositeRoot) { + newCompositeRoot = "DEPLOY_COMPOSITE_ROOT"; + } + + if (null == command) { + command = "copy"; + } + + if (Options.outputCommand()) { + + String tail = message; + switch (eventType) { + case DEPLOYMENT_ARTEFACT_ENCOUNTERED: + if (message.startsWith(scagenInputDir)) { + tail = message.substring(scagenInputDir.length()); + } + + String dest = joinPathElements(newCompositeRoot, tail); + + System.out.println(command + " " + platformSlashes(message) + + " " + platformSlashes(dest)); + break; + + case DEPLOYMENT_ARTEFACT_GENERATED: + if (message.startsWith(scagenOutputDir)) { + tail = message.substring(scagenOutputDir.length()); + } + + dest = joinPathElements(newCompositeRoot, tail); + System.out.println(command + " " + platformSlashes(message) + + " " + platformSlashes(dest)); + break; + case DEPLOYMENT_INPUT_DIRECTORY: + scagenInputDir = message; + //System.out.println("inputDir " + message); + break; + case DEPLOYMENT_OUTPUT_DIRECTORY: + scagenOutputDir = message; + //System.out.println("outputDir " + message); + break; + default: + break; + } + + } else { + + if (Options.list()) { + switch (eventType) { + case DEPLOYMENT_ARTEFACT_ENCOUNTERED: + case DEPLOYMENT_ARTEFACT_GENERATED: + System.out.println(platformSlashes(message)); + break; + case DEPLOYMENT_INPUT_DIRECTORY: + case DEPLOYMENT_OUTPUT_DIRECTORY: + default: + break; + } + } else { + switch (eventType) { + case DEPLOYMENT_ARTEFACT_ENCOUNTERED: + //TODO make efficient + System.out.println("$sourceDir1" + + platformSlashes(message.substring(scagenInputDir.length()))); + break; + case DEPLOYMENT_ARTEFACT_GENERATED: + //TODO make efficient + System.out.println(generatedDirName + + platformSlashes(message.substring(scagenOutputDir.length()))); + break; + case DEPLOYMENT_INPUT_DIRECTORY: + scagenInputDir = platformSlashes(message); + System.out.println("sourceDir1=" + scagenInputDir); + break; + case DEPLOYMENT_OUTPUT_DIRECTORY: + scagenOutputDir = platformSlashes(message); + if (!scagenInputDir.equals(scagenOutputDir)) { + generatedDirName = "$sourceDir2"; + System.out.println("sourceDir2=" + scagenOutputDir); + } else { + //generatedDirName = "sourceDir1"; + } + break; + default: + break; + } + } + } + } + } + + /** + * @param tail + * @param tail + * @return + */ + public static String joinPathElements(String root, String tail) { + String separator; + // Stick in a "/" (File.separator) if required. + if ((tail.substring(0, 1).equals("/") || newCompositeRoot.substring( + root.length() - 1, root.length()).equals("/")) + || (tail.substring(0, 1).equals("\\") || root.substring( + root.length() - 1, root.length()).equals("\\")) + + ) { + separator = ""; + } else { + separator = File.separator; + } + String dest = newCompositeRoot + separator + tail; + return dest; + } + + /** + * @param reportArtefacts + * The reportArtefacts to set. + */ + public static void setReportArtefacts(boolean reportArtefacts) { + Utils.reportArtefacts = reportArtefacts; + } + + /** + * @return Returns the reportArtefacts. + */ + private static boolean isReportArtefacts() { + return reportArtefacts; + } + + private static String platformSlashes(String path) { + if (null == path) { + return path; + } + // We need a double level of \\ escapes if the slashes are + // this way round. + String separatorForRegex = File.separator + .replaceAll("\\\\", "\\\\\\\\"); + return path.replaceAll("[/\\\\]+", separatorForRegex); + + } + +} diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/package.html b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/package.html new file mode 100644 index 0000000000..c423477193 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/package.html @@ -0,0 +1,58 @@ + + + + + +Design documentation for org\apache\tuscany\sca\cpp\tools\common + + + + +
+ +

Overview

+ +This package can be used to reflect across C++ source code. It can produce +a network of descriptive objects describing C++ Headers, Signatures, Parameters and so +on that it finds in a given location of the file system. +Each of the descriptive objects has a set of getters that return either +the descriptive child objects, or for primitives, the string that represents the actual +value such as "int" or "myFunction". +

+There are also various utility methods that help with navigating the information, for example the Signature +class has an isConstructor method. The API Javadoc contains further details of these. +

+The package can scan a directory using a file mask to identify what types +of files are to be scanned. In this application we are interested only +in the function prototypes in the C++ header files. +

+The implementation was originated using some java code that was also +contributed to the Apache org.apache.axis.tools.common package. Care +has been taken that the original code was not sourced via Apache. If +this project is adopted by Apache then it is very possible that this +package could be merged with or made obsolete by org.apache.axis.tools.common +and because of this the design and interfaces have been preserved from +the original code as much as possible. + +

+

+ + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ComponentDomNodeHandler.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ComponentDomNodeHandler.java new file mode 100644 index 0000000000..28974b41a6 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ComponentDomNodeHandler.java @@ -0,0 +1,366 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +package org.apache.tuscany.sca.cpp.tools.services; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.apache.tuscany.sca.cpp.tools.common.Headers; +import org.apache.tuscany.sca.cpp.tools.common.Signature; +import org.apache.tuscany.sca.cpp.tools.common.Utils; +import org.w3c.dom.Node; + +/** + * This class will do the required processing for the element of a + * sca composite file. + */ +public class ComponentDomNodeHandler extends GenericDomNodeHandler { + + /** + * This method will do the "normal" processing and then trigger a call to + * processComponentNode. + * + * @param node + * the node being processed + * @param contextXPath + * the XPath to the node + * @param handlers + * the map pf element names to DomNodeHandlers + * @param parameters + * a map of XPaths to parameters values found so far + */ + + public void handleNode(Node node, String contextXPath, Map handlers, + Map parameters) { + + // Pick up attrs and the interface.cpp child elements + super.handleNode(node, contextXPath, handlers, parameters); + + try { + //OK now go and create the wrapper and proxy for the service + processComponentNode(contextXPath, parameters); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + /** + * This method basically moved from the text names of things to operating on + * the actual Files. It will also verify or work out the correct class name + * for the implmentation and complain if this does match at least one + * potential service method in the class. + * + * @param contextXPath + * used to pull the correct values from the parameters map (as + * there can be multiple implementation.cpp elelements in there). + * @param parameters + * a map of XPath keys to attribute values + * @throws Exception + */ + private void processComponentNode(String contextXPath, Map parameters) + throws Exception { + + String implHeader = (String) parameters.get(contextXPath + + "/implementation.cpp/@header"); + String implClass = (String) parameters.get(contextXPath + + "/implementation.cpp/@class"); + + File compositeOrFragmentFile = (File) parameters + .get("compositeOrFragmentFile"); + File implHeaderFile = null; + if (null != compositeOrFragmentFile) { + File dir = compositeOrFragmentFile.getParentFile(); + implHeaderFile = new File(dir, implHeader); + } else { + throw new InternalError( + "Internal error: composite or fragment file not present in internal parameters"); + } + + try { + String resolvedImplClassName = getClassName(implHeaderFile, + implClass); + + // Check or retrieve the impl Class name. + if (null == resolvedImplClassName) { + try { + //A class attribute was set but there were no methods of + // the + // class in the header + System.out + .println("Classname given (" + + implClass + + ") does not match any header file method's classes in file: " + + implHeaderFile.getCanonicalPath()); + } catch (IOException e) { + System.out + .println("Classname given (" + + implClass + + ") does not match any header file method's classes in file: " + + implHeaderFile.getAbsolutePath()); + } + return; + } else { + File target = (File) parameters.get("targetFile"); + // go into the .componentType file and generate the cpp + processComponentTypeFile(implHeaderFile, target, + resolvedImplClassName); + + } + } catch (Exception e) { + String compName = (String) parameters + .get("/compositeFragment/component/@name"); + Utils + .screenMessage("Problem interpreting header or class attributes in " + + compName + + " component, in " + + compositeOrFragmentFile.getPath() + " file"); + System.exit(-2); + } + + } + + /** + * The purpose of this method is to move from the DOM parameters to dealing + * with the actual Files involved. It is from this method that we kick off + * the processing of the componentType file. + * + * @param header + * the implementation header + * @param target + * the directory for the output + * @param implClass + * @throws Exception + */ + private void processComponentTypeFile(File header, File target, + String implClass) throws Exception { + + // The componentType files should be in the same dir as the Impl + // header... + if (header == null || target == null) { + return; + } + + File componentTypeDirectory = header.getParentFile(); + String headerFileName = header.getName(); + String componentTypeName = headerFileName.substring(0, headerFileName + .lastIndexOf(".")); + + File componentTypeFile = new File(componentTypeDirectory, + componentTypeName + ".componentType"); + + ComponentTypeFileHandler ctParser = new ComponentTypeFileHandler(); + + // The implClass is used in the generated wrapper code so we need to + // store + // it so we can tunnel through the standard actOnFile signature. + + int namespaceEnd = -1; + if (null != implClass) { + namespaceEnd = implClass.lastIndexOf("::"); + } + + String namespace = null; + + if (-1 != namespaceEnd) { + namespace = implClass.substring(0, namespaceEnd); + ctParser.setParameter("implNamespace", namespace); + implClass = implClass.substring(namespaceEnd + 2); + } + + if (implClass != null) { + ctParser.setParameter("implClass", implClass); + } + + try { + ctParser.handleComponentTypeFile(componentTypeFile, target); + } catch (Exception e) { + Utils + .screenMessage("There has been a problem parsing the componentType file: " + + componentTypeFile.getCanonicalPath()); + Utils.screenMessage(" the reported errors is " + + e.getLocalizedMessage()); + Utils.screenMessage(" and the java exception stack is below."); + e.printStackTrace(); + throw e; + } + } + + /** + * The resolve and check the classname of the service. If we have an + * implementation class name we have to check that there is: at least one + * (non-private, non constructor or finalizer) method of that class in the + * header If there is no implementation class then we will return the class + * of the first non-private/constructor/finalizer method we find. + * + * @param header + * @param implementationCppClass + * @return + * @throws Exception + */ + private String getClassName(File header, String implementationCppClass) + throws Exception { + String methodClassName = null; + List methods = null; + + if (null == header) { + return null; + } + + Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_ENCOUNTERED, header + .getAbsolutePath()); + Utils.postEvent(Utils.EVENT_TYPE_FILE_PARSED, + "Scagen processing C++ implementation header " + + header.getAbsolutePath()); + + try { + Headers headers = new Headers(); + + headers.actOnFile(header, null, 1); + + methods = headers.getAllMethods(); + + } catch (FileNotFoundException fnfe) { + String path; + try { + path = header.getCanonicalPath(); + } catch (IOException e1) { + path = header.getPath(); + } + Utils.screenMessage("The header file: " + path + + " referenced cannot be found."); + throw fnfe; + } catch (Exception e) { + String path = header.getPath(); + Utils.screenMessage("The header file: " + path + + " referenced is not valid. Reason given is " + + e.getLocalizedMessage()); + throw e; + } + + // We need at least some methods + if (null == methods) { + return null; + } + + // We need at least one service method of to do anything + methods = trimMethodsOfPrivatesConstructorsAndDestrutors(methods); + if (null == methods || methods.size() == 0) { + return null; + } + + // If the user specifies an implementation class then we need at + // least one service method of that class + if (implementationCppClass != null) { + methods = filterMethodsToOneClass(methods, implementationCppClass); + + if (null == methods || methods.size() == 0) { + return null; + } else { + // There was at least one method of the correct type + return implementationCppClass; + } + } else { + // Implementation class is null so we return the fully qualified classname of the + // first service method + Signature s = (Signature) methods.get(0); + String className = s.getTrimClassName(); + String namespace = s.getNamespace(); + if( namespace != null && namespace.length() > 0) + { + className = namespace + "::" + className; + } + + return className; + } + } + + /** + * Filter the mthods supplied to only ones fo the supplied class. + * + * @param methods + * the list of methods + * @param implementationCppClass + * the class we wish + * @return a list of methods of the correct class + */ + private List filterMethodsToOneClass(List methods, + String implementationCppClass) { + + if (null == methods) { + return null; + } + + if (null == implementationCppClass + || implementationCppClass.length() == 0) { + return null; + } + + for (Iterator iter = methods.listIterator(); iter.hasNext();) { + Signature method = (Signature) iter.next(); + + String className = method.getTrimClassName(); + String namespace = method.getNamespace(); + + if (namespace != null && namespace.length() > 0) { + className = namespace + "::" + className; + } + + if (!implementationCppClass.equals(className)) { + iter.remove(); + } + } + + return methods; + + } + + /** + * This method removes contructor and destructor methods from the list. + * + * @param methods + * the list of methods + * @return + */ + private List trimMethodsOfPrivatesConstructorsAndDestrutors(List methods) { + + if (null == methods) { + return null; + } + + for (Iterator iter = methods.listIterator(); iter.hasNext();) { + Signature method = (Signature) iter.next(); + + if (method.isConstructor() || method.isDestructor()) { + iter.remove(); + } + } + + return methods; + } + +} diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ComponentTypeFileHandler.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ComponentTypeFileHandler.java new file mode 100644 index 0000000000..6c86fa25b5 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ComponentTypeFileHandler.java @@ -0,0 +1,130 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +package org.apache.tuscany.sca.cpp.tools.services; + +import java.io.File; + +import org.apache.tuscany.sca.cpp.tools.common.FileActor; +import org.apache.tuscany.sca.cpp.tools.common.Utils; + +/** + * The purpose of this class is to specialise the map of XML element handlers + * for a XXX.componentType file that is used by the XMLFileActor + */ +public class ComponentTypeFileHandler extends XMLFileActor { + + static { + // We set up a map for each element type we wish to handle + // this alows the XML handling code to be generic and type free + // while the handlers don't have to do mcuh XML handling. + + GenericDomNodeHandler gdnh = new GenericDomNodeHandler(); + handlers.put("componentType", gdnh); + handlers.put("interface.cpp", gdnh); + + ServiceDomNodeHandler sdnh = new ServiceDomNodeHandler(); + handlers.put("service", sdnh); + + ReferenceDomNodeHandler rdnh = new ReferenceDomNodeHandler(); + handlers.put("reference", rdnh); + } + + /** + * This method just exists to add the default starting depth of 1 to the + * underlying actOnFile interface + * + * @param componentTypeXML + * @param target + * @throws Exception + */ + public void handleComponentTypeFile(File componentTypeXML, File target) + throws Exception { + // We have already set up the XML element handlers. + actOnFile(componentTypeXML, target, 1); + // We need do no more, the service and reference handlers + // ServiceDomNodeHandler and ReferenceDomNodeHandler + // will take appropriate action. + } + + /** + * This method is the main FileActor method + * + * @see FileActor#actOnFile(File, File, int) Here we create an initial DOM + * and kick off the processing (using the handler map that has been set + * up by the concrete subclass). + * + * @param compositeXML + * the composite or fragment file + * @param target + * the target directory + * @param depth + * not uesed here but in the + * @see FileActor#actOnFile(File, File, int) interface to allow for + * recursive diving into a directory structure. + */ + public void actOnFile(File fileXML, File target, int depth) + throws Exception { + + if (null == fileXML || null == target) { + return; + } + + parameters.put("componentTypeFile", fileXML); + + Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_ENCOUNTERED, fileXML.getAbsolutePath()); + Utils.postEvent(Utils.EVENT_TYPE_FILE_PARSED, "Scagen processing SCA componentType file " + fileXML.getAbsolutePath()); + + super.actOnFile(fileXML, target, depth); + + } + + /** + * @return an error message - usually over-ridden. + */ + protected String getContextMessage() { + + String composite = ((File) parameters.get("compositeOrFragmentFile")).getPath(); + if (null == composite) { + composite = "unknown"; + } + + String component = (String) parameters.get("/composite/component/@name"); + if (null == component) { + component = (String) parameters + .get("/compositeFragment/component/@name"); + } + if (null == component) { + composite = "unknown"; + } + + String msg = "when processing composite " + composite; + + msg = msg + + "\nin this composite file, the component \"" + + component + + "\" has an implementation.cpp element with a header attribute \nwhere the C++ header can be found but it has no matching .componentType file present in\nthe same directory as the header."; + + return msg; + } + +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/CompositeOrFragmentFileHandler.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/CompositeOrFragmentFileHandler.java new file mode 100644 index 0000000000..3eb8dc7d98 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/CompositeOrFragmentFileHandler.java @@ -0,0 +1,91 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +package org.apache.tuscany.sca.cpp.tools.services; + +import java.io.File; + +import org.apache.tuscany.sca.cpp.tools.common.FileActor; +import org.apache.tuscany.sca.cpp.tools.common.Utils; + +/** + * The purpose of this class is purely to specialise the handler map to one with + * a specific ComponentDomNodeHandler. + */ +public class CompositeOrFragmentFileHandler extends XMLFileActor { + + static { + + GenericDomNodeHandler gdnh = new GenericDomNodeHandler(); + + /* + * We use a specific Component node handler in order to be able to + * process multiple components in the same XML file + */ + ComponentDomNodeHandler componentdnh = new ComponentDomNodeHandler(); + handlers.put("component", componentdnh); + + /* + * We are interested inthe elements below but they only need standard + * processing + */ + handlers.put("composite", gdnh); + handlers.put("compositeFragment", gdnh); + handlers.put("implementation.cpp", gdnh); + } + + /** + * This method is the main FileActor method + * + * @see FileActor#actOnFile(File, File, int) Here we create an initial DOM + * and kick off the processing (using the handler map that has been set + * up by the concrete subclass). + * + * @param compositeXML + * the composite or fragment file + * @param target + * the target directory + * @param depth + * not uesed here but in the + * @see FileActor#actOnFile(File, File, int) interface to allow for + * recursive diving into a directory structure. + */ + public void actOnFile(File compositeXML, File target, int depth) + throws Exception { + + if (null == compositeXML || null == target) { + return; + } + + parameters.put("compositeOrFragmentFile", compositeXML); + + Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_ENCOUNTERED, compositeXML + .getAbsolutePath()); + + Utils.postEvent(Utils.EVENT_TYPE_FILE_PARSED, + "Scagen processing SCA composite file " + + compositeXML.getAbsolutePath()); + + super.actOnFile(compositeXML, target, depth); + + } +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DirectoryScanner.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DirectoryScanner.java new file mode 100644 index 0000000000..9cf7952afa --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DirectoryScanner.java @@ -0,0 +1,93 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +package org.apache.tuscany.sca.cpp.tools.services; + +import java.io.File; +import java.util.Set; + +import org.apache.tuscany.sca.cpp.tools.common.FileActor; +import org.apache.tuscany.sca.cpp.tools.common.Utils; + +public class DirectoryScanner { + private FileActor actor; + + private Set actOnTheseFileExtensions; + + public DirectoryScanner(FileActor actor, Set extensions) { + this.actor = actor; + this.actOnTheseFileExtensions = extensions; + } + + /** + * + * @param source + * The composite root directory + * @param target + * The directory that will hold the generated output + * @param depth + * The depth from the initial starting point, not significant for + * the Scagen tool as we are only interested in the composite root + * directory but present due to the FileActor actOnFile interface + * method. This code is pulled from the code in the CParsingTool + * class and further work is needed to remove the duplication. + * Tnterface has been left unchanged as we hope to reconverge the + * parser here with the original one once the changes are fed + * back into the original code. + * @throws Exception + */ + public void walkTree(File source, File target, int depth) throws Exception { + depth++; + boolean noTarget = (null == target); + + if (!source.canRead()) + Utils.rude("Cannot read from source directory " + source); + if (!noTarget && !target.canWrite()) + Utils.rude("Cannot write to target directory " + target); + + if (source.isDirectory()) { + File[] filesInDirectory = source.listFiles(); + for (int i = 0; i < filesInDirectory.length; i++) { + File file = filesInDirectory[i]; + String name = file.getName(); + int dot = name.lastIndexOf('.'); + String ext = null; + if (-1 != dot) { + ext = name.substring(dot + 1); + } + + if (file.isFile() + && (actOnTheseFileExtensions == null || (!file + .isHidden() && actOnTheseFileExtensions + .contains(ext)))) { + // this is a file we need to act on! + actor.actOnFile(file, target, depth); + } + } + } else { + return; // Do not act on single files for now we expect a composite + // root directory + // and the "main" class checks its parameters to ensure this is so. + } + } + +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DomHandler.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DomHandler.java new file mode 100644 index 0000000000..0756b5fc3b --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DomHandler.java @@ -0,0 +1,83 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +package org.apache.tuscany.sca.cpp.tools.services; + +import java.util.Map; + +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * The purpose of this class it to provide a generic class that can handle both + * a DOM and a DOM node. + * + */ +public class DomHandler extends GenericDomNodeHandler { + /** + * This method will run through the initial level of the DOM using the + * handlers map + * + * @param dom + * the document being consumed + * @param handlers + * the map from element name to node handler + * @param parameters + * a map of parameters - this is often used by a handler to place + * a name-value pair, the name is often an Xpath representation + * of the location of the data in the DOM but handlers are free + * to use whatever they like - the contextXpath is generated as + * an Xpath prefix for those handlers that wish to use it. + */ + public static void handleDom(Document dom, Map handlers, Map parameters) { + if (dom != null) { + NodeList childNodes = dom.getChildNodes(); + for (int i = 0; i < childNodes.getLength(); i++) { + Node childNode = childNodes.item(i); + mapNodeToHandlerAndHandle(childNode, "/" + + childNode.getNodeName(), handlers, parameters); + } + } + } + + /** + * + * @param node + * The DOM node being consumed + * @param contextXPath + * The XPath to this node + * @param handlers + * The map from element name to node handler + * @param parameters + * A map of parameters - this is often used by a handler to place + * a name-value pair, the name is often an Xpath representation + * of the location of the data in the DOM but handlers are free + * to use whatever they like - the contextXpath is generated as + * an Xpath prefix for those handlers that wish to use it. + */ + public void handleNode(Node node, String contextXPath, Map handlers, + Map parameters) { + mapNodeToHandlerAndHandle(node, contextXPath, handlers, parameters); + } + +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DomNodeHandler.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DomNodeHandler.java new file mode 100644 index 0000000000..37c2a1a81c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DomNodeHandler.java @@ -0,0 +1,46 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +package org.apache.tuscany.sca.cpp.tools.services; + +import java.util.Map; + +import org.w3c.dom.Node; + +public interface DomNodeHandler { + + public static int ELEMENT = 1; + /** + * An interface for classes that can process DOM nodes. + * + * @param node the DOM node being consumed + * @param contextXPath the XPath to this node + * @param handlers The map from element name to node handler + * @param parameters A map of parameters - this is often used by a handler to place + * a name-value pair, the name is often an Xpath like representation of the + * location of the data in the DOM but handlers are free to use whatever + * they like - the contextXpath is generated as an Xpath prefix for those + * handlers that wish to use it. + */ + void handleNode( Node node, String contextXPath, Map handlers, Map parameters ); + +} diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/GenericDomNodeHandler.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/GenericDomNodeHandler.java new file mode 100644 index 0000000000..1ec393959d --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/GenericDomNodeHandler.java @@ -0,0 +1,220 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +package org.apache.tuscany.sca.cpp.tools.services; + +import java.io.File; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; + +import org.apache.tuscany.sca.cpp.tools.common.Utils; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * + * + * + * + */ +public class GenericDomNodeHandler implements DomNodeHandler { + /** + * This method parses the DOM attributes into name value pairs in the + * parameter map each valued keyed by its XPath. + * + * @param node + * the DOM node being processed + * @param contextPath + * the XPath to the DOM node being processed + * @param parameters + * a scratchpad map of name value pairs + */ + public void transferAttrsToParameters(Node node, String contextPath, + Map parameters) { + + if (node == null || contextPath == null || parameters == null) + return; + + NamedNodeMap attrs = node.getAttributes(); + if (attrs != null) { + for (int i = 0; i < attrs.getLength(); i++) { + Node attr = attrs.item(i); + parameters.put(contextPath + "/" + "@" + attr.getNodeName(), + attr.getNodeValue()); + + // Report the library name to the deployment tool if required. + if ("library".equals(attr.getNodeName())) { + //This is a path relative to the composite root. + //so we need to add it in. + File mod = (File) parameters.get("compositeOrFragmentFile"); + if (null != mod) { + String separatorForRegex = File.separator.replaceAll( + "\\\\", "\\\\\\\\"); + + String end = attr.getNodeValue().replaceAll("[/\\\\]+", + separatorForRegex); + + if (!end.startsWith(File.separator)) { + end = File.separator + end; + } + + String fullPath = mod.getParentFile().getAbsolutePath() + + end; + Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_ENCOUNTERED, + fullPath); + } + + } + + } + } + return; + } + + /** + * This method will iterate through the DOM node's children and call the + * appropriate handler for each one. + * + * @param node + * the DOM node being processed + * @param contextPath + * the XPath to the DOM node being processed + * @param handlers + * a map of element name to handler objects + * @param parameters + * a scratchpad map of name value pairs + */ + public void handleChildElements(Node node, String contextPath, + Map handlers, Map parameters) { + + if (node == null || contextPath == null) + return; + + NodeList children = node.getChildNodes(); + if (children != null) { + for (int i = 0; i < children.getLength(); i++) { + Node child = children.item(i); + mapNodeToHandlerAndHandle(child, contextPath + "/" + + child.getNodeName(), handlers, parameters); + } + } + return; + } + + /** + * This method will resolve any registered handler for a particular DOM + * element and call the handleNode method on it. If the handlers map has a + * mapping from "entity" to an instance of EntityHandler which implements + * the DomNodeHandler interface then any node that looks like + * + * + * Will be passed to the EntityHandler to process. + * + * @param node + * the DOM node being processed + * @param contextPath + * the XPath to the DOM node being processed + * @param handlers + * a map of element name to handler objects + * @param parameters + * a scratchpad map of name value pairs + */ + public static void mapNodeToHandlerAndHandle(Node node, String contextPath, + Map handlers, Map parameters) { + if (node != null && node.getNodeType() == DomNodeHandler.ELEMENT) { + String nodeName = node.getNodeName(); + if (nodeName != null && nodeName.length() > 0) { + DomNodeHandler handler = (DomNodeHandler) handlers + .get(nodeName); + if (handler != null) { + handler.handleNode(node, contextPath, handlers, parameters); + } + } + } + } + + /** + * This method will place the attributes in this node into the parameter map + * keyed by the XPath and recursively continue processing for any + * sub-elements of the node. + * + * @param node + * The DOM node being consumed + * @param contextXPath + * The XPath to this node + * @param handlers + * The map from element name to node handler + * @param parameters + * A map of parameters - this is often used by a handler to place + * a name-value pair, the name is often an Xpath representation + * of the location of the data in the DOM but handlers are free + * to use whatever they like - the contextXpath is generated as + * an Xpath prefix for those handlers that wish to use it. + */ + public void handleNode(Node node, String contextXPath, Map handlers, + Map parameters) { + + clearParametersAtThisXPath(contextXPath, parameters); + transferAttrsToParameters(node, contextXPath, parameters); + handleChildElements(node, contextXPath, handlers, parameters); + } + + /** + * @param contextXPath + * @param parameters + */ + private void clearParametersAtThisXPath(String contextXPath, Map parameters) { + + // TODO: Slow but works, improve parameters mechanism overall + // to make this unecessary + if (contextXPath == null || parameters == null) { + return; + } + + // We want to clear both /compositeFragment and /composite + // subtrees when we come across the root of either.. + if (contextXPath.equals("/compositeFragment")) { + //clear both this and "composite" + contextXPath = "/composite"; + } + + Set parms = parameters.entrySet(); + if (null != parms) { + Iterator iter = parms.iterator(); + Map.Entry item = null; + String thisKey; + + while (iter.hasNext()) { + item = (Entry) iter.next(); + thisKey = (String) item.getKey(); + if (thisKey.startsWith(contextXPath)) { + //System.out.println(" removing " + thisKey + " for " + + // item.getValue().toString() + " against " + contextXPath); + iter.remove(); + } + } + } + } +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/LittleClass.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/LittleClass.java new file mode 100644 index 0000000000..e7036037c6 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/LittleClass.java @@ -0,0 +1,33 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +package org.apache.tuscany.sca.cpp.tools.services; + +/** + * This class is just a convenient application class that is loaded in order to + * get the application class loader. We are interested in the application class + * loader as we use its getResource method to resolve XML files independantly of + * where they are. + */ +public class LittleClass { + +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ReferenceDomNodeHandler.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ReferenceDomNodeHandler.java new file mode 100644 index 0000000000..5631249769 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ReferenceDomNodeHandler.java @@ -0,0 +1,75 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +package org.apache.tuscany.sca.cpp.tools.services; + +import java.util.Map; + +import org.apache.tuscany.sca.cpp.tools.common.Options; +import org.w3c.dom.Node; + +/** + * The purpose of this class is to process a element in a + * componentType file and then trigger a call to the method in ServicesGenerator + * to process the interface header file + */ +public class ReferenceDomNodeHandler extends GenericDomNodeHandler { + + /* + * (non-Javadoc) + * + * @see org.apache.tuscany.sca.cpp.services.DomNodeHandler#handleNode(org.w3c.dom.Node, + * java.lang.String, java.util.Map, java.util.Map) + */ + public void handleNode(Node node, String contextXPath, Map handlers, + Map parameters) { + + // Pick up attrs and children + super.handleNode(node, contextXPath, handlers, parameters); + + //OK we know we are handling a reference + //now go and create the wrapper and proxy for it if it is a C++ reference + if(parameters.containsKey("/componentType/reference/interface.cpp/@header")) { + createProxyForReference(parameters); + } + + } + + /** + * This method is really just an adapter that adapts the -dir Option to a + * value int he parameters map for "composite_root" + * + * @param parameters + * the map of name-value parameters. + */ + private void createProxyForReference(Map parameters) { + try { + String mr = (String) Options.getOption("-dir"); + parameters.put("composite_root", mr); + ServicesGenerator.handleInterfaceHeader(parameters, true); + + } catch (Exception e) { + e.printStackTrace(); + } + + } +} diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/Scagen.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/Scagen.java new file mode 100644 index 0000000000..19e983c6b1 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/Scagen.java @@ -0,0 +1,176 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +package org.apache.tuscany.sca.cpp.tools.services; + +import java.io.File; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import org.apache.tuscany.sca.cpp.tools.common.CParsingTool; +import org.apache.tuscany.sca.cpp.tools.common.Options; +import org.apache.tuscany.sca.cpp.tools.common.Utils; + +/** + * This is the main top level class. Its purpose is to create a + * Composite/FragmentFile handler visitor and pass it to a DirectoryScanner for + * processing. + */ +public class Scagen extends CParsingTool { + + public static Set COMPOSITE_EXTENSIONS = new HashSet(Arrays + .asList(new Object[] { "composite", "fragment" })); + + /** + * @throws Exception + * + */ + public Scagen(String[] args) throws Exception { + super(args); + } + + /** + * Take a directory scanning class and create a vistor that knows how to + * handle any .composite or .fragment that the scanner comes across. + * + * @param args + * standard main args. THe values we expect in this class are + * scagen -dir input_dir -output output_dir + * + */ + public static void main(String[] args) { + boolean failed = false; + try { + Scagen env = new Scagen(args); + CompositeOrFragmentFileHandler composite_handler = new CompositeOrFragmentFileHandler(); + + // Check and access the input SCA composite directory + String name = (String) Options.getOption("-dir"); + if (null == name) { + Utils + .screenMessage("Please provide a SCA composite directory name as a \"-dir\" option."); + env.printUsage(); + System.exit(-1); + } + File source = new File(name); + if (!source.isFile() && !source.isDirectory()) { + Utils + .screenMessage("The SCA composite directory provided as the \"-dir\" option cannot be accessed,"); + Utils.screenMessage("the option given was: " + source); + env.printUsage(); + System.exit(-1); + } + + String deployDir = null; + try { + deployDir = (String) Options.getOption("-deploy"); + if (null != deployDir || Options.deploy()) { + Utils.setReportArtefacts(true); + } + } catch (Exception e) { + // let it default to null + } + + Utils.postEvent(Utils.DEPLOYMENT_INPUT_DIRECTORY, source + .getAbsolutePath()); + + // We check the -output option here as we wish to + // reuse the env.maybeCreateDirectory method + // unchanged from the original that went into axis and it will do a + // System.exit if there is no matching Option + String outputDirName = (String) Options.getOption("-output"); + if (null == outputDirName) { + Utils + .screenMessage("Please provide an output directory name for the generated files as a \"-output\" option."); + env.printUsage(); + System.exit(-1); + } + + File outputDir = new File(outputDirName); + + // Check we can create the output directory + if (outputDir == null || !outputDir.exists() && !outputDir.mkdir()) { + Utils.screenMessage("Failed to create output directory: " + + outputDirName); + env.printUsage(); + System.exit(-1); + } + + Utils.postEvent(Utils.DEPLOYMENT_OUTPUT_DIRECTORY, outputDir + .getAbsolutePath()); + + DirectoryScanner scanner = new DirectoryScanner(composite_handler, + COMPOSITE_EXTENSIONS); + scanner.walkTree(source, outputDir, 1); + + if (0 == composite_handler.getFilesActedOn()) { + Utils + .screenMessage("No SCA composite or fragment files were found in: " + + source); + } + + failed = composite_handler.failed; + + } catch (Exception exception) { + Utils + .screenMessage("Unexpected error occurred while runnning the Scagen tool. The Java exception is below."); + exception.printStackTrace(); + failed = true; + } + + if (failed) { + Utils + .outputDebugString("Finished! (but encountered problems parsing composites)"); + System.exit(-2); + } + + Utils.outputDebugString("Finished!"); + } + + /** + * Provide a hint to the user on how to call this class + */ + protected void printUsage() { + System.out + .println("usage: Java Scagen -dir -output [-verbose] [-deploy ] [-nogenerate] [-outputCommand] [-command ]"); + System.out + .println(" -dir : the SCA composite root directory"); + System.out + .println(" -output : a directory to put the generated output into"); + System.out.println(" [-verbose]: report on what scagen is doing"); + System.out + .println(" [-deploy ]: output text to help in deploying the composite's artefacts"); + System.out + .println(" [-command ]: a string that is injected into the deploy text"); + System.out + .println(" [-list]: change the deploy output text to a simple list of artefacts"); + System.out + .println(" [-outputCommand]: change the deploy output text to command text format"); + System.out + .println(" output is of form \"copy_cmd file1 file1\""); + System.out + .println(" [-nogenerate]: do not generate proxies and wrappers"); + + } + +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ServiceDomNodeHandler.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ServiceDomNodeHandler.java new file mode 100644 index 0000000000..cedb4bdb54 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ServiceDomNodeHandler.java @@ -0,0 +1,71 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +package org.apache.tuscany.sca.cpp.tools.services; + +import java.util.Map; + +import org.apache.tuscany.sca.cpp.tools.common.Options; +import org.w3c.dom.Node; + +public class ServiceDomNodeHandler extends GenericDomNodeHandler { + + /* + * (non-Javadoc) + * + * @see org.apache.tuscany.sca.cpp.services.DomNodeHandler#handleNode(org.w3c.dom.Node, + * java.lang.String, java.util.Map, java.util.Map) + */ + public void handleNode(Node node, String contextXPath, Map handlers, + Map parameters) { + + // Pick up attrs and the interface.cpp child elements + super.handleNode(node, contextXPath, handlers, parameters); + + // Only generate if this is a C++ service + if(parameters.containsKey("/componentType/service/interface.cpp/@header")) { + //OK now go and create the wrapper and proxy for the service + createWrapperAndProxyForService(parameters); + } + + } + + /** + * This method will generate the wrapper and proxy C++ and header files for + * the service. + * + * @param parameters + * a map of name-value parameters + */ + private void createWrapperAndProxyForService(Map parameters) { + + try { + String mr = (String) Options.getOption("-dir"); + parameters.put("composite_root", mr); + ServicesGenerator.handleInterfaceHeader(parameters, false); + + } catch (Exception e) { + e.printStackTrace(); + } + + } +} diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ServicesGenerator.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ServicesGenerator.java new file mode 100644 index 0000000000..956db364a1 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ServicesGenerator.java @@ -0,0 +1,831 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +package org.apache.tuscany.sca.cpp.tools.services; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import org.apache.tuscany.sca.cpp.tools.common.CParsingTool; +import org.apache.tuscany.sca.cpp.tools.common.Headers; +import org.apache.tuscany.sca.cpp.tools.common.Options; +import org.apache.tuscany.sca.cpp.tools.common.Parameter; +import org.apache.tuscany.sca.cpp.tools.common.Signature; +import org.apache.tuscany.sca.cpp.tools.common.Utils; +import org.w3c.dom.Attr; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Text; + +/** + * This class is the main class that handles the function that parses a C++ + * interface header file into a DOM that holds all the semantic information + * about the interface - method names, parameters and return values. It then + * uses XSLT to generate different "views" of this data plus the parameter map + * from other sources that are the C++ programs for the proxy and wrapper + * implementations and headers. + */ +public class ServicesGenerator extends CParsingTool { + + private static final String OPERATION_NAME_ATTR = "operationNameAttr"; + + private static final String HEADER_NAME_ATTR = "headerNameAttr"; + + private static final String SCA_OPERATION = "scaOperation"; + + private static final String SCA_SERVICE = "scaService"; + + private static final String SCA_OPERATION_RETURN_TYPE = "scaOperationReturnType"; + + private static final String SCA_OPERATION_PARAMETER = "scaOperationParameter"; + + private static final String SCA_OPERATION_PARAMETER_NAME_ATTR = "scaOperationParameterNameAttr"; + + private static final String SCA_OPERATION_PARAMETER_CONST_ATTR = "scaOperationParameterConstAttr"; + + private static final String SCA_INTERFACE_NAME_ATTR = "scaInterfaceNameAttr"; + + private static final String CPP_HEADER = "cppHeader"; + + private static boolean TESTING = true; + + private static TransformerFactory txmf = null; + + private static ServicesGenerator instance = null; + + public ServicesGenerator(String[] args) throws Exception { + super(args); + txmf = TransformerFactory.newInstance(); + } + + /** + * + * @param parameters + * @param forReference + * true if we are creating a proxy for a reference (rather than + * for a service) + * @throws Exception + * + * The design is + *
    + *
  • handleInterfaceHeader + *
  • createDOMofMethods + *
  • createProxyCPPFromDom(outputDir, dom); + *
  • createProxyHeaderFromDom(outputDir, dom); + *
+ * + * plus if we are not generating for a reference element + *
    + *
  • createWrapperCPPFromDom(outputDir, dom); + *
  • createWrapperHeaderFromDom(outputDir, dom); + *
      + * Each of the create.... methods calls createOutputFromDom with a different + * style sheet. + * + */ + public static void handleInterfaceHeader(Map parameters, + boolean forReference) throws Exception { + boolean failed = false; + + String type = null; + if (forReference) { + type = "reference"; + } else { + type = "service"; + } + String interfaceHeaderFilename = (String) parameters + .get("/componentType/" + type + "/interface.cpp/@header"); + + String componentTypeFileHeaderName = interfaceHeaderFilename; + + String sca_composite_root = (String) Options.getOption("-dir"); + parameters.put("composite_root", sca_composite_root); + + if (sca_composite_root != null && interfaceHeaderFilename != null + && interfaceHeaderFilename.length() > 0) { + String separator; + // Stick in a "/" (File.separator) if required. + if ((interfaceHeaderFilename.substring(0, 1).equals("/") || sca_composite_root + .substring(sca_composite_root.length() - 1, + sca_composite_root.length()).equals("/")) + || (interfaceHeaderFilename.substring(0, 1).equals("\\") || sca_composite_root + .substring(sca_composite_root.length() - 1, + sca_composite_root.length()).equals("\\")) + + ) { + separator = ""; + } else { + separator = File.separator; + } + interfaceHeaderFilename = sca_composite_root + separator + + interfaceHeaderFilename; + } + + File outputDir = (File) parameters.get("targetDirectoryFile"); + + String[] args = new String[] { "-source", interfaceHeaderFilename, + "-target", outputDir.getPath() }; + ServicesGenerator gen = new ServicesGenerator(args); + File file; + try { + if (null == interfaceHeaderFilename) { + gen.printUsage(); + System.exit(-1); + } + + file = new File(interfaceHeaderFilename); + if (!file.isFile()) { + if (file.isDirectory()) { + Utils + .rude("This tool works at the header file level and not for directories like " + + file); + } + Utils.rude("Bad file or directory " + file); + } + File source = file; + if (!outputDir.exists() && !outputDir.mkdir()) + Utils.rude("Failed to create directory " + outputDir); + + // The class below is the one that will go through the header + // file(s) + Headers headers = new Headers(); + + if (null != interfaceHeaderFilename) { + Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_ENCOUNTERED, file + .getAbsolutePath()); + Utils.postEvent(Utils.EVENT_TYPE_FILE_PARSED, + "Scagen processing C++ interface header " + + file.getAbsolutePath()); + headers.actOnFile(file, outputDir, 1); + Utils.outputDebugString("Parsing files..."); + } + + String nameOfSorR = null; + String referenceName = null; + String serviceName = null; + + if (forReference) { + + Object rn = parameters.get("/componentType/reference/@name"); + + if (rn instanceof String) { + referenceName = (String) rn; + nameOfSorR = referenceName; + } + } else { + + Object sn = parameters.get("/componentType/service/@name"); + + if (sn instanceof String) { + serviceName = (String) sn; + nameOfSorR = serviceName; + } + } + + String compositeXmlFileHeader = null; + String compositeXmlFileHeaderNoExt = null; + Object compositeh = parameters + .get("/composite/component/implementation.cpp/@header"); + + if (compositeh == null) { + compositeh = parameters + .get("/compositeFragment/component/implementation.cpp/@header"); + } + + if (compositeh instanceof String) { + File f = new File((String) compositeh); + compositeXmlFileHeader = (String) compositeh; + + String fname = f.getName(); + compositeXmlFileHeaderNoExt = fname.substring(0, fname + .lastIndexOf('.')); + + } + + String implClassNameAttrFromCompositeFile = (String) parameters + .get("implClass"); + String implClassNamespaceAttrFromCompositeFile = (String) parameters + .get("implNamespace"); + + if(implClassNamespaceAttrFromCompositeFile == null || implClassNamespaceAttrFromCompositeFile.length() == 0) + { + implClassNamespaceAttrFromCompositeFile = ""; + } + else + { + implClassNamespaceAttrFromCompositeFile += "::"; + } + + String interfaceClassNameAttrFromComponentTypeFile; + if (forReference) { + interfaceClassNameAttrFromComponentTypeFile = (String) parameters + .get("/componentType/reference/interface.cpp/@class"); + } else { + interfaceClassNameAttrFromComponentTypeFile = (String) parameters + .get("/componentType/service/interface.cpp/@class"); + } + + List methods = headers.getAllMethods(); + + // Pull out one of the methods' namespace attributes. + String intfNamespace = null; + if (methods.size() > 0) { + Signature method = (Signature) methods.get(0); + intfNamespace = method.getNamespace(); + } + + if (interfaceClassNameAttrFromComponentTypeFile != null) { + methods = filterToPublicMethodsOfGivenClass(methods, + interfaceClassNameAttrFromComponentTypeFile, true); + } else { + //We want to filter to methods of the class whose + //name matches the header file name. + // String intfClassName = (String) parameters.get("intfClass"); + // + String headerFileBase = file.getName().replaceAll( + "\\.h|\\.hpp|\\.h++", ""); + + methods = filterToPublicMethodsOfGivenClass(methods, + headerFileBase, false); + } + + Document dom = createDOMofMethods(methods, source, serviceName, + referenceName, nameOfSorR, null, + componentTypeFileHeaderName, compositeXmlFileHeader, + compositeXmlFileHeaderNoExt, intfNamespace, + interfaceClassNameAttrFromComponentTypeFile, + implClassNameAttrFromCompositeFile, implClassNamespaceAttrFromCompositeFile); + +// // Print out the generated DOM +// StringWriter sw = new StringWriter(); +// OutputFormat outputFormat = new OutputFormat("xml", "UTF-8", true); +// XMLSerializer serializer = new XMLSerializer(sw, outputFormat); +// serializer.serialize(dom); +// System.out.println("DOM:\n"+sw.toString()); + + + createProxyCPPFromDom(outputDir, dom); + createProxyHeaderFromDom(outputDir, dom); + + if (!forReference) { + createWrapperCPPFromDom(outputDir, dom); + createWrapperHeaderFromDom(outputDir, dom); + } + + } catch (Exception exception) { + exception.printStackTrace(); + failed = true; + } + + if (failed) { + Utils.outputDebugString("Finished! (but encountered problems)"); + System.exit(-2); + } + } + + /** + * This methods takes a list of methods and filters them to only contain the + * public methods of the given class + * + * @param methods + * a list of methods + * @param className + * we will return a list of only this classes methods from the + * methods parameter + * @param attrSpecified + * if the user does not specify one we ignore namespaces + * @return + */ + private static List filterToPublicMethodsOfGivenClass(List methods, + String className, boolean useNamespace) { + if (methods != null && className != null && className.length() > 0) { + for (Iterator iter = methods.listIterator(); iter.hasNext();) { + Signature method = (Signature) iter.next(); + String scope = method.getScope(); + String sig = method.getOriginal(); + String namespace = method.getNamespace(); + + String qualifiedClassName; + if (useNamespace && null != namespace && 0 < namespace.length()) { + qualifiedClassName = namespace + "::" + + method.getTrimClassName(); + } else { + qualifiedClassName = method.getTrimClassName(); + } + + // If we are not public or the classname does not match + // remove... + if (!qualifiedClassName.equals(className) + || -1 == scope.indexOf("public")) { + iter.remove(); + } + } + } + return methods; + } + + /** + * Use an XSLT transformation to create a Proxy "view" of the DOM + * information + * + * @param outputDir + * where to put the C++ + * @param dom + * the DOM of semantic method information + * @throws TransformerException + */ + private static void createProxyCPPFromDom(File outputDir, Document dom) + throws TransformerException { + + //Create the Filename from the Service Name in the DOM + if (dom == null) { + return; + } + + String serviceOrReferenceName = "noSorRNameDefined"; + + String implClass = "nocompositeXmlFileHeaderDefined"; + + Element topNode = dom.getDocumentElement(); + if (null != topNode) { + Attr attr = topNode.getAttributeNode("nameOfSorR"); + if (attr != null) { + serviceOrReferenceName = attr.getNodeValue(); + } + + attr = topNode.getAttributeNode("implClass"); + if (attr != null) { + implClass = attr.getNodeValue(); + } + } + + File proxyCPP = new File(outputDir, implClass + "_" + + serviceOrReferenceName + "_Proxy.cpp"); + if (null != proxyCPP) { + + Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_GENERATED, proxyCPP + .getAbsolutePath()); + Utils.postEvent(Utils.EVENT_TYPE_FILE_CREATE, + "Scagen creating SCA for C++ proxy implementation " + + proxyCPP.getAbsolutePath()); + } + + createOutputFromDom(dom, proxyCPP, + "org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyCPP.xsl"); + + } + + /** + * Use an XSLT transformation to create a Wrapper "view" of the DOM + * information + * + * @param outputDir + * where to put the C++ + * @param dom + * the DOM of semantic method information + * @throws TransformerException + */ + private static void createWrapperCPPFromDom(File outputDir, Document dom) + throws TransformerException { + + //Create the Filename from the Service Name in the DOM + if (dom == null) { + return; + } + + String serviceName = "noServiceDefined"; + + String implClass = "nocompositeXmlFileHeaderDefined"; + + Element topNode = dom.getDocumentElement(); + if (null != topNode) { + Attr attr = topNode.getAttributeNode("serviceName"); + if (attr != null) { + serviceName = attr.getNodeValue(); + } + + attr = topNode.getAttributeNode("implClass"); + if (attr != null) { + implClass = attr.getNodeValue(); + } + } + + File wrapperCPP = new File(outputDir, implClass + "_" + serviceName + + "_Wrapper.cpp"); + if (null != wrapperCPP) { + Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_GENERATED, wrapperCPP + .getAbsolutePath()); + Utils.postEvent(Utils.EVENT_TYPE_FILE_CREATE, + "Scagen creating SCA for C++ wrapper implementation " + + wrapperCPP.getAbsolutePath()); + } + createOutputFromDom(dom, wrapperCPP, + "org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperCPP.xsl"); + + } + + /** + * Use an XSLT transformation to create a Proxy header "view" of the DOM + * information + * + * @param outputDir + * where to put the C++ + * @param dom + * the DOM of sematic method information + * @throws TransformerException + */ + private static void createProxyHeaderFromDom(File outputDir, Document dom) + throws TransformerException { + + //Create the Filename from the Service Name in the DOM + if (dom == null) { + return; + } + + String serviceOrReferenceName = "noServiceDefined"; + String intfClass = "noInterfaceClassNameOrDefaultDefined"; + String implClass = "noImplementationClassOrDefaultDefined"; + + Element topNode = dom.getDocumentElement(); + if (null != topNode) { + Attr attr = topNode.getAttributeNode("nameOfSorR"); + if (attr != null) { + serviceOrReferenceName = attr.getNodeValue(); + } + attr = topNode.getAttributeNode("intfClass"); + if (attr != null) { + intfClass = attr.getNodeValue(); + } + attr = topNode.getAttributeNode("implClass"); + if (attr != null) { + implClass = attr.getNodeValue(); + } + } + + File proxyHeader = new File(outputDir, implClass + "_" + + serviceOrReferenceName + "_Proxy.h"); + if (null != proxyHeader) { + Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_GENERATED, proxyHeader + .getAbsolutePath()); + Utils.postEvent(Utils.EVENT_TYPE_FILE_CREATE, + "Scagen creating SCA for C++ proxy header " + + proxyHeader.getAbsolutePath()); + } + + createOutputFromDom(dom, proxyHeader, + "org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyHeader.xsl"); + + } + + /** + * Use an XSLT transformation to create a Wrapper header "view" of the DOM + * information + * + * @param outputDir + * where to put the C++ + * @param dom + * the DOM of sematic method information + * @throws TransformerException + */ + private static void createWrapperHeaderFromDom(File outputDir, Document dom) + throws TransformerException { + + //Create the Filename from the Service Name in the DOM + if (dom == null) { + return; + } + + String serviceName = "noServiceDefined"; + + String implClass = "nocompositeXmlFileHeaderDefined"; + + Element topNode = dom.getDocumentElement(); + if (null != topNode) { + Attr attr = topNode.getAttributeNode("serviceName"); + if (attr != null) { + serviceName = attr.getNodeValue(); + } + + attr = topNode.getAttributeNode("implClass"); + if (attr != null) { + implClass = attr.getNodeValue(); + } + } + + File wrapperHeader = new File(outputDir, implClass + "_" + serviceName + + "_Wrapper.h"); + + if (null != wrapperHeader) { + Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_GENERATED, wrapperHeader + .getAbsolutePath()); + Utils.postEvent(Utils.EVENT_TYPE_FILE_CREATE, + "Scagen creating SCA for C++ wrapper header " + + wrapperHeader.getAbsolutePath()); + } + createOutputFromDom(dom, wrapperHeader, + "org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperHeader.xsl"); + + } + + /** + * This method will return a class loader that can see the resources that + * are parts of "this" package. + */ + private static ClassLoader getALoader() { + + LittleClass lc; + try { + lc = new LittleClass(); + return lc.getClass().getClassLoader(); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + /** + * This method will generically process the DOM using a stylesheet passed + * in. + * + * @param dom + * the source of data (the model) + * @param outputFile + * where to put the result + * @param xslTransformationFileName + * the xsl file containing the "view" + * @throws TransformerException + */ + private static void createOutputFromDom(Document dom, File outputFile, + String xslTransformationFileName) throws TransformerException { + + if(Options.noGenerate()){ + return; + } + + InputStream stream = getALoader().getResourceAsStream( + xslTransformationFileName); + StreamSource ss = new StreamSource(stream); + StreamResult out = new StreamResult(outputFile); + try { + Transformer xslt = txmf.newTransformer(ss); + + // Unless a width is set, there will be only line breaks but no + // indentation. + // The IBM JDK and the Sun JDK don't agree on the property name, + // so we set them both. + // + try { + xslt.setOutputProperty( + "{http://xml.apache.org/xalan}indent-amount", "2"); + } catch (Throwable t) { + //OK to ignore this, depends on XSLT engine and one will fail + } + try { + xslt.setOutputProperty( + "{http://xml.apache.org/xslt}indent-amount", "2"); + } catch (Throwable t) { + //OK to ignore this, depends on XSLT engine and one will fail + } + + DOMSource from = new DOMSource(dom); + + xslt.transform(from, out); + + } catch (TransformerConfigurationException e) { + e.printStackTrace(); + throw (e); + } catch (TransformerException e) { + e.printStackTrace(); + throw (e); + } finally { + try { + stream.close(); + } catch (IOException e1) { + // unlikely but if + // we can't close it, we can't close it + } + } + + } + + //TODO clear up the parameter list below to make it smaller if + // possible + /** + * This method will create A DOM containing all the semantic information + * that it can extract from a C++ header file. + * + * @param methods + * a list of methods that are going into the DOM + * @param source + * the header file the methods came from + * @param serviceName + * the name of the service + * @referenceName the name of the reference + * @nameOfSorR the non null one of the two parameters above + * @headerClassName the name of the header class + * @param compositeXmlFileImplHeaderNameWithPathAndExt + * the source filename + * @param compositeXmlFileHeaderNoExtorPath + * the shortname of the source file + * @param implClass + * the implementation class + * @param intfClass + * the interface we are turning into a service + * @return + */ + private static Document createDOMofMethods(List methods, File source, + String serviceName, String referenceName, String nameOfSorR, + String headerClassName, + String componentTypeXmlFileIntfHeaderNameWithPathAndExt, + String compositeXmlFileImplHeaderNameWithPathAndExt, + String compositeXmlFileHeaderNoExtorPath, String intfNamespace, + String intfClass, String implClass, String implNamespace) { + + if (methods == null) { + return null; + } + + // Create a DOM of the methods + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + Document document = null; + try { + DocumentBuilder builder = factory.newDocumentBuilder(); + document = builder.newDocument(); + + Element root = (Element) document.createElement(CPP_HEADER); + + root.setAttribute(HEADER_NAME_ATTR, source.getPath()); + + document.appendChild(root); + + Element intf = (Element) document.createElement(SCA_SERVICE); + root.appendChild(intf); + + // Go through all the signatures we have collected... + Signature s = null; + for (Iterator iter = methods.iterator(); iter.hasNext();) { + s = (Signature) iter.next(); + + // Each signature is an operation + Element op = document.createElement(SCA_OPERATION); + op.setAttribute(OPERATION_NAME_ATTR, s.getMethodName()); + intf.appendChild(op); + + Parameter[] parms = s.getParameters(); + if (parms != null) { + + for (int i = 0; i < parms.length; i++) { + Element parm = (Element) document + .createElement(SCA_OPERATION_PARAMETER); + String type_string = parms[i].getTypeWithoutConst() + .toString(); + + type_string = type_string.replaceAll(":: ", "::"); + + Text text = document.createTextNode(type_string); + parm.appendChild(text); + parm.setAttribute(SCA_OPERATION_PARAMETER_NAME_ATTR, + parms[i].getName()); + + if (parms[i].getTypeWithoutConst().intern() != parms[i] + .getType().intern()) { + parm.setAttribute( + SCA_OPERATION_PARAMETER_CONST_ATTR, "true"); + } + + op.appendChild(parm); + // TO DO only really stores the value + // unsafely/temporarily + // which is fine while we handle everything at the + // end of parsing the "leaf" that represents that actual + // interface/service but the below will cause the second + // service + // processed to overwite the first one in the DOM. I we + // wish + // to do some overall processing at the end we will have + // to + // use a better more XPath like key that varies by + // instance + // of the service. + intf.setAttribute(SCA_INTERFACE_NAME_ATTR, s + .getTrimClassName()); + } + } + + Element rc = document.createElement(SCA_OPERATION_RETURN_TYPE); + rc.appendChild(document.createTextNode(s.getReturnType() + .toString().replaceAll(":: ", "::"))); + op.appendChild(rc); + + root.appendChild(intf); + } + + // Set the name of the Service + // here, if we are not passed one we use + // the classname from the last header function signature... + if (serviceName == null && s != null) { + serviceName = s.getTrimClassName(); + } + + // this is used for the proxy file name but we need to + // use the reference name if this is pulled in due to it + // being a reference!!! + if (serviceName != null) + root.setAttribute("serviceName", serviceName); + if (referenceName != null) + root.setAttribute("referenceName", referenceName); + if (nameOfSorR != null) + root.setAttribute("nameOfSorR", nameOfSorR); + + if (implClass != null) { + root.setAttribute("implClass", implClass); + } else { + root.setAttribute("implClass", compositeXmlFileHeaderNoExtorPath); + } + + if (implClass != null) { + root.setAttribute("implNamespace", implNamespace); + } + + // default class name to the name of the header... + if (headerClassName == null && source != null) { + headerClassName = source.getName().replaceAll( + "\\.h|\\.hpp|\\.h++", ""); + } + root.setAttribute("headerClassName", headerClassName); + + if (null == intfClass) { + intfClass = headerClassName; + } + + if (null != intfNamespace) { + root.setAttribute("namespace", intfNamespace); + if (null != intfClass && !intfClass.startsWith(intfNamespace)) { + intfClass = intfNamespace + "::" + intfClass; + } + } + + root.setAttribute("intfClass", intfClass); + + if (componentTypeXmlFileIntfHeaderNameWithPathAndExt == null) { + componentTypeXmlFileIntfHeaderNameWithPathAndExt = "componentTypeHeader"; + } + root.setAttribute("componentTypeHeader", + componentTypeXmlFileIntfHeaderNameWithPathAndExt); + + if (compositeXmlFileImplHeaderNameWithPathAndExt == null) { + compositeXmlFileImplHeaderNameWithPathAndExt = "compositeXmlFileImplHeader"; + } + root.setAttribute("compositeXmlFileHeader", + compositeXmlFileImplHeaderNameWithPathAndExt); + + if (compositeXmlFileHeaderNoExtorPath == null) { + compositeXmlFileHeaderNoExtorPath = "compositeXmlFileHeaderNoExt"; + } + root.setAttribute("compositeXmlFileHeaderNoExt", + compositeXmlFileHeaderNoExtorPath); + + } catch (ParserConfigurationException pce) { + // Parser with specified options can't be built + pce.printStackTrace(); + } + + return document; + + } + +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/XMLFileActor.java b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/XMLFileActor.java new file mode 100644 index 0000000000..dd260c9787 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/XMLFileActor.java @@ -0,0 +1,208 @@ +/** + * + * 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. + */ + +/* @version $Rev$ $Date$ */ + +package org.apache.tuscany.sca.cpp.tools.services; + +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.dom.DOMSource; + +import org.apache.tuscany.sca.cpp.tools.common.FileActor; +import org.apache.tuscany.sca.cpp.tools.common.Utils; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; + +/** + * The purpose of this abstract class is to provide a home for the standard + * processing that is involved in turning a XML file into an internal DOM. + */ +public abstract class XMLFileActor implements FileActor { + + protected static Map handlers = new HashMap(); + + protected static Map parameters = new HashMap(); + + public boolean failed; + + private int filesActedOn=0; + + protected static TransformerFactory transformerFactory = TransformerFactory + .newInstance(); + + /** + * This method is the main FileActor method + * + * @see FileActor#actOnFile(File, File, int) Here we create an initial DOM + * and kick off the processing (using the handler map that has been set + * up by the concrete subclass). + * + * @param compositeXML + * the composite or fragment file + * @param target + * the target directory + * @param depth + * not uesed here but in the + * @see FileActor#actOnFile(File, File, int) interface to allow for + * recursive diving into a directory structure. + */ + public void actOnFile(File compositeXML, File target, int depth) + throws Exception { + + if (null == compositeXML || null == target) { + return; + } + + filesActedOn++; + + parameters.put("sourceFile", compositeXML); + parameters.put("targetFile", target); + + if (transformerFactory.getFeature(DOMSource.FEATURE) + && transformerFactory.getFeature(DOMResult.FEATURE)) { + Document dom = createDomFromXMLFile(compositeXML); + if (dom != null) { + parameters.put("targetDirectoryFile", target); + DomHandler.handleDom(dom, handlers, parameters); + } + } + } + + /** + * This method builds an in memory DOM from an XML file + * + * @param xmlSourceFile + * the XML file we are handling + * @return the resulting document + */ + protected Document createDomFromXMLFile(File xmlSourceFile) { + Document dom = null; + DocumentBuilderFactory f = DocumentBuilderFactory.newInstance(); + //We do not validate via f.setValidating(true); + f.setNamespaceAware(true); + + try { + DocumentBuilder parser = f.newDocumentBuilder(); + dom = parser.parse(xmlSourceFile); + } catch (SAXException sxe) { + String path; + try { + path = xmlSourceFile.getCanonicalPath(); + } catch (IOException e) { + path = xmlSourceFile.getPath(); + } + Utils.screenMessage("There has been a SAXException of type " + + sxe.getLocalizedMessage()); + if (null != xmlSourceFile) { + Utils.screenMessage(" when processing file " + path); + } else { + Utils.screenMessage(" as the input file is null."); + } + +// Leave for possible future debug option +// Utils.screenMessage(" The returned Java exception is below."); +// if (sxe.getException() != null) +// sxe.getException().printStackTrace(); +// else +// sxe.printStackTrace(); + } catch (ParserConfigurationException pce) { + String path; + try { + path = xmlSourceFile.getCanonicalPath(); + } catch (IOException e) { + path = xmlSourceFile.getPath(); + } + Utils + .screenMessage("There has been a ParserConfigurationException of type " + + pce.getLocalizedMessage()); + if (null != xmlSourceFile) { + Utils.screenMessage(" when processing file " + path); + } else { + Utils.screenMessage(" as the input file is null."); + } + +// Leave for possible future debug option +// Utils.screenMessage(" The returned Java exception is below."); +// pce.printStackTrace(); + + } catch (IOException ioe) { + String path; + try { + path = xmlSourceFile.getCanonicalPath(); + } catch (IOException e) { + path = xmlSourceFile.getPath(); + } + + Utils.screenMessage("Unable to open file " + path); + Utils.screenMessage(this.getContextMessage()); + + + + } + + return dom; + } + + /** + * @return an error message - usually over-ridden. + */ + private String getContextMessage() { + return "Check the file exists and can be read."; + } + + /** + * Set a parameter + * + * @param name + * @param value + */ + public void setParameter(String name, Object value) { + parameters.put(name, value); + } + + /** + * Get a parameter + * + * @param name + * @param value + * @return the value of the parameter + */ + public Object getParameter(String name, Object value) { + return parameters.get(name); + } + + + + /** + * @return Returns the filesActedOn. + */ + public int getFilesActedOn() { + return filesActedOn; + } +} \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/package.html b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/package.html new file mode 100644 index 0000000000..ea15ca587b --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/package.html @@ -0,0 +1,159 @@ + + + + + +Design documentation for org\apache\tuscany\sca\cpp\tools\services + + + + +
      + +

      Overview

      + + + +

      This package contains classes that generate C++ wrappers and +proxies for C++ implementations of SCA services.

      + +

      What the package does

      + +

      The Scagen class main method will take in an input and +output directory name. The input directory is taken to be the SCA composite root +directory.  The tool will generate the wrapper and proxy headers and methods +bodies in the output directory.

      + +

      These proxies and wrappers enable the SCA for C++ runtime to +act as a conduit for SCA C++ calls in a type free manner. Client code can call +the type specific functions that are in the generated proxy classes. The call +is marshalled into a generic format and a SCA for C++ runtime function with a +standard signature is invoked. The details of the call are passed as data.

      + +

      On the other end of the runtime, a generated function with a +standard signature is called, this function will inspect the data that +represents the call’s method name and call the appropriate type specific +function in the C++ implementation.

      + +

      The Input Data Used

      + +

      The input directory passed to the Scagen method is taken to +be the SCA composite root directory. All the sca.composite and .fragment files in +that directory are inspected to resolve all the <component/> elements +within them.

      + +

      Each <component/> element found is inspected to see if +it has a <implementation.cpp/> element within it.

      + +

      Each <implementation.cpp/> element should have a +header attribute that represents a C++ header file that contains function +prototypes for the C++ implementation of the service. An optional class +attribute can be used to select one class if more than one that is present in +the header file. The default class is the one with the same name as the header +file. The tool will verify that the implementation header contains an +appropriate class prototype.

      + + + +

      The directory that contains the implementation header should +also contain a matching .componentType file for the equivalent SCA component. So +for example, a MyServiceImpl.h file would have a corresponding MyServiceImpl.componentType +file in the same directory.

      + + + +

      Each componentType file is inspected for <service/> +and <reference/> elements. For each <service/> element that is +found that contains a <interface.cpp/> element within it,

      + +

      the header attribute of the <interface.cpp/> is taken +as the filename of the C++ interface header for the SCA service.  This C++ +header file is opened and used as a means for specifying the SCA service +resulting in an appropriate wrapper and proxy being generated for this service +interface. Both method bodies and headers are generated in the given output +directory. The processing of a <reference/> element is the same except +that only a proxy header and implementation are generated.

      + + + + + +

      Outline Design: How it Works

      + + + +

      The basic approach is to scan in the XML files by first +creating a DOM document tree of them and then recursively rifling through the DOM  +with some generic code in the XMLFileActorClass by default this processing will +build up a map which maps the XPath location of attributes to their values. +Additionally subclasses can add to a “handlers map” which maps from the name of +a particular element to an object that implements the DomNodeHandler interface. +If the XMLFileActor code comes across any element that has an equivalent handler +in the handler map the objects handleNode method will be called.

      + +

      Typically the DomNodeHandler’s handle node interface will +use XPath to pull out the parameters that it is interested in from the +parameters map that is being built up by the generic code.

      + +

      This design was chosen as the Java level specified for the +original implementation did not have direct XPath query of XML data but it was +known that this would be available in Java 1.5 onwards. The design allows the +DOM and parameters map handling to be replaced in the future with JRE 1.5 code +with less impact on the rest of the code.

      + + + +

      The processing leads to the parsing of the C++ interface +files using the org\apache\tuscany\sca\cpp\tools\common package. This results +in a Headers object

      + +

      that contains a List of Signature objects, each one +representing a function prototype found in the header.

      + + + +

      We are aiming to get all the semantic data we want to use +into a DOM document (this represents the model of our input data) and then use +XSLT to create the 4 different views of this data:

      + +

      Proxy C++ header

      + +

      Proxy C++  body

      + +

      Wrapper C++ header

      + +

      Wrapper C++ body

      + + + +

      So we prepopulate the DOM with parameter data that comes +from the XML files and then iterate through the Signatures that are returned +from the C++ header parser transferring the useful data into the DOM.

      + + + +

      We than use 4 XSLT stylesheets to generate the C++ output +files as required.

      + +
      + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyCPP.xsl b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyCPP.xsl new file mode 100644 index 0000000000..3d9dafa103 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyCPP.xsl @@ -0,0 +1,278 @@ + + + + + + + + + + + + + + + + + + + +/* + * 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. + */ + + + +#include "osoa/sca/sca.h" + + + + + + + + + + _ + + _Proxy + + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + +* + +_Factory(tuscany::sca::ServiceWrapper* target) + { + return new (target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void + +_Destructor(void* proxy) + { + delete (*)proxy; + } +} + + +::(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +::~() +{ + if (target) + delete target; +} + + + + + + + + + + + + _ + + _Proxy + +#include " + +.h" + + + + + + + + + + + _ + + _Proxy + + + + + + + + +:: +( + + + + + + + + + const + + + + + + + + , + + + + + +) +{ + + +} + + + + + + + + + +0 + + + + + + + + tuscany::sca::Operation operation(" + + "); + + + + + + + + target->invoke(operation); + + + + + + + + + + + + return; + + + + + + + return *(*)operation.getReturnValue(); + + + + return *(*)operation.getReturnValue(); + + + + + + + + + + + + + + + + + ret; + operation.setReturnValue(&ret); + + + + + + + + + + + + + + operation.addParameter("", &); + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyHeader.xsl b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyHeader.xsl new file mode 100644 index 0000000000..2f5edb3a93 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyHeader.xsl @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +/* + * 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. + */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #ifndef _h + + + + #define _h + + + + + #if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + + + + + + + + + + #include "" + + + + #include "tuscany/sca/core/ServiceWrapper.h" + + + + + + + + + + +class + + : public + +{ +public: + (tuscany::sca::ServiceWrapper*); + + virtual ~(); + + + +private: + tuscany::sca::ServiceWrapper* target; +}; + + + + + + + +#endif // _h + + + + + + + + + + + + + + + virtual + + +( + + + + + + + + const + + + + + + + , + + + +); + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperCPP.xsl b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperCPP.xsl new file mode 100644 index 0000000000..f983917e36 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperCPP.xsl @@ -0,0 +1,290 @@ + + + + + + + + + + + + + + + + + + + + + +/* + * 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. + */ + + + +#include "osoa/sca/sca.h" + +using ; + + + + + + + + + + + + + + + + + + _ + + _Wrapper + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + +* + +_Factory(tuscany::sca::model::Service* target) + { + return new (target); + } +} + + +::(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (*)getImplementation(); +} + + +::~() +{ + releaseImplementation(); +} + +void* +::newImplementation() +{ + return new ; +} + +void +::deleteImplementation() +{ + delete impl; +} + +void ::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + + + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + + + + + + _ + + _Wrapper + +#include " + +.h" + + + + + + + + + if (operationName == " + +") + { + + + + } + + + + + + + + + + + + + + + + + + return; + + + + + + + + + + + + + + + + p = *( + *)operation.getParameterValue(); + + + + const + p = *( + const + + *)operation.getParameterValue(); + + + + commonj::sdo::DataObjectPtr& p = *(commonj::sdo::DataObjectPtr*)operation.getParameterValue(); + + + const & p = *( + const + + *)operation.getParameterValue(); + + + + + + + + + + + + + + + ; + + + ret = ; + + operation.setReturnValue(&ret); + + + + if(operation.getReturnValue() != NULL) + { + *(*)operation.getReturnValue() = ; + } + else + { + * ret = new ; + *ret = ; + operation.setReturnValue((const *)ret); + } + + + + + + impl->( + + + + + + + + + +) + + + +p + + + + , + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperHeader.xsl b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperHeader.xsl new file mode 100644 index 0000000000..c8157fe2f6 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperHeader.xsl @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + + + + + + + + + + + +/* + * 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. + */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #ifndef _h + + + + #define _h + + + + + #if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + + + + + + + + + + #include "" + + + + #include "tuscany/sca/cpp/CPPServiceWrapper.h" + + + + + + + + + + +class + + : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + (tuscany::sca::model::Service* target); + + virtual ~(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); + +private: + + * impl; +}; + + + + + + + +#endif // _h + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/xsd/sca-implementation-cpp.xsd b/sca-cpp/trunk/contrib/runtime/extensions/cpp/xsd/sca-implementation-cpp.xsd new file mode 100644 index 0000000000..ac2004bd73 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/xsd/sca-implementation-cpp.xsd @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/cpp/xsd/sca-interface-cpp.xsd b/sca-cpp/trunk/contrib/runtime/extensions/cpp/xsd/sca-interface-cpp.xsd new file mode 100644 index 0000000000..a8493fe726 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/cpp/xsd/sca-interface-cpp.xsd @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/AUTHORS b/sca-cpp/trunk/contrib/runtime/extensions/php/AUTHORS new file mode 100644 index 0000000000..e69de29bb2 diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/COPYING b/sca-cpp/trunk/contrib/runtime/extensions/php/COPYING new file mode 100755 index 0000000000..6b0b1270ff --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/COPYING @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/ChangeLog b/sca-cpp/trunk/contrib/runtime/extensions/php/ChangeLog new file mode 100644 index 0000000000..e69de29bb2 diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/INSTALL b/sca-cpp/trunk/contrib/runtime/extensions/php/INSTALL new file mode 100644 index 0000000000..059a43057b --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/INSTALL @@ -0,0 +1,2 @@ +Please read the GettingStarted.html document for information on +building and installing Tuscany SCA Native PHP extemstion diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/LICENSE b/sca-cpp/trunk/contrib/runtime/extensions/php/LICENSE new file mode 100755 index 0000000000..f433b1a53f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/php/Makefile.am new file mode 100644 index 0000000000..fb661fec63 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/Makefile.am @@ -0,0 +1,24 @@ +# 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 samples + +datadir=$(prefix) + +nobase_data_DATA = xsd/*.xsd + +EXTRA_DIST = xsd \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/NEWS b/sca-cpp/trunk/contrib/runtime/extensions/php/NEWS new file mode 100644 index 0000000000..e69de29bb2 diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/NOTICE b/sca-cpp/trunk/contrib/runtime/extensions/php/NOTICE new file mode 100644 index 0000000000..b240b0a121 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/NOTICE @@ -0,0 +1,5 @@ +Apache Tuscany SCA Native +Copyright 2005, 2007 The Apache Software Foundation + +This product includes software developed by +The Apache Software Foundation (http://www.apache.org/) \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/README b/sca-cpp/trunk/contrib/runtime/extensions/php/README new file mode 100644 index 0000000000..ad96622516 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/README @@ -0,0 +1,276 @@ +PHP Extension for C++ SCA README +================================ + +Overview +-------- + +The PHP extension for C++ SCA allows PHP scripts to be used to implement SCA components. +This is achieved by using the C++ SCA extension API to drive script execution through the +PHP embedding SAPI. In its current incarnation the PHP Extension requires that a full SCDL +description is provided for each PHP component, i.e. we are not yet making use of the meta data +provided by the annotations that can appear in PHP SCA components. + +There are various styles of PHP script that are supported. The examples here are taken from +the PHPCalculator sample and if you look at the SCDL files provided with the sample you can +see the component type and composite files that tie these components into the working system + +SCA Service +----------- + +/** + * @service + * @binding.ws + */ +class Divide { + + /** + * @reference + * @binding.tuscany cppDivideService + */ + public $another_divide; + + /** + * Division + * + * @param float $num1 (the first number) + * @param float $num2 (the second number) + * @return float The result + */ + function div($num1, $num2) { + return $this->another_divide->div($num1, $num2); + } + +} + +PHP Class +--------- + +class Multiply { + function mul($num1, $num2) { + $result = $num1 * $num2; + + $log_proxy = SCA::getService("log_service"); + $log_proxy->log_message($result); + + return $result; + } +} + +PHP Function +------------ + +function sub($num1, $num2){ + $result = $num1 - $num2; + + $log_proxy = SCA::getService("log_service"); + $log_proxy->log_message($result); + + return $result; +} + +PHP Script +---------- + +$num1 = $_REQUEST[0]; +$num2 = $_REQUEST[1]; + +$result = $num1 + $num2; + +$log_proxy = SCA::getService("log_service"); +$log_proxy->log_message($result); + +echo $result; + +TODO +---- +* I struggled for a long time with a missing symbol problem loading sdo.so at runtime on linux. + I got round this by creating a standalone Makefile for the CalculatorClient exe. All the + shared objects that are loaded are compiled with the normal automake toolchain still but this + solves the problem. I need to investigate in detail what's going on here. Having someone + else try building with the full automake configuration would be insteresting +* The problem from above does appear when running SCA behind axis hence I am unable to test with + remote clients +* The SCA_SDO build generates sdo.so and the Tuscany PHP Extension tries to load libsdo.so. + One side needs fixing. For now I just copy the library +* SDO passing in and out of components is coded but not tested +* Returning values from plain PHP scripts (scripts without classes and functions) is not + operating correctly +* Error handling needs looking at. Many situations are not trapped and those + that are may not be reported correctly +* Reorganize the extension code so that Tuscany SCA can be loaded by PHP running in Apache + and accessed through SCA references. This will play the same role as SCA running hosted + in Axis2C and will open up the service bindings implemented in PHP SCA_SDO. +* Implement meta data exchange between the PHP SCA implementation and the Tuscany C++ SCA + implementations so that selected parts of the SCDL definition can be omitted. +* There is a threading issue with the way that we are firing up the PHP embedding SAPI + TSRM should solve it fails on the embedding initialization for some reason. + +Dependencies +------------ +PHP5.2.0 source code - - (http://php.net/) + The binary release of PHP doesn't ship with the header files required to build + against the PHP embedding SAPI and runtime libraries. So go get the PHP source + code and build PHP. PHP will need to be configured correctly in order to + work properly when embedded in C++ SCA. Here are some sample configuration + statements but they will need to be tailored for you specific environment: + + Winodws + ------- + cscript configure.js --with-extra-includes=win32build\include; + libxml2-2.6.26.threads\include; + iconv-1.9.1.win32\include; + libcurl-7.15.4-nossl\include + --with-extra-libs=win32build\lib; + libxml2-2.6.26.threads\lib; + iconv-1.9.1.win32\lib; + libcurl-7.15.4-nossl\lib + --enable-debug + --enable-soap + --enable-apache2handler=shared + --enable-embed + --with-curl=C:\simon\apps\libcurl-7.15.4-nossl + + Note. This configure line is artificially broken across sever lines to aid + readability here. You will need to join it all back together on one line to + run it. + + Linux + ----- + ./configure --enable-debug \ + --enable-soap \ + --enable-fastcgi \ + --with-zlib \ + --enable-embed \ + --with-tsrm-pthreads \ + --enable-maintainer-zts + Note. debug, pthreads, maintainer-zts, fastcgi are not absolute requirements but just + represent the environment I was testing with when I wrote this. + +SCA_SDO PECL extension AVOCET branch source code - (http://pecl.php.net/package/SCA_SDO) + Provides the SCA framework for PHP and the necessary mediation code to translate + between Tuscany SCA and PHP SCA. Go get the AVOCET branch from PECL cvs + + export CVSROOT=:pserver:cvsread@cvs.php.net/repository + cvs export -r AVOCET pecl/sdo + + The process to build this code varies quite considerably between windows and Linux. + Take a look at the instructions in the SCA_SDO manual, follow the documentation link + from the projects PECL page (http://uk2.php.net/sdo/). + + Once built you will need to copy the library sdo.so to + libsdo.so so that the Tuscany PHPExtension can load it given the makefile + configuration as it stands. For example, on linux + + ln -s sdo.so libsdo.so + + +Building on windows +------------------- + +The Visual C++ Express solution provided with C++ SCA includes a project +to build the PHP extension. This project relies on being able to access the +PHP include files from the source code directory and the PHP lib files from the +binary install. Make sure your environment is set as follows before you start +Visual C++ Express (if you do this after you start Visual C++ Express it will +not pick up the changes) + +PHP_HOME = the root directory of the PHP 5.2.0 source code install +PATH = ensure that the root directory of the PHP 5.2.0 binary install appears + +PHP_SCA_SDO_HOME = the directory in which the SCA_SDO pecl extension source is installed + +These changes come over and above the environment changes you need to make +to build the core C++ SCA software. I have the following set in my environment but +of course the details depend on where you have the various bits of software installed. + +AXIS2C_HOME=c:\axis2c-bin-0.96-win32 +LIBXML2_HOME=c:\libxml2-2.6.26.ein32 +ICONV_HOME=c:\iconv-1.9.2.win32 +ZLIB_HOME=c:\zlib-1.2.3.win32 +TUSCANY_SCACPP=c:\sca\deploy +TUSCANY_SDOCPP=c:\sdo\deploy + +Now compile the PHP extension. Compiling with VC++ Express requires some care + +1/ Ensure that the PHP include files are configured correctly for + compiling against C++ SCA in Visual C++ express + + See - http://bugs.php.net/bug.php?id=39130 + + Comment out two lines in $(PHP_HOME)/main/config.w32.h: + #define _USE_32BIT_TIME_T 1 + #define HAVE_STDLIB_H 1 + + +Building on Linux +----------------- + +The PHP extension comes with a set of automake files so that the PHP extension is built +at the same time as all of the other extensions assuming that appropriate environment +variables are set. The build.sh script that can be found under the top level sca directory +checks whether the PHP_LIB and PHP_INCLUDE variables are set and if so enables compilation +of the PHP extension automatically by adding --enable-php to the configure line. + +There are a number of environment variables that the build depends on. I find setting the +following variables useful. + +# the location of libxm2 +export LIBXML2_LIB=/usr/lib +export LIBXML2_INCLUDE=/usr/include/libxml2 + +# the location of PHP +export PHP_LIB=/usr/local/lib +export PHP_INCLUDE=/usr/local/include/php + +# the location of the PHP SCA_SDO extension source +# the lib location depends oh the configuration options used +# when building PHP so beware +export PHP_SCA_SDO_INCLUDE=where ever you install the SCA_SDO package source +export PHP_SCA_SDO_LIB=$PHP_LIB/php/extensions/no-debug-zts-20060613/ + +# the location of axis2 +export AXIS2C_HOME=/usr/local/axis2c-bin-0.96-linux + +# the install directories for the tuscany sca and sdo projects +export TUSCANY_SDOCPP=/usr/local/tuscany/cpp/sdo/deploy +export TUSCANY_SCACPP=/usr/local/tuscany/cpp/sca/deploy + +Once these are set running sca/build.sh should compile and install the PHP extension. + +Testing the PHP Extension +------------------------- + +In order to run the PHP extension successfully as an embedded component of the +C++ SCA runtime the PHP environment must be configured correctly. This configuration +is provided by the php.ini file. The location of this file depends on your installation +of PHP but by default is as follows. + +/usr/local/bin - PHP executables +/usr/local/lib/php.ini - the ini file that tell PHP where to look for scripts and + extension libraries +/usr/local/lib/php - PHP runtime installation, extension files and tests + +As is usually the case your milage may vary but wherever PHP is installed you will find +a similar set of directories. To force PHP to look in the correct place use the following +setting + +# tell PHP specifically where to find php.ini rather than relying on the default +set PHPRC=/usr/local/lib + +The php.ini file must be configured to load the SCA_SDO extension so you would expect to +see the following modifications to the file. + +; around line 528 you need to set the variable that tells PHP where to +; load extension libraries from. This varies depending on how PHP has been +; compiled and installed, for example, +extension_dir = "/usr/local/lib/php/extensions/no-debug-zts-20060613/" + +; around line 512 you need to set the variable that tells PHP where to +; load included scripts from. There are windows and unix versions. Here +; is a Unix example +include_path=".:/usr/local/lib/php:/usr/local/lib/php/PEAR:/usr/local/tuscany/cppsca/samples/PHPCalculator/deploy/sample.calculator" + +; around line 673 you will find the end of the list of enabled extensions. We need to turn +; on SDO so add the following line. sdo.so should be found in "extension_dir". +extension=sdo.so + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/autogen.sh b/sca-cpp/trunk/contrib/runtime/extensions/php/autogen.sh new file mode 100755 index 0000000000..af38864985 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/autogen.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# 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. + +for i in "libtoolize --force" aclocal autoconf autoheader +do + echo -n "Running $i..." + $i || exit 1 + echo 'done.' +done + +echo -n 'Running automake...' +automake --add-missing +echo 'done.' +exit 0 + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/build.sh b/sca-cpp/trunk/contrib/runtime/extensions/php/build.sh new file mode 100755 index 0000000000..41e96d0565 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/build.sh @@ -0,0 +1,55 @@ +#!/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. + +SCA_PHP_EXTENSION_HOME=`pwd` + +if [ x$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi + +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$PHP_LIB = x ]; then +echo "PHP_LIB not set." +exit; +elif [ x$PHP_INCLUDE = x ]; then +echo "PHP_INCLUDE not set." +exit; +elif [ x$PHP_SCA_SDO_INCLUDE = x ]; then +echo "PHP_SCA_SDO_INCLUDE not set." +exit; +elif [ x$PHP_SCA_SDO_LIB = x ]; then +echo "PHP_SCA_SDO_LIB not set." +exit; +fi +echo "Building PHP extension with PHP installed at $PHP_LIB, $PHP_INCLUDE" +echo "and PHP SCA and SDO installed at $PHP_SCA_SDO_LIB, $PHP_SCA_SDO_INCLUDE" + +#cd ${TUSCANY_SCACPP_HOME}/samples +#./autogen.sh + +cd ${SCA_PHP_EXTENSION_HOME} +./autogen.sh + + +./configure --prefix=${TUSCANY_SCACPP}/extensions/php +make +make install + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/configure.ac b/sca-cpp/trunk/contrib/runtime/extensions/php/configure.ac new file mode 100644 index 0000000000..d68d262b78 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/configure.ac @@ -0,0 +1,79 @@ +# 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. + +dnl run autogen.sh to generate the configure script. + +AC_PREREQ(2.59) +AC_INIT(tuscany_sca_php, 1.0-incubator-M3) +AC_CANONICAL_SYSTEM +AM_CONFIG_HEADER(tuscany_sca_php_config.h) +AM_INIT_AUTOMAKE([tar-ustar]) +AC_PREFIX_DEFAULT(/usr/local/tuscany/sca/extensions/php) + +# Checks for programs. +AC_PROG_CXX +AC_PROG_CC +AC_PROG_CPP +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PROG_LIBTOOL + +# Check for running on Darwin +AC_MSG_CHECKING([Checking if running on Darwin]) +UNAME=`uname -s` +if test "x$UNAME" = "xDarwin"; then + AC_DEFINE([IS_DARWIN], [1], [Set to 1 when running on Darwin - Mac OSX]) + AC_MSG_RESULT(yes) + AC_SUBST([libsuffix],[".dylib"]) + is_darwin=true +else + AC_MSG_RESULT(no) + AC_SUBST([libsuffix],[".so"]) + is_darwin=false +fi +AM_CONDITIONAL([DARWIN], [test x$is_darmin = xtrue]) + +# Checks for libraries. + +# Checks for header files. +AC_HEADER_DIRENT +AC_HEADER_STDC +AC_CHECK_HEADERS([inttypes.h stdlib.h string.h sys/time.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_HEADER_STDBOOL +AC_C_CONST +AC_C_INLINE + +# Checks for library functions. +AC_FUNC_CLOSEDIR_VOID +AC_FUNC_STAT +AC_FUNC_VPRINTF +AC_CHECK_FUNCS([getcwd putenv strdup]) +# AC_CONFIG_SUBDIRS([samples]) + + +AC_CONFIG_FILES([Makefile + src/Makefile + samples/Makefile + samples/PHPCalculator/Makefile + samples/PHPCalculator/sample.calculator/Makefile + samples/PHPCalculator/sample.calculator.client/Makefile + ]) +AC_OUTPUT + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/samples/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/Makefile.am new file mode 100644 index 0000000000..920828ef4f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/Makefile.am @@ -0,0 +1,18 @@ +# 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 = PHPCalculator \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/Makefile.am new file mode 100644 index 0000000000..fd34c6442a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/Makefile.am @@ -0,0 +1,21 @@ +# 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. + +deploydir=$(prefix)/samples/PHPCalculator/deploy +SUBDIRS = sample.calculator sample.calculator.client +EXTRA_DIST = *.composite +deploy_DATA = *.composite diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/README b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/README new file mode 100644 index 0000000000..dbee1f5f85 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/README @@ -0,0 +1,32 @@ +Tuscany SCA for C++ Samples - PHP Calculator Sample +=================================================== + +This is a simple sample to show how an SCA composite can wire together +a number of components to implement a Calculator service and expose that service as +to a number of different tpyes of client. The sample components are implemented in various +ways to demonstrate the different features of the PHP SCA extension. + +There are two sub projects in this workspace: + - sample.calculator + This contains the source code and SCDL artifacts for the SCA Calculator + composite implementing the sample Calculator + + - sample.calculator.client + A sample client which does a local call to the Calculator service + +A Python client is used because the work to enable PHP to host SCA is not done yet + +Windows +======= +tba + +Linux +===== + +The make install will deploy this under $TUSCANY_SCACPP/extensions/php/samples + +To run the sample + +cd $TUSCANY_SCACPP/extensions/php/samples/PHPCalculator/deploy/sample.calculator.client +./runclient.sh + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator.app.composite b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator.app.composite new file mode 100644 index 0000000000..ada4d89a1c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator.app.composite @@ -0,0 +1,28 @@ + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/Makefile.am new file mode 100644 index 0000000000..548f9bdcb8 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/Makefile.am @@ -0,0 +1,24 @@ +# 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. + +deploydir=$(prefix)/samples/PHPCalculator/deploy +clientdir=$(deploydir)/sample.calculator.client + +client_DATA = *.py +client_SCRIPTS = runclient.sh +EXTRA_DIST = *.py *.php runclient.sh + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/calculator_client.py b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/calculator_client.py new file mode 100644 index 0000000000..d4b37ee2b2 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/calculator_client.py @@ -0,0 +1,50 @@ +# 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 a simple sample that provides a Python +# client for the Calculator sample + + +import sys +import sca + +op = sys.argv[1] +val1 = sys.argv[2] +val2 = sys.argv[3] + +# Locate the calculator service +calc = sca.locateservice("CalculatorComponent/CalculatorService") + +# Invoke the calculator operations +if op == 'add': + result = calc.add(val1, val2) + +elif op == 'sub': + result = calc.sub(val1, val2) + +elif op == 'mul': + result = calc.mul(val1, val2) + +elif op == 'div': + result = calc.div(val1, val2) + + +print "calculator_client: ",op,"(",val1,",",val2,") = ",result + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/runclient.sh b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/runclient.sh new file mode 100755 index 0000000000..54ebfdbde4 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/runclient.sh @@ -0,0 +1,48 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$PYTHON_LIB != x ]; then +echo "Using Python library installed at $PYTHON_LIB" +export LD_LIBRARY_PATH=$PYTHON_LIB:$LD_LIBRARY_PATH +export PATH=$PYTHON_LIB/../bin:$PATH +fi + +export LD_LIBRARY_PATH=$PHP_SCA_SDO_LIB:$TUSCANY_SCACPP/lib:$TUSCANY_SCACPP/extensions/python/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH +export PYTHONPATH=$TUSCANY_SCACPP/extensions/python/lib:$PYTHONPATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ +export TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent +export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +cd $TUSCANY_SCACPP_ROOT/sample.calculator.client +python calculator_client.py mul 7 6 diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Calculator.componentType b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Calculator.componentType new file mode 100644 index 0000000000..5a6c3a199e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Calculator.componentType @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Calculator.php b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Calculator.php new file mode 100644 index 0000000000..f0f35bab56 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Calculator.php @@ -0,0 +1,89 @@ +add_service->add($num1, $num2); + } + + /** + * Subtraction + * + * @param float $num1 (the first number) + * @param float $num2 (the second number) + * @return float The result + */ + function sub($num1, $num2) { + return $num1 - $num2; +// return $this->sub_service->sub($num1, $num2); + } + + /** + * Multiplication + * + * @param float $num1 (the first number) + * @param float $num2 (the second number) + * @return float The result + */ + function mul($num1, $num2) { + return $this->mul_service->mul($num1, $num2); + } + + /** + * Division + * + * @param float $num1 (the first number) + * @param float $num2 (the second number) + * @return float The result + */ + function div($num1, $num2) { + return $this->div_service->div($num1, $num2); + } +} + +?> diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Divide.componentType b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Divide.componentType new file mode 100644 index 0000000000..b50b20d9c6 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Divide.componentType @@ -0,0 +1,29 @@ + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Divide.php b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Divide.php new file mode 100644 index 0000000000..5a08e5b063 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Divide.php @@ -0,0 +1,47 @@ +log_message($result); + + return $result; + + } + +} + +?> diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Log.componentType b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Log.componentType new file mode 100644 index 0000000000..f945c6af8c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Log.componentType @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Log.php b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Log.php new file mode 100644 index 0000000000..0a955f36d3 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Log.php @@ -0,0 +1,36 @@ +toLog('>>> ' . $message); + } +} + +?> diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Makefile.am new file mode 100644 index 0000000000..10020c4f03 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Makefile.am @@ -0,0 +1,23 @@ +# 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. + +deploydir=$(prefix)/samples/PHPCalculator/deploy +compositedir=$(deploydir)/sample.calculator + +composite_DATA = *.composite *.componentType *.php +EXTRA_DIST = *.composite *.componentType *.php + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Multiply.php b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Multiply.php new file mode 100644 index 0000000000..ed2e75edc8 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Multiply.php @@ -0,0 +1,39 @@ +log_service->log_message($result); + + return $result; + } +} + +?> diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/sample.calculator.composite b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/sample.calculator.composite new file mode 100644 index 0000000000..f1a82a70db --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/samples/PHPCalculator/sample.calculator/sample.calculator.composite @@ -0,0 +1,44 @@ + + + + + + + + DivideComponent + + + + + + LogComponent + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/php/src/Makefile.am new file mode 100644 index 0000000000..d0b04262f5 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/Makefile.am @@ -0,0 +1,57 @@ +# 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)/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/PHPInterfaceExtension.cpp \ +tuscany/sca/php/PHPServiceWrapper.cpp \ +tuscany/sca/php/PHPServiceProxy.cpp \ +tuscany/sca/php/sca.cpp \ +tuscany/sca/php/model/PHPImplementation.cpp \ +tuscany/sca/php/model/PHPInterface.cpp \ +tuscany/sca/php/model/PHPReferenceBinding.cpp \ +tuscany/sca/php/model/PHPServiceBinding.cpp + +libtuscany_sca_php_la_LIBADD = -L${TUSCANY_SCACPP}/lib -ltuscany_sca \ + -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \ + -L${PHP_LIB} -lphp5 \ + -L${PHP_SCA_SDO_LIB} -lsdo + +INCLUDES = -I${TUSCANY_SCACPP}/include \ + -I${TUSCANY_SDOCPP}/include \ + -I${PHP_INCLUDE} \ + -I${PHP_INCLUDE}/main \ + -I${PHP_INCLUDE}/Zend \ + -I${PHP_INCLUDE}/TSRM \ + -I${PHP_INCLUDE}/sapi/embed \ + -I${PHP_SCA_SDO_INCLUDE} + +moduledir=$(prefix)/module +extension = libtuscany_sca_php$(libsuffix) + +install-exec-hook: + test -z $(moduledir) || $(mkdir_p) $(moduledir); + -rm -f $(moduledir)/$(extension) + $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.cpp new file mode 100644 index 0000000000..0ffb660139 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.cpp @@ -0,0 +1,71 @@ +/* + * 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" +#include "tuscany/sca/php/PHPInterfaceExtension.h" + + +extern "C" +{ +#if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) +#endif + void tuscany_sca_php_initialize() + { + tuscany::sca::php::PHPExtension::initialize(); + } +} + +namespace tuscany +{ + namespace sca + { + namespace php + { + // =================================================================== + // Constructor for the PHPExtension class. + // =================================================================== + PHPExtension::PHPExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the PHPExtension class. + // =================================================================== + PHPExtension::~PHPExtension() + { + logentry(); + } + + void PHPExtension::initialize() + { + logentry(); + SCARuntime::getCurrentRuntime()->registerImplementationExtension(new PHPImplementationExtension()); + SCARuntime::getCurrentRuntime()->registerInterfaceExtension(new PHPInterfaceExtension()); + } + + } // End namespace php + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.h b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.h new file mode 100644 index 0000000000..971ed93c86 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.h @@ -0,0 +1,57 @@ +/* + * 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/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.cpp new file mode 100644 index 0000000000..101667302f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.cpp @@ -0,0 +1,73 @@ +/* + * 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" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace php + { + // =================================================================== + // Constructor for the PHPImplementationExtension class. + // =================================================================== + PHPImplementationExtension::PHPImplementationExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the PHPImplementationExtension class. + // =================================================================== + PHPImplementationExtension::~PHPImplementationExtension() + { + logentry(); + } + + 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) + { + logentry(); + + string module = scdlImplementation->getCString("module"); + string className = scdlImplementation->getCString("class"); + + PHPImplementation* phpImpl = new PHPImplementation(composite, module, className); + + return phpImpl; + } + + } // End namespace php + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.h b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.h new file mode 100644 index 0000000000..604c4ea102 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.h @@ -0,0 +1,74 @@ +/* + * 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 std::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 std::string& getExtensionTypeQName() {return typeQName;} + + virtual tuscany::sca::model::ComponentType* getImplementation( + tuscany::sca::model::Composite* composite, + commonj::sdo::DataObjectPtr scdlImplementation); + + private: + static const std::string extensionName; + static const std::string typeQName; + + }; + + + } // End namespace php + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_php_phpimplementationextension_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.cpp new file mode 100644 index 0000000000..a07c499dec --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.cpp @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#include "tuscany/sca/php/PHPInterfaceExtension.h" +#include "tuscany/sca/php/model/PHPInterface.h" +#include "tuscany/sca/util/Logging.h" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace php + { + // =================================================================== + // Constructor for the PHPInterfaceExtension class. + // =================================================================== + PHPInterfaceExtension::PHPInterfaceExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the PHPInterfaceExtension class. + // =================================================================== + PHPInterfaceExtension::~PHPInterfaceExtension() + { + logentry(); + } + + const string PHPInterfaceExtension::extensionName("php"); + const string PHPInterfaceExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#PHPInterface"); + + // =================================================================== + // loadModelElement - load the info from interface.php + // =================================================================== + tuscany::sca::model::Interface* PHPInterfaceExtension::getInterface(Composite* composite, DataObjectPtr scdlInterface) + { + logentry(); + + // Determine the type + string ifType = scdlInterface->getType().getName(); + if (ifType == "PHPInterface") + { + bool remotable = scdlInterface->getBoolean("remotable"); + bool conversational = scdlInterface->getBoolean("conversational"); + + return new PHPInterface(remotable, conversational); + } + return 0; + } + + } // End namespace php + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.h b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.h new file mode 100644 index 0000000000..4279376300 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.h @@ -0,0 +1,74 @@ +/* + * 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_phpinterfaceextension_h +#define tuscany_sca_php_phpinterfaceextension_h + +#include "tuscany/sca/extension/InterfaceExtension.h" + +namespace tuscany +{ + namespace sca + { + namespace php + { + + class PHPInterfaceExtension : public InterfaceExtension + { + public: + /** + * Default constructor + */ + PHPInterfaceExtension(); + + /** + * Destructor + */ + virtual ~PHPInterfaceExtension(); + + /** + * return the name of the extension + */ + virtual const std::string& getExtensionName() {return extensionName;} + + /** + * return the QName of schema elemant for this implementation extension + * (e.g. "http://www.osoa.org/xmlns/sca/1.0#PHPInterface") + */ + virtual const std::string& getExtensionTypeQName() {return typeQName;} + + virtual tuscany::sca::model::Interface* getInterface( + tuscany::sca::model::Composite* composite, + commonj::sdo::DataObjectPtr scdlInterface); + + private: + static const std::string extensionName; + static const std::string typeQName; + + }; + + + } // End namespace php + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_php_phpinterfaceextension_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPServiceProxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPServiceProxy.cpp new file mode 100644 index 0000000000..4b66c42a5b --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPServiceProxy.cpp @@ -0,0 +1,81 @@ +/* + * 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/PHPServiceProxy.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/model/ServiceBinding.h" +#include "tuscany/sca/php/model/PHPReferenceBinding.h" + +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace php + { + + // ============================================ + // Constructor: Create a proxy from a reference + // ============================================ + PHPServiceProxy::PHPServiceProxy(Reference* reference) + : ServiceProxy(reference) + { + logentry(); + + // Get the service wrapper + PHPReferenceBinding* referenceBinding = (PHPReferenceBinding*)reference->getBinding(); + serviceWrapper = referenceBinding->getTargetServiceBinding()->getServiceWrapper(); + } + + // ========================================== + // Constructor: Create a proxy from a service + // ========================================== + PHPServiceProxy::PHPServiceProxy(Service* service) + : ServiceProxy(NULL) + { + logentry(); + + // Get the service wrapper + serviceWrapper = service->getBinding()->getServiceWrapper(); + } + + // ========== + // Destructor + // ========== + PHPServiceProxy::~PHPServiceProxy() + { + logentry(); + } + + // ===================================================== + // invokeService: invoke the service wired to this proxy + // ===================================================== + void PHPServiceProxy::invokeService(Operation& operation) + { + logentry(); + + // Invoke the service + serviceWrapper->invoke(operation); + } + } // End namespace php + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPServiceProxy.h b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPServiceProxy.h new file mode 100644 index 0000000000..bddb262617 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPServiceProxy.h @@ -0,0 +1,83 @@ +/* + * 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_phpserviceproxy_h +#define tuscany_sca_php_phpserviceproxy_h + +#include "tuscany/sca/php/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" + + +namespace tuscany +{ + namespace sca + { + namespace php + { + + /** + * Holds a proxy for a given reference from a component implemented in PHP. + */ + class PHPServiceProxy : 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. + */ + PHPServiceProxy(tuscany::sca::model::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. + */ + PHPServiceProxy(tuscany::sca::model::Service* service); + + /** + * Destructor. + */ + virtual ~PHPServiceProxy(); + + /** + * Invoke the wired service. + */ + virtual void invokeService(Operation& operation); + + private: + + /** + * The target service wrapper + */ + ServiceWrapper* serviceWrapper; + }; + + } // End namespace php + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_php_phpserviceproxy_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp new file mode 100644 index 0000000000..8c92be0d83 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp @@ -0,0 +1,505 @@ +/* + * 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$ */ + +#ifdef WIN32 + +// some strangeness in the build that causes +// WinSock.h and WinSock2.h to be included leading to redefinitions +#define _WINSOCKAPI_ + +// sdo.cpp also includes the math libraries and causes redeclarations +// of all the math functions +#define _INC_MATH + +#endif //WIN32 + +#include +#include + +#include + + +#include "tuscany/sca/php/PHPServiceWrapper.h" +#include "tuscany/sca/php/PHPServiceProxy.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/Exceptions.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 "sca.h" +#include "php_sdo_int.h" + +using namespace std; +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace php + { + + int embedSAPIInitializeCount = 0; + + // Global callbacks used by the PHP engine + + // Callback for SAPI error + void php_sapi_error(int type, const char *error_msg, ...) + { + logwarning("PHP sapi error: %s", error_msg); + //TODO - do something sensible with this output + zend_bailout(); + } + + // Callback for log messages + void php_log_message(char *message) + { + loginfo("PHP log: %s", message); + //TODO - do something sensible with this output + } + + // Callback for unbuffered writes (echo, print etc.) + int php_ub_write(const char *str, unsigned int str_length TSRMLS_DC) + { + logentry(); + loginfo("PHP Output: %s", str); + //TODO - do something sensible with this output + 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) + { + logentry(); + + char buffer[2048]; + int len; + + len = snprintf(buffer, 2048, "Error in file %s on line %d: ", error_filename, error_lineno); + vsnprintf(buffer + len, (2048 - len), format, args); + logwarning("PHP error: %s", buffer); + //TODO - do something sensible with this output + zend_bailout(); + } + + + // =========== + // Constructor + // =========== + PHPServiceWrapper::PHPServiceWrapper(Service* service) + : ServiceWrapper(service) + { + logentry(); + + 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"; + throwException(SystemConfigurationException, msg.c_str()); + } + + loginfo("Module: %s", impl->getModule().c_str()); + loginfo("Class: %s", impl->getClass().c_str()); + } + + // ========== + // Destructor + // ========== + PHPServiceWrapper::~PHPServiceWrapper() + { + logentry(); + } + + + // ====================================================================== + // invoke: wrapper call to service with setting the component context + // ====================================================================== + void PHPServiceWrapper::invoke(Operation& operation) + { + zval z_func_name, retval, z_component_name, z_class_name, z_operation_name, z_arg_array; + zval *params[5]; + + logentry(); + + // set the current component in the SCA runtime + // so that other things can get at it thorugh this + // static class + SCARuntime* runtime = SCARuntime::getCurrentRuntime(); + runtime->setCurrentComponent(component); + + try + { + // get the component type information + PHPImplementation* impl = (PHPImplementation*)component->getType(); + + // get the directory containing the component type + const string &compositeDir = impl->getComposite()->getRoot(); + + // get some useful information that will be used later + // when we construct the wrapper script + string componentName = component->getName(); + string className = impl->getClass(); + string operationName = operation.getName(); + loginfo("Component %s class %s operation: %s", + componentName.c_str(), + className.c_str(), + operationName.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.sapi_error = php_sapi_error; + + // would normally use the following macro before the embeded call + // but we need to take account of multiple nested calls + // and ZTS threading safety is not behaving itself + // PHP_EMBED_START_BLOCK(/* argc */ 0, /* argv */ NULL) + // ===================================================================== + { +#ifdef ZTS + static void ***tsrm_ls; + loginfo("ZTS enabled"); + + printf("tsrm_ls = %x, embedSAPIInitializeCount = %d\n", + tsrm_ls, embedSAPIInitializeCount); +#endif + + if ( embedSAPIInitializeCount == 0 ) + { + embedSAPIInitializeCount = 1; + + php_embed_init(0, NULL PTSRMLS_CC); + + // load up the sca module that provides the interface between + // C++ and user space PHP + zend_first_try { + zend_startup_module(&sca_module_entry); + } zend_end_try(); + } else { + embedSAPIInitializeCount++; + } + + zend_try { + // set error handler + zend_error_cb = php_error_cb; + + /* + * Open the include files + */ + // includeFile("SCA/SCA.php" TSRMLS_CC); + // includeFile("SCA/Bindings/tuscany/SCA_TuscanyWrapper.php" TSRMLS_CC); + + /* Instantiate a SCA_Tuscany (mediator) object, and + * set its operation property + */ + zval z_tuscany_mediator; + zval *pz_mediator = &z_tuscany_mediator; + INIT_ZVAL(z_tuscany_mediator); + zend_class_entry *ce_mediator = + zend_fetch_class("SCA_Tuscany", sizeof("SCA_Tuscany") - 1, 0 TSRMLS_CC); + object_init_ex(pz_mediator, ce_mediator); + z_tuscany_mediator.value.obj.handlers->add_ref(pz_mediator TSRMLS_CC); + + zend_update_property_long(ce_mediator, pz_mediator, + "operation", sizeof("operation") - 1, (long)&operation TSRMLS_CC); + + /* get the class info loaded up */ + zend_eval_string("include 'SCA/SCA.php';", + NULL, "Include SCA" TSRMLS_CC); + zend_eval_string("include 'SCA/Bindings/tuscany/SCA_TuscanyWrapper.php';", + NULL, "Include SCA_TuscanyWrapper" TSRMLS_CC); + + /* Now instantiate an SCA_TuscanyWrapper object and call its constructor */ + zval z_tuscany_wrapper; + zval *pz_tuscany_wrapper = &z_tuscany_wrapper; + INIT_ZVAL(z_tuscany_wrapper); + object_init_ex(pz_tuscany_wrapper, + zend_fetch_class("SCA_TuscanyWrapper", sizeof("SCA_TuscanyWrapper") - 1, 0 TSRMLS_CC)); + z_tuscany_wrapper.value.obj.handlers->add_ref(pz_tuscany_wrapper TSRMLS_CC); + + ZVAL_STRING(&z_func_name, "__construct", 1); + ZVAL_STRING(&z_component_name, (char *)componentName.c_str(), 1); + if( &className != NULL && className.size() > 0) { + ZVAL_STRING(&z_class_name, (char *)className.c_str(), 1); + } else { + ZVAL_NULL(&z_class_name); + } + ZVAL_STRING(&z_operation_name, (char *)operationName.c_str(), 1); + + array_init(&z_arg_array); + + // get the parameters from the operation structure + for(unsigned int i = 0; i < operation.getNParms(); i++) + { + const Operation::Parameter& parm = operation.getParameter(i); + //printf("Arg %d type %d\n", i, parm.getType()); + switch(parm.getType()) + { + case Operation::BOOL: + { + add_next_index_bool(&z_arg_array, (int)*(bool*)parm.getValue() ); + break; + } + case Operation::SHORT: + case Operation::USHORT: + case Operation::LONG: + case Operation::ULONG: + { + add_next_index_long(&z_arg_array, *(long*)parm.getValue() ); + break; + } + case Operation::FLOAT: + { + add_next_index_double(&z_arg_array,( double)*(float*)parm.getValue() ); + break; + } + case Operation::DOUBLE: + case Operation::LONGDOUBLE: + { + add_next_index_double(&z_arg_array, *(double*)parm.getValue() ); + break; + } + case Operation::CHARS: + { + add_next_index_string(&z_arg_array, *(char**)parm.getValue(), 1 ); + break; + } + case Operation::STRING: + { + add_next_index_string(&z_arg_array, (char*)(*(string*)parm.getValue()).c_str(), 1 ); + break; + } + case Operation::DATAOBJECT: + { + // convert the tuscany SDO into a PHP SDO + + // create the object + zval *sdo; + ALLOC_INIT_ZVAL(sdo); + sdo_do_new(sdo, *(DataObjectPtr*)parm.getValue() TSRMLS_CC); + + // add it to the arg array + add_next_index_zval(&z_arg_array, sdo); + break; + } + default: + { + char *class_name; + char *space; + class_name = get_active_class_name(&space TSRMLS_CC); + php_error(E_ERROR, + "%s%s%s(): Argument type %d not supported", + class_name, + space, + get_active_function_name(TSRMLS_C), + parm.getType()); + } + } + } + + params[0] = &z_tuscany_mediator; + params[1] = &z_component_name; + params[2] = &z_class_name; + params[3] = &z_operation_name; + params[4] = &z_arg_array; + + call_user_function(EG(function_table), + &pz_tuscany_wrapper, + &z_func_name, + &retval, + 5, + params TSRMLS_CC); + + zval_dtor(&z_func_name); + zval_dtor(&z_component_name); + zval_dtor(&z_class_name); + zval_dtor(&z_operation_name); + zval_dtor(&z_arg_array); + + string script; + script = "include '" + compositeDir + "/" + impl->getModule() + ".php';"; + loginfo("Script: %s", script.c_str()); + + // call the dynamically created script + // I'm not trapping the return value here + // as it seems to prevent any kind of output + // being produced. Needs investigation. + //zval retval; + zend_eval_string((char *) script.c_str(), + NULL, //&retval, + "Include module" TSRMLS_CC); + + loginfo(">>>> About to call SCA_TuscanyWrapper->invoke()"); + + /* Now call SCA_TuscanyWrapper->invoke() ... */ + ZVAL_STRING(&z_func_name, "invoke", 1); + call_user_function(EG(function_table), + &pz_tuscany_wrapper, &z_func_name, + &retval, 0, NULL TSRMLS_CC); + + loginfo("<<<< Return from SCA_TuscanyWrapper->invoke()"); + + zval_dtor(&z_func_name); + + /* ... and copy the return value into the operation */ + switch(Z_TYPE(retval)) + { + case IS_NULL: + { + //printf("NULL response"); + break; + } + case IS_BOOL: + { + bool *newBool = new bool; + *newBool = ZEND_TRUTH(Z_BVAL(retval)); + operation.setReturnValue(newBool); + break; + } + case IS_LONG: + { + long *newLong = new long; + *newLong = Z_LVAL(retval); + operation.setReturnValue(newLong); + break; + } + case IS_DOUBLE: + { + //double *newDouble = new double; + float *newDouble = new float; + *newDouble = (float)Z_DVAL(retval); + operation.setReturnValue(newDouble); + break; + } + case IS_STRING: + { + string newString (Z_STRVAL(retval)); + operation.setReturnValue(&newString); + break; + } + case IS_OBJECT: + { + // convert the PHP SDO into a Tuscany SDO + DataObjectPtr sdo = sdo_do_get(&retval TSRMLS_CC); + operation.setReturnValue(&sdo); + break; + } + default: + { + char *class_name; + char *space; + class_name = get_active_class_name(&space TSRMLS_CC); + php_error(E_ERROR, + "%s%s%s(): Input argument type %d not supported on invoke", + class_name, + space, + get_active_function_name(TSRMLS_C), + Z_TYPE(retval)); + } + } + } zend_catch { + /* int exit_status = EG(exit_status); */ + } + zend_end_try(); + + if ( embedSAPIInitializeCount == 1 ) + { + php_embed_shutdown(TSRMLS_C); + loginfo("Engine shutdown"); + } + else + { + embedSAPIInitializeCount--; + } + } + // ===================================================================== + } + catch (...) + { + runtime->unsetCurrentComponent(); + throw; + } + runtime->unsetCurrentComponent(); + + } + + // ====================================================================== + // getServiceWrapper: create a wrapper for the target ComponentService + // ====================================================================== + PHPServiceWrapper* PHPServiceWrapper::getServiceWrapper(Service* service) + { + logentry(); + PHPServiceWrapper* serviceWrapper = 0; + + // --------------------------------- + // Create an instance of the wrapper + // --------------------------------- + serviceWrapper = new PHPServiceWrapper(service); + if (!serviceWrapper) + { + string msg = "Could not create new PHPServiceWrapper"; + throwException(SystemConfigurationException, msg.c_str()); + } + + return serviceWrapper; + } + + /* Not used at the moment + * Can find the include file and execute it, + * but doesn't make the contents available + */ + void PHPServiceWrapper::includeFile(char *includeFileName TSRMLS_DC) + { + zend_file_handle include_file_handle; + + include_file_handle.type = ZEND_HANDLE_FP; + include_file_handle.filename = includeFileName; + include_file_handle.opened_path = NULL; + include_file_handle.free_filename = 0; + if (!(include_file_handle.handle.fp = php_fopen_with_path( + include_file_handle.filename, "rb", PG(include_path), + &include_file_handle.opened_path TSRMLS_CC))) { + php_error(E_ERROR, + "Could not open %s", include_file_handle.filename); + return; + } + php_execute_script(&include_file_handle TSRMLS_CC); + } + + } // End namespace php + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.h new file mode 100644 index 0000000000..be20f34217 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.h @@ -0,0 +1,112 @@ +/* + * 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 "tuscany/sca/php/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 + +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(tuscany::sca::model::Service* service); + + /** + * Constructor. + * @param target The component service to which this wrapper refers. + */ + PHPServiceWrapper(tuscany::sca::model::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: + + /** + * Utility method to execute a script on the include_path. + */ + static void includeFile(char *includeFileName TSRMLS_DC); + + /** + * The component to which this wrapper refers. + */ + tuscany::sca::model::Component* component; + + /** + * Set to true if the service is remotable. + */ + bool remotable; + + /** + * A pointer to the interface which the service exposes. + */ + tuscany::sca::model::Interface* interf; + + }; + + } // End namespace php + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_php_phpservicewrapper_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/export.h b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/export.h new file mode 100644 index 0000000000..11a9519361 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/export.h @@ -0,0 +1,41 @@ +/* + * 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_export_h +#define tuscany_sca_php_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 // tuscany_sca_export_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.cpp b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.cpp new file mode 100644 index 0000000000..63f1672ec5 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.cpp @@ -0,0 +1,85 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#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" + +using namespace std; +using namespace tuscany::sca::model; + +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(); + } + + PHPImplementation::~PHPImplementation() + { + logentry(); + } + + void PHPImplementation::initializeComponent(Component* component) + { + logentry(); + 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++; + } + + // 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++; + } + } + + } // End namespace php + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.h b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.h new file mode 100644 index 0000000000..78e678dff5 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.h @@ -0,0 +1,95 @@ +/* + * 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 + +#include "tuscany/sca/model/ComponentType.h" + + +namespace tuscany +{ + namespace sca + { + namespace php + { + /** + * Holds information about an SCA implementation written in PHP + */ + class PHPImplementation : public tuscany::sca::model::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(tuscany::sca::model::Composite* composite, const std::string& module, const std::string& className); + + /** + * Destructor + */ + virtual ~PHPImplementation(); + + /** + * Initialize a component of this type. + * @param component The component to initialize. + */ + virtual void initializeComponent(tuscany::sca::model::Component* component); + + /** + * Returns the name of the module. + * @return The name of the module. + */ + const std::string& getModule() const { return module; } + + /** + * Get the name of the class. + * @return The class name if specified. + */ + const std::string& getClass() const { return className; } + + private: + + /** + * Name of the module. + */ + std::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. + */ + std::string className; + }; + + } // End namespace php + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_php_model_phpimplementation_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.cpp b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.cpp new file mode 100644 index 0000000000..cbea3f2b71 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.cpp @@ -0,0 +1,53 @@ +/* + * 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/export.h" +#include "tuscany/sca/php/model/PHPInterface.h" + +using namespace std; + +namespace tuscany +{ + namespace sca + { + namespace php + { + const string PHPInterface::typeQName("http://www.osoa.org/xmlns/sca/1.0#PHPInterface"); + + // Constructor + PHPInterface::PHPInterface( + bool remotable, + bool conversational) + : Interface(remotable, conversational) + { + logentry(); + } + + PHPInterface::~PHPInterface() + { + logentry(); + } + + } // End namespace php + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.h b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.h new file mode 100644 index 0000000000..9a4f658eb0 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.h @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + + +#ifndef tuscany_sca_php_model_phpinterface_h +#define tuscany_sca_php_model_phpinterface_h + +#include + +#include "tuscany/sca/php/export.h" +#include "tuscany/sca/model/Interface.h" + +namespace tuscany +{ + namespace sca + { + namespace php + { + /** + * Holds information about an interface described using a PHP + * header file. + */ + class PHPInterface : public tuscany::sca::model::Interface + { + + public: + /** + * Constuctor. + * @param scope The scope of the interface (stateless or composite). + * @param remotable True if the interface is remotable. + */ + PHPInterface( + bool remotable, + bool conversational); + + /** + * Destructor. + */ + virtual ~PHPInterface(); + + /** + * return the QName of the schema type for this interface type + * (e.g. "http://www.osoa.org/xmlns/sca/1.0#interface.cpp") + */ + const std::string& getInterfaceTypeQName() { return typeQName; }; + + /** + * The QName of the schema type for this interface type. + */ + SCA_PHP_API static const std::string typeQName; + + }; + + } // End namespace php + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_php_model_phpinterface_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPReferenceBinding.cpp b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPReferenceBinding.cpp new file mode 100644 index 0000000000..919d4c8646 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPReferenceBinding.cpp @@ -0,0 +1,61 @@ +/* + * 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/PHPReferenceBinding.h" +#include "tuscany/sca/php/PHPServiceProxy.h" + +using namespace std; +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace php + { + + // Constructor + PHPReferenceBinding::PHPReferenceBinding(Reference* reference) + : ReferenceBinding(reference, ""), serviceProxy(NULL) + { + } + + // Destructor + PHPReferenceBinding::~PHPReferenceBinding() + { + } + + ServiceProxy* PHPReferenceBinding::getServiceProxy() + { + return serviceProxy; + } + + void PHPReferenceBinding::configure(ServiceBinding* binding) + { + setTargetServiceBinding(binding); + + serviceProxy = new PHPServiceProxy(getReference()); + } + + } // End namespace + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPReferenceBinding.h b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPReferenceBinding.h new file mode 100644 index 0000000000..45b422da2c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPReferenceBinding.h @@ -0,0 +1,82 @@ +/* + * 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_phpreferencebinding_h +#define tuscany_sca_php_model_phpreferencebinding_h + +#include + +#include "tuscany/sca/model/ReferenceBinding.h" + + +namespace tuscany +{ + namespace sca + { + namespace php + { + /** + * Information about a PHP service binding for service or a reference. + */ + class PHPReferenceBinding : public tuscany::sca::model::ReferenceBinding + { + public: + + /** + * Constructor. + */ + PHPReferenceBinding(tuscany::sca::model::Reference* reference); + + /** + * Destructor. + */ + virtual ~PHPReferenceBinding(); + + /** + * Returns the type of binding. + */ + virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#PHPImplementationBinding"; }; + + /** + * Create a proxy representing the reference to the + * client component. + */ + virtual ServiceProxy* getServiceProxy(); + + /** + * Configure this binding from a service binding. + */ + virtual void configure(tuscany::sca::model::ServiceBinding* serviceBinding); + + private: + + /** + * The proxy representing the reference to the client + * component. + */ + ServiceProxy* serviceProxy; + }; + + } // End namespace php + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_php_model_phpreferencebinding_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.cpp b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.cpp new file mode 100644 index 0000000000..4d18424ae2 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.cpp @@ -0,0 +1,58 @@ +/* + * 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" + +using namespace std; +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace php + { + + // Constructor + PHPServiceBinding::PHPServiceBinding(Service* service) + : ServiceBinding(service, "") + { + logentry(); + serviceWrapper = PHPServiceWrapper::getServiceWrapper(service); + } + + // Destructor + PHPServiceBinding::~PHPServiceBinding() + { + logentry(); + } + + ServiceWrapper* PHPServiceBinding::getServiceWrapper() + { + logentry(); + return (ServiceWrapper*)serviceWrapper; + } + + } // End namespace php + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.h b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.h new file mode 100644 index 0000000000..ef3d6b1604 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.h @@ -0,0 +1,81 @@ +/* + * 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 + +#include "tuscany/sca/model/ServiceBinding.h" + + +namespace tuscany +{ + namespace sca + { + namespace php + { + /** + * Information about a PHP service binding for service or a reference. + */ + class PHPServiceBinding : public tuscany::sca::model::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(tuscany::sca::model::Service* service); + + /** + * Destructor. + */ + virtual ~PHPServiceBinding(); + + /** + * Returns the type of binding. + */ + virtual std::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/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/php_sca.h b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/php_sca.h new file mode 100644 index 0000000000..8aea8dadb2 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/php_sca.h @@ -0,0 +1,132 @@ +/* + * 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. + */ + +/* $ Id: $ */ + +#ifndef PHP_SCA_H +#define PHP_SCA_H + +#include "tuscany/sca/core/Operation.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include
      + +#ifdef HAVE_SCA + +#include
      +#include
      +#include +#include +#ifdef __cplusplus +} // extern "C" +#endif +#ifdef __cplusplus +extern "C" { +#endif + + +//extern zend_module_entry sca_module_entry; +#define phpext_sca_ptr &sca_module_entry + +#ifdef PHP_WIN32 +#define PHP_SCA_API __declspec(dllexport) +#else +#define PHP_SCA_API +#endif + +PHP_MINIT_FUNCTION(sca); +PHP_MSHUTDOWN_FUNCTION(sca); +PHP_MINFO_FUNCTION(sca); + +#ifdef ZTS +#include "TSRM/TSRM.h" +#endif + +#define FREE_RESOURCE(resource) zend_list_delete(Z_LVAL_P(resource)) + +#define PROP_GET_LONG(name) Z_LVAL_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) +#define PROP_SET_LONG(name, l) zend_update_property_long(_this_ce, _this_zval, #name, strlen(#name), l TSRMLS_CC) + +#define PROP_GET_DOUBLE(name) Z_DVAL_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) +#define PROP_SET_DOUBLE(name, d) zend_update_property_double(_this_ce, _this_zval, #name, strlen(#name), d TSRMLS_CC) + +#define PROP_GET_STRING(name) Z_STRVAL_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) +#define PROP_GET_STRLEN(name) Z_STRLEN_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) +#define PROP_SET_STRING(name, s) zend_update_property_string(_this_ce, _this_zval, #name, strlen(#name), s TSRMLS_CC) +#define PROP_SET_STRINGL(name, s, l) zend_update_property_string(_this_ce, _this_zval, #name, strlen(#name), s, l TSRMLS_CC) + + +PHP_METHOD(SCA_Tuscany, __construct); +#if (PHP_MAJOR_VERSION >= 5) +ZEND_BEGIN_ARG_INFO_EX(SCA_Tuscany____construct_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_END_ARG_INFO() +#else /* PHP 4.x */ +#define SCA_Tuscany____construct_args NULL +#endif + +PHP_METHOD(SCA_Tuscany, invoke); +#if (PHP_MAJOR_VERSION >= 5) +ZEND_BEGIN_ARG_INFO_EX(SCA_Tuscany__invoke_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 4) + ZEND_ARG_INFO(0, component_name) + ZEND_ARG_INFO(0, reference_name) + ZEND_ARG_INFO(0, method_name) +#if (PHP_MINOR_VERSION > 0) + ZEND_ARG_ARRAY_INFO(0, arguments, 1) +#else + ZEND_ARG_INFO(0, arguments) +#endif +ZEND_END_ARG_INFO() +#else /* PHP 4.x */ +#define SCA_Tuscany__invoke_args NULL +#endif + +PHP_METHOD(SCA_Tuscany, getArgArray); +#if (PHP_MAJOR_VERSION >= 5) +ZEND_BEGIN_ARG_INFO_EX(SCA_Tuscany__getArgArray_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_END_ARG_INFO() +#else /* PHP 4.x */ +#define SCA_Tuscany__getArgArray_args NULL +#endif + +#ifdef __cplusplus +} // extern "C" +#endif + + + +#endif /* PHP_HAVE_SCA */ + +#endif /* PHP_SCA_H */ + + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/sca.cpp b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/sca.cpp new file mode 100644 index 0000000000..4078226f63 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/sca.cpp @@ -0,0 +1,517 @@ +/* + * 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. + */ + +/* $ Id: $ */ + +#ifdef WIN32 + +// some strangeness in the build that causes +// WinSock.h and WinSock2.h to be included leading to redefinitions +#define _WINSOCKAPI_ + +#endif //WIN32 + +#include "tuscany/sca/core/SCARuntime.h" +#include "tuscany/sca/php/PHPServiceProxy.h" +#include "commonj/sdo/RefCountingPointer.h" + +using namespace std; +using namespace tuscany::sca; +using namespace tuscany::sca::model; +using namespace tuscany::sca::php; +using namespace commonj::sdo; + +#define HAVE_SCA 1 + + +#include "php_sca.h" +#include "sca.h" + +#if HAVE_SCA + +#include "php_sdo.h" +#include "php_sdo_int.h" +/* {{{ Class definitions */ + +/* {{{ Class SCA_Tuscany */ + +static zend_class_entry * SCA_Tuscany_ce_ptr = NULL; + +/* {{{ Methods */ + +/* {{{ proto void __construct(int operation_handle) + */ +PHP_METHOD(SCA_Tuscany, __construct) +{ + zval *_this_zval = getThis(); + zend_class_entry *_this_ce = Z_OBJCE_P(_this_zval); + + long operation_handle = 0; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &operation_handle) == FAILURE) { + return; + } + + if (!operation_handle) { + php_error(E_ERROR, "SCA_Tuscany ctor called with NULL operation"); + } + + PROP_SET_LONG(operation, operation_handle); +} +/* }}} __construct */ + +/* {{{ proto int invoke(string component_name, string reference_name, string method_name, array arguments) + Invoke a Tuscany component */ +PHP_METHOD(SCA_Tuscany, invoke) +{ + //zval * _this_zval = NULL; + const char * component_name = NULL; + int component_name_len = 0; + const char * reference_name = NULL; + int reference_name_len = 0; + const char * method_name = NULL; + int method_name_len = 0; + zval * arguments = NULL; + HashTable * arguments_hash = NULL; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssa/", + &component_name, &component_name_len, + &reference_name, &reference_name_len, + &method_name, &method_name_len, + &arguments) == FAILURE) { + return; + } + + arguments_hash = HASH_OF(arguments); + + // find the correct service proxy + SCARuntime* runtime = SCARuntime::getCurrentRuntime(); + Component* component = runtime->getCurrentComponent(); + Reference* ref = component->findReference(reference_name); + if(!ref) { + char *class_name; + char *space; + class_name = get_active_class_name(&space TSRMLS_CC); + php_error(E_ERROR, + "%s%s%s(): Can't find reference %s", + class_name, + space, + get_active_function_name(TSRMLS_C), + reference_name); + return; + } + + ReferenceBinding* refBinding = ref->getBinding(); + PHPServiceProxy *serviceProxy = (PHPServiceProxy*) refBinding->getServiceProxy(); + + // construct an operation structure + Operation operation(method_name); + + // add the parameters to the operation + for ( zend_hash_internal_pointer_reset(arguments_hash); + zend_hash_has_more_elements(arguments_hash) == SUCCESS; + zend_hash_move_forward(arguments_hash) ) + { + zval **data; + + if ( zend_hash_get_current_data(arguments_hash, + (void**)&data ) == FAILURE ) + { + continue; + } + + char *hashKey; + uint hashKeyLength; + ulong hashIndex; + int type; + + type = zend_hash_get_current_key_ex(arguments_hash, + &hashKey, + &hashKeyLength, + &hashIndex, + 0, + NULL); + + switch(Z_TYPE_PP(data)) + { + case IS_NULL: + { + //printf("NULL argument"); + break; + } + case IS_BOOL: + { + convert_to_boolean(*data); + bool *newBool = new bool; + *newBool = ZEND_TRUTH(Z_BVAL_PP(data)); + operation.addParameter(newBool); + break; + } + case IS_LONG: + { + convert_to_long(*data); + long *newLong = new long; + *newLong = Z_LVAL_PP(data); + operation.addParameter(newLong); + break; + } + case IS_DOUBLE: + { + //convert_to_double(*data); + //double *newDouble = new double; + convert_to_double(*data); + float *newDouble = new float; + *newDouble = (float)Z_DVAL_PP(data); + operation.addParameter(newDouble); + break; + } + case IS_STRING: + { + convert_to_string(*data); + string newString (Z_STRVAL_PP(data)); + operation.addParameter(&newString); + break; + } + case IS_OBJECT: + { + // convert the PHP SDO into a Tuscany SDO + DataObjectPtr sdo = sdo_do_get(*data TSRMLS_CC); + operation.addParameter(&sdo); + break; + } + default: + { + char *class_name; + char *space; + class_name = get_active_class_name(&space TSRMLS_CC); + php_error(E_ERROR, + "%s%s%s(): Input argument type %d not supported on invoke", + class_name, + space, + get_active_function_name(TSRMLS_C), + Z_TYPE_PP(data)); + } + } + } + + // call the proxy + serviceProxy->invokeService(operation); + + switch(operation.getReturnType()) + { + case Operation::BOOL: + { + ZVAL_BOOL(return_value, *(bool*)operation.getReturnValue()); + break; + } + case Operation::SHORT: + case Operation::USHORT: + case Operation::LONG: + case Operation::ULONG: + { + ZVAL_LONG(return_value, *(long*)operation.getReturnValue()); + break; + } + case Operation::FLOAT: + case Operation::DOUBLE: + case Operation::LONGDOUBLE: + { + ZVAL_DOUBLE(return_value, (double)*(float*)operation.getReturnValue()); + break; + } + case Operation::CHARS: + { + ZVAL_STRING(return_value, (char*)operation.getReturnValue(), 1); + break; + } + case Operation::STRING: + { + ZVAL_STRING(return_value, (char*)((string*)operation.getReturnValue())->c_str(), 1); + break; + } + case Operation::VOID_TYPE: + { + // do nothing + break; + } + case Operation::DATAOBJECT: + { + // convert the tuscany SDO into a PHP SDO + sdo_do_new(return_value, *(DataObjectPtr*)operation.getReturnValue() TSRMLS_CC); + break; + } + default: + { + char *class_name; + char *space; + class_name = get_active_class_name(&space TSRMLS_CC); + php_error(E_ERROR, + "%s%s%s(): Response type %d not supported on invoke", + class_name, + space, + get_active_function_name(TSRMLS_C), + operation.getReturnType()); + } + } + +} +/* }}} invoke */ + +/* {{{ proto array getArgArray() + return the arguments for the operation as an array */ +PHP_METHOD(SCA_Tuscany, getArgArray) +{ + zval * _this_zval = getThis(); + zend_class_entry *_this_ce = Z_OBJCE_P(_this_zval); + + if (ZEND_NUM_ARGS() > 0) { + WRONG_PARAM_COUNT; + } + + array_init(return_value); + + // get the operation object from the object properties + Operation *operation = (Operation *)PROP_GET_LONG(operation); + + // get the parameters from the operation structure + for(unsigned int i = 0; i < operation->getNParms(); i++) + { + const Operation::Parameter& parm = operation->getParameter(i); + //printf("Arg %d type %d\n", i, parm.getType()); + switch(parm.getType()) + { + case Operation::BOOL: + { + add_next_index_bool(return_value,(int)*(bool*)parm.getValue() ); + break; + } + case Operation::SHORT: + case Operation::USHORT: + case Operation::LONG: + case Operation::ULONG: + { + add_next_index_long(return_value,*(long*)parm.getValue() ); + break; + } + case Operation::FLOAT: + { + add_next_index_double(return_value,(double)*(float*)parm.getValue() ); + break; + } + case Operation::DOUBLE: + case Operation::LONGDOUBLE: + { + add_next_index_double(return_value,*(double*)parm.getValue() ); + break; + } + case Operation::CHARS: + { + add_next_index_string(return_value,*(char**)parm.getValue(), 1 ); + break; + } + case Operation::STRING: + { + add_next_index_string(return_value,(char*)(*(string*)parm.getValue()).c_str(), 1 ); + break; + } + case Operation::DATAOBJECT: + { + // convert the tuscany SDO into a PHP SDO + + // create the object + zval *sdo; + ALLOC_INIT_ZVAL(sdo); + sdo_do_new(sdo, *(DataObjectPtr*)parm.getValue() TSRMLS_CC); + + // add it to the arg array + add_next_index_zval(return_value, sdo); + break; + } + default: + { + char *class_name; + char *space; + class_name = get_active_class_name(&space TSRMLS_CC); + php_error(E_ERROR, + "%s%s%s(): Argument type %d not supported", + class_name, + space, + get_active_function_name(TSRMLS_C), + parm.getType()); + } + } + } +} +/* }}} getArgArray */ + +static zend_function_entry SCA_Tuscany_methods[] = { + PHP_ME(SCA_Tuscany, __construct, SCA_Tuscany____construct_args, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(SCA_Tuscany, invoke, SCA_Tuscany__invoke_args, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(SCA_Tuscany, getArgArray, SCA_Tuscany__getArgArray_args, ZEND_ACC_PUBLIC) + { NULL, NULL, NULL } +}; + +/* }}} Methods */ + +static void class_init_SCA_Tuscany(TSRMLS_D) +{ + zend_class_entry ce; + + INIT_CLASS_ENTRY(ce, "SCA_Tuscany", SCA_Tuscany_methods); + SCA_Tuscany_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC); + + /* {{{ Property registration */ + + zend_declare_property_null(SCA_Tuscany_ce_ptr, + "operation", sizeof("operation") -1, + ZEND_ACC_PUBLIC TSRMLS_CC); + + /* }}} Property registration */ + +} + +/* }}} Class SCA_Tuscany */ + +/* }}} Class definitions*/ + +/* {{{ sca_functions[] */ +function_entry sca_functions[] = { + { NULL, NULL, NULL } +}; +/* }}} */ + +/* {{{ cross-extension dependencies */ + +#if ZEND_EXTENSION_API_NO >= 220050617 +static zend_module_dep sca_deps[] = { + ZEND_MOD_REQUIRED("sdo") + {NULL, NULL, NULL, 0} +}; +#endif +/* }}} */ + +/* {{{ sca_module_entry */ +zend_module_entry sca_module_entry = { +#if ZEND_EXTENSION_API_NO >= 220050617 + STANDARD_MODULE_HEADER_EX, NULL, + sca_deps, +#else + STANDARD_MODULE_HEADER, +#endif + + "sca", + sca_functions, + PHP_MINIT(sca), /* Replace with NULL if there is nothing to do at php startup */ + PHP_MSHUTDOWN(sca), /* Replace with NULL if there is nothing to do at php shutdown */ + NULL, /* Replace with NULL if there is nothing to do at request start */ + NULL, /* Replace with NULL if there is nothing to do at request end */ + PHP_MINFO(sca), + "0.0.1", + STANDARD_MODULE_PROPERTIES +}; +/* }}} */ + +#ifdef COMPILE_DL_SCA +extern "C" { +ZEND_GET_MODULE(sca) +} // extern "C" +#endif + + +/* {{{ PHP_MINIT_FUNCTION */ +PHP_MINIT_FUNCTION(sca) +{ + /* We use the SDO extension for reference because it is a prereq */ + zend_module_entry *req_module_entry; + char *req_module_name = "libxml"; + if (zend_hash_find(&module_registry, req_module_name, strlen(req_module_name)+1, (void**)&req_module_entry) == SUCCESS) { + if (req_module_entry->zend_debug != ZEND_DEBUG || + req_module_entry->zts != USING_ZTS || + req_module_entry->zend_api != ZEND_MODULE_API_NO) { + php_error(E_ERROR, + "Cannot initialize module sca.\nModule sca compiled with module API=%d, debug=%d, thread-safety=%d\nModule %n compiled with module API=%d, debug=%d, thread-safety=%d\nThese options need to match", + req_module_name, + ZEND_MODULE_API_NO, ZEND_DEBUG, USING_ZTS, + req_module_entry->zend_api, req_module_entry->zend_debug, req_module_entry->zts); + return FAILURE; + } + } else { + /* The dependency checker should already have found this, but to be on the safe side ... */ + php_error (E_ERROR, + "Cannot load module sca because required module %n is not loaded", + req_module_name); + return FAILURE; + } + + class_init_SCA_Tuscany(TSRMLS_C); + + return SUCCESS; +} +/* }}} */ + + +/* {{{ PHP_MSHUTDOWN_FUNCTION */ +PHP_MSHUTDOWN_FUNCTION(sca) +{ + /* + * There is some corruption going on at shutdown. + * The following hack eliminates the symptom, but there's probably still + * an underlying problem. + */ + free(SCA_Tuscany_ce_ptr->name); + SCA_Tuscany_ce_ptr->name = NULL; + destroy_zend_class(&SCA_Tuscany_ce_ptr); + SCA_Tuscany_ce_ptr = NULL; + + return SUCCESS; +} +/* }}} */ + +/* {{{ PHP_MINFO_FUNCTION */ +PHP_MINFO_FUNCTION(sca) +{ + php_info_print_box_start(0); + php_printf("

      SCA Extension

      \n"); + php_printf("

      Version 0.0.1alpha (2007-01-15)

      \n"); + php_printf("

      Authors:

      \n"); + php_printf("

      Simon Laws <slaws@php.net> (lead)

      \n"); + php_printf("

      Caroline Maynard <cem@php.net> (lead)

      \n"); + php_info_print_box_end(); + php_info_print_table_start(); + php_info_print_table_header(2, "SCA", "enabled"); + php_info_print_table_row(2, "SCA Version", "0.0.1"); + php_info_print_table_end(); + +} +/* }}} */ + +/* Other functions not directly related to implementing the + SCA_Tuscany extension */ + +#endif /* HAVE_SCA */ + + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/sca.h b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/sca.h new file mode 100644 index 0000000000..5bbc9001dc --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/src/tuscany/sca/php/sca.h @@ -0,0 +1,49 @@ +/* + * 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. + */ + +/* $ Id: $ */ + +#ifndef SCA_H +#define SCA_H + +#include "tuscany/sca/core/Operation.h" + +#include
      + +#ifdef __cplusplus +extern "C" { +#endif + +extern zend_module_entry sca_module_entry; + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif /* SCA_H */ + + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/sca-cpp/trunk/contrib/runtime/extensions/php/xsd/sca-implementation-php.xsd b/sca-cpp/trunk/contrib/runtime/extensions/php/xsd/sca-implementation-php.xsd new file mode 100644 index 0000000000..c40d63799a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/php/xsd/sca-implementation-php.xsd @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/python/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/python/Makefile.am new file mode 100644 index 0000000000..83e70b4b94 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/Makefile.am @@ -0,0 +1,24 @@ +# 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/sca-cpp/trunk/contrib/runtime/extensions/python/src/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/python/src/Makefile.am new file mode 100644 index 0000000000..15d75f8c42 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/Makefile.am @@ -0,0 +1,63 @@ +# 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 + +pydir=$(prefix)/extensions/python/lib +py_DATA = tuscany/sca/python/sca_proxy.py +EXTRA_DIST = tuscany/sca/python/sca_proxy.py + +rootdir=$(prefix)/extensions/python + +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} + +moduledir=$(prefix)/extensions/python/module +extension = libtuscany_sca_python$(libsuffix) + +install-exec-hook: + test -z $(moduledir) || $(mkdir_p) $(moduledir); + -rm -f $(moduledir)/$(extension) + $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) + -rm -f $(libdir)/sca.so + $(LN_S) $(libdir)/libtuscany_sca_python$(libsuffix) $(libdir)/sca.so diff --git a/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.cpp new file mode 100644 index 0000000000..0274ffc774 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.cpp @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + + +#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" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + +extern "C" +{ +#if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) +#endif + void tuscany_sca_python_initialize() + { + tuscany::sca::python::PythonExtension::initialize(); + } +} + +namespace tuscany +{ + namespace sca + { + namespace python + { + // =================================================================== + // Constructor for the PythonExtension class. + // =================================================================== + PythonExtension::PythonExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the PythonExtension class. + // =================================================================== + PythonExtension::~PythonExtension() + { + logentry(); + } + + void PythonExtension::initialize() + { + logentry(); + SCARuntime* runtime = SCARuntime::getCurrentRuntime(); + runtime->registerImplementationExtension(new PythonImplementationExtension()); + runtime->registerInterfaceExtension(new PythonInterfaceExtension()); + } + + } // End namespace python + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.h b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.h new file mode 100644 index 0000000000..783f37a228 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.h @@ -0,0 +1,57 @@ +/* + * 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/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.cpp new file mode 100644 index 0000000000..84cc34c6a4 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.cpp @@ -0,0 +1,86 @@ +/* + * 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" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace python + { + // =================================================================== + // Constructor for the PythonImplementationExtension class. + // =================================================================== + PythonImplementationExtension::PythonImplementationExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the PythonImplementationExtension class. + // =================================================================== + PythonImplementationExtension::~PythonImplementationExtension() + { + logentry(); + } + + 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) + { + logentry(); + + 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; + } + + } // End namespace python + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.h b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.h new file mode 100644 index 0000000000..c94925c3fc --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.h @@ -0,0 +1,75 @@ +/* + * 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 std::string& getExtensionName() {return extensionName;} + + /** + * return the QName of schema elemant for this implementation extension + * (e.g. "http://www.osoa.org/xmlns/sca/1.0#implementation.python") + */ + virtual const std::string& getExtensionTypeQName() {return typeQName;} + + virtual tuscany::sca::model::ComponentType* getImplementation( + tuscany::sca::model::Composite* composite, + commonj::sdo::DataObjectPtr scdlImplementation); + + private: + static const std::string extensionName; + static const std::string typeQName; + + }; + + + } // End namespace python + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_python_pythonimplementationextension_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.cpp new file mode 100644 index 0000000000..1d5e3b6361 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.cpp @@ -0,0 +1,123 @@ +/* + * 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" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace python + { + // =================================================================== + // Constructor for the PythonInterfaceExtension class. + // =================================================================== + PythonInterfaceExtension::PythonInterfaceExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the PythonInterfaceExtension class. + // =================================================================== + PythonInterfaceExtension::~PythonInterfaceExtension() + { + logentry(); + } + + 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) + { + logentry(); + + // 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/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.h b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.h new file mode 100644 index 0000000000..803d94743d --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.h @@ -0,0 +1,74 @@ +/* + * 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 std::string& getExtensionName() {return extensionName;} + + /** + * return the QName of schema elemant for this implementation extension + * (e.g. "http://www.osoa.org/xmlns/sca/1.0#PythonInterface") + */ + virtual const std::string& getExtensionTypeQName() {return typeQName;} + + virtual tuscany::sca::model::Interface* getInterface( + tuscany::sca::model::Composite* composite, + commonj::sdo::DataObjectPtr scdlInterface); + + private: + static const std::string extensionName; + static const std::string typeQName; + + }; + + + } // End namespace python + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_python_pythoninterfaceextension_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.cpp new file mode 100644 index 0000000000..9282bb953c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.cpp @@ -0,0 +1,81 @@ +/* + * 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/model/ServiceBinding.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(); + + // Get the service wrapper + PythonReferenceBinding* referenceBinding = (PythonReferenceBinding*)reference->getBinding(); + serviceWrapper = referenceBinding->getTargetServiceBinding()->getServiceWrapper(); + } + + // ========================================== + // Constructor: Create a proxy from a service + // ========================================== + PythonServiceProxy::PythonServiceProxy(Service* service) + : ServiceProxy(NULL) + { + logentry(); + + // Get the service wrapper + serviceWrapper = service->getBinding()->getServiceWrapper(); + } + + // ========== + // Destructor + // ========== + PythonServiceProxy::~PythonServiceProxy() + { + logentry(); + } + + // ===================================================== + // invokeService: invoke the service wired to this proxy + // ===================================================== + void PythonServiceProxy::invokeService(Operation& operation) + { + logentry(); + + // Invoke the service + serviceWrapper->invoke(operation); + } + } // End namespace python + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.h b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.h new file mode 100644 index 0000000000..64f856f51d --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.h @@ -0,0 +1,83 @@ +/* + * 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 "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" + + +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(tuscany::sca::model::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(tuscany::sca::model::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/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp new file mode 100644 index 0000000000..cb876827bd --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp @@ -0,0 +1,1095 @@ +/* + * 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 "commonj/sdo/SDO.h" + +#include "tuscany/sca/python/PythonServiceWrapper.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/Exceptions.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" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + +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("PyObject %s: %s", name, PyString_AsString(pObjRepr)); + Py_DECREF(pObjRepr); + + PyObject* pObjDir = PyObject_Dir(pObj); + PyObject* pObjDirRepr = PyObject_Repr(pObjDir); + loginfo("PyObject dir(%s): %s", name, PyString_AsString(pObjDirRepr)); + Py_DECREF(pObjDirRepr); + Py_DECREF(pObjDir); + } + + // =========== + // Constructor + // =========== + PythonServiceWrapper::PythonServiceWrapper(Service* service) + : ServiceWrapper(service) + { + logentry(); + + 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"; + throwException(SystemConfigurationException, msg.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(); + if(impl->getModulePath().size() > 0) + { + path += "/" + impl->getModulePath(); + } + + loginfo("Module: %s", impl->getModule().c_str()); + loginfo("Path: %s", path.c_str()); + loginfo("Class: %s", impl->getClass().c_str()); + + 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() + " on path " + path; + throwException(SystemConfigurationException, msg.c_str()); + } + printPyObject("pythonModule",pythonModule); + } + + // ========== + // Destructor + // ========== + PythonServiceWrapper::~PythonServiceWrapper() + { + logentry(); + + Py_XDECREF(pythonClassInstance); + Py_XDECREF(pythonModule); + Py_Finalize(); + } + + // ====================================================================== + // newInstance: create a new class instance + // ====================================================================== + PyObject* PythonServiceWrapper::newInstance() + { + logentry(); + + 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"; + throwException(SystemConfigurationException, 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"; + throwException(ServiceInvocationException, msg.c_str()); + } + Py_XDECREF(pClass); + } + } + return pClassInstance; + } + + // ====================================================================== + // getInstance: get a class instance for this scope + // ====================================================================== + PyObject* PythonServiceWrapper::getInstance() + { + logentry(); + + PythonImplementation::Scope scope = implementation->getScope(); + if (scope == PythonImplementation::COMPOSITE) + { + if (!pythonClassInstance) + { + pythonClassInstance = newInstance(); + } + return pythonClassInstance; + } + else // (scope == PythonImplementation::STATELESS) + { + return newInstance(); + } + } + + // ====================================================================== + // releaseImplementation: release the implementation for this scope + // ====================================================================== + void PythonServiceWrapper::releaseInstance() + { + logentry(); + + 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; + } + } + } + + // ====================================================================== + // invoke: wrapper call to service with setting the component context + // ====================================================================== + void PythonServiceWrapper::invoke(Operation& operation) + { + logentry(); + + SCARuntime* runtime = SCARuntime::getCurrentRuntime(); + runtime->setCurrentComponent(component); + + + // Load the references & properties into the module + addReferences(pythonModule); + addProperties(pythonModule); + + try + { + loginfo("Operation: %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 + string msg = "Python module or class instance has not been created"; + throwException(ServiceInvocationException, msg.c_str()); + } + + if (pFunc && PyCallable_Check(pFunc)) + { + PyObject* pArgs = PyTuple_New(operation.getNParms()); + PyObject* pKeywordsDict = PyDict_New(); + PyObject* pValue = NULL; + + // Load up the xml.etree.ElementTree module for dealing with SDO params and return values + PyObject* elementTreeModuleName = PyString_FromString("xml.etree.ElementTree"); + PyObject* elementTreeModule = PyImport_Import(elementTreeModuleName); + + if(elementTreeModule == NULL) + { + // pre-Python2.5? - try to get an installed elementtree package + elementTreeModuleName = PyString_FromString("elementtree.ElementTree"); + elementTreeModule = PyImport_Import(elementTreeModuleName); + } + if(elementTreeModule == NULL) + { + // Still null - throw a warning but carry on - user may not need XML + logwarning("Could not load Python ElementTree module - is it installed? SDO and XML will not be supported"); + } + + 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; + } + case Operation::DATAOBJECT: + { + if(elementTreeModule != NULL) + { + DataObjectPtr dob = *(DataObjectPtr*)parm.getValue(); + + // Convert a DataObject to a xml.etree.ElementTree Element object + Composite* composite = component->getComposite(); + XMLHelperPtr xmlHelper = composite->getXMLHelper(); + char* str = xmlHelper->save( + dob, + dob->getType().getURI(), + dob->getType().getName()); + + loginfo("Converting SDO DataObject to Python ElementTree: %s", str); + + // Get the xml.etree.ElementTree.XML function + PyObject* elementTreeXMLFunc = PyObject_GetAttrString(elementTreeModule, "XML"); + + // Call the XML() function with the XML string + pValue = PyObject_CallFunction(elementTreeXMLFunc, "s", str); + + Py_DECREF(elementTreeXMLFunc); + } + else + { + throwException(ServiceDataException, "Could not convert SDO DataObject to Python ElementTree as ElementTree module could not be loaded"); + } + break; + } + default: + throwException(ServiceDataException, "Operation parameter type not supported"); + } + + if (!pValue) + { + Py_DECREF(pArgs); + + if(PyErr_Occurred()) + { + PyErr_Print(); + } + + string msg = "Error converting parameter into Python type"; + throwException(ServiceDataException, msg.c_str()); + + } + //printPyObject("Param value", pValue); + + // If we have a param name, put it in the keyword args + if(parm.hasName()) + { + PyDict_SetItemString(pKeywordsDict, parm.getName().c_str(), pValue); + Py_DECREF(pValue); + } + else + { + /* pValue reference stolen here: */ + PyTuple_SetItem(pArgs, i, pValue); + } + } + + // Resize the args to the correct length + _PyTuple_Resize(&pArgs, operation.getNParms() - PyDict_Size(pKeywordsDict)); + + loginfo("Calling python func with %d args and %d keyword args", PyTuple_Size(pArgs), PyDict_Size(pKeywordsDict)); + + pValue = PyObject_Call(pFunc, pArgs, pKeywordsDict); + //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("Int return value: %d", PyInt_AsLong(pValue)); + *data = PyInt_AsLong(pValue); + } + else + { + loginfo("Long return value: %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("Bool return value: %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("Float return value: %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("String return value: %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 + string* stringData = new string; + *stringData = *data; + operation.setReturnValue(stringData); + } + } + } + else + { + PyObject* pIsElement = Py_False; + + if(elementTreeModule != NULL) + { + // Get the xml.etree.ElementTree.iselement function + PyObject* elementTreeIsElementFunc = PyObject_GetAttrString(elementTreeModule, "iselement"); + + // Call the iselement() function with pValue to check it + pIsElement = PyObject_CallFunction(elementTreeIsElementFunc, "O", pValue); + Py_DECREF(elementTreeIsElementFunc); + } + + if(PyObject_IsTrue(pIsElement) == 1) + { + // pValue is an xml.etree.ElementTree.Element - convert to SDO + PyObject* elementTreeToStringFunc = PyObject_GetAttrString(elementTreeModule, "tostring"); + PyObject* pElemString = PyObject_CallFunction(elementTreeToStringFunc, "O", pValue); + char* data = PyString_AsString(pElemString); + + loginfo("Converting Python ElementTree to SDO DataObject: %s", data); + + Composite* composite = component->getComposite(); + XMLHelperPtr xmlHelper = composite->getXMLHelper(); + XMLDocumentPtr xmlDoc = xmlHelper->load(data); + DataObjectPtr* dataObjectData = new DataObjectPtr; + if (xmlDoc != NULL) + { + *dataObjectData = xmlDoc->getRootDataObject(); + } + else + { + *dataObjectData = NULL; + } + + if (*dataObjectData != NULL) + { + operation.setReturnValue(dataObjectData); + } + else + { + string msg = "xml.etree.ElementTree.Element could not be converted to a DataObject"; + throwException(ServiceDataException, msg.c_str()); + } + + Py_DECREF(elementTreeToStringFunc); + Py_DECREF(pElemString); + } + else + { + PyObject* valueRepr = PyObject_Repr(pValue); + PyObject* valueType = PyObject_Type(pValue); + PyObject* valueTypeRepr = PyObject_Repr(valueType); + loginfo("Return value of unknown type (%s) has repr: %s", PyString_AsString(valueTypeRepr), PyString_AsString(valueRepr)); + Py_DECREF(valueTypeRepr); + Py_DECREF(valueType); + Py_DECREF(valueRepr); + } + + Py_DECREF(pIsElement); + } + + Py_DECREF(elementTreeModule); + Py_DECREF(elementTreeModuleName); + Py_DECREF(pValue); + } + else + { + Py_DECREF(pFunc); + Py_XDECREF(elementTreeModule); + Py_XDECREF(elementTreeModuleName); + + string msg = "Error whilst calling Python function "+operation.getName()+": "; + if(PyErr_Occurred()) + { + PyObject *pErrorType, *pErrorValue, *pErrorTraceback; + PyErr_Fetch(&pErrorType, &pErrorValue, &pErrorTraceback); + + if (pErrorType != NULL && pErrorValue != NULL) + { + PyObject* pErrorTypeStr = PyObject_Str(pErrorType); + PyObject* pErrorValueStr = PyObject_Str(pErrorValue); + msg += PyString_AsString(pErrorTypeStr); + msg += " : "; + msg += PyString_AsString(pErrorValueStr); + Py_DECREF(pErrorTypeStr); + Py_DECREF(pErrorValueStr); + } + else + { + msg += "No Python Error information provided"; + } + Py_XDECREF(pErrorType); + Py_XDECREF(pErrorValue); + Py_XDECREF(pErrorTraceback); + + PyErr_Print(); + } + + throwException(ServiceInvocationException, msg.c_str()); + } + } + else + { + if (PyErr_Occurred()) + { + PyErr_Print(); + } + string msg = "Cannot find the operation named " + operation.getName() + " in the Python module"; + throwException(ServiceInvocationException, msg.c_str()); + } + Py_XDECREF(pFunc); + + } + catch (...) + { + releaseInstance(); + runtime->unsetCurrentComponent(); + throw; + } + releaseInstance(); + runtime->unsetCurrentComponent(); + } + + + // ========================================================================== + // Add any properties into the loaded implementation module as Python objects + // ========================================================================== + void PythonServiceWrapper::addProperties(PyObject* module) + { + logentry(); + + // Set all the configured properties + DataObjectPtr properties = component->getProperties(); + PropertyList pl = properties->getInstanceProperties(); + + for (unsigned 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::IntType: + { + property = PyInt_FromLong(properties->getInt(pl[i])); + break; + } + case Type::DoubleType: + case Type::FloatType: + { + property = PyFloat_FromDouble(properties->getDouble(pl[i])); + break; + } + case Type::DataObjectType: + { + // 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, + data->getType().getURI(), + data->getType().getName()); + + loginfo("Converting SDO DataObject to Python ElementTree: %s", serializedData.c_str()); + + // Get the xml.etree.ElementTree.XML function + PyObject* elementTreeModuleName = PyString_FromString("xml.etree.ElementTree"); + PyObject* elementTreeModule = PyImport_Import(elementTreeModuleName); + PyObject* elementTreeXMLFunc = PyObject_GetAttrString(elementTreeModule, "XML"); + + // Call the XML() function with the XML string + property = PyObject_CallFunction(elementTreeXMLFunc, "s", serializedData.c_str()); + + Py_DECREF(elementTreeXMLFunc); + Py_DECREF(elementTreeModule); + Py_DECREF(elementTreeModuleName); + 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("Added property named %s with type %s and value %s to python module", propName.c_str(), pl[i].getType().getName(), propValue.c_str()); + } + else + { + logwarning("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) + { + logentry(); + + // 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"; + logwarning(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("Successfully added sca_proxy_class instance as %s to pythonModule", referenceName.c_str()); + } + else + { + logwarning("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/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.h new file mode 100644 index 0000000000..fbf75b3223 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.h @@ -0,0 +1,142 @@ +/* + * 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 + + +// 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 + +#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" + + +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(tuscany::sca::model::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. + */ + tuscany::sca::model::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/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/export.h b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/export.h new file mode 100644 index 0000000000..b608a50711 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/export.h @@ -0,0 +1,41 @@ +/* + * 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/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp new file mode 100644 index 0000000000..235468eca9 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp @@ -0,0 +1,131 @@ +/* + * 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/ServiceType.h" +#include "tuscany/sca/model/Reference.h" +#include "tuscany/sca/model/ReferenceType.h" +#include "tuscany/sca/util/Utils.h" + +using namespace std; +using namespace tuscany::sca::model; + +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(); + + // Create a default service for this componentType + ServiceType* defaultServiceType = new ServiceType(this, "", NULL, NULL); + addServiceType(defaultServiceType); + } + + PythonImplementation::~PythonImplementation() + { + logentry(); + } + + /** + * Overrides the findReferenceType method in ComponentType. + * This allows us to create references without needing a componentType file. + */ + ReferenceType* PythonImplementation::findReferenceType(const string& referenceName) + { + logentry(); + + ReferenceType* refType = ComponentType::findReferenceType(referenceName); + if(!refType) + { + // The reference has not yet been created - try creating it + refType = new ReferenceType(this, referenceName, NULL, NULL, ReferenceType::ONE_ONE); + addReferenceType(refType); + } + + return refType; + } + + /** + * Overrides the findPropertyType method in ComponentType. + * This allows us to create properties without needing a componentType file. + */ + const commonj::sdo::Property* PythonImplementation::findPropertyType(const string& propertyName) + { + logentry(); + + const commonj::sdo::Property* prop = ComponentType::findPropertyType(propertyName); + if(!prop) + { + ComponentType::addPropertyType(propertyName, "http://www.w3.org/2001/XMLSchema#string", false, NULL); + // Just added it so it should now be available + prop = ComponentType::findPropertyType(propertyName); + loginfo("Added string property named %s to Python component", propertyName.c_str()); + } + + return prop; + } + + void PythonImplementation::initializeComponent(Component* component) + { + logentry(); + 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++; + } + } + + } // End namespace python + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h new file mode 100644 index 0000000000..75b14529bf --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h @@ -0,0 +1,145 @@ +/* + * 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 + +#include "commonj/sdo/SDO.h" + +#include "tuscany/sca/model/ComponentType.h" + + +namespace tuscany +{ + namespace sca + { + namespace python + { + /** + * Holds information about an SCA implementation written in Python + */ + class PythonImplementation : public tuscany::sca::model::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(tuscany::sca::model::Composite* composite, + const std::string& module, const std::string& modulePath, const std::string& className, + Scope scope); + + /** + * Destructor + */ + virtual ~PythonImplementation(); + + /** + * Initialize a component of this type. + * @param component The component to initialize. + */ + virtual void initializeComponent(tuscany::sca::model::Component* component); + + /** + * Override the ComponentType::findReferenceType method + * to allow Python components to be defined without requiring + * a componentType side-file + */ + virtual tuscany::sca::model::ReferenceType* findReferenceType(const std::string& referenceName); + + /** + * Override the ComponentType::findPropertyType method + * to allow Python components to be defined without requiring + * a componentType side-file + */ + virtual const commonj::sdo::Property* findPropertyType(const std::string& propertyName); + + + /** + * Returns the name of the module. + * @return The name of the module. + */ + const std::string& getModule() const { return module; } + + /** + * Get the header path. + * @return The pathe element of the header. + */ + const std::string& getModulePath() const { return modulePath; } + + /** + * Get the name of the class. + * @return The class name if specified. + */ + const std::string& getClass() const { return className; } + + /** + * Returns the implementation scope + */ + Scope getScope() const { return scope; } + + private: + + /** + * Name of the module. + */ + std::string module; + + /** + * Path to the module. + */ + std::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. + */ + std::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/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.cpp b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.cpp new file mode 100644 index 0000000000..3c30f363b8 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.cpp @@ -0,0 +1,53 @@ +/* + * 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" + +using namespace std; + +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(); + } + + PythonInterface::~PythonInterface() + { + logentry(); + } + + } // End namespace python + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.h b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.h new file mode 100644 index 0000000000..cfc2ca8914 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.h @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + + +#ifndef tuscany_sca_python_model_pythoninterface_h +#define tuscany_sca_python_model_pythoninterface_h + +#include + +#include "tuscany/sca/python/export.h" +#include "tuscany/sca/model/Interface.h" + +namespace tuscany +{ + namespace sca + { + namespace python + { + /** + * Holds information about an interface described using a Python + * header file. + */ + class PythonInterface : public tuscany::sca::model::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 std::string& getInterfaceTypeQName() { return typeQName; }; + + /** + * The QName of the schema type for this interface type. + */ + SCA_PYTHON_API static const std::string typeQName; + + }; + + } // End namespace python + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_python_model_pythoninterface_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.cpp b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.cpp new file mode 100644 index 0000000000..958a3a86ac --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.cpp @@ -0,0 +1,61 @@ +/* + * 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" + +using namespace std; +using namespace tuscany::sca::model; + +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) + { + setTargetServiceBinding(binding); + + serviceProxy = new PythonServiceProxy(getReference()); + } + + } // End namespace python + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.h b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.h new file mode 100644 index 0000000000..65028f4613 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.h @@ -0,0 +1,82 @@ +/* + * 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 + +#include "tuscany/sca/model/ReferenceBinding.h" + + +namespace tuscany +{ + namespace sca + { + namespace python + { + /** + * Information about a Python service binding for service or a reference. + */ + class PythonReferenceBinding : public tuscany::sca::model::ReferenceBinding + { + public: + + /** + * Constructor. + */ + PythonReferenceBinding(tuscany::sca::model::Reference* reference); + + /** + * Destructor. + */ + virtual ~PythonReferenceBinding(); + + /** + * Returns the type of binding. + */ + virtual std::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(tuscany::sca::model::ServiceBinding* serviceBinding); + + private: + + /** + * The proxy representing the reference to the client + * component. + */ + ServiceProxy* serviceProxy; + }; + + } // End namespace python + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_python_model_pythonreferencebinding_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.cpp b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.cpp new file mode 100644 index 0000000000..061aeb7515 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.cpp @@ -0,0 +1,58 @@ +/* + * 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" + +using namespace std; +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace python + { + + // Constructor + PythonServiceBinding::PythonServiceBinding(Service* service) + : ServiceBinding(service, "") + { + logentry(); + serviceWrapper = new PythonServiceWrapper(service); + } + + // Destructor + PythonServiceBinding::~PythonServiceBinding() + { + logentry(); + } + + ServiceWrapper* PythonServiceBinding::getServiceWrapper() + { + logentry(); + return (ServiceWrapper*)serviceWrapper; + } + + } // End namespace ws + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.h b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.h new file mode 100644 index 0000000000..9a803cdced --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.h @@ -0,0 +1,81 @@ +/* + * 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 + +#include "tuscany/sca/model/ServiceBinding.h" + +namespace tuscany +{ + namespace sca + { + namespace python + { + /** + * Information about a Python service binding for service or a reference. + */ + class PythonServiceBinding : public tuscany::sca::model::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(tuscany::sca::model::Service* service); + + /** + * Destructor. + */ + virtual ~PythonServiceBinding(); + + /** + * Returns the type of binding. + */ + virtual std::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/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp new file mode 100644 index 0000000000..dc2c7bfe22 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp @@ -0,0 +1,540 @@ +/* + * 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 +#include + +// undefine _DEBUG so Python does not need it's debug dll +#ifdef _DEBUG +#undef _DEBUG +#define _SCA_PYTHON_DEBUG +#endif +#include +#ifdef _SCA_PYTHON_DEBUG +#define _DEBUG +#endif + +#include "commonj/sdo/SDO.h" + +#include "PythonServiceProxy.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/Exceptions.h" +#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 std; +using namespace commonj::sdo; +using namespace tuscany::sca; +using namespace tuscany::sca::model; + +static PyObject* scaError; + +/** +* Prints out PyObject and dir(PyObject) +* for debugging purposes +*/ +static void printPyObject(char* prefix, char* name, PyObject* pObj) +{ + PyObject* pObjRepr = PyObject_Repr(pObj); + PyTypeObject* type = pObj->ob_type; + loginfo("%s printPyObject (%s) %s = %s", prefix, type->tp_name, name, PyString_AsString(pObjRepr)); + Py_XDECREF(pObjRepr); + + if(pObj != NULL) + { + PyObject* pObjDir = PyObject_Dir(pObj); + PyObject* pObjDirRepr = PyObject_Repr(pObjDir); + loginfo("%s printPyObject dir(%s): %s", prefix, name, PyString_AsString(pObjDirRepr)); + Py_DECREF(pObjDirRepr); + Py_DECREF(pObjDir); + } +} + +static PyObject* sca_locateservice(PyObject *self, PyObject *args) +{ + logentry(); + + // 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(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 tuscany::sca::python::PythonServiceProxy* getServiceProxy(PyObject *args) +{ + logentry(); + + tuscany::sca::python::PythonServiceProxy* serviceProxy = NULL; + SCARuntime* runtime = SCARuntime::getCurrentRuntime(); + + // 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("Service/Reference name is %s", name.c_str()); + } + else + { + string msg = "Service/Reference name has not been set"; + logwarning(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 = "Could not find the reference: "+name; + logwarning(msg.c_str()); + PyErr_SetString(scaError, msg.c_str()); + + return NULL; + } + + ReferenceBinding* refBinding = ref->getBinding(); + serviceProxy = (tuscany::sca::python::PythonServiceProxy*) refBinding->getServiceProxy(); + } + else + { + Component* component = runtime->getDefaultComponent(); + Composite* composite = (Composite*)component->getType(); + Service* service = composite->findComponentService(name); + + if(!service) + { + string msg = "Could not find service: "+name; + logwarning(msg.c_str()); + PyErr_SetString(scaError, msg.c_str()); + return NULL; + } + + serviceProxy = new tuscany::sca::python::PythonServiceProxy(service); + } + + return serviceProxy; +} + + +static PyObject* sca_invoke(PyObject *self, PyObject *args) +{ + logentry(); + + tuscany::sca::python::PythonServiceProxy* pythonServiceProxy = getServiceProxy(args); + if(!pythonServiceProxy) + { + return NULL; + } + + // Get the component from the reference or service provided + Component* component = NULL; + SCARuntime* runtime = SCARuntime::getCurrentRuntime(); + + PyObject* isReference = PyTuple_GetItem(args, 1); + if(PyObject_IsTrue(isReference)) + { + component = runtime->getCurrentComponent(); + } + else + { + component = runtime->getDefaultComponent(); + } + + // 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("sca_invoke Operation name: %s", operationName.c_str()); + } + else + { + string msg = "Operation name has not been set"; + logwarning(msg.c_str()); + PyErr_SetString(scaError, msg.c_str()); + return NULL; + } + + // Create the Operation object + Operation operation(operationName.c_str()); + + // Load up the xml.etree.ElementTree module for dealing with SDO params and return values + PyObject* elementTreeModuleName = PyString_FromString("xml.etree.ElementTree"); + PyObject* elementTreeModule = PyImport_Import(elementTreeModuleName); + + if(elementTreeModule == NULL) + { + // pre-Python2.5? - try to get an installed elementtree package + elementTreeModuleName = PyString_FromString("elementtree.ElementTree"); + elementTreeModule = PyImport_Import(elementTreeModuleName); + } + if(elementTreeModule == NULL) + { + // Still null - throw a warning but carry on - user may not need XML + logwarning("Could not load Python ElementTree module - is it installed? SDO and XML will not be supported"); + } + + // Parameters are the fourth argument + PyObject* paramTuple = PyTuple_GetItem(args, 3); + unsigned int numberOfArgs = (unsigned int) PyTuple_Size(paramTuple); + loginfo("sca_invoke %d arg parameters supplied", numberOfArgs); + + // Keyword parameters (AKA named arguments) are the fifth argument + PyObject* keywordParamDict = PyTuple_GetItem(args, 4); + loginfo("sca_invoke %d keyword parameters supplied", PyDict_Size(keywordParamDict)); + + PyObject* paramKeys = PyDict_Keys(keywordParamDict); + + // Go through all the supplied parameters (args and keyword args) + for(unsigned int i=0; i < (numberOfArgs + PyList_Size(paramKeys)); i++) + { + string* paramName; + PyObject* param; + + if(i < PyTuple_Size(paramTuple)) + { + param = PyTuple_GetItem(paramTuple, i); + paramName = new string(); + } + else + { + PyObject* key = PyList_GetItem(paramKeys, i-numberOfArgs); + param = PyDict_GetItem(keywordParamDict, key); + paramName = new string(PyString_AsString(key)); + } + + if(PyInt_Check(param)) + { + loginfo("Int param %d %s: %d", i, (*paramName).c_str(), PyInt_AsLong(param)); + long* intData = new long; + *intData = PyInt_AsLong(param); + operation.addParameter(*paramName, intData); + } + else if(PyBool_Check(param)) + { + loginfo("Bool param %d %s: %d", i, (*paramName).c_str(), (param == Py_True)); + bool* boolData = new bool; + *boolData = (param == Py_True); + operation.addParameter(*paramName, boolData); + } + else if(PyLong_Check(param)) + { + loginfo("Long param %d %s: %l", i, (*paramName).c_str(), PyLong_AsLong(param)); + long* longData = new long; + *longData = PyLong_AsLong(param); + operation.addParameter(*paramName, longData); + } + else if(PyFloat_Check(param)) + { + loginfo("Float param %d %s: %f", i, (*paramName).c_str(), PyFloat_AsDouble(param)); + double* doubleData = new double; + *doubleData = PyFloat_AsDouble(param); + operation.addParameter(*paramName, doubleData); + } + else if(PyString_Check(param)) + { + loginfo("String param %d %s: %s", i, (*paramName).c_str(), PyString_AsString(param)); + const char** stringData = new const char*; + *stringData = PyString_AsString(param); + operation.addParameter(*paramName, stringData); + } + else + { + PyObject* pIsElement = Py_False; + if(elementTreeModule != NULL) + { + // Get the xml.etree.ElementTree.iselement function + PyObject* elementTreeIsElementFunc = PyObject_GetAttrString(elementTreeModule, "iselement"); + + // Call the iselement() function with pValue to check it + pIsElement = PyObject_CallFunction(elementTreeIsElementFunc, "O", param); + } + + if(PyObject_IsTrue(pIsElement) == 1) + { + // pValue is an xml.etree.ElementTree.Element - convert to SDO + PyObject* elementTreeToStringFunc = PyObject_GetAttrString(elementTreeModule, "tostring"); + PyObject* pElemString = PyObject_CallFunction(elementTreeToStringFunc, "O", param); + char* data = PyString_AsString(pElemString); + loginfo("SDO param %d %s: %s", i, (*paramName).c_str(), data); + + loginfo("Converting Python ElementTree to SDO DataObject: %s", data); + + Composite* composite = component->getComposite(); + XMLHelperPtr xmlHelper = composite->getXMLHelper(); + XMLDocumentPtr xmlDoc = xmlHelper->load(data); + + DataObjectPtr* dataObjectData = new DataObjectPtr; + if (xmlDoc != NULL) + { + *dataObjectData = xmlDoc->getRootDataObject(); + } + else + { + *dataObjectData = NULL; + } + if (*dataObjectData != NULL) + { + operation.addParameter(*paramName, dataObjectData); + } + else + { + string msg = "xml.etree.ElementTree.Element could not be converted to a DataObject"; + logerror(msg.c_str()); + PyErr_SetString(scaError, msg.c_str()); + return NULL; + } + Py_DECREF(elementTreeToStringFunc); + Py_DECREF(pElemString); + } + 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(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(TuscanyRuntimeException& ex) + { + string msg = "Exception whilst invoking the "; + msg += operationName.c_str(); + msg += " operation on an SCA service/reference: "; + msg += ex.getEClassName(); + msg += ": "; + msg += ex.getMessageText(); + logwarning(msg.c_str()); + PyErr_SetString(scaError, msg.c_str()); + return NULL; + } + catch(...) + { + string msg = "Exception whilst invoking the "; + msg += operationName.c_str(); + msg += " operation on an SCA service/reference"; + + logwarning(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; + } + case Operation::DATAOBJECT: + { + if(elementTreeModule != NULL) + { + DataObjectPtr dob = *(DataObjectPtr*)operation.getReturnValue(); + + // Convert a DataObject to a xml.etree.ElementTree Element object + Composite* composite = component->getComposite(); + XMLHelperPtr xmlHelper = composite->getXMLHelper(); + char* str = xmlHelper->save( + dob, + dob->getType().getURI(), + dob->getType().getName()); + + loginfo("Converting SDO DataObject to Python ElementTree: %s", str); + + // Get the xml.etree.ElementTree.XML function + PyObject* elementTreeXMLFunc = PyObject_GetAttrString(elementTreeModule, "XML"); + + // Call the XML() function with the XML string + returnValue = PyObject_CallFunction(elementTreeXMLFunc, "s", str); + + Py_DECREF(elementTreeXMLFunc); + } + else + { + logwarning("Could not convert SDO DataObject to Python ElementTree as ElementTree module could not be loaded. Returning NONE"); + Py_INCREF(Py_None); + returnValue = Py_None; + } + break; + } + default: + { + Py_INCREF(Py_None); + returnValue = Py_None; + } + + } + + Py_XDECREF(elementTreeModuleName); + Py_XDECREF(elementTreeModule); + + return returnValue; +} +static PyMethodDef ModuleMethods[] = +{ + {"locateservice", (PyCFunction) sca_locateservice, METH_VARARGS, "Locates an SCA service & returns an sca_proxy_class instance"}, + {"invoke", (PyCFunction) sca_invoke, METH_VARARGS, "Invoke an operation on an SCA service or reference"}, + {NULL, NULL, 0, NULL} /* Sentinel */ +}; + +PyMODINIT_FUNC initsca(void) +{ + logentry(); + + // 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); +} diff --git a/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/sca_proxy.py b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/sca_proxy.py new file mode 100644 index 0000000000..92a224275e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/src/tuscany/sca/python/sca_proxy.py @@ -0,0 +1,57 @@ +# 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): + # Pass the args and keywords in to the invoke method as arguments + return sca.invoke(self.sca_proxy_name, self.sca_proxy_is_reference, operationName, args, kwargs) + + return invokeFunction + + def __getattr__(self, operationName): + return self.invoke(operationName) + + def __str__(self): + return '' + + def __repr__(self): + return '' + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/python/xsd/sca-implementation-python.xsd b/sca-cpp/trunk/contrib/runtime/extensions/python/xsd/sca-implementation-python.xsd new file mode 100644 index 0000000000..5730e66116 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/xsd/sca-implementation-python.xsd @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/python/xsd/sca-interface-python.xsd b/sca-cpp/trunk/contrib/runtime/extensions/python/xsd/sca-interface-python.xsd new file mode 100644 index 0000000000..1ce24b7249 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/python/xsd/sca-interface-python.xsd @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/rest/Makefile.am new file mode 100644 index 0000000000..742a8152ad --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/Makefile.am @@ -0,0 +1,6 @@ +SUBDIRS = interface reference service +datadir=$(prefix)/extensions/rest + +nobase_data_DATA = xsd/*.xsd + +EXTRA_DIST = xsd \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/Makefile.am new file mode 100644 index 0000000000..f963effea2 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = src \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/Makefile.am new file mode 100644 index 0000000000..a2b7ac74e4 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/Makefile.am @@ -0,0 +1,23 @@ +libdir=$(prefix)/extensions/rest/interface/lib +lib_LTLIBRARIES = libtuscany_sca_rest_interface.la + +noinst_HEADERS = tuscany/sca/rest/*.h tuscany/sca/rest/model/*.h + +libtuscany_sca_rest_interface_la_SOURCES = \ +tuscany/sca/rest/RESTInterfaceExtension.cpp \ +tuscany/sca/rest/model/RESTInterface.cpp + +libtuscany_sca_rest_interface_la_LIBADD = \ + -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \ + -L$(top_builddir)/runtime/core/src -ltuscany_sca + +INCLUDES = -I$(top_builddir)/runtime/core/src \ + -I${TUSCANY_SDOCPP}/include + +moduledir=$(prefix)/extensions/rest/interface/module +extension = libtuscany_sca_rest_interface$(libsuffix) + +install-exec-hook: + test -z $(moduledir) || $(mkdir_p) $(moduledir); + -rm -f $(moduledir)/$(extension) + $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/RESTInterfaceExtension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/RESTInterfaceExtension.cpp new file mode 100644 index 0000000000..c69febf39a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/RESTInterfaceExtension.cpp @@ -0,0 +1,85 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#include "tuscany/sca/rest/RESTInterfaceExtension.h" +#include "tuscany/sca/rest/model/RESTInterface.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/SCARuntime.h" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + +extern "C" +{ +#if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) +#endif + void tuscany_sca_rest_interface_initialize() + { + tuscany::sca::rest::RESTInterfaceExtension::initialize(); + } +} + +namespace tuscany +{ + namespace sca + { + namespace rest + { + // =================================================================== + // Constructor for the RESTInterfaceExtension class. + // =================================================================== + RESTInterfaceExtension::RESTInterfaceExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the RESTInterfaceExtension class. + // =================================================================== + RESTInterfaceExtension::~RESTInterfaceExtension() + { + logentry(); + } + + const string RESTInterfaceExtension::extensionName("rest"); + const string RESTInterfaceExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#RESTInterface"); + + // =================================================================== + // loadModelElement - load the info from interface.rest + // =================================================================== + tuscany::sca::model::Interface* RESTInterfaceExtension::getInterface(Composite* composite, DataObjectPtr scdlInterface) + { + logentry(); + + return new RESTInterface(); + } + + void RESTInterfaceExtension::initialize() + { + logentry(); + SCARuntime::getCurrentRuntime()->registerInterfaceExtension(new RESTInterfaceExtension()); + } + + } // End namespace rest + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/RESTInterfaceExtension.h b/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/RESTInterfaceExtension.h new file mode 100644 index 0000000000..de61ee5751 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/RESTInterfaceExtension.h @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#ifndef tuscany_sca_rest_restinterfaceextension_h +#define tuscany_sca_rest_restinterfaceextension_h + +#include "tuscany/sca/extension/InterfaceExtension.h" + +namespace tuscany +{ + namespace sca + { + namespace rest + { + + class RESTInterfaceExtension : public InterfaceExtension + { + public: + /** + * Default constructor + */ + RESTInterfaceExtension(); + + /** + * Destructor + */ + virtual ~RESTInterfaceExtension(); + + /** + * return the name of the extension + */ + virtual const std::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.rest") + */ + virtual const std::string& getExtensionTypeQName() {return typeQName;} + + virtual tuscany::sca::model::Interface* getInterface( + tuscany::sca::model::Composite* composite, + commonj::sdo::DataObjectPtr scdlInterface); + + static void initialize(); + + private: + static const std::string extensionName; + static const std::string typeQName; + + }; + + + } // End namespace rest + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_rest_restinterfaceextension_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/exportinterface.h b/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/exportinterface.h new file mode 100644 index 0000000000..f3636f0d39 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/exportinterface.h @@ -0,0 +1,38 @@ +/* + * 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_rest_exportinterface_h +#define tuscany_sca_rest_exportinterface_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) + +#ifdef TUSCANY_SCA_REST_INTERFACE_EXPORTS +#define SCA_REST_INTERFACE_API __declspec(dllexport) +#else +#define SCA_REST_INTERFACE_API __declspec(dllimport) +#endif + +#else +#define SCA_REST_INTERFACE_API +#endif + +#endif // tuscany_sca_rest_exportinterface_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/model/RESTInterface.cpp b/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/model/RESTInterface.cpp new file mode 100644 index 0000000000..34feda2049 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/model/RESTInterface.cpp @@ -0,0 +1,51 @@ +/* + * 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/rest/model/RESTInterface.h" + +using namespace std; + +namespace tuscany +{ + namespace sca + { + namespace rest + { + + const string RESTInterface::typeQName("http://www.osoa.org/xmlns/sca/1.0#RESTInterface"); + + // Constructor + RESTInterface::RESTInterface() + : Interface(true, false) + { + logentry(); + } + + RESTInterface::~RESTInterface() + { + logentry(); + } + + } // End namespace rest + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/model/RESTInterface.h b/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/model/RESTInterface.h new file mode 100644 index 0000000000..88aacecc16 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/interface/src/tuscany/sca/rest/model/RESTInterface.h @@ -0,0 +1,80 @@ +/* + * 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_rest_model_restinterface_h +#define tuscany_sca_rest_model_restinterface_h + +#include + +#include "tuscany/sca/model/Interface.h" +#include "tuscany/sca/rest/exportinterface.h" + + +namespace tuscany +{ + namespace sca + { + namespace rest + { + /** + * Holds information about a REST interface + */ + class RESTInterface : public tuscany::sca::model::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. + */ + RESTInterface(); + + /** + * Destructor. + */ + virtual ~RESTInterface(); + + /** + * return the QName of the schema type for this interface type + * (e.g. "http://www.osoa.org/xmlns/sca/1.0#interface.rest") + */ + virtual const std::string& getInterfaceTypeQName() { return typeQName; }; + + /** + * The QName of the schema type for this interface type. + */ + SCA_REST_INTERFACE_API static const std::string typeQName; + + private: + + }; + + } // End namespace rest + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_rest_model_restinterface_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/Makefile.am new file mode 100644 index 0000000000..2a0247f16f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = curl \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/Makefile.am new file mode 100644 index 0000000000..f963effea2 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = src \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/Makefile.am new file mode 100644 index 0000000000..f6e6c28b55 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/Makefile.am @@ -0,0 +1,28 @@ +libdir=$(prefix)/extensions/rest/reference/lib +lib_LTLIBRARIES = libtuscany_sca_rest_reference.la + +noinst_HEADERS = tuscany/sca/rest/*.h tuscany/sca/rest/model/*.h + +libtuscany_sca_rest_reference_la_SOURCES = \ +tuscany/sca/rest/RESTServiceBindingExtension.cpp \ +tuscany/sca/rest/model/RESTServiceBinding.cpp \ +tuscany/sca/rest/RESTServiceWrapper.cpp + +libtuscany_sca_rest_reference_la_LIBADD = \ + -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \ + -L$(top_builddir)/runtime/core/src -ltuscany_sca \ + -L$(top_builddir)/runtime/extensions/rest/interface/src -ltuscany_sca_rest_interface \ + -L${CURL_LIB} -lcurl + +INCLUDES = -I$(top_builddir)/runtime/core/src \ + -I$(top_builddir)/runtime/extensions/rest/interface/src \ + -I${TUSCANY_SDOCPP}/include \ + -I${CURL_INCLUDE} + +moduledir=$(prefix)/extensions/rest/reference/module +extension = libtuscany_sca_rest_reference$(libsuffix) + +install-exec-hook: + test -z $(moduledir) || $(mkdir_p) $(moduledir); + -rm -f $(moduledir)/$(extension) + $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceBindingExtension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceBindingExtension.cpp new file mode 100644 index 0000000000..f8eb9ad05c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceBindingExtension.cpp @@ -0,0 +1,89 @@ +/* +* 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. +*/ + +#include "RESTServiceBindingExtension.h" +#include "model/RESTServiceBinding.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/core/SCARuntime.h" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + + +extern "C" +{ +#if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) +#endif + void tuscany_sca_rest_reference_initialize() + { + tuscany::sca::rest::RESTServiceBindingExtension::initialize(); + } +} + + +namespace tuscany +{ + namespace sca + { + namespace rest + { + // =================================================================== + // Constructor for the RESTServiceBinding class. + // =================================================================== + RESTServiceBindingExtension::RESTServiceBindingExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the RESTServiceBindingExtension class. + // =================================================================== + RESTServiceBindingExtension::~RESTServiceBindingExtension() + { + logentry(); + } + + const string RESTServiceBindingExtension::extensionName("rest"); + const string RESTServiceBindingExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#RESTBinding"); + + + // =================================================================== + // loadModelElement - load the info from binding.rest + // =================================================================== + ServiceBinding* RESTServiceBindingExtension::getServiceBinding(Composite *composite, Service* service, DataObjectPtr scdlBinding) + { + string uri = scdlBinding->getCString("uri"); + + RESTServiceBinding* serviceBinding = new RESTServiceBinding(service, uri); + + return serviceBinding; + } + + void RESTServiceBindingExtension::initialize() + { + logentry(); + SCARuntime::getCurrentRuntime()->registerServiceBindingExtension(new RESTServiceBindingExtension()); + } + + } // End namespace rest + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceBindingExtension.h b/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceBindingExtension.h new file mode 100644 index 0000000000..ad1d861d95 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceBindingExtension.h @@ -0,0 +1,75 @@ +/* + * 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. + */ + +#ifndef tuscany_sca_extension_rest_restservicebindingextension_h +#define tuscany_sca_extension_rest_restservicebindingextension_h + +#include "tuscany/sca/extension/ServiceBindingExtension.h" + +namespace tuscany +{ + namespace sca + { + namespace rest + { + + class RESTServiceBindingExtension : public ServiceBindingExtension + { + public: + /** + * Default constructor + */ + RESTServiceBindingExtension(); + + /** + * Destructor + */ + virtual ~RESTServiceBindingExtension(); + + /** + * return the name of the extension + */ + virtual const std::string& getExtensionName() {return extensionName;} + + /** + * return the QName of schema elemant for this implementation extension + * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.rest") + */ + virtual const std::string& getExtensionTypeQName() {return typeQName;} + + virtual tuscany::sca::model::ServiceBinding* getServiceBinding( + tuscany::sca::model::Composite* composite, + tuscany::sca::model::Service* service, + commonj::sdo::DataObjectPtr scdlBinding); + + static void initialize(); + + private: + static const std::string extensionName; + static const std::string typeQName; + + }; + + + } // End namespace rest + } // End namespace sca +} // End namespace tuscany + +#endif //tuscany_sca_extension_rest_restservicebindingextension_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.cpp new file mode 100644 index 0000000000..e28e7976e8 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.cpp @@ -0,0 +1,1225 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Rev$ $Date$ */ +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4091) +#endif + +#include +#include +#include + +#include "commonj/sdo/SDO.h" + +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/util/SDOUtils.h" +#include "RESTServiceWrapper.h" +#include "tuscany/sca/core/Operation.h" +#include "tuscany/sca/core/SCARuntime.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 "tuscany/sca/model/CompositeReference.h" +#include "model/RESTServiceBinding.h" +#include "tuscany/sca/rest/model/RESTInterface.h" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; +using namespace tuscany::sca::util; + +namespace tuscany +{ + namespace sca + { + namespace rest + { + + class ResponseChunk { + public: + ResponseChunk() : memory(NULL), size(0) + { + } + + ~ResponseChunk() + { + if (memory) + { + free(memory); + } + } + + char *memory; + int size; + }; + + class RequestChunk { + public: + RequestChunk() : memory(NULL), size(0), read(0) + { + } + + ~RequestChunk() + { + } + + const char *memory; + int size; + int read; + }; + + class HeaderChunk { + public: + HeaderChunk() : location("") + { + } + + ~HeaderChunk() + { + } + + string location; + }; + + size_t write_callback(void *ptr, size_t size, size_t nmemb, void *data) + { + int realsize = size * nmemb; + ResponseChunk *mem = (ResponseChunk *)data; + + if (mem->memory != NULL) + { + mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1); + } + else + { + mem->memory = (char *)malloc(mem->size + realsize + 1); + } + memcpy(&(mem->memory[mem->size]), ptr, realsize); + mem->size += realsize; + mem->memory[mem->size] = 0; + return realsize; + } + + static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *data) + { + int realsize = size * nmemb; + RequestChunk *mem = (RequestChunk *)data; + + if (realsize > mem->size - mem->read) + { + realsize = mem->size - mem->read; + } + if (realsize != 0) + { + memcpy(ptr, &(mem->memory[mem->read]), realsize); + mem->read += realsize; + } + return realsize; + } + + size_t header_callback(void *ptr, size_t size, size_t nmemb, void *data) + { + int realsize = size * nmemb; + HeaderChunk* mem = (HeaderChunk*)data; + + char* str = new char[realsize + 1]; + memcpy(str, ptr, realsize); + str[realsize] = 0; + + if (strlen(str) > 10 && !strncmp(str, "Location: ", 10)) + { + string s = &str[10]; + mem->location = s.substr(0,s.find_last_not_of("\r\n")+1); + } + + delete str; + + return realsize; + } + + bool RESTServiceWrapper::initialized = false; + + RESTServiceWrapper::RESTServiceWrapper(Service* service) : ServiceWrapper(service) + { + logentry(); + + DataFactoryPtr dataFactory = service->getComponent()->getComposite()->getDataFactory(); + try { + const Type& tempType = dataFactory->getType("http://tempuri.org", "RootType"); + } catch (SDORuntimeException&) + { + dataFactory->addType("http://tempuri.org", "RootType", false, false, false); + dataFactory->addType("http://tempuri.org", "Wrapper", false, true, false); + dataFactory->addPropertyToType( + "http://tempuri.org", "RootType", + "Wrapper", + "http://tempuri.org", "Wrapper", + false, false, true); + dataFactory->addType("http://tempuri.org", "Part", false, true, false); + dataFactory->addPropertyToType( + "http://tempuri.org", "RootType", + "Part", + "http://tempuri.org", "Part", + false, false, true); + } + + if (!initialized) + { + curl_global_init(CURL_GLOBAL_ALL); + initialized = true; + } + } + + RESTServiceWrapper::~RESTServiceWrapper() + { + } + + /// + /// This method will be called when a service call needs to be made. + /// + void RESTServiceWrapper::invoke(Operation& operation) + { + logentry(); + + const string& operationName = operation.getName(); + + loginfo("Service: %s, operation: %s", getService()->getType()->getName().c_str() , operationName.c_str()); + + for (unsigned int i=0; igetComponent(); + Composite* composite = compositeReference->getComposite(); + XMLHelperPtr xmlHelper = composite->getXMLHelper(); + + // Get the REST binding + RESTServiceBinding* binding = (RESTServiceBinding *)service->getBinding(); + Interface* iface = service->getType()->getInterface(); + + // Init the curl session + CURL *curl_handle = curl_easy_init(); + + RequestChunk requestChunk; + ResponseChunk responseChunk; + HeaderChunk headerChunk; + + // Some servers don't like requests that are made without a user-agent + curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "libcurl-agent/1.0"); + + // Get the operation name + string opName = operation.getName(); + + // If we have a REST interface, the operation name translates to an HTTP verb + if (iface != NULL && iface->getInterfaceTypeQName() == RESTInterface::typeQName) + { + + // HTTP GET + if (opName == "retrieve") + { + // Build the request URL + bool firstParm = 0; + string uri; + if (operation.getNParms() !=0) + { + + // If the first parameter is a URI, then we'll use it, + // otherwise we'll use the binding URI + ostringstream s0; + writeParameter(xmlHelper, s0, operation.getParameter(0)); + string p0 = s0.str(); + if (p0.find("://") != string::npos) + { + firstParm = 1; + uri = p0; + } + else + { + uri = getBindingURI(); + } + } + else + { + uri = getBindingURI(); + } + // Add the parameters to the end of the URI + ostringstream os; + if (uri[uri.length()-1] == '?') + { + // If the URI ends with a "?" then we use the query + // form param=value& + os << uri; + for (unsigned int i = firstParm; i < operation.getNParms(); i++) + { + Operation::Parameter param = operation.getParameter(i); + + if(param.hasName()) + { + os << param.getName() << "="; + } + else + { + // No name - use "param1", etc + os << "param" << (i + 1) << "="; + } + writeParameter(xmlHelper, os, param); + if (i < operation.getNParms()-1) + os << "&"; + } + } + else + { + // Add the parameters in the form + // value1 / value2 / value3 + os << uri; + for (unsigned int i = firstParm; i < operation.getNParms(); i++) + { + os << "/"; + writeParameter(xmlHelper, os, operation.getParameter(i)); + } + } + + string url = os.str(); + //loginfo("RESTServiceWrapper: HTTP GET %s", url.c_str()); + curl_easy_setopt(curl_handle, CURLOPT_URL, url.c_str()); + + // Send all data to this function + curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_callback); + + // Pass our 'chunk' struct to the callback function + curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&responseChunk); + + // Send all headers to this function + curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, header_callback); + + // Pass our 'chunk' struct to the callback function + curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, (void *)&headerChunk); + + // Perform the HTTP GET + CURLcode rc = curl_easy_perform(curl_handle); + + if (rc) + { + throwException(ServiceInvocationException, curl_easy_strerror(rc)); + } + + // Get the output data out of the returned document + long httprc; + curl_easy_getinfo (curl_handle, CURLINFO_RESPONSE_CODE, &httprc); + + string responsePayload = ""; + if (responseChunk.memory) + { + responsePayload = string((const char*)responseChunk.memory, responseChunk.size); + } + + if (httprc == 200) + { + if (responsePayload != "") + { + //TODO Remove this workaround once SDO supports loading of open top level content + // The workaround is to wrap the open content in a wrapper element + string xmldecl; + string xml; + Utils::rTokeniseString("?>", responsePayload, xmldecl, xml); + string part = "\n"; + part += "\n"; + part += xml; + part += "\n"; + + setReturn(xmlHelper, part, operation); + } + else + { + throwException(ServiceInvocationException, "Failed to retrieve resource, empty response"); + } + } + else + { + ostringstream msg; + msg << "Failed to retrieve REST resource, HTTP code: " << httprc; + if (responsePayload != "") + { + msg << ", payload: " << responsePayload; + } + throwException(ServiceInvocationException, msg.str().c_str()); + } + } + else if (opName == "create") + { + // HTTP POST + + // Set the target URL + string url = getBindingURI(); + curl_easy_setopt(curl_handle, CURLOPT_URL, url.c_str()); + + // Create the input payload + ostringstream spayload; + writeParameter(xmlHelper, spayload, operation.getParameter(0)); + const string& requestPayload = spayload.str(); + requestChunk.memory = requestPayload.c_str(); + requestChunk.size = requestPayload.size(); + + curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDSIZE, requestChunk.size); + + // Read all data using this function + curl_easy_setopt(curl_handle, CURLOPT_READFUNCTION, read_callback); + + // Pass our 'chunk' struct to the callback function + curl_easy_setopt(curl_handle, CURLOPT_READDATA, (void *)&requestChunk); + + // Send all data to this function + curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_callback); + + // Pass our 'chunk' struct to the callback function + curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&responseChunk); + + // Send all headers to this function + curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, header_callback); + + // Pass our 'chunk' struct to the callback function + curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, (void *)&headerChunk); + + // Configure headers + curl_slist *requestHeaders = NULL; + requestHeaders = curl_slist_append(requestHeaders, "Expect:"); + requestHeaders = curl_slist_append(requestHeaders, "Content-Type: text/xml"); + curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, requestHeaders); + + // Perform the HTTP POST + curl_easy_setopt(curl_handle, CURLOPT_POST, true); + CURLcode rc = curl_easy_perform(curl_handle); + + curl_slist_free_all(requestHeaders); + + if (rc) + { + throwException(ServiceInvocationException, curl_easy_strerror(rc)); + } + + // Get the output and location of the created resource + string responsePayload = ""; + if (responseChunk.memory) + { + responsePayload = string((const char*)responseChunk.memory, responseChunk.size); + } + + long httprc; + curl_easy_getinfo (curl_handle, CURLINFO_RESPONSE_CODE, &httprc); + if (httprc == 201) + { + string* location = new string; + *location = headerChunk.location; + operation.setReturnValue(location); + } + else + { + ostringstream msg; + msg << "Failed to create REST resource, HTTP code: " << httprc; + if (responsePayload != "") + { + msg << ", payload: " << responsePayload; + } + throwException(ServiceInvocationException, msg.str().c_str()); + } + } + else if (opName == "update") + { + // HTTP PUT + + // Build the request URL + bool firstParm = 0; + string uri; + if (operation.getNParms() > 1) + { + + // If the first parameter is a URI, then we'll use it, + // otherwise we'll use the binding URI + ostringstream s0; + writeParameter(xmlHelper, s0, operation.getParameter(0)); + string p0 = s0.str(); + if (p0.find("://") != string::npos) + { + firstParm = 1; + uri = p0; + } + else + { + uri = getBindingURI(); + } + } + else + { + uri = getBindingURI(); + } + // Add the parameters to the end of the URI + ostringstream os; + if (uri[uri.length()-1] == '?') + { + // If the URI ends with a "?" then we use the query + // form param=value& + os << uri; + for (unsigned int i = firstParm; i < operation.getNParms()-1; i++) + { + Operation::Parameter param = operation.getParameter(i); + if(param.hasName()) + { + os << param.getName() << "="; + } + else + { + // No name - use "param1", etc + os << "param" << (i + 1) << "="; + } + writeParameter(xmlHelper, os, param); + if (i < operation.getNParms()-1) + os << "&"; + } + } + else + { + // Add the parameters in the form + // value1 / value2 / value3 + os << uri; + for (unsigned int i = firstParm; i < operation.getNParms()-1; i++) + { + os << "/"; + writeParameter(xmlHelper, os, operation.getParameter(i)); + } + } + + string url = os.str(); + curl_easy_setopt(curl_handle, CURLOPT_URL, url.c_str()); + + // Create the input payload + ostringstream spayload; + writeParameter(xmlHelper, spayload, operation.getParameter(operation.getNParms()-1)); + const string& requestPayload = spayload.str(); + requestChunk.memory = requestPayload.c_str(); + requestChunk.size = requestPayload.size(); + + // Read all data using this function + curl_easy_setopt(curl_handle, CURLOPT_READFUNCTION, read_callback); + + // Pass our 'chunk' struct to the callback function + curl_easy_setopt(curl_handle, CURLOPT_READDATA, (void *)&requestChunk); + + // Send all data to this function + curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_callback); + + // Pass our 'chunk' struct to the callback function + curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&responseChunk); + + // Send all headers to this function + curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, header_callback); + + // Pass our 'chunk' struct to the callback function + curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, (void *)&headerChunk); + + // Configure headers + curl_slist *requestHeaders = NULL; + requestHeaders = curl_slist_append(requestHeaders, "Expect:"); + requestHeaders = curl_slist_append(requestHeaders, "Content-Type: text/xml"); + curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, requestHeaders); + + // Perform the HTTP PUT + curl_easy_setopt(curl_handle, CURLOPT_PUT, true); + curl_easy_setopt(curl_handle, CURLOPT_UPLOAD, true) ; + long size = (long)requestChunk.size; + curl_easy_setopt(curl_handle, CURLOPT_INFILESIZE, size); + + CURLcode rc = curl_easy_perform(curl_handle); + + curl_slist_free_all(requestHeaders); + + if (rc) + { + throwException(ServiceInvocationException, curl_easy_strerror(rc)); + } + + // Get the output and location of the created resource + string responsePayload = ""; + if (responseChunk.memory) + { + responsePayload = string((const char*)responseChunk.memory, responseChunk.size); + } + + long httprc; + curl_easy_getinfo (curl_handle, CURLINFO_RESPONSE_CODE, &httprc); + if (httprc != 200) + { + ostringstream msg; + msg << "Failed to update REST resource, HTTP code: " << httprc; + if (responsePayload != "") + { + msg << ", payload: " << responsePayload; + } + throwException(ServiceInvocationException, msg.str().c_str()); + } + } + else if (opName == "delete") + { + // HTTP DELETE + + // Build the request URL + bool firstParm = 0; + string uri; + if (operation.getNParms() !=0) + { + + // If the first parameter is a URI, then we'll use it, + // otherwise we'll use the binding URI + ostringstream s0; + writeParameter(xmlHelper, s0, operation.getParameter(0)); + string p0 = s0.str(); + if (p0.find("://") != string::npos) + { + firstParm = 1; + uri = p0; + } + else + { + uri = getBindingURI(); + } + } + else + { + uri = getBindingURI(); + } + // Add the parameters to the end of the URI + ostringstream os; + if (uri[uri.length()-1] == '?') + { + // If the URI ends with a "?" then we use the query + // form param=value& + os << uri; + for (unsigned int i = firstParm; i < operation.getNParms(); i++) + { + Operation::Parameter param = operation.getParameter(i); + + if(param.hasName()) + { + os << param.getName() << "="; + } + else + { + // No name - use "param1", etc + os << "param" << (i + 1) << "="; + } + writeParameter(xmlHelper, os, param); + if (i < operation.getNParms()-1) + os << "&"; + } + } + else + { + // Add the parameters in the form + // value1 / value2 / value3 + os << uri; + for (unsigned int i = firstParm; i < operation.getNParms(); i++) + { + os << "/"; + writeParameter(xmlHelper, os, operation.getParameter(i)); + } + } + + string url = os.str(); + curl_easy_setopt(curl_handle, CURLOPT_URL, url.c_str()); + + // Send all data to this function + curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_callback); + + // Pass our 'chunk' struct to the callback function + curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&responseChunk); + + // Send all headers to this function + curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, header_callback); + + // Pass our 'chunk' struct to the callback function + curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, (void *)&headerChunk); + + // Perform the HTTP DELETE + curl_easy_setopt(curl_handle, CURLOPT_CUSTOMREQUEST, "DELETE"); + CURLcode rc = curl_easy_perform(curl_handle); + if (rc) + { + throwException(ServiceInvocationException, curl_easy_strerror(rc)); + } + + // Get the output data out of the returned document + string responsePayload = ""; + if (responseChunk.memory) + { + responsePayload = string((const char*)responseChunk.memory, responseChunk.size); + } + + long httprc; + curl_easy_getinfo (curl_handle, CURLINFO_RESPONSE_CODE, &httprc); + if (httprc != 200) + { + ostringstream msg; + msg << "Failed to delete REST resource, HTTP code: " << httprc; + if (responsePayload != "") + { + msg << ", payload: " << responsePayload; + } + throwException(ServiceInvocationException, msg.str().c_str()); + } + } + else + { + string msg = "Unknown REST verb: " + opName; + throwException(ServiceInvocationException, msg.c_str()); + } + } + else + { + // Not a REST interface, XML / HTTP command style + curl_slist *requestHeaders = NULL; + struct curl_httppost *formpost = NULL; + ostringstream spayload; + string requestPayload; + string url; + + // If the request contains complex content then we'll use + // a POST, otherwise we use a GET with a query string + bool complexContent = false; + for (unsigned int i=0; i", responsePayload, xmldecl, xml); + string part = "\n"; + part += "\n"; + part += xml; + part += "\n"; + + setReturn(xmlHelper, part, operation); + } + } + + // Cleanup curl session + curl_easy_cleanup(curl_handle); + } + + + const string RESTServiceWrapper::getBindingURI() + { + string bindingURI = ""; + + // Get the binding URI configured on the top level component + Service* service = getService(); + CompositeReference* compositeReference = (CompositeReference*)service->getComponent(); + SCARuntime* runtime = SCARuntime::getCurrentRuntime(); + Component* component = runtime->getDefaultComponent(); + Reference* reference = component->findReference(compositeReference->getName()); + if (reference != NULL) + { + ReferenceBinding* binding = reference->getBinding(); + if (binding != NULL && binding->getURI() != "") + { + bindingURI = binding->getURI(); + } + } + if (bindingURI == "") + { + // Get the binding URI configured on the binding + RESTServiceBinding* binding = (RESTServiceBinding *)service->getBinding(); + bindingURI = binding->getURI(); + } + if (bindingURI != "") + { + + // Prepend the default base URI if the URI is not absolute + if (bindingURI.find("://") == string::npos) + { + bindingURI = runtime->getDefaultBaseURI() + string("/rest/") + bindingURI; + } + } + return bindingURI; + } + + + void RESTServiceWrapper::writeParameter(XMLHelperPtr xmlHelper, ostringstream& os, const Operation::Parameter& parm) + { + logentry(); + + switch(parm.getType()) + { + case Operation::BOOL: + { + os << *(bool*)parm.getValue(); + break; + } + case Operation::SHORT: + { + os << *(short*)parm.getValue(); + break; + } + case Operation::INT: + { + os << *(long*)parm.getValue(); + break; + } + case Operation::LONG: + { + os << *(long*)parm.getValue(); + break; + } + case Operation::USHORT: + { + os << *(short*)parm.getValue(); + break; + } + case Operation::UINT: + { + os << *(long*)parm.getValue(); + break; + } + case Operation::ULONG: + { + os << *(long*)parm.getValue(); + break; + } + case Operation::FLOAT: + { + os << *(float*)parm.getValue(); + break; + } + case Operation::DOUBLE: + { + os << *(long double*)parm.getValue(); + break; + } + case Operation::LONGDOUBLE: + { + os << *(long double*)parm.getValue(); + break; + } + case Operation::CHARS: + { + os << *(char**)parm.getValue(); + break; + } + case Operation::STRING: + { + os << (*(string*)parm.getValue()).c_str(); + break; + } + case Operation::DATAOBJECT: + { + DataObjectPtr dob = *(DataObjectPtr*)parm.getValue(); + XMLDocumentPtr doc = xmlHelper->createDocument(dob, NULL, NULL); + xmlHelper->save(doc, os); + break; + } + default: + { + break; + } + } + } + + void RESTServiceWrapper::setReturn(XMLHelperPtr xmlHelper, string& payload, + Operation& operation) + { + logentry(); + + //TODO Remove this workaround once SDO supports loading of open top level content + // The workaround is to wrap the open content in a wrapper element + string xmldecl; + string xml; + Utils::rTokeniseString("?>", payload, xmldecl, xml); + string body = "\n"; + body += "\n"; + body += xml; + body += "\n"; + + // Convert the body to an SDO DataObject + DataObjectPtr outputWrapperDataObject = NULL; + XMLDocumentPtr theXMLDocument = xmlHelper->load(body.c_str(), NULL); + if (theXMLDocument != 0) + { + outputWrapperDataObject = theXMLDocument->getRootDataObject(); + } + if(!outputWrapperDataObject) + { + ostringstream msg; + msg << "Could not convert received document to SDO: " << body; + throwException(ServiceDataException, msg.str().c_str()); + } + + // Get the body part + DataObjectPtr outputDataObject = NULL; + PropertyList bpl = outputWrapperDataObject->getInstanceProperties(); + if (bpl.size()!=0) + { + if (bpl[0].isMany()) + { + DataObjectList& parts = outputWrapperDataObject->getList((unsigned int)0); + outputDataObject = parts[0]; + } + else + { + outputDataObject = outputWrapperDataObject->getDataObject(bpl[0]); + } + } + if (outputDataObject == NULL) + { + ostringstream msg; + msg << "Could not convert body part to SDO: " << body; + throwException(ServiceDataException, msg.str().c_str()); + } + + 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; + } + 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::IntType: + { + long* intData = new long; + *intData = outputDataObject->getInt(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: + { + if (!strcmp(pl[0].getType().getURI(), SDOUtils::sdoURI) && + !strcmp(pl[0].getType().getName(), "OpenDataObject")) { + + /* + * This code deals with xsd:any element parameters + * Get each element as a DataObject and add in to the parameter list + */ + DataObjectList& dataObjectList = outputDataObject->getList(pl[i]); + + for(unsigned 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* dataObjectData = new DataObjectPtr; + *dataObjectData = sequence->getDataObjectValue(0); + if(!*dataObjectData) + { + loginfo("Null DataObject return value"); + } + else + { + (*dataObjectData)->detach(); + } + operation.setReturnValue(dataObjectData); + } + } + else + { + // Empty content, add an empty string + loginfo("Null OpenDataObject return value"); + string *stringData = new string(""); + operation.setReturnValue(stringData); + } + } + } + } + else { + DataObjectPtr* dataObjectData = new DataObjectPtr; + *dataObjectData = outputDataObject->getDataObject(pl[i]); + if(!*dataObjectData) + { + loginfo("Null SDO DataObject return value"); + } + else + { + (*dataObjectData)->detach(); + } + operation.setReturnValue(dataObjectData); + } + } + break; + default: + { + ostringstream msg; + msg << "Unsupported result type: " << pl[i].getTypeEnum(); + throwException(ServiceDataException, msg.str().c_str()); + } + } + } + + } // End namespace rest + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.h new file mode 100644 index 0000000000..42e136a5d4 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.h @@ -0,0 +1,90 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Rev$ $Date$ */ + +#ifndef tuscany_sca_extension_rest_restservicewrapper_h +#define tuscany_sca_extension_rest_restservicewrapper_h + +#include + +#include "commonj/sdo/SDO.h" + +#include "tuscany/sca/core/ServiceWrapper.h" +#include "tuscany/sca/core/Operation.h" +#include "tuscany/sca/model/Service.h" + + +namespace tuscany +{ + namespace sca + { + + namespace rest + { + + class RESTServiceWrapper : public ServiceWrapper + { + public: + + /** + * Constructor. + * @param target The service wrapper represents a Web service. + */ + RESTServiceWrapper(tuscany::sca::model::Service* service); + + /** + * Destructor + */ + virtual ~RESTServiceWrapper(); + + /** + * 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); + + private: + + /** + * Used to track initialization of the CURL library + */ + static bool initialized; + + /** + * Get the configured binding URI + */ + const std::string getBindingURI(); + + /** + * Write a parameter into a URL + */ + void writeParameter(commonj::sdo::XMLHelperPtr xmlHelper, std::ostringstream& os, const Operation::Parameter& parm); + + /** + * Set the return value on the given operation + */ + void setReturn(commonj::sdo::XMLHelperPtr xmlHelper, std::string& payload, Operation& operation); + + }; + } // End namespace rest + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_rest_restservicewrapper_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/model/RESTServiceBinding.cpp b/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/model/RESTServiceBinding.cpp new file mode 100644 index 0000000000..72701bfa65 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/model/RESTServiceBinding.cpp @@ -0,0 +1,59 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Rev$ $Date$ */ + +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/rest/model/RESTServiceBinding.h" +#include "tuscany/sca/core/ServiceWrapper.h" +#include "tuscany/sca/rest/RESTServiceWrapper.h" + +using namespace std; +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace rest + { + + // Constructor + RESTServiceBinding::RESTServiceBinding(Service* service, const string& uri) + : ServiceBinding(service, uri) + { + logentry(); + + serviceWrapper = new RESTServiceWrapper(service); + } + + // Destructor + RESTServiceBinding::~RESTServiceBinding() + { + logentry(); + } + + ServiceWrapper* RESTServiceBinding::getServiceWrapper() + { + logentry(); + + return serviceWrapper; + } + + } // End namespace rest + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/model/RESTServiceBinding.h b/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/model/RESTServiceBinding.h new file mode 100644 index 0000000000..d19bcdacf5 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/model/RESTServiceBinding.h @@ -0,0 +1,76 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Rev$ $Date$ */ + +#ifndef tuscany_sca_extension_rest_model_restservicebinding_h +#define tuscany_sca_extension_rest_model_restservicebinding_h + +#include + +#include "tuscany/sca/model/ServiceBinding.h" +#include "tuscany/sca/model/Service.h" + +namespace tuscany +{ + namespace sca + { + namespace rest + { + /** + * Information about a REST binding for a service or a reference. + */ + class RESTServiceBinding : public tuscany::sca::model::ServiceBinding + { + public: + + /** + * Constructor. + * @param uri The uri of the binding. + */ + RESTServiceBinding(tuscany::sca::model::Service* service, const std::string& uri); + + /** + * Destructor. + */ + virtual ~RESTServiceBinding(); + + /** + * Returns the type of binding. + */ + virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#RESTBinding"; }; + + /** + * 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 rest + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_extension_rest_model_restservicebinding_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/service/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/Makefile.am new file mode 100644 index 0000000000..2ecfda6c6c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = httpd \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/Makefile.am new file mode 100644 index 0000000000..f963effea2 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = src \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/Makefile.am new file mode 100644 index 0000000000..e5b3ce85bd --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/Makefile.am @@ -0,0 +1,42 @@ +libdir=$(prefix)/extensions/rest/service/lib +lib_LTLIBRARIES = \ +libtuscany_sca_rest_service.la \ +libtuscany_sca_mod_rest.la + +noinst_HEADERS = \ +tuscany/sca/rest/*.h \ +tuscany/sca/rest/model/*.h + +libtuscany_sca_rest_service_la_SOURCES = \ +tuscany/sca/rest/RESTReferenceBindingExtension.cpp \ +tuscany/sca/rest/model/RESTReferenceBinding.cpp \ +tuscany/sca/rest/RESTServiceProxy.cpp + +libtuscany_sca_rest_service_la_LIBADD = \ + -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \ + -L$(top_builddir)/runtime/core/src -ltuscany_sca \ + -L$(top_builddir)/runtime/extensions/rest/interface/src -ltuscany_sca_rest_interface + +rootdir=$(prefix)/extensions/rest/service + +libtuscany_sca_mod_rest_la_SOURCES = \ +tuscany/sca/rest/ModREST.cpp + +libtuscany_sca_mod_rest_la_LIBADD = \ + -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \ + -L$(top_builddir)/runtime/core/src -ltuscany_sca \ + -L$(top_builddir)/runtime/extensions/rest/service/httpd/src -ltuscany_sca_rest_service \ + -L$(top_builddir)/runtime/extensions/rest/interface/src -ltuscany_sca_rest_interface + +INCLUDES = -I$(top_builddir)/runtime/core/src \ + -I$(top_builddir)/runtime/extensions/rest/interface/src \ + -I${TUSCANY_SDOCPP}/include \ + -I${HTTPD_INCLUDE} -I${APR_INCLUDE} + +moduledir=$(prefix)/extensions/rest/service/module +extension = libtuscany_sca_rest_service$(libsuffix) + +install-exec-hook: + test -z $(moduledir) || $(mkdir_p) $(moduledir); + -rm -f $(moduledir)/$(extension) + $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp new file mode 100644 index 0000000000..4a63991515 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp @@ -0,0 +1,1372 @@ +/* + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "apr_strings.h" +#include "apr_fnmatch.h" +#include "apr_lib.h" + +#define APR_WANT_STRFUNC +#include "apr_want.h" +#include "ap_config.h" +#include "httpd.h" + +// This section removes the windows/httpd build error "strtoul_is_not_a_portable_function_use_strtol_instead" +#if defined(WIN32) || defined (_WINDOWS) +#ifdef strtoul +#undef strtoul +#endif +#define strtoul strtoul +#endif + +#include "http_config.h" +#include "http_core.h" +#include "http_request.h" +#include "http_protocol.h" +#include "http_log.h" +#include "http_main.h" +#include "util_script.h" +#include "util_md5.h" + +#include "mod_core.h" + +#include "commonj/sdo/SDO.h" + +#include "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/util/Logging.h" +#include "RESTServiceProxy.h" +#include "model/RESTReferenceBinding.h" +#include "tuscany/sca/rest/model/RESTInterface.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/WSDLMessagePart.h" +#include "tuscany/sca/model/WSDLInterface.h" +#include "tuscany/sca/model/Interface.h" +#include "tuscany/sca/core/SCARuntime.h" +#include "tuscany/sca/util/Utils.h" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca; +using namespace tuscany::sca::model; +using namespace tuscany::sca::util; + + +extern "C" +{ + extern module AP_MODULE_DECLARE_DATA sca_rest_module; +} + +namespace tuscany +{ + namespace sca + { + namespace rest + { + + typedef struct rest_server_config_rec + { + char * home; + } rest_server_config_rec_t; + + typedef struct rest_dir_config_rec + { + char * root; + char * path; + char * base_uri; + char * component; + } rest_dir_config_rec_t; + + CompositeService* initializeSCARuntime(const char* home, const char* root, + const char* path, const char* baseURI, const char *component, const char* service); + + DataObjectPtr createPayload(DataFactoryPtr dataFactory, + Operation& operation, const WSDLOperation& wsdlOperation); + + void addPart(XMLHelperPtr xmlHelper, string& payload, Operation& operation); + + int logHeaders(void* request, const char* key, const char* value); + + /** + * Initialize the SCA runtime + */ + CompositeService* initializeSCARuntime(const char* home, const char* root, + const char* path, const char* baseURI, const char *component, const char* service) + { + logentry(); + loginfo("Home: %s", home); + loginfo("Root: %s", root); + loginfo("Path: %s", path); + loginfo("Base URI: %s", baseURI); + loginfo("Component: %s", component); + loginfo("Service: %s", service); + + try + { + SCARuntime* runtime = SCARuntime::initializeSharedRuntime(home, root, path, baseURI); + + string componentName; + if (strlen(component)) + { + componentName = component; + } + else + { + componentName = runtime->getDefaultComponentName(); + } + string serviceName = service; + + loginfo("Resolving composite: %s, service: %s", componentName.c_str(), serviceName.c_str()); + Component* compositeComponent = runtime->getSystem()->findComponent(componentName); + if (compositeComponent == NULL) + { + string msg = "Component not found " + componentName; + throwException(SystemConfigurationException, msg.c_str()); + } + runtime->setDefaultComponent(compositeComponent); + + Composite* composite = (Composite*)compositeComponent->getType(); + CompositeService* compositeService = (CompositeService*)composite->findComponent(serviceName); + if (compositeService == NULL) + { + string msg = "Composite service not found " + serviceName; + throwException(SystemConfigurationException, msg.c_str()); + } + + return compositeService; + } + catch(TuscanyRuntimeException &ex) + { + ostringstream msg; + msg << ex; + logerror("Failed to initialize SCA runtime: %s", msg.str().c_str()); + throw; + } + } + + bool printRequest = false; + + int logHeaders(void* request, const char* key, const char* value) + { + loginfo("Header key: %s, value: %s", key, value); + if (printRequest) + { + ap_rprintf((request_rec*)request, "
      Header key: %s, value: %s", key, value); + } + return 1; + } + + int rest_handler(request_rec *request) + { + logentry(); + + if (strcmp(request->handler, "sca_rest_module")) + { + return DECLINED; + } + + try { + + // Set up the read policy + int rc = ap_setup_client_block(request, REQUEST_CHUNKED_DECHUNK); + if (rc != OK) + { + return rc; + } + ap_should_client_block(request); + if (request->read_chunked == true && request->remaining == 0) + { + request->chunked = true; + } + + apr_table_setn(request->headers_out, "Connection", "close"); + + if (printRequest) + { + // Set the content type + ap_set_content_type(request, "text/html"); + + // Send the response document + ap_rputs("

      Tuscany Mod_rest works!", request); + } + + rest_server_config_rec_t* server_conf = (rest_server_config_rec_t*)ap_get_module_config(request->server->module_config, &sca_rest_module); + loginfo("Tuscany home: %s", server_conf->home); + if (printRequest) + { + ap_rprintf(request, "

      Tuscany home: %s", server_conf->home); + } + + rest_dir_config_rec_t* dir_conf = (rest_dir_config_rec_t*)ap_get_module_config(request->per_dir_config, &sca_rest_module); + loginfo("Tuscany root: %s", dir_conf->root); + if (printRequest) + { + ap_rprintf(request, "

      Tuscany root: %s", dir_conf->root); + } + loginfo("Tuscany path: %s", dir_conf->path); + if (printRequest) + { + ap_rprintf(request, "

      Tuscany path: %s", dir_conf->path); + } + loginfo("SCA component: %s", dir_conf->component); + if (printRequest) + { + ap_rprintf(request, "

      SCA component: %s", dir_conf->component); + } + + if (request->protocol) + { + loginfo("Protocol: %s", request->protocol); + if (printRequest) + { + ap_rprintf(request, "

      Protocol: %s", request->protocol); + } + } + + if (request->method) + { + loginfo("HTTP method: %s", request->method); + if (printRequest) + { + ap_rprintf(request, "

      HTTP method: %s", request->method); + } + } + + loginfo("HTTP method number: %d", request->method_number); + if (printRequest) + { + ap_rprintf(request, "

      HTTP method number: %d", request->method_number); + } + + const char* content_type = apr_table_get(request->headers_in, "Content-Type"); + if (content_type) + { + loginfo("Content type: %s", content_type); + if (printRequest) + { + ap_rprintf(request, "

      Content type: %s", content_type); + } + } + else + { + content_type = "text/plain"; + } + + if (request->content_encoding) + { + loginfo("Content encoding: %s", request->content_encoding); + if (printRequest) + { + ap_rprintf(request, "

      Content encoding: %s", request->content_encoding); + } + } + + if (printRequest) + { + ap_rputs("

      ", request); + } + apr_table_do(logHeaders, request, request->headers_in, NULL); + + if (request->uri) + { + loginfo("URI: %s", request->uri); + if (printRequest) + { + ap_rprintf(request, "

      URI: %s", request->uri); + } + } + + if (request->path_info) + { + loginfo("Path info: %s", request->path_info); + if (printRequest) + { + ap_rprintf(request, "

      Path info: %s", request->path_info); + } + } + + if (request->args) + { + loginfo("Args: %s", request->args); + if (printRequest) + { + ap_rprintf(request, "

      Args: %s", request->args); + } + } + + if (printRequest) + { + ap_rputs("", request); + } + + // Extract the service and component names from the HTTP URI path + string path; + if (strlen(request->path_info) != 0 && *(request->path_info) == '/') + { + path = request->path_info + 1; + } + else + { + path = request->path_info; + } + string uri; + + string component; + string service; + if (strlen(dir_conf->component)) + { + // The path only specifies the service, the component name + // is configured in the directory/location configured + component = dir_conf->component; + Utils::tokeniseString("/", path, service, uri); + } + else + { + // The path must be in the form component / service + string path2; + Utils::tokeniseString("/", path, component, path2); + Utils::tokeniseString("/", path2, service, uri); + } + + loginfo("Component name: %s", component.c_str()); + loginfo("Service name: %s", service.c_str()); + + // Initialize the SCA runtime + CompositeService* compositeService = initializeSCARuntime( + server_conf->home, dir_conf->root, dir_conf->path, dir_conf->base_uri, component.c_str(), service.c_str()); + + if(!compositeService) + { + throwException(SystemConfigurationException, + "Failed to initialize SCA runtime, could not initialize CompositeService"); + } + + Composite* composite = compositeService->getComposite(); + DataFactoryPtr dataFactory = composite->getDataFactory(); + if (dataFactory == 0) + { + throwException(SystemConfigurationException, + "Failed to initialize SCA runtime, could not get DataFactory"); + } + XMLHelperPtr xmlHelper = composite->getXMLHelper(); + + // Get the REST binding + Reference* reference = compositeService->getReference(); + RESTReferenceBinding* binding = (RESTReferenceBinding*)reference->getBinding(); + + // Get the REST proxy + RESTServiceProxy* proxy = (RESTServiceProxy*)binding->getServiceProxy(); + + // Get the component interface + Interface* iface = reference->getType()->getInterface(); + + if (request->method_number == M_GET) + { + // Handle an HTTP GET + + // Determine the operation to invoke + WSDLOperation wsdlOperation; + string wsdlNamespace = ""; + string op_name = ""; + string uriArgs = ""; + if (iface != NULL) + { + // If we have a REST interface, the operation name is "retrieve" + if (iface->getInterfaceTypeQName() == RESTInterface::typeQName) + { + op_name = "retrieve"; + uriArgs = uri; + } + else if (iface->getInterfaceTypeQName() == WSDLInterface::typeQName) + { + // we have a WSDL interface, the operation name is part of the URI + Utils::tokeniseString("/", uri, op_name, uriArgs); + + // look for the WSDL operation definition + WSDLInterface* wsdlInterface = (WSDLInterface*)iface; + wsdlNamespace = wsdlInterface->getNamespaceURI(); + + if (wsdlNamespace != "") + { + WSDLDefinition* wsdl = composite->findWSDLDefinition(wsdlNamespace); + if (wsdl == 0) + { + string msg = "WSDL not found for: " + wsdlNamespace; + throwException(SystemConfigurationException, msg.c_str()); + } + try + { + wsdlOperation = wsdl->findOperation(wsdlInterface->getName(), op_name.c_str()); + } + catch(SystemConfigurationException&) + { + throw; + } + + if (!wsdlOperation.isDocumentStyle() || !wsdlOperation.isWrappedStyle()) + { + throwException(ServiceInvocationException, + "Only wrapped document style WSDL operations are currentlysupported"); + } + } + } + } + else + { + Utils::tokeniseString("/", uri, op_name, uriArgs); + } + + // Create a default document literal wrapped WSDL operation + if (wsdlNamespace == "") + { + WSDLMessagePart inPart(op_name, "", "http://tempuri.org"); + WSDLMessagePart outPart((op_name+"Response"), "", "http://tempuri.org"); + 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.setInputEncoded(false); + wsdlOperation.setOutputEncoded(false); + wsdlOperation.setInputMessagePart(op_name, inPart); + wsdlOperation.setOutputMessagePart((op_name+"Response"), outPart); + } + + // Create the input DataObject + Operation operation(op_name.c_str()); + + // Parse the args part of the URI + if (uriArgs != "") + { + string args = uriArgs; + for (; args != ""; ) + { + string param; + string next; + Utils::tokeniseString("/", args, param, next); + if (param != "") + { + string* data = new string; + *data = param; + operation.addParameter(data); + } + args = next; + } + } + + // Parse the query string + if (request->args) + { + string query = request->args; + for (; query != ""; ) + { + string param; + string next; + Utils::tokeniseString("&", query, param, next); + if (param != "") + { + string n; + string* data = new string; + Utils::tokeniseString("=", param, n, *data); + operation.addParameter(data); + } + query = next; + } + } + DataObjectPtr inputDataObject = createPayload(dataFactory, operation, wsdlOperation); + + // Dispatch to the REST proxy + DataObjectPtr outputDataObject = proxy->invoke(wsdlOperation, inputDataObject); + + // Send the output DataObject + if (iface!=NULL && + iface->getInterfaceTypeQName() == RESTInterface::typeQName) + { + if (outputDataObject == NULL) + { + throwException(ServiceInvocationException, "Null output from REST create operation"); + } + else + { + + // Pure REST, send the response document + XMLHelperPtr xm = HelperProvider::getXMLHelper(dataFactory); + DataObjectList& l = outputDataObject->getList("return"); + if (l.size() != 0) + { + DataObjectPtr resourceDataObject = l[0]; + XMLDocumentPtr doc = xm->createDocument( + resourceDataObject, + resourceDataObject->getType().getURI(), + resourceDataObject->getType().getName()); + char* str = xm->save(doc); + + // Calculate an Etag hash for the response + char* etag = ap_md5(request->pool, (const unsigned char*)str); + + // Handle a conditional GET, if the etag matches the etag + // sent by the client, we don't need to send the whole response + const char* match = apr_table_get(request->headers_in, "If-None-Match"); + if (match != NULL && !strcmp(etag, match)) + { + loginfo("REST resource matches ETag, sending HTTP 304 response code"); + request->status = HTTP_NOT_MODIFIED; + } + else + { + loginfo("Sending response: %s", str); + ap_set_content_type(request, "text/xml"); + apr_table_setn(request->headers_out, "ETag", etag); + + // Send an Etag header to allow caching and + // conditional gets + apr_table_setn(request->headers_out, "ETag", etag); + + ap_rputs(str, request); + } + } + else + { + loginfo("REST resource not found, sending HTTP 404 response code"); + request->status = HTTP_NOT_FOUND; + + return OK; + } + } + } + else + { + // Command style, send the response wrapper element + + if (outputDataObject == NULL) + { + loginfo("Sending empty response"); + //request->status = HTTP_NO_CONTENT; + } + else + { + XMLHelperPtr xm = HelperProvider::getXMLHelper(dataFactory); + DataObjectList& l = outputDataObject->getList("return"); + if (l.size() != 0) + { + DataObjectPtr resultDataObject = l[0]; + XMLDocumentPtr doc = xm->createDocument( + resultDataObject, + resultDataObject->getType().getURI(), + resultDataObject->getType().getName()); + char* str = xm->save(doc); + + loginfo("Sending response: %s", str); + ap_set_content_type(request, "text/xml"); + ap_rputs(str, request); + } + else + { + loginfo("Sending empty response"); + //request->status = HTTP_NO_CONTENT; + } + } + } + + return OK; + } + else if (request->method_number == M_POST) + { + // Handle an HTTP POST + + // Determine the operation to invoke + WSDLOperation wsdlOperation; + string wsdlNamespace = ""; + string op_name = ""; + string uriArgs = ""; + if (iface != NULL) + { + // If we have a REST interface, the operation name is "create" + if (iface->getInterfaceTypeQName() == RESTInterface::typeQName) + { + op_name = "create"; + } + else if (iface->getInterfaceTypeQName() == WSDLInterface::typeQName) + { + // we have a WSDL interface, the operation name is part of the URI + Utils::tokeniseString("/", uri, op_name, uriArgs); + + // look for the WSDL operation definition + WSDLInterface* wsdlInterface = (WSDLInterface*)iface; + wsdlNamespace = wsdlInterface->getNamespaceURI(); + + if (wsdlNamespace != "") + { + WSDLDefinition* wsdl = composite->findWSDLDefinition(wsdlNamespace); + if (wsdl == 0) + { + string msg = "WSDL not found for: " + wsdlNamespace; + throwException(SystemConfigurationException, msg.c_str()); + } + try + { + wsdlOperation = wsdl->findOperation(wsdlInterface->getName(), op_name.c_str()); + } + catch(SystemConfigurationException&) + { + throw; + } + + if (!wsdlOperation.isDocumentStyle() || !wsdlOperation.isWrappedStyle()) + { + throwException(ServiceInvocationException, + "Only wrapped document style WSDL operations are currentlysupported"); + } + } + } + } + else + { + Utils::tokeniseString("/", uri, op_name, uriArgs); + } + + // Create a default document literal wrapped WSDL operation + if (wsdlNamespace == "") + { + WSDLMessagePart inPart(op_name, "", "http://tempuri.org"); + WSDLMessagePart outPart((op_name+"Response"), "", "http://tempuri.org"); + 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.setInputEncoded(false); + wsdlOperation.setOutputEncoded(false); + wsdlOperation.setInputMessagePart(op_name, inPart); + wsdlOperation.setOutputMessagePart((op_name+"Response"), outPart); + } + + // Create the input DataObject + Operation operation(op_name.c_str()); + + // Parse the args part of the URI + if (uriArgs != "") + { + string args = uriArgs; + for (; args != ""; ) + { + string param; + string next; + Utils::tokeniseString("/", args, param, next); + if (param != "") + { + string* data = new string; + *data = param; + operation.addParameter(data); + } + args = next; + } + } + + // Parse the query string + if (request->args) + { + string query = request->args; + for (; query != ""; ) + { + string param; + string next; + Utils::tokeniseString("&", query, param, next); + if (param != "") + { + string n; + string* data = new string; + Utils::tokeniseString("=", param, n, *data); + operation.addParameter(data); + } + query = next; + } + } + + // Read the POST input + ostringstream sinput; + char buffer[2049]; + for ( ; ; ) + { + int size = ap_get_client_block(request, buffer, 2048); + if (size > 0) + { + buffer[size] = '\0'; + sinput << buffer; + } + else if (size == 0) + { + break; + } + else if (size < 0) + { + throwException(ServiceInvocationException, "Error reading POST input"); + } + } + string input = sinput.str(); + + string contentType = content_type; + if (contentType.find("multipart/form-data") == 0) + { + // This is a multipart POST, extract each part from the + // POST body + string begin; + string boundary; + Utils::tokeniseString("boundary=", contentType, begin, boundary); + + for (;;) + { + // Read each part + string part; + string next; + Utils::tokeniseString(boundary, input, part, next); + input = next; + + // Skip first and last empty parts + if (part.length() == 0 || part == "--") + continue; + + // Read headers + bool xml = false; + int empty = -1; + for (;;) + { + string header; + Utils::tokeniseString("\r\n", part, header, next); + part = next; + if (header == "") + { + // Two empty lines signal the beginning of the content + empty++; + if (empty == 1) + break; + } + else + { + empty = 0; + + // Detect XML content + if (header == "Content-Type: text/xml") + xml = true; + } + } + + // Read the part content + if (part.length()) + { + // Strip the trailer + string value; + Utils::tokeniseString("\r\n--", part, value, next); + + if (xml) + { + // Add an XML parameter to the operation + addPart(xmlHelper, value, operation); + } + else + { + // Add a text parameter to the operation + string* stringData = new string; + *stringData = value; + operation.addParameter(stringData); + } + } + + // Read till the end of the POST body + if (input.length() == 0) + break; + } + } + else + { + // The POST body represents a single part + addPart(xmlHelper, input, operation); + } + + DataObjectPtr inputDataObject = createPayload(dataFactory, operation, wsdlOperation); + + // Dispatch to the REST proxy + DataObjectPtr outputDataObject = proxy->invoke(wsdlOperation, inputDataObject); + + // Send the response back to the client + if (iface!=NULL && + iface->getInterfaceTypeQName() == RESTInterface::typeQName) + { + // Pure REST, send the location of the created resource + + if (outputDataObject == NULL) + { + throwException(ServiceInvocationException, "Null output from REST create operation"); + } + + string location = ""; + + DataObjectList& l = outputDataObject->getList("return"); + if (l.size()) + { + location = l.getCString(0); + } + + if (location == "") + { + loginfo("No resource location, sending HTTP 400 response code"); + request->status = HTTP_BAD_REQUEST; + + return OK; + } + + string locuri = request->uri; + locuri += '/'; + locuri += location; + + const char* loc = ap_construct_url(request->pool, locuri.c_str(), request); + loginfo("Sending resource location: %s", loc); + apr_table_setn(request->headers_out, "Location", loc); + apr_table_setn(request->headers_out, "Content-Location", loc); + request->status = HTTP_CREATED; + + // Send the created resource entity back to the client + ap_set_content_type(request, "text/xml"); + ap_rputs(input.c_str(), request); + + } + else + { + // Command style, send the response element + + if (outputDataObject == NULL) + { + loginfo("Sending empty response"); + //request->status = HTTP_NO_CONTENT; + } + else + { + XMLHelperPtr xm = HelperProvider::getXMLHelper(dataFactory); + DataObjectList& l = outputDataObject->getList("return"); + if (l.size() != 0) + { + DataObjectPtr resultDataObject = l[0]; + XMLDocumentPtr doc = xm->createDocument( + resultDataObject, + resultDataObject->getType().getURI(), + resultDataObject->getType().getName()); + char* str = xm->save(doc); + + loginfo("Sending response: %s", str); + ap_set_content_type(request, "text/xml"); + ap_rputs(str, request); + } + else + { + loginfo("Sending empty response"); + //request->status = HTTP_NO_CONTENT; + } + } + } + + return OK; + } + else if (request->method_number == M_PUT) + { + + // Handle an HTTP PUT + + // Determine the operation to invoke + WSDLOperation wsdlOperation; + string wsdlNamespace = ""; + string op_name = "update"; + string uriArgs = uri; + + // Create a default document literal wrapped WSDL operation + WSDLMessagePart inputPart(op_name, "", "http://tempuri.org"); + WSDLMessagePart outputPart((op_name+"Response"), "", "http://tempuri.org"); + 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.setInputEncoded(false); + wsdlOperation.setOutputEncoded(false); + wsdlOperation.setInputMessagePart(op_name, inputPart); + wsdlOperation.setOutputMessagePart((op_name+"Response"), outputPart); + + // Create the input DataObject + Operation operation(op_name.c_str()); + + // Parse the args part of the URI + if (uriArgs != "") + { + string args = uriArgs; + for (; args != ""; ) + { + string param; + string next; + Utils::tokeniseString("/", args, param, next); + if (param != "") + { + string* data = new string; + *data = param; + operation.addParameter(data); + } + args = next; + } + } + + // Parse the query string + if (request->args) + { + string query = request->args; + for (; query != ""; ) + { + string param; + string next; + Utils::tokeniseString("&", query, param, next); + if (param != "") + { + string n; + string* data = new string; + Utils::tokeniseString("=", param, n, *data); + operation.addParameter(data); + } + query = next; + } + } + + // Read the PUT input + ostringstream sinput; + char buffer[2049]; + for ( ; ; ) + { + int size = ap_get_client_block(request, buffer, 2048); + if (size > 0) + { + buffer[size] = '\0'; + sinput << buffer; + } + else if (size == 0) + { + break; + } + else if (size < 0) + { + throwException(ServiceInvocationException, "Error reading PUT input"); + } + } + string input = sinput.str(); + addPart(xmlHelper, input, operation); + + DataObjectPtr inputDataObject = createPayload(dataFactory, operation, wsdlOperation); + + // Dispatch to the REST proxy + DataObjectPtr outputDataObject = proxy->invoke(wsdlOperation, inputDataObject); + + // Empty response + //request->status = HTTP_NO_CONTENT; + return OK; + } + else if (request->method_number == M_DELETE) + { + + // Determine the operation to invoke + WSDLOperation wsdlOperation; + string wsdlNamespace = ""; + string op_name = "delete"; + string uriArgs = uri; + + // Create a default document literal wrapped WSDL operation + WSDLMessagePart inPart(op_name, "", "http://tempuri.org"); + WSDLMessagePart outPart((op_name+"Response"), "", "http://tempuri.org"); + 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.setInputEncoded(false); + wsdlOperation.setOutputEncoded(false); + wsdlOperation.setInputMessagePart(op_name, inPart); + wsdlOperation.setOutputMessagePart((op_name+"Response"), outPart); + + // Create the input DataObject + Operation operation(op_name.c_str()); + + // Parse the args part of the URI + if (uriArgs != "") + { + string args = uriArgs; + for (; args != ""; ) + { + string param; + string next; + Utils::tokeniseString("/", args, param, next); + if (param != "") + { + string* data = new string; + *data = param; + operation.addParameter(data); + } + args = next; + } + } + + // Parse the query string + if (request->args) + { + string query = request->args; + for (; query != ""; ) + { + string param; + string next; + Utils::tokeniseString("&", query, param, next); + if (param != "") + { + string n; + string* data = new string; + Utils::tokeniseString("=", param, n, *data); + operation.addParameter(data); + } + query = next; + } + } + + DataObjectPtr inputDataObject = createPayload(dataFactory, operation, wsdlOperation); + + // Dispatch to the REST proxy + DataObjectPtr outputDataObject = proxy->invoke(wsdlOperation, inputDataObject); + + // Empty response + //request->status = HTTP_NO_CONTENT; + return OK; + } + else + { + if (request->method) + { + logerror("Unsupported HTTP method: %s", request->method); + } + else + { + logerror("Unsupported HTTP method: %d", request->method_number); + } + return HTTP_NOT_IMPLEMENTED; + } + } + catch(TuscanyRuntimeException& ex) + { + ostringstream msg; + msg << ex; + logerror("Failed to process REST request: %s", msg.str().c_str()); + return HTTP_INTERNAL_SERVER_ERROR; + } + } + + DataObjectPtr createPayload(DataFactoryPtr dataFactory, Operation& operation, const WSDLOperation& wsdlOperation) + { + logentry(); + + DataObjectPtr inputDataObject; + string inputTypeUri; + string inputTypeName; + try + { + // Since its Document wrapped, there will only be one part + std::list partList = wsdlOperation.getInputMessagePartNames(); + const WSDLMessagePart &inputMessage = + wsdlOperation.getInputMessagePart(partList.front()); + inputTypeName = inputMessage.getPartType(); + inputTypeUri = inputMessage.getPartUri(); + + // Create the input wrapper + const Type& rootType = dataFactory->getType(inputTypeUri.c_str(), "RootType"); + const Property& prop = rootType.getProperty(inputTypeName.c_str()); + const Type& inputType = prop.getType(); + inputDataObject = dataFactory->create(inputType); + } + catch (SDORuntimeException&) + { + try + { + // Create the input wrapper + const Type& inputType = + dataFactory->getType(inputTypeUri.c_str(), inputTypeName.c_str()); + inputDataObject = dataFactory->create(inputType); + } + catch (SDORuntimeException&) + { + + // The input wrapper type is not known, create an open DataObject + inputDataObject = dataFactory->create("http://tempuri.org", "Wrapper"); + } + } + + // 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::STRING: + { + l.append((*(string*)parm.getValue()).c_str()); + break; + } + case Operation::DATAOBJECT: + { + l.append(*(DataObjectPtr*)parm.getValue()); + break; + } + default: + { + break; + } + } + } + } + } + else { + + // Each parameter in the operation should be a property on the request dataobject + for (unsigned int i=0; isetCString(i, (*(string*)parm.getValue()).c_str()); + break; + } + case Operation::DATAOBJECT: + { + inputDataObject->setDataObject(i, *(DataObjectPtr*)parm.getValue()); + break; + } + default: + { + break; + } + } + } + } + + return inputDataObject; + } + + void addPart(XMLHelperPtr xmlHelper, string& payload, Operation& operation) + { + logentry(); + + + //TODO Remove this workaround once SDO supports loading of open top level content + // The workaround is to wrap the open content in a wrapper element + string xmldecl; + string xml; + Utils::rTokeniseString("?>", payload, xmldecl, xml); + string body = "\n"; + body += "\n"; + body += xml; + body += "\n"; + + // Convert the body to an SDO DataObject + DataObjectPtr inputWrapperDataObject = NULL; + XMLDocumentPtr theXMLDocument = xmlHelper->load(body.c_str(), NULL); + if (theXMLDocument != 0) + { + inputWrapperDataObject = theXMLDocument->getRootDataObject(); + } + if(!inputWrapperDataObject) + { + ostringstream msg; + msg << "Could not convert received document to SDO: " << body; + throwException(ServiceDataException, msg.str().c_str()); + } + + // Get the body part + DataObjectPtr inputDataObject = NULL; + PropertyList bpl = inputWrapperDataObject->getInstanceProperties(); + if (bpl.size()!=0) + { + if (bpl[0].isMany()) + { + DataObjectList& parts = inputWrapperDataObject->getList((unsigned int)0); + inputDataObject = parts[0]; + } + else + { + inputDataObject = inputWrapperDataObject->getDataObject(bpl[0]); + } + } + if (inputDataObject == NULL) + { + ostringstream msg; + msg << "Could not convert received document to SDO: " << body; + throwException(ServiceDataException, msg.str().c_str()); + } + + DataObjectPtr* dataObjectData = new DataObjectPtr; + *dataObjectData = inputDataObject; + (*dataObjectData)->detach(); + operation.addParameter(dataObjectData); + } + + const char *rest_set_home(cmd_parms *cmd, void *dummy, + const char *arg) + { + rest_server_config_rec_t *conf = (rest_server_config_rec_t*)ap_get_module_config( + cmd->server->module_config, &sca_rest_module); + conf->home = apr_pstrdup(cmd->pool, arg); + return NULL; + } + + const char *rest_set_path(cmd_parms *cmd, void *c, + const char *arg) + { + rest_dir_config_rec_t *conf = (rest_dir_config_rec_t*)c; + conf->path = apr_pstrdup(cmd->pool, arg); + return NULL; + } + + const char *rest_set_root(cmd_parms *cmd, void *c, + const char *arg) + { + rest_dir_config_rec_t *conf = (rest_dir_config_rec_t*)c; + conf->root = apr_pstrdup(cmd->pool, arg); + return NULL; + } + + const char *rest_set_base_uri(cmd_parms *cmd, void *c, + const char *arg) + { + rest_dir_config_rec_t *conf = (rest_dir_config_rec_t*)c; + conf->base_uri = apr_pstrdup(cmd->pool, arg); + return NULL; + } + + const char *rest_set_component(cmd_parms *cmd, void *c, + const char *arg) + { + rest_dir_config_rec_t *conf = (rest_dir_config_rec_t*)c; + conf->component = apr_pstrdup(cmd->pool, arg); + return NULL; + } + + const command_rec rest_module_cmds[] = + { + AP_INIT_TAKE1("TuscanyHome", (const char*(*)())tuscany::sca::rest::rest_set_home, NULL, RSRC_CONF, + "Tuscany home directory"), + AP_INIT_TAKE1("TuscanyPath", (const char*(*)())tuscany::sca::rest::rest_set_path, NULL, ACCESS_CONF, + "Tuscany SCA composite search path"), + AP_INIT_TAKE1("TuscanyRoot", (const char*(*)())tuscany::sca::rest::rest_set_root, NULL, ACCESS_CONF, + "Tuscany root SCA configuration path"), + AP_INIT_TAKE1("TuscanyBaseURI", (const char*(*)())tuscany::sca::rest::rest_set_base_uri, NULL, ACCESS_CONF, + "Tuscany SCA system base URI"), + AP_INIT_TAKE1("TuscanyComponent", (const char*(*)())tuscany::sca::rest::rest_set_component, NULL, ACCESS_CONF, + "SCA component name"), + {NULL} + }; + + int rest_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, + server_rec *s) + { + return OK; + } + + void rest_child_init(apr_pool_t* p, server_rec* svr_rec) + { + rest_server_config_rec_t *conf = (rest_server_config_rec_t*)ap_get_module_config( + svr_rec->module_config, &sca_rest_module); + + if(false) + { + fprintf(stderr, "[Tuscany] Due to one or more errors mod_rest loading" + " failed. Causing apache2 to stop loading\n"); + exit(APEXIT_CHILDFATAL); + } + } + + void register_hooks(apr_pool_t *p) + { + ap_hook_handler(rest_handler, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_post_config(rest_init, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_child_init(rest_child_init, NULL, NULL, APR_HOOK_MIDDLE); + } + + void *rest_create_dir_config(apr_pool_t *p, char *dirspec) + { + rest_dir_config_rec_t* conf = (rest_dir_config_rec_t* )apr_palloc(p, sizeof(*conf)); + conf->path = ""; + conf->root = ""; + conf->base_uri = ""; + conf->component = ""; + return conf; + } + + void* rest_create_server_config(apr_pool_t *p, server_rec *s) + { + rest_server_config_rec_t* conf = (rest_server_config_rec_t* )apr_palloc(p, sizeof(*conf)); + conf->home = ""; + return conf; + } + + } // End namespace rest + } // End namespace sca +} // End namespace tuscany + +extern "C" +{ + + module AP_MODULE_DECLARE_DATA sca_rest_module = + { + STANDARD20_MODULE_STUFF, + tuscany::sca::rest::rest_create_dir_config, /* dir config */ + NULL, /* dir merger --- default is to override */ + tuscany::sca::rest::rest_create_server_config, /* server config */ + NULL, /* merge server config */ + tuscany::sca::rest::rest_module_cmds, /* command table */ + tuscany::sca::rest::register_hooks /* register_hooks */ + }; + +} diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.cpp new file mode 100644 index 0000000000..18720f42f5 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.cpp @@ -0,0 +1,86 @@ +/* +* 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. +*/ + +#include "RESTReferenceBindingExtension.h" +#include "model/RESTReferenceBinding.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/core/SCARuntime.h" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + +extern "C" +{ +#if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) +#endif + void tuscany_sca_rest_service_initialize() + { + tuscany::sca::rest::RESTReferenceBindingExtension::initialize(); + } +} + +namespace tuscany +{ + namespace sca + { + namespace rest + { + // =================================================================== + // Constructor for the RESTReferenceBinding class. + // =================================================================== + RESTReferenceBindingExtension::RESTReferenceBindingExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the RESTReferenceBindingExtension class. + // =================================================================== + RESTReferenceBindingExtension::~RESTReferenceBindingExtension() + { + logentry(); + } + + const string RESTReferenceBindingExtension::extensionName("rest"); + const string RESTReferenceBindingExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#RESTBinding"); + + // =================================================================== + // loadModelElement - load the info from binding.rest + // =================================================================== + ReferenceBinding* RESTReferenceBindingExtension::getReferenceBinding(Composite *composite, Reference* reference, DataObjectPtr scdlBinding) + { + string uri = scdlBinding->getCString("uri"); + + RESTReferenceBinding* referenceBinding = new RESTReferenceBinding(reference, uri); + + return referenceBinding; + } + + void RESTReferenceBindingExtension::initialize() + { + logentry(); + SCARuntime::getCurrentRuntime()->registerReferenceBindingExtension(new RESTReferenceBindingExtension()); + } + + } // End namespace rest + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.h b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.h new file mode 100644 index 0000000000..0d9e41841b --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.h @@ -0,0 +1,75 @@ +/* + * 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. + */ + +#ifndef tuscany_sca_extension_rest_restreferencebindingextension_h +#define tuscany_sca_extension_rest_restreferencebindingextension_h + +#include "tuscany/sca/extension/ReferenceBindingExtension.h" + +namespace tuscany +{ + namespace sca + { + namespace rest + { + + class RESTReferenceBindingExtension : public ReferenceBindingExtension + { + public: + /** + * Default constructor + */ + RESTReferenceBindingExtension(); + + /** + * Destructor + */ + virtual ~RESTReferenceBindingExtension(); + + /** + * return the name of the extension + */ + virtual const std::string& getExtensionName() {return extensionName;} + + /** + * return the QName of schema elemant for this implementation extension + * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.rest") + */ + virtual const std::string& getExtensionTypeQName() {return typeQName;} + + virtual tuscany::sca::model::ReferenceBinding* getReferenceBinding( + tuscany::sca::model::Composite* composite, + tuscany::sca::model::Reference *reference, + commonj::sdo::DataObjectPtr scdlBinding); + + static void initialize(); + + private: + static const std::string extensionName; + static const std::string typeQName; + + }; + + + } // End namespace rest + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_extension_rest_restreferencebindingextension_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp new file mode 100644 index 0000000000..95affe6202 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp @@ -0,0 +1,567 @@ +/* + * 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 "commonj/sdo/SDO.h" + +#include "RESTServiceProxy.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/util/SDOUtils.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 "tuscany/sca/model/WSDLMessagePart.h" +#include "model/RESTReferenceBinding.h" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; +using namespace tuscany::sca::util; + +namespace tuscany +{ + namespace sca + { + namespace rest + { + + // ============================ + // Constructor: Create a proxy + // ============================ + RESTServiceProxy::RESTServiceProxy(Reference* reference) + : ServiceProxy(reference) + { + logentry(); + + // Get the target service wrapper + RESTReferenceBinding* referenceBinding = (RESTReferenceBinding*)reference->getBinding(); + serviceWrapper = referenceBinding->getTargetServiceBinding()->getServiceWrapper(); + + DataFactoryPtr dataFactory = reference->getComponent()->getComposite()->getDataFactory(); + try { + const Type& tempType = dataFactory->getType("http://tempuri.org", "RootType"); + } catch (SDORuntimeException&) + { + dataFactory->addType("http://tempuri.org", "RootType", false, false, false); + dataFactory->addType("http://tempuri.org", "Wrapper", false, true, false); + dataFactory->addPropertyToType( + "http://tempuri.org", "RootType", + "Wrapper", + "http://tempuri.org", "Wrapper", + false, false, true); + dataFactory->addType("http://tempuri.org", "Part", false, true, false); + dataFactory->addPropertyToType( + "http://tempuri.org", "RootType", + "Part", + "http://tempuri.org", "Part", + false, false, true); + } + } + + // ========== + // Destructor + // ========== + RESTServiceProxy::~RESTServiceProxy() + { + logentry(); + } + + /// + /// This method will be called to process an operation invocation. + /// + DataObjectPtr RESTServiceProxy::invoke(const WSDLOperation& wsdlOperation, DataObjectPtr inputDataObject) + { + logentry(); + + Reference* reference = getReference(); + Component* component = reference->getComponent(); + Composite* composite = component ->getComposite(); + + RESTReferenceBinding* referenceBinding = (RESTReferenceBinding*)reference->getBinding(); + DataFactoryPtr dataFactoryPtr = reference->getComponent()->getComposite()->getDataFactory(); + + // Since its Document wrapped, there will only be one message part + std::list partList = wsdlOperation.getOutputMessagePartNames(); + const WSDLMessagePart &part = wsdlOperation.getOutputMessagePart(partList.front()); + const char* outputTypeURI = part.getPartUri().c_str(); + const char* outputTypeName = part.getPartName().c_str(); + + loginfo("WSDLOperation input message Type: %s#%s", + wsdlOperation.getInputMessageUri().c_str(), + wsdlOperation.getInputMessageName().c_str()); + loginfo("WSDLOperation output part Type: %s#%s", + outputTypeURI, + outputTypeName); + + // Create new Operation object and set parameters and return value + Operation operation(wsdlOperation.getOperationName().c_str()); + + try + { + + // 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*; + *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::IntType: + { + long* intData = new long; + *intData = inputDataObject->getInt(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 (pl[i].isMany()) + { + DataObjectList& l = inputDataObject->getList(pl[i]); + stringData = new string(l.getCString(0)); + } + else + { + 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: + { + if (!strcmp(pl[i].getType().getURI(), SDOUtils::sdoURI) && + !strcmp(pl[i].getType().getName(), "OpenDataObject")) { + + /* + * 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* dataObjectData =new DataObjectPtr; + *dataObjectData = sequence->getDataObjectValue(0); + if(!*dataObjectData) + { + loginfo("Null DataObject parameter named %s", name); + } + else + { + (*dataObjectData)->detach(); + } + operation.addParameter(dataObjectData); + } + } + else + { + // Empty content, add an empty string + loginfo("Empty OpenDataObject parameter named %s[%d]", name, j); + string* stringData = new string(""); + operation.addParameter(stringData); + } + } + } + } + else { + DataObjectPtr* dataObjectData = new DataObjectPtr; + if (pl[i].isMany()) + { + DataObjectList& l = inputDataObject->getList((unsigned int)i); + *dataObjectData = l[0]; + } + else + { + *dataObjectData = inputDataObject->getDataObject(pl[i]); + } + if(!*dataObjectData) + { + loginfo("Null DataObject parameter named %s", name); + } + else + { + (*dataObjectData)->detach(); + } + operation.addParameter(dataObjectData); + } + } + break; + default: + { + ostringstream msg; + msg << "Unsupported param type: " << pl[i].getTypeEnum(); + throwException(SystemConfigurationException, msg.str().c_str()); + } + } + } + + // 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&) + { + try + { + + // Create the output wrapper + const Type& outputType = dataFactoryPtr->getType(outputTypeURI, outputTypeName); + outputDataObject = dataFactoryPtr->create(outputType); + } + catch (SDORuntimeException&) + { + // The output wrapper type is not known, create an open DataObject + outputDataObject = dataFactoryPtr->create("http://tempuri.org", "Wrapper"); + } + } + + setOutputData(operation, outputDataObject, dataFactoryPtr); + + return outputDataObject; + } + catch(SDORuntimeException& ex) + { + throwException(ServiceInvocationException, ex); + } + catch(TuscanyRuntimeException& ex) + { + throw; + } + } + + + void RESTServiceProxy::setOutputData(Operation& operation, DataObjectPtr outputDataObject, DataFactoryPtr dataFactoryPtr) + { + logentry(); + + // 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: + { + break; + } + } + } + else + { + loginfo("No return values 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->setInt(pl[i], *(int*)operation.getReturnValue()); + break; + } + case Operation::LONG: + { + outputDataObject->setInt(pl[i], *(long*)operation.getReturnValue()); + break; + } + case Operation::USHORT: + { + outputDataObject->setInt(pl[i], *(unsigned short*)operation.getReturnValue()); + break; + } + case Operation::UINT: + { + outputDataObject->setInt(pl[i], *(unsigned int*)operation.getReturnValue()); + break; + } + case Operation::ULONG: + { + outputDataObject->setInt(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("Null return value, 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("Null return value, leaving property %s unset", pl[i].getName()); + } + + break; + } + default: + { + break; + } + } + } + } + } + + } // End namespace rest + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.h b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.h new file mode 100644 index 0000000000..387add3f35 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.h @@ -0,0 +1,95 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Rev$ $Date$ */ + +#ifndef tuscany_sca_extension_rest_restserviceproxy_h +#define tuscany_sca_extension_rest_restserviceproxy_h + +#include "commonj/sdo/SDO.h" + +#include "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" +#include "tuscany/sca/model/WSDLOperation.h" +#include "model/RESTReferenceBinding.h" + + +namespace tuscany +{ + namespace sca + { + namespace rest + { + + /** + * 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 RESTServiceProxy : 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. + */ + RESTServiceProxy(tuscany::sca::model::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. + */ + RESTServiceProxy(tuscany::sca::model::Service* service); + + /** + * Destructor. + */ + virtual ~RESTServiceProxy(); + + /** + * Invoke the specified operation + */ + SCA_REST_SERVICE_API commonj::sdo::DataObjectPtr invoke( + const tuscany::sca::model::WSDLOperation& wsdlOperation, + commonj::sdo::DataObjectPtr inputDataObject); + + private: + + void setOutputData(Operation& operation, + commonj::sdo::DataObjectPtr outputDataObject, commonj::sdo::DataFactoryPtr dataFactoryPtr); + + /** + * The target service wrapper + */ + ServiceWrapper* serviceWrapper; + + }; + + } // End namespace rest + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_extension_rest_restserviceproxy_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/export.h b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/export.h new file mode 100644 index 0000000000..802218a2fe --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/export.h @@ -0,0 +1,38 @@ +/* + * 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_rest_service_export_h +#define tuscany_sca_rest_service_export_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) + +#ifdef TUSCANY_SCA_REST_SERVICE_EXPORTS +#define SCA_REST_SERVICE_API __declspec(dllexport) +#else +#define SCA_REST_SERVICE_API __declspec(dllimport) +#endif + +#else +#define SCA_REST_SERVICE_API +#endif + +#endif // tuscany_sca_rest_service_export_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.cpp b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.cpp new file mode 100644 index 0000000000..877ee01178 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.cpp @@ -0,0 +1,66 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Rev$ $Date$ */ + +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/rest/model/RESTReferenceBinding.h" +#include "tuscany/sca/core/ServiceProxy.h" +#include "tuscany/sca/rest/RESTServiceProxy.h" + +using namespace std; +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace rest + { + + // Constructor + RESTReferenceBinding::RESTReferenceBinding(Reference* reference, const string& uri) + : ReferenceBinding(reference, uri) + { + logentry(); + } + + // Destructor + RESTReferenceBinding::~RESTReferenceBinding() + { + logentry(); + } + + void RESTReferenceBinding::configure(ServiceBinding *binding) + { + logentry(); + + setTargetServiceBinding(binding); + + serviceProxy = new RESTServiceProxy(getReference()); + } + + ServiceProxy* RESTReferenceBinding::getServiceProxy() + { + logentry(); + + return serviceProxy; + } + + } // End namespace rest + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.h b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.h new file mode 100644 index 0000000000..22fc04c356 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.h @@ -0,0 +1,80 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Rev$ $Date$ */ + +#ifndef tuscany_sca_extension_rest_model_restreferencebinding_h +#define tuscany_sca_extension_rest_model_restreferencebinding_h + +#include + +#include "tuscany/sca/model/ReferenceBinding.h" + +namespace tuscany +{ + namespace sca + { + namespace rest + { + /** + * Information about a web service binding for service or a reference. + */ + class RESTReferenceBinding : public tuscany::sca::model::ReferenceBinding + { + public: + + /** + * Constructor. + * @param uri The uri of the binding. + */ + RESTReferenceBinding(tuscany::sca::model::Reference* reference, const std::string& uri); + + /** + * Destructor. + */ + virtual ~RESTReferenceBinding(); + + /** + * Returns the type of binding. + */ + virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#RESTBinding"; }; + + /** + * Configure this binding from a service binding. + */ + virtual void configure(tuscany::sca::model::ServiceBinding* serviceBinding); + + /** + * Create a proxy representing the reference to the + * client component. + */ + virtual ServiceProxy* getServiceProxy(); + + private: + + /** + * The proxy representing the reference to the client + * component. + */ + ServiceProxy* serviceProxy; + }; + + } // End namespace rest + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_extension_rest_model_restreferencebinding_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/xsd/sca-binding-rest.xsd b/sca-cpp/trunk/contrib/runtime/extensions/rest/xsd/sca-binding-rest.xsd new file mode 100644 index 0000000000..ace4c54a39 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/xsd/sca-binding-rest.xsd @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/rest/xsd/sca-interface-rest.xsd b/sca-cpp/trunk/contrib/runtime/extensions/rest/xsd/sca-interface-rest.xsd new file mode 100644 index 0000000000..30422ab038 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/rest/xsd/sca-interface-rest.xsd @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ruby/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/ruby/Makefile.am new file mode 100644 index 0000000000..08ba2f553f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/Makefile.am @@ -0,0 +1,24 @@ +# 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 extension + +datadir=$(prefix)/extensions/ruby + +nobase_data_DATA = xsd/*.xsd + +EXTRA_DIST = xsd diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ruby/extension/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/ruby/extension/Makefile.am new file mode 100644 index 0000000000..41ce75925b --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/extension/Makefile.am @@ -0,0 +1,34 @@ +# 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 = + +libdir=$(prefix)/extensions/ruby/lib +BUILT_SOURCES = extension_build + +EXTRA_DIST = src + +extension_build: src/Extension.cpp src/extconf.rb + cd src; ruby extconf.rb; make + touch extension_build + +clean: + cd src;make clean + rm -f extension_build + +install-exec-hook: + cp src/tuscany_sca_ruby.* $(libdir) + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ruby/extension/src/Extension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ruby/extension/src/Extension.cpp new file mode 100644 index 0000000000..458700e5f1 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/extension/src/Extension.cpp @@ -0,0 +1,56 @@ +/* + * 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) +#define SCA_RUBYEXTENSION_API __declspec(dllexport) +#else +#define SCA_RUBYEXTENSION_API +#endif + +#include "tuscany/sca/ruby/Ruby.h" +#include "tuscany/sca/ruby/RubyCompositeContext.h" + +extern "C" +{ + + // Implement the Sca::locateService module function + SCA_RUBYEXTENSION_API VALUE tuscany_sca_ruby_locateService(VALUE module, VALUE value) + { + // Locate the service + const char* serviceName = rb_string_value_cstr(&value); + return tuscany::sca::ruby::RubyCompositeContext::locateService(serviceName); + } + + // Initialize the Ruby extension + SCA_RUBYEXTENSION_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_RUBYEXTENSION_API void Init_libtuscany_sca_ruby() + { + Init_tuscany_sca_ruby(); + } +} diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ruby/extension/src/extconf.rb b/sca-cpp/trunk/contrib/runtime/extensions/ruby/extension/src/extconf.rb new file mode 100644 index 0000000000..9c41843d63 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/extension/src/extconf.rb @@ -0,0 +1,25 @@ +# +# 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. +# + + require 'mkmf' + CONFIG["CC"] = "g++" + $CPPFLAGS << " -I../../src " + $LIBPATH << "../../src/.libs" + $LIBS << " -ltuscany_sca_ruby_lang " + create_makefile 'tuscany_sca_ruby' diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/Makefile.am new file mode 100644 index 0000000000..d9310440b9 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/Makefile.am @@ -0,0 +1,53 @@ +# 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_lang.la + +install-exec-hook: + +rootdir=$(prefix)/extensions/ruby + +noinst_HEADERS = \ +tuscany/sca/ruby/*.h \ +tuscany/sca/ruby/model/*.h + +libtuscany_sca_ruby_lang_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_lang_la_LIBADD = -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \ + -L$(top_builddir)/runtime/core/src -ltuscany_sca \ + -L${RUBY_LIB} -lruby -lpthread + +INCLUDES = -Imodel -I$(top_builddir)/runtime/core/src \ + -I${TUSCANY_SDOCPP}/include \ + -I${RUBY_INCLUDE} + +moduledir=$(prefix)/extensions/ruby/module +extension = libtuscany_sca_ruby_lang$(libsuffix) + +install-exec-hook: + test -z $(moduledir) || $(mkdir_p) $(moduledir); + -rm -f $(moduledir)/$(extension) + $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/Ruby.h b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/Ruby.h new file mode 100644 index 0000000000..a6b8ee8ffa --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/Ruby.h @@ -0,0 +1,39 @@ +/* + * 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/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.cpp new file mode 100644 index 0000000000..5554ac6756 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.cpp @@ -0,0 +1,70 @@ +/* + * 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" +#include "tuscany/sca/ruby/RubyCompositeContext.h" + +using namespace std; +using namespace tuscany::sca::model; + + +namespace tuscany +{ + namespace sca + { + namespace ruby + { + + VALUE RubyCompositeContext::locateService(const char* serviceName) + { + // Get the default component + Component* defaultComponent = tuscany::sca::SCARuntime::getCurrentRuntime()->getDefaultComponent(); + Composite* composite = (Composite*)defaultComponent->getType(); + + // Locate the service + 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 + tuscany::sca::ruby::RubyServiceProxy* serviceProxy = new tuscany::sca::ruby::RubyServiceProxy(service); + + // Return the Ruby proxy value object + return serviceProxy->getProxyValue(); + } + + + } // End namespace ruby + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.h b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.h new file mode 100644 index 0000000000..2414b66fb1 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.h @@ -0,0 +1,50 @@ +/* + * 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_RubyCompositeContext_h +#define tuscany_sca_ruby_RubyCompositeContext_h + +#include "tuscany/sca/ruby/Ruby.h" +#include "tuscany/sca/ruby/export.h" + + + +namespace tuscany +{ + namespace sca + { + namespace ruby + { + + class RubyCompositeContext + { + public: + SCA_RUBY_API static VALUE locateService(const char* serviceName); + + }; + + + } // End namespace ruby + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_ruby_RubyCompositeContext_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.cpp new file mode 100644 index 0000000000..5789517cfd --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.cpp @@ -0,0 +1,72 @@ +/* + * 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" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + +extern "C" +{ +#if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) +#endif + void tuscany_sca_ruby_lang_initialize() + { + tuscany::sca::ruby::RubyExtension::initialize(); + } +} + +namespace tuscany +{ + namespace sca + { + namespace ruby + { + // =================================================================== + // Constructor for the RubyExtension class. + // =================================================================== + RubyExtension::RubyExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the RubyExtension class. + // =================================================================== + RubyExtension::~RubyExtension() + { + logentry(); + } + + void RubyExtension::initialize() + { + logentry(); + SCARuntime::getCurrentRuntime()->registerImplementationExtension(new RubyImplementationExtension()); + } + + } // End namespace ruby + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.h b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.h new file mode 100644 index 0000000000..232431ca1e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.h @@ -0,0 +1,58 @@ +/* + * 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/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.cpp new file mode 100644 index 0000000000..aa416f139a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.cpp @@ -0,0 +1,74 @@ +/* + * 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" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace ruby + { + // =================================================================== + // Constructor for the RubyImplementationExtension class. + // =================================================================== + RubyImplementationExtension::RubyImplementationExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the RubyImplementationExtension class. + // =================================================================== + RubyImplementationExtension::~RubyImplementationExtension() + { + logentry(); + } + + 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) + { + logentry(); + + 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; + } + + } // End namespace ruby + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.h b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.h new file mode 100644 index 0000000000..79d9ed2dbe --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.h @@ -0,0 +1,74 @@ +/* + * 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 std::string& getExtensionName() {return extensionName;} + + /** + * return the QName of schema elemant for this implementation extension + * (e.g. "http://www.osoa.org/xmlns/sca/1.0#implementation.ruby") + */ + virtual const std::string& getExtensionTypeQName() {return typeQName;} + + virtual tuscany::sca::model::ComponentType* getImplementation( + tuscany::sca::model::Composite* composite, + commonj::sdo::DataObjectPtr scdlImplementation); + + private: + static const std::string extensionName; + static const std::string typeQName; + + }; + + + } // End namespace ruby + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_ruby_rubyimplementationextension_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp new file mode 100644 index 0000000000..d830cd92de --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp @@ -0,0 +1,384 @@ +/* + * 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/ruby/RubyServiceProxy.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/SCARuntime.h" +#include "tuscany/sca/core/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" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + +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(); + + // ---------------------- + // 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(); + } + + // ============================ + // Constructor: Create a proxy + // ============================ + RubyServiceProxy::RubyServiceProxy(Service* service) + : ServiceProxy(0) + { + logentry(); + + // ---------------------- + // Get the component + // ---------------------- + component = service->getComponent(); + string name = service->getType()->getName(); + + // Get the service wrapper + serviceWrapper = service->getBinding()->getServiceWrapper(); + + // Create the Ruby proxy + createProxy(); + } + + // ========== + // Destructor + // ========== + RubyServiceProxy::~RubyServiceProxy() + { + logentry(); + } + + void RubyServiceProxy::createProxy() + { + logentry(); + + // 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) + { + logentry(); + + // 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)); + + loginfo("Converting Ruby Rexml document to SDO DataObject: %s", str.c_str()); + + Composite* composite = getReference()->getComponent()->getComposite(); + commonj::sdo::XMLHelperPtr xmlHelper = composite->getXMLHelper(); + commonj::sdo::XMLDocumentPtr xmlDoc = xmlHelper->load(str.c_str()); + + DataObjectPtr dob; + if (xmlDoc != NULL) + { + dob = xmlDoc->getRootDataObject(); + } + if (dob != NULL) + { + DataObjectPtr* dataObjectData = new DataObjectPtr; + *dataObjectData = dob; + operation.addParameter(dataObjectData); + } + 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::XMLHelperPtr xmlHelper = composite->getXMLHelper(); + char* str = xmlHelper->save( + dob, + dob->getType().getURI(), + dob->getType().getName()); + + loginfo("Converting SDO DataObject to Ruby Rexml document: %s", str); + + VALUE vstr[1]; + vstr[0] = rb_str_new2(str); + + value = rb_class_new_instance(1, vstr, RubyImplementation::getXMLDocumentClass()); + break; + } + default: + { + value = Qnil; + break; + } + } + + 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/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.h b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.h new file mode 100644 index 0000000000..e6c37cf1da --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.h @@ -0,0 +1,114 @@ +/* + * 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/Ruby.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" + + +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(tuscany::sca::model::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(tuscany::sca::model::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 + */ + tuscany::sca::model::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/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp new file mode 100644 index 0000000000..db6bc07b7e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp @@ -0,0 +1,794 @@ +/* + * 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 "commonj/sdo/SDO.h" + +#include "tuscany/sca/ruby/RubyServiceWrapper.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/Exceptions.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" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace ruby + { + + class RubyServiceInvocation + { + public: + VALUE instance; + ID method; + int argc; + const VALUE* argv; + }; + } + } +} + +extern "C" +{ + + static VALUE safe_rb_funcall(VALUE value) + { + tuscany::sca::ruby::RubyServiceInvocation* call = (tuscany::sca::ruby::RubyServiceInvocation*)value; + if (call->argc == 0) + { + VALUE result = rb_funcall(call->instance, call->method, 0); + return result; + } + else + { + VALUE result = rb_funcall2(call->instance, call->method, call->argc, call->argv); + return result; + } + } + +} + +namespace tuscany +{ + namespace sca + { + namespace ruby + { + + // =========== + // Constructor + // =========== + RubyServiceWrapper::RubyServiceWrapper(Service* service) + : ServiceWrapper(service) + { + logentry(); + + component = service->getComponent(); + implementation = (RubyImplementation*)component->getType(); + interf = service->getType()->getInterface(); + } + + // ========== + // Destructor + // ========== + RubyServiceWrapper::~RubyServiceWrapper() + { + logentry(); + } + + // ====================================================================== + // invoke: wrapper call to service with setting the component context + // ====================================================================== + void RubyServiceWrapper::invoke(Operation& operation) + { + logentry(); + + SCARuntime* runtime = SCARuntime::getCurrentRuntime(); + 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::XMLHelperPtr xmlHelper = composite->getXMLHelper(); + char* str = xmlHelper->save( + dob, + dob->getType().getURI(), + dob->getType().getName()); + + loginfo("Converting SDO DataObject to Ruby Rexml document: %s", str); + + VALUE vstr[1]; + vstr[0] = rb_str_new2(str); + + value = rb_class_new_instance(1, vstr, RubyImplementation::getXMLDocumentClass()); + break; + } + default: + { + ostringstream msg; + msg << "Operation parameter type not supported: " << parmType; + throwException(ServiceDataException, msg.str().c_str()); + } + } + + args[i] = value; + } + } + + + // Invoke the specified method + RubyServiceInvocation call; + call.instance = instance; + call.method = method; + call.argc = n; + call.argv = args; + int error = 0; + VALUE result = rb_protect(safe_rb_funcall, (VALUE)&call, &error); + if (error) + { + // Convert a Ruby error to a C++ exception + VALUE lasterr = rb_gv_get("$!"); + ostringstream msg; + + // class + VALUE klass = rb_class_path(CLASS_OF(lasterr)); + msg << "Ruby Exception " << RSTRING(klass)->ptr << ": "; + + // message + VALUE message = rb_obj_as_string(lasterr); + msg << RSTRING(message)->ptr << endl; + + // backtrace + if(!NIL_P(ruby_errinfo)) { + VALUE ary = rb_funcall(ruby_errinfo, rb_intern("backtrace"), 0); + int c; + for (c=0; clen; c++) { + msg << "from " << RSTRING(RARRAY(ary)->ptr[c])->ptr << endl; + } + } + throwException(ServiceInvocationException, msg.str().c_str()); + } + + // 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)); + + loginfo("Converting Ruby Rexml document to SDO DataObject: %s", str.c_str()); + + Composite* composite = component->getComposite(); + commonj::sdo::XMLHelperPtr xmlHelper = composite->getXMLHelper(); + commonj::sdo::XMLDocumentPtr xmlDoc = xmlHelper->load(str.c_str()); + + DataObjectPtr* dataObjectData = new DataObjectPtr; + if (xmlDoc != NULL) + { + *dataObjectData = xmlDoc->getRootDataObject(); + } + else + { + *dataObjectData = NULL; + } + if (*dataObjectData != NULL) + { + operation.setReturnValue(dataObjectData); + } + else + { + string msg = "Document could not be converted to a DataObject"; + throwException(ServiceDataException, msg.c_str()); + } + } + else + { + string msg = "Ruby type not supported: " + resultType; + throwException(ServiceDataException, msg.c_str()); + } + break; + } + default: + { + string msg = "Ruby type not supported: " + resultType; + throwException(ServiceDataException, msg.c_str()); + } + } + + } + catch (...) + { + runtime->unsetCurrentComponent(); + throw; + } + + runtime->unsetCurrentComponent(); + } + + } // End namespace ruby + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.h new file mode 100644 index 0000000000..2526084a72 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.h @@ -0,0 +1,94 @@ +/* + * 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/ruby/export.h" +#include "tuscany/sca/ruby/Ruby.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" + + +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(tuscany::sca::model::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. + */ + tuscany::sca::model::Component* component; + + /** + * A pointer to the interface which the service exposes. + */ + tuscany::sca::model::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/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/export.h b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/export.h new file mode 100644 index 0000000000..5db72a1ebe --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/export.h @@ -0,0 +1,38 @@ +/* + * 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_LANG_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/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.cpp new file mode 100644 index 0000000000..fa30642318 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.cpp @@ -0,0 +1,171 @@ +/* + * 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" + +using namespace std; +using namespace tuscany::sca::model; + +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() + { + } + + VALUE RubyImplementation::getXMLDocumentClass() + { + logentry(); + + // 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; + } + + return xmlDocumentClass; + } + + void RubyImplementation::loadClass() + { + logentry(); + + // Ensure xmlDocumentClass is initialized + getXMLDocumentClass(); + + ID to_s = rb_intern("to_s"); + VALUE xstr = rb_funcall(xmlDocumentClass, to_s, 0); + loginfo("Got Ruby Rexml class: %s", rb_string_value_cstr(&xstr)); + + // Load the specified Ruby script + if (script != "") + { + // Convert any windows slashes \ in the root path to unix slashes / + 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/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.h b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.h new file mode 100644 index 0000000000..c7bc851635 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.h @@ -0,0 +1,136 @@ +/* + * 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 + +#include "tuscany/sca/ruby/Ruby.h" +#include "tuscany/sca/model/ComponentType.h" + +namespace tuscany +{ + namespace sca + { + namespace ruby + { + /** + * Holds information about an SCA implementation written in Ruby + */ + class RubyImplementation : public tuscany::sca::model::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(tuscany::sca::model::Composite* composite, + const std::string& module, const std::string& className, const std::string& script); + + /** + * Destructor + */ + virtual ~RubyImplementation(); + + /** + * Initialize a component of this type. + * @param component The component to initialize. + */ + virtual void initializeComponent(tuscany::sca::model::Component* component); + + /** + * Returns the name of the Ruby module. + * @return The name of the Ruby module. + */ + const std::string& getModule() const { return module; } + + /** + * Returns the name of Ruby class. + * @return Name of the Ruby class. + */ + const std::string& getClass() const { return className; } + + /** + * Returns the path of the Ruby script. + * @return The path of the Ruby script. + */ + const std::string& getScript() const { return script; } + + /** + * Returns the Ruby implementation class + */ + VALUE getImplementationClass() const { return implementationClass; } + + /** + * Returns the Ruby REXML::Document class + */ + static VALUE getXMLDocumentClass(); + + private: + + /** + * Load the Ruby implementation class + */ + void loadClass(); + + /** + * Name of the Ruby module. + */ + std::string module; + + /** + * Name of the Ruby class. + */ + std::string className; + + /** + * Path of the Ruby script. + */ + std::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/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.cpp new file mode 100644 index 0000000000..3187c07973 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.cpp @@ -0,0 +1,60 @@ +/* + * 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" + +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace ruby + { + + // Constructor + RubyReferenceBinding::RubyReferenceBinding(Reference* reference) + : ReferenceBinding(reference, ""), serviceProxy(NULL) + { + } + + // Destructor + RubyReferenceBinding::~RubyReferenceBinding() + { + } + + ServiceProxy* RubyReferenceBinding::getServiceProxy() + { + return serviceProxy; + } + + void RubyReferenceBinding::configure(ServiceBinding* binding) + { + setTargetServiceBinding(binding); + + serviceProxy = new RubyServiceProxy(getReference()); + } + + } // End namespace ruby + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.h b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.h new file mode 100644 index 0000000000..72d39b5639 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.h @@ -0,0 +1,83 @@ +/* + * 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 + +#include "tuscany/sca/model/ReferenceBinding.h" + + +namespace tuscany +{ + namespace sca + { + namespace ruby + { + /** + * Information about a Ruby service binding for service or a reference. + */ + class RubyReferenceBinding : public tuscany::sca::model::ReferenceBinding + { + public: + + /** + * Constructor. + */ + RubyReferenceBinding(tuscany::sca::model::Reference* reference); + + /** + * Destructor. + */ + virtual ~RubyReferenceBinding(); + + /** + * Returns the type of binding. + */ + virtual std::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(tuscany::sca::model::ServiceBinding* serviceBinding); + + private: + + /** + * The proxy representing the reference to the client + * component. + */ + ServiceProxy* serviceProxy; + }; + + } // End namespace ruby + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_ruby_model_rubyreferencebinding_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.cpp new file mode 100644 index 0000000000..163f8a9d8b --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.cpp @@ -0,0 +1,54 @@ +/* + * 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" + +using namespace tuscany::sca::model; + +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/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.h b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.h new file mode 100644 index 0000000000..b772daf712 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.h @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + + +#ifndef tuscany_sca_ruby_model_rubyservicebinding_h +#define tuscany_sca_ruby_model_rubyservicebinding_h + +#include + +#include "tuscany/sca/model/ServiceBinding.h" + +namespace tuscany +{ + namespace sca + { + namespace ruby + { + /** + * Information about a Ruby service binding for service or a reference. + */ + class RubyServiceBinding : public tuscany::sca::model::ServiceBinding + { + public: + + /** + * Constructor. + */ + RubyServiceBinding(tuscany::sca::model::Service* service); + + /** + * Destructor. + */ + virtual ~RubyServiceBinding(); + + /** + * Returns the type of binding. + */ + virtual std::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/sca-cpp/trunk/contrib/runtime/extensions/ruby/xsd/sca-implementation-ruby.xsd b/sca-cpp/trunk/contrib/runtime/extensions/ruby/xsd/sca-implementation-ruby.xsd new file mode 100644 index 0000000000..5772019a4f --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ruby/xsd/sca-implementation-ruby.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/sca/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/sca/Makefile.am new file mode 100644 index 0000000000..50dfb45557 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/sca/Makefile.am @@ -0,0 +1,23 @@ +# 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/sca-cpp/trunk/contrib/runtime/extensions/sca/reference/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/sca/reference/Makefile.am new file mode 100644 index 0000000000..2b9491ec1c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/sca/reference/Makefile.am @@ -0,0 +1,18 @@ +# 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/sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/Makefile.am new file mode 100644 index 0000000000..d5fdf775ca --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/Makefile.am @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +libdir=$(prefix)/extensions/sca/reference/lib +lib_LTLIBRARIES = libtuscany_sca_binding_reference.la + +noinst_HEADERS = \ +tuscany/sca/binding/*.h \ +tuscany/sca/binding/model/*.h + +libtuscany_sca_binding_reference_la_SOURCES = \ +tuscany/sca/binding/SCAServiceBindingExtension.cpp \ +tuscany/sca/binding/model/SCAServiceBinding.cpp + +libtuscany_sca_binding_reference_la_LIBADD = \ + -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo -ltuscany_sdo_axiom \ + -L$(top_builddir)/runtime/core/src -ltuscany_sca + +INCLUDES = -I$(top_builddir)/runtime/core/src \ + -I${TUSCANY_SDOCPP}/include + +moduledir=$(prefix)/extensions/sca/reference/module +extension = libtuscany_sca_binding_reference$(libsuffix) + +install-exec-hook: + test -z $(moduledir) || $(mkdir_p) $(moduledir); + -rm -f $(moduledir)/$(extension) + $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp new file mode 100644 index 0000000000..7d70f595cc --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#include "SCAServiceBindingExtension.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/core/SCARuntime.h" +#include "tuscany/sca/core/Exceptions.h" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + +extern "C" +{ +#if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) +#endif + void tuscany_sca_binding_reference_initialize() + { + tuscany::sca::binding::SCAServiceBindingExtension::initialize(); + } +} + + +namespace tuscany +{ + namespace sca + { + namespace binding + { + // =================================================================== + // Constructor for the SCAServiceBinding class. + // =================================================================== + SCAServiceBindingExtension::SCAServiceBindingExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the SCAServiceBindingExtension class. + // =================================================================== + SCAServiceBindingExtension::~SCAServiceBindingExtension() + { + logentry(); + } + + const string SCAServiceBindingExtension::extensionName("sca"); + const string SCAServiceBindingExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#SCABinding"); + + + // =================================================================== + // loadModelElement - load the info from binding.ws + // =================================================================== + ServiceBinding* SCAServiceBindingExtension::getServiceBinding(Composite *composite, Service* service, DataObjectPtr scdlBinding) + { + logentry(); + + SCARuntime* runtime = SCARuntime::getCurrentRuntime(); + + ServiceBindingExtension* bindingExtension = NULL; // runtime->getServiceBindingExtension("http://www.osoa.org/xmlns/sca/1.0#RESTBinding"); + if (bindingExtension == NULL) + { + bindingExtension = runtime->getServiceBindingExtension("http://www.osoa.org/xmlns/sca/1.0#WebServiceBinding"); + if (bindingExtension == NULL) + { + logerror("SCA default binding requires the REST or WS binding to be available"); + + string message = "SCA default binding requires the REST or WS binding to be available"; + throwException(SystemConfigurationException, message.c_str()); + } + } + + return bindingExtension->getServiceBinding(composite, service, scdlBinding); + } + + void SCAServiceBindingExtension::initialize() + { + logentry(); + SCARuntime::getCurrentRuntime()->registerServiceBindingExtension(new SCAServiceBindingExtension()); + } + + } // End namespace ws + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.h b/sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.h new file mode 100644 index 0000000000..389541061a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.h @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#ifndef tuscany_sca_extension_binding_scaservicebindingextension_h +#define tuscany_sca_extension_binding_scaservicebindingextension_h + +#include "tuscany/sca/extension/ServiceBindingExtension.h" + +namespace tuscany +{ + namespace sca + { + namespace binding + { + + class SCAServiceBindingExtension : public ServiceBindingExtension + { + public: + /** + * Default constructor + */ + SCAServiceBindingExtension(); + + /** + * Destructor + */ + virtual ~SCAServiceBindingExtension(); + + /** + * return the name of the extension + */ + virtual const std::string& getExtensionName() {return extensionName;} + + /** + * return the QName of schema elemant for this implementation extension + * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.ws") + */ + virtual const std::string& getExtensionTypeQName() {return typeQName;} + + virtual tuscany::sca::model::ServiceBinding* getServiceBinding( + tuscany::sca::model::Composite* composite, + tuscany::sca::model::Service* service, + commonj::sdo::DataObjectPtr scdlBinding); + + static void initialize(); + + private: + static const std::string extensionName; + static const std::string typeQName; + + }; + + + } // End namespace binding + } // End namespace sca +} // End namespace tuscany + +#endif //tuscany_sca_extension_binding_scaservicebindingextension_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.cpp b/sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.cpp new file mode 100644 index 0000000000..3b5564a765 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.cpp @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/binding/model/SCAServiceBinding.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca; +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace binding + { + + // Constructor + SCAServiceBinding::SCAServiceBinding(Composite* composite, Service* service, const string& uri, DataObjectPtr scdlBinding) + : ServiceBinding(service, uri) + { + } + + // Destructor + SCAServiceBinding::~SCAServiceBinding() + { + } + + ServiceWrapper* SCAServiceBinding::getServiceWrapper() + { + logentry(); + + throwException(SystemConfigurationException, "Not supported"); + } + + } // End namespace binding + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.h b/sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.h new file mode 100644 index 0000000000..d73a10f202 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.h @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#ifndef tuscany_sca_extension_binding_model_scaservicebinding_h +#define tuscany_sca_extension_binding_model_scaservicebinding_h + +#include + +#include "tuscany/sca/core/SCARuntime.h" +#include "tuscany/sca/model/ServiceBinding.h" +#include "tuscany/sca/model/Composite.h" +#include "tuscany/sca/model/Service.h" + + +namespace tuscany +{ + namespace sca + { + namespace binding + { + /** + * Information about an SCA service binding for service or a reference. + */ + class SCAServiceBinding : public tuscany::sca::model::ServiceBinding + { + public: + + /** + * Constructor. + * @param uri The uri of the binding. + */ + SCAServiceBinding(tuscany::sca::model::Composite* composite, tuscany::sca::model::Service* service, const std::string& uri, commonj::sdo::DataObjectPtr scdlBinding); + + /** + * Destructor. + */ + virtual ~SCAServiceBinding(); + + /** + * Returns the type of binding. + */ + virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#SCABinding"; }; + + /** + * Create a service wrapper handling the interaction + * with the service configured with this binding. + */ + virtual tuscany::sca::ServiceWrapper* getServiceWrapper(); + + private: + + }; + + } // End namespace model + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_extension_ws_model_wsservicebinding_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/sca/service/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/sca/service/Makefile.am new file mode 100644 index 0000000000..2b9491ec1c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/sca/service/Makefile.am @@ -0,0 +1,18 @@ +# 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/sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/Makefile.am new file mode 100644 index 0000000000..1136dba677 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/Makefile.am @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +libdir=$(prefix)/extensions/sca/service/lib +lib_LTLIBRARIES = libtuscany_sca_binding_service.la + +noinst_HEADERS = \ +tuscany/sca/binding/*.h \ +tuscany/sca/binding/model/*.h + +libtuscany_sca_binding_service_la_SOURCES = \ +tuscany/sca/binding/SCAReferenceBindingExtension.cpp \ +tuscany/sca/binding/model/SCAReferenceBinding.cpp + +libtuscany_sca_binding_service_la_LIBADD = \ + -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo -ltuscany_sdo_axiom \ + -L$(top_builddir)/runtime/core/src -ltuscany_sca + +INCLUDES = -I$(top_builddir)/runtime/core/src \ + -I${TUSCANY_SDOCPP}/include + +moduledir=$(prefix)/extensions/sca/service/module +extension = libtuscany_sca_binding_service$(libsuffix) + +install-exec-hook: + test -z $(moduledir) || $(mkdir_p) $(moduledir); + -rm -f $(moduledir)/$(extension) + $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp new file mode 100644 index 0000000000..789d8794df --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + + +#include "SCAReferenceBindingExtension.h" +#include "model/SCAReferenceBinding.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/core/SCARuntime.h" +#include "tuscany/sca/core/Exceptions.h" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + +extern "C" +{ +#if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) +#endif + void tuscany_sca_binding_service_initialize() + { + tuscany::sca::binding::SCAReferenceBindingExtension::initialize(); + } +} + +namespace tuscany +{ + namespace sca + { + namespace binding + { + // =================================================================== + // Constructor for the SCAReferenceBinding class. + // =================================================================== + SCAReferenceBindingExtension::SCAReferenceBindingExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the SCAReferenceBindingExtension class. + // =================================================================== + SCAReferenceBindingExtension::~SCAReferenceBindingExtension() + { + logentry(); + } + + const string SCAReferenceBindingExtension::extensionName("sca"); + const string SCAReferenceBindingExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#SCABinding"); + + // =================================================================== + // loadModelElement - load the info from binding.ws + // =================================================================== + ReferenceBinding* SCAReferenceBindingExtension::getReferenceBinding(Composite *composite, Reference* reference, DataObjectPtr scdlBinding) + { + logentry(); + + SCARuntime* runtime = SCARuntime::getCurrentRuntime(); + + ReferenceBindingExtension* bindingExtension = NULL; // runtime->getReferenceBindingExtension("http://www.osoa.org/xmlns/sca/1.0#RESTBinding"); + if (bindingExtension == NULL) + { + bindingExtension = runtime->getReferenceBindingExtension("http://www.osoa.org/xmlns/sca/1.0#WebServiceBinding"); + if (bindingExtension == NULL) + { + logerror("SCA default binding requires the REST or WS binding to be available"); + + string message = "SCA default binding requires the REST or WS binding to be available"; + throwException(SystemConfigurationException, message.c_str()); + } + } + + return bindingExtension->getReferenceBinding(composite, reference, scdlBinding); + } + + void SCAReferenceBindingExtension::initialize() + { + logentry(); + SCARuntime::getCurrentRuntime()->registerReferenceBindingExtension(new SCAReferenceBindingExtension()); + } + + } // End namespace binding + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.h b/sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.h new file mode 100644 index 0000000000..8cde2fbef4 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.h @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#ifndef tuscany_sca_extension_binding_scareferencebindingextension_h +#define tuscany_sca_extension_binding_scareferencebindingextension_h + +#include "tuscany/sca/extension/ReferenceBindingExtension.h" + +namespace tuscany +{ + namespace sca + { + namespace binding + { + + class SCAReferenceBindingExtension : public ReferenceBindingExtension + { + public: + /** + * Default constructor + */ + SCAReferenceBindingExtension(); + + /** + * Destructor + */ + virtual ~SCAReferenceBindingExtension(); + + /** + * return the name of the extension + */ + virtual const std::string& getExtensionName() {return extensionName;} + + /** + * return the QName of schema elemant for this implementation extension + * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.ws") + */ + virtual const std::string& getExtensionTypeQName() {return typeQName;} + + virtual tuscany::sca::model::ReferenceBinding* getReferenceBinding( + tuscany::sca::model::Composite* composite, + tuscany::sca::model::Reference *reference, + commonj::sdo::DataObjectPtr scdlBinding); + + static void initialize(); + + private: + static const std::string extensionName; + static const std::string typeQName; + + }; + + + } // End namespace binding + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_extension_binding_scareferencebindingextension_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp b/sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp new file mode 100644 index 0000000000..b8eaaaa1f9 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/binding/model/SCAReferenceBinding.h" +#include "tuscany/sca/core/ServiceProxy.h" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + +namespace tuscany +{ + namespace sca + { + namespace binding + { + + // Constructor + SCAReferenceBinding::SCAReferenceBinding(Composite* composite, Reference* reference, const string& uri, DataObjectPtr scdlBinding) + : ReferenceBinding(reference, uri) + { + } + + // Destructor + SCAReferenceBinding::~SCAReferenceBinding() + { + } + + ServiceProxy* SCAReferenceBinding::getServiceProxy() + { + throwException(SystemConfigurationException, "Not supported"); + } + + void SCAReferenceBinding::configure(ServiceBinding* serviceBinding) + { + throwException(SystemConfigurationException, "Not supported"); + } + + void SCAReferenceBinding::configure(const std::string& uri) + { + throwException(SystemConfigurationException, "Not supported"); + } + + } // End namespace binding + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.h b/sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.h new file mode 100644 index 0000000000..f3e699e2ee --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.h @@ -0,0 +1,85 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#ifndef tuscany_sca_extension_binding_model_scareferencebinding_h +#define tuscany_sca_extension_binding_model_scareferencebinding_h + +#include + +#include "tuscany/sca/model/Composite.h" +#include "tuscany/sca/model/ReferenceBinding.h" +#include "tuscany/sca/model/ServiceBinding.h" +#include "tuscany/sca/core/ServiceProxy.h" + +namespace tuscany +{ + namespace sca + { + namespace binding + { + /** + * Information about a web service binding for service or a reference. + */ + class SCAReferenceBinding : public tuscany::sca::model::ReferenceBinding + { + public: + + /** + * Constructor. + * @param uri The uri of the binding. + */ + SCAReferenceBinding(tuscany::sca::model::Composite* composite, tuscany::sca::model::Reference* reference, const std::string&uri, commonj::sdo::DataObjectPtr scdlBinding); + + /** + * Destructor. + */ + virtual ~SCAReferenceBinding(); + + /** + * Returns the type of binding. + */ + virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#SCABinding"; }; + + /** + * Create a proxy representing the reference to the + * client component. + */ + virtual tuscany::sca::ServiceProxy* getServiceProxy(); + + /** + * Configure this binding from a service binding. + */ + virtual void configure(tuscany::sca::model::ServiceBinding* serviceBinding); + + /** + * Configure this binding from a URI. + */ + virtual void configure(const std::string& uri); + + private: + + }; + + } // End namespace binding + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_extension_binding_model_scareferencebinding_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/sca/xsd/sca-binding-sca.xsd b/sca-cpp/trunk/contrib/runtime/extensions/sca/xsd/sca-binding-sca.xsd new file mode 100644 index 0000000000..6ec18bd992 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/sca/xsd/sca-binding-sca.xsd @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/ws/Makefile.am new file mode 100644 index 0000000000..806786ce04 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/Makefile.am @@ -0,0 +1,23 @@ +# 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/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/Makefile.am new file mode 100644 index 0000000000..18e9ba89b9 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/Makefile.am @@ -0,0 +1,18 @@ +# 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/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/Makefile.am new file mode 100644 index 0000000000..2b9491ec1c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/Makefile.am @@ -0,0 +1,18 @@ +# 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/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/Makefile.am new file mode 100644 index 0000000000..fbf304f8c2 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/Makefile.am @@ -0,0 +1,54 @@ +# 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 + +moduledir=$(prefix)/extensions/ws/reference/module +extension = libtuscany_sca_ws_reference$(libsuffix) + +install-exec-hook: + test -z $(moduledir) || $(mkdir_p) $(moduledir); + -rm -f $(moduledir)/$(extension) + $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.cpp new file mode 100644 index 0000000000..fa55c049b7 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.cpp @@ -0,0 +1,820 @@ +/* + * 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 + +#include "Axis2Client.h" +#include "tuscany/sca/core/SCARuntime.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/util/SDOUtils.h" +#include "model/WSServiceBinding.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/core/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 "tuscany/sca/model/WSDLMessagePart.h" + +using namespace std; +using namespace commonj::sdo; +using namespace commonj::sdo_axiom; +using namespace tuscany::sca::model; +using namespace tuscany::sca::util; + + +namespace tuscany +{ + namespace sca + { + namespace ws + { + + Axis2Client::Axis2Client(CompositeReference* compositeReference) + : compositeReference(compositeReference) + { + logentry(); + } + + Axis2Client::~Axis2Client() + { + logentry(); + } + + void Axis2Client::invoke(tuscany::sca::Operation& operation) + { + logentry(); + + // Initialize Axis2 stuff + axis2_env_t *env = axis2_env_create_all("tuscany_ws_reference.log",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) + { + string msg = "WSDL not found for " + wsdlNamespace; + throwException(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&) + { + 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) + { + string msg = "WSDL not found for " + wsdlNamespace; + throwException(SystemConfigurationException, msg.c_str()); + } + + try + { + wsdlOperation = wsdl->findOperation(wsdlInterface->getName(), operationName); + } + catch(SystemConfigurationException&) + { + throw; + } + } + } + } + + if (wsdlNamespace == "") + { + + // Create a default document literal wrapped WSDL operation + WSDLMessagePart inputPart(operationName, "", "http://tempuri.org"); + WSDLMessagePart outputPart((operationName+"Response"), "", "http://tempuri.org"); + 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.setInputEncoded(false); + wsdlOperation.setOutputEncoded(false); + wsdlOperation.setInputMessagePart(operationName, inputPart); + wsdlOperation.setOutputMessagePart((operationName+"Response"), outputPart); + } + else if (!wsdlOperation.isDocumentStyle() || !wsdlOperation.isWrappedStyle()) + { + throwException(ServiceInvocationException, + "Only wrapped document style WSDL operations are currentlysupported"); + } + + // The URI specified in the binding overrides the address specified in + // the WSDL + axis2_char_t* address; + + // Get the URI configured on the top level component + string bindingURI = ""; + SCARuntime* runtime = SCARuntime::getCurrentRuntime(); + Component* component = runtime->getDefaultComponent(); + Reference* reference = component->findReference(compositeReference->getName()); + if (reference != NULL) + { + ReferenceBinding* referenceBinding = reference->getBinding(); + if (referenceBinding != NULL && referenceBinding->getURI() != "") + { + bindingURI = referenceBinding->getURI(); + } + } + if (bindingURI == "") + { + // Get the URI configured on the binding + if (binding->getURI() != "") + { + bindingURI = binding->getURI(); + } + } + if (bindingURI != "") + { + // Prepend the default base URI if the URI is not absolute + if (bindingURI.find("://") == string::npos) + { + bindingURI = runtime->getDefaultBaseURI() + string("/axis2/services/") + bindingURI; + } + address = (axis2_char_t*)bindingURI.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(); + + // 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); + AXIS2_OPTIONS_SET_XML_PARSER_RESET(options, env, AXIS2_FALSE); + + loginfo("WS SOAP action: %s", soap_action); + loginfo("WS Endpoint address: %s", address); + if(soap_version == AXIOM_SOAP11) + { + // Only set the SOAP action when using SOAP1.1 + AXIS2_OPTIONS_SET_SOAP_ACTION(options, env, soap_action); + loginfo("Set soap version: 1.1"); + } + else if(soap_version == AXIOM_SOAP12) + { + loginfo("Set soap version: 1.2"); + } + else + { + loginfo("Set soap version: unset"); + } + /* Create service client */ + + axis2_char_t* client_home = AXIS2_GETENV("AXIS2C_HOME"); + if (!client_home) + { + throwException(SystemConfigurationException, "AXIS2C_HOME not set"); + } + axis2_svc_client_t* svc_client = axis2_svc_client_create(env, client_home); + if (!svc_client) + { + ostringstream msg; + msg << "Axis2 svc_client_create failed, error: " << env->error->error_number << + ", " << AXIS2_ERROR_GET_MESSAGE(env->error); + throwException(SystemConfigurationException, msg.str().c_str()); + } + + /* Set service client options */ + AXIS2_SVC_CLIENT_SET_OPTIONS(svc_client, env, options); + + /* Engage addressing module */ + AXIS2_SVC_CLIENT_ENGAGE_MODULE(svc_client, env, AXIS2_MODULE_ADDRESSING); + + loginfo("Sending WS request"); + /* 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); + + // Set return value - now need to detach the node from the Axiom document + // for clean-up + axiom_document_t *document = AXIOM_NODE_GET_DOCUMENT(ret_node, env); + if (document) + { + AXIOM_DOCUMENT_BUILD_ALL (document, env); + } + AXIOM_NODE_DETACH (ret_node, env); + } + else + { + ostringstream msg; + msg << "Axis2 client_send_received failed, error: " << env->error->error_number << + ", " << AXIS2_ERROR_GET_MESSAGE(env->error); + throwException(ServiceInvocationException, msg.str().c_str()); + } + + if (svc_client) + { + AXIS2_SVC_CLIENT_FREE(svc_client, env); + svc_client = NULL; + } + + if(env) + { + axis2_env_free((axis2_env_t *) env); + env = NULL; + } + loginfo("Freed env"); + + } + + axiom_node_t* Axis2Client::createPayload(Operation& operation, + const WSDLOperation& wsdlOperation, + axis2_env_t* env) + { + logentry(); + + axiom_node_t* request_node = NULL; + + // 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; + string inputTypeUri; + string inputTypeName; + + try + { + // Since its Document wrapped, there will only be one part + std::list partList = wsdlOperation.getInputMessagePartNames(); + const WSDLMessagePart &inputMessage = + wsdlOperation.getInputMessagePart(partList.front()); + inputTypeName = inputMessage.getPartType(); + inputTypeUri = inputMessage.getPartUri(); + + // Create the input wrapper + const Type& rootType = dataFactory->getType(inputTypeUri.c_str(), "RootType"); + const Property& prop = rootType.getProperty(inputTypeName.c_str()); + const Type& inputType = prop.getType(); + inputDataObject = dataFactory->create(inputType); + } + catch (SDORuntimeException&) + { + try + { + // Create the input wrapper + const Type& inputType = + dataFactory->getType(inputTypeUri.c_str(), inputTypeName.c_str()); + inputDataObject = dataFactory->create(inputType); + } + catch (SDORuntimeException&) + { + + // The input wrapper type is not known, create an open DataObject + //inputDataObject = dataFactory->create("http://tempuri.org", "Wrapper"); + inputDataObject = dataFactory->create(SDOUtils::sdoURI, "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 (unsigned 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: + { + ostringstream msg; + msg << "Unsupported parameter type: " << parm.getType(); + throwException(ServiceDataException, msg.str().c_str()); + } + } + } + } + } + else { + + // Each parameter in the operation should be a property on the request dataobject + for (unsigned int i=0; isetBoolean(i, *(bool*)parm.getValue()); + break; + } + case Operation::SHORT: + { + inputDataObject->setShort(i, *(short*)parm.getValue()); + break; + } + case Operation::INT: + { + inputDataObject->setInt(i, *(int*)parm.getValue()); + break; + } + case Operation::LONG: + { + inputDataObject->setLong(i, *(long*)parm.getValue()); + break; + } + case Operation::USHORT: + { + inputDataObject->setInt(i, *(unsigned short*)parm.getValue()); + break; + } + case Operation::UINT: + { + inputDataObject->setInt(i, *(unsigned int*)parm.getValue()); + break; + } + case Operation::ULONG: + { + inputDataObject->setInt(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: + ostringstream msg; + msg << "Unsupported parameter type: " << parm.getType(); + throwException(ServiceDataException, msg.str().c_str()); + } + } + } + + // Create the Axiom object from the request dataobject + AxiomHelper* axiomHelper = AxiomHelper::getHelper(); + request_node = axiomHelper->toAxiomNode(inputDataObject, + inputTypeUri.c_str(), inputTypeName.c_str()); + AxiomHelper::releaseHelper(axiomHelper); + + char* str = AXIOM_NODE_TO_STRING(request_node, env); + loginfo("Sending Axis2 OM: %s ", str); + + return request_node; + + } + + void Axis2Client::setReturn(axiom_node_t* ret_node, + Operation& operation, + const WSDLOperation& wsdlOperation, + axis2_env_t* env) + { + logentry(); + + 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) + { + loginfo("Received Axis2 OM: %s ", str); + } + + // Convert the SOAP body to an SDO DataObject + AxiomHelper* axiomHelper = AxiomHelper::getHelper(); + DataObjectPtr outputBodyDataObject = axiomHelper->toSdo(body, dataFactory); + AxiomHelper::releaseHelper(axiomHelper); + + if(!outputBodyDataObject) + { + string msg = "Could not convert Axis2 OM node to SDO"; + throwException(ServiceInvocationException, msg.c_str()); + } + else + { + ostringstream os; + os << outputBodyDataObject; + loginfo("Converted Axis2 OM node to SDO: %s", os.str().c_str()); + } + + XMLHelperPtr xmlHelper = compositeReference->getComposite()->getXMLHelper(); + + // 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) + { + string msg = "Could not convert Axis2 body part to SDO"; + throwException(ServiceInvocationException, msg.c_str()); + } + + PropertyList pl = outputDataObject->getType().getProperties(); + if (pl.size() == 0) + { + if (outputDataObject->getType().isOpenType() && outputDataObject->getType().isDataObjectType()) + { + SequencePtr sequence = outputDataObject->getSequence(); + if (sequence != NULL && 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 *dataObjectData = new DataObjectPtr; + *dataObjectData = sequence->getDataObjectValue(0); + if(!*dataObjectData) + { + loginfo("Null DataObject return value"); + } + else + { + (*dataObjectData)->detach(); + } + operation.setReturnValue(dataObjectData); + } + } + } + } + else + { + const Property* p = &pl[0]; + + switch(pl[0].getTypeEnum()) + { + case Type::BooleanType: + { + bool* boolData = new bool; + *boolData = outputDataObject->getBoolean(pl[0]); + operation.setReturnValue(boolData); + } + break; + case Type::ByteType: + { + char* byteData = new char; + *byteData = outputDataObject->getByte(pl[0]); + operation.setReturnValue(byteData); + } + break; + case Type::BytesType: + { + int len = outputDataObject->getLength(pl[0]); + char** bytesData = new char*; + *bytesData = new char[len+1]; + int bytesWritten = outputDataObject->getBytes(pl[0], *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[0]); + operation.setReturnValue(charData); + } + break; + case Type::DoubleType: + { + long double* doubleData = new long double; + *doubleData = outputDataObject->getDouble(pl[0]); + operation.setReturnValue(doubleData); + } + break; + case Type::FloatType: + { + float* floatData = new float; + *floatData = outputDataObject->getFloat(pl[0]); + operation.setReturnValue(floatData); + } + break; + case Type::IntType: + { + long* intData = new long; + *intData = outputDataObject->getInt(pl[0]); + operation.setReturnValue(intData); + } + break; + case Type::ShortType: + { + short* shortData = new short; + *shortData = outputDataObject->getShort(pl[0]); + operation.setReturnValue(shortData); + } + break; + case Type::StringType: + { + string* stringData = new string(outputDataObject->getCString(pl[0])); + operation.setReturnValue(stringData); + } + break; + case Type::DataObjectType: + { + if (!strcmp(pl[0].getType().getURI(), SDOUtils::sdoURI) && + !strcmp(pl[0].getType().getName(), "OpenDataObject")) { + + /* + * This code deals with xsd:any element parameters + */ + + DataObjectList& dataObjectList = outputDataObject->getList(pl[0]); + + for(unsigned 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 *dataObjectData = new DataObjectPtr; + *dataObjectData = sequence->getDataObjectValue(0); + if(!*dataObjectData) + { + loginfo("Null DataObject return value"); + } + else + { + (*dataObjectData)->detach(); + } + operation.setReturnValue(dataObjectData); + } + } + else + { + // Empty content, add an empty string + loginfo("Null OpenDataObject return value"); + string *stringData = new string(""); + operation.setReturnValue(stringData); + } + } + } + } + else { + DataObjectPtr* dataObjectData = new DataObjectPtr; + *dataObjectData = outputDataObject->getDataObject(pl[0]); + if(!*dataObjectData) + { + loginfo("Null DataObject return value"); + } + else + { + (*dataObjectData)->detach(); + } + operation.setReturnValue(dataObjectData); + } + } + break; + default: + { + ostringstream msg; + msg << "Unsupported result type: " << pl[0].getTypeEnum(); + throwException(SystemConfigurationException, msg.str().c_str()); + } + } + } + } + + } // End namespace ws + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.h b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.h new file mode 100644 index 0000000000..397440dd5d --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.h @@ -0,0 +1,65 @@ +/* + * 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" + + +namespace tuscany +{ + namespace sca + { + namespace ws + { + + class Axis2Client + { + public: + Axis2Client(tuscany::sca::model::CompositeReference* compositeReference); + virtual ~Axis2Client(); + + virtual void invoke(Operation& operation); + + private: + tuscany::sca::model::CompositeReference* compositeReference; + + axiom_node_t* createPayload(Operation& operation, + const tuscany::sca::model::WSDLOperation& wsdlOp, + axis2_env_t* env); + + void setReturn(axiom_node_t* returnNode, + Operation& operation, + const tuscany::sca::model::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/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.cpp new file mode 100644 index 0000000000..53d6075bbd --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.cpp @@ -0,0 +1,118 @@ +/* + * 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" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; + +extern "C" +{ +#if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) +#endif + void tuscany_sca_ws_reference_initialize() + { + tuscany::sca::ws::WSServiceBindingExtension::initialize(); + } +} + + +namespace tuscany +{ + namespace sca + { + namespace ws + { + // =================================================================== + // Constructor for the WSServiceBinding class. + // =================================================================== + WSServiceBindingExtension::WSServiceBindingExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the WSServiceBindingExtension class. + // =================================================================== + WSServiceBindingExtension::~WSServiceBindingExtension() + { + logentry(); + } + + 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) + { + logentry(); + + string uri = scdlBinding->getCString("uri"); + string endpoint; + try + { + endpoint = scdlBinding->getCString("endpoint"); + } + catch (SDORuntimeException&) + { + endpoint = ""; + } + string version; + try + { + commonj::sdo::DataObjectList& soap = scdlBinding->getList("soapbinding"); + if (soap.size()!=0) + { + version = soap.getCString(0); + } + else + { + version = ""; + } + } + catch (SDORuntimeException&) + { + version = ""; + } + + WSServiceBinding* serviceBinding = new WSServiceBinding(service, uri, endpoint, version); + + return serviceBinding; + } + + void WSServiceBindingExtension::initialize() + { + logentry(); + SCARuntime::getCurrentRuntime()->registerServiceBindingExtension(new WSServiceBindingExtension()); + } + + } // End namespace ws + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.h b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.h new file mode 100644 index 0000000000..68dd657657 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.h @@ -0,0 +1,78 @@ +/* + * 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 std::string& getExtensionName() {return extensionName;} + + /** + * return the QName of schema elemant for this implementation extension + * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.ws") + */ + virtual const std::string& getExtensionTypeQName() {return typeQName;} + + virtual tuscany::sca::model::ServiceBinding* getServiceBinding( + tuscany::sca::model::Composite* composite, + tuscany::sca::model::Service* service, + commonj::sdo::DataObjectPtr scdlBinding); + + static void initialize(); + + private: + static const std::string extensionName; + static const std::string typeQName; + + }; + + + } // End namespace ws + } // End namespace sca +} // End namespace tuscany + +#endif //tuscany_sca_extension_ws_wsservicebindingextension_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.cpp new file mode 100644 index 0000000000..4adcd5b4ff --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.cpp @@ -0,0 +1,131 @@ +/* + * 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 "commonj/sdo/SDO.h" + +#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" + +using namespace std; +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) + { + logentry(); + + // 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&) + { + 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); + } + + try { + const Type& tempType = dataFactory->getType("http://tempuri.org", "RootType"); + } catch (SDORuntimeException&) + { + dataFactory->addType("http://tempuri.org", "RootType", false, false, false); + dataFactory->addType("http://tempuri.org", "Wrapper", false, true, false); + dataFactory->addPropertyToType( + "http://tempuri.org", "RootType", + "Wrapper", + "http://tempuri.org", "Wrapper", + false, false, true); + dataFactory->addType("http://tempuri.org", "Part", false, true, false); + dataFactory->addPropertyToType( + "http://tempuri.org", "RootType", + "Part", + "http://tempuri.org", "Part", + false, false, true); + } + } + + WSServiceWrapper::~WSServiceWrapper() + { + logentry(); + } + + /// + /// This method will be called when a web service call needs to be made. + /// + void WSServiceWrapper::invoke(Operation& operation) + { + logentry(); + + const string& operationName = operation.getName(); + + loginfo("Service: %s, operation: %s", getService()->getType()->getName().c_str() , operationName.c_str()); + + for (unsigned int i=0; igetComponent(); + + Axis2Client client(compositeReference); + client.invoke(operation); + } + + } // End namespace ws + } // End namespace sca +} // End namespace tuscany + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.h b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.h new file mode 100644 index 0000000000..f7aebbb575 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.h @@ -0,0 +1,65 @@ +/* + * 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" + + +namespace tuscany +{ + namespace sca + { + + namespace ws + { + + class WSServiceWrapper : public ServiceWrapper + { + public: + + /** + * Constructor. + * @param target The service wrapper represents a Web service. + */ + WSServiceWrapper(tuscany::sca::model::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/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/export.h b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/export.h new file mode 100644 index 0000000000..d0e708f1a1 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/export.h @@ -0,0 +1,38 @@ +/* + * 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_ws_reference_export_h +#define tuscany_sca_ws_reference_export_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) + +#ifdef TUSCANY_SCA_WS_REFERENCE_EXPORTS +#define SCA_WS_REFERENCE_API __declspec(dllexport) +#else +#define SCA_WS_REFERENCE_API __declspec(dllimport) +#endif + +#else +#define SCA_WS_REFERENCE_API +#endif + +#endif // tuscany_sca_ws_reference_export_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.cpp new file mode 100644 index 0000000000..26d8dffc45 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.cpp @@ -0,0 +1,144 @@ +/* + * 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" + +using namespace std; +using namespace tuscany::sca::model; + +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) + { + logentry(); + + parseEndpoint(); + + serviceWrapper = new WSServiceWrapper(service); + } + + void WSServiceBinding::parseEndpoint() + { + logentry(); + + // 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() + { + logentry(); + } + + ServiceWrapper* WSServiceBinding::getServiceWrapper() + { + logentry(); + + return serviceWrapper; + } + + } // End namespace ws + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.h b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.h new file mode 100644 index 0000000000..3c8c5eb12d --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.h @@ -0,0 +1,137 @@ +/* + * 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 + +#include "tuscany/sca/ws/export.h" +#include "tuscany/sca/model/ServiceBinding.h" +#include "tuscany/sca/model/Service.h" + +namespace tuscany +{ + namespace sca + { + namespace ws + { + /** + * Information about a web service binding for service or a reference. + */ + class WSServiceBinding : public tuscany::sca::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") + */ + SCA_WS_REFERENCE_API WSServiceBinding(tuscany::sca::model::Service* service, const std::string& uri, const std::string& endpoint, const std::string& version); + + /** + * Destructor. + */ + SCA_WS_REFERENCE_API virtual ~WSServiceBinding(); + + /** + * Returns the type of binding. + */ + virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#WebServiceBinding"; }; + + /** + * Create a wrapper for the service configured by this + * binding. + */ + SCA_WS_REFERENCE_API virtual ServiceWrapper* getServiceWrapper(); + + /** + * Return the part of the endpoint definition describing the wsdl + * namespace. + * @return The wsdl namespace. + */ + std::string getWSDLNamespaceURL() const { return wsdlNamespaceURL; }; + + /** + * Return the service part of the endpoint definition. + * @return The service to use. + */ + std::string getServiceName() const { return serviceName; }; + + /** + * Return the endpoint name part of the endpoint definition. + * @return The endpoint name to use. + */ + std::string getEndpointName() const { return endpointName; }; + + /** + * Return the SOAP version. + * @return The SOAP version to use. + */ + std::string getSOAPVersion() const { return soapVersion; }; + + private: + + /** + * Parse the endpoint specification. + */ + void parseEndpoint(); + + /** + * The full endpoint string. + */ + std::string endpoint; + + /** + * Namespace from the endpoint. + */ + std::string wsdlNamespaceURL; + + /** + * Service name from the endpoint. + */ + std::string serviceName; + + /** + * WSDL Endpoint name. + */ + std::string endpointName; + + /** + * SOAP version. + */ + std::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/sca-cpp/trunk/contrib/runtime/extensions/ws/service/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/Makefile.am new file mode 100644 index 0000000000..18e9ba89b9 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/Makefile.am @@ -0,0 +1,18 @@ +# 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/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/Makefile.am new file mode 100644 index 0000000000..feadf9e317 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/Makefile.am @@ -0,0 +1,18 @@ +# 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/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/Makefile.am b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/Makefile.am new file mode 100644 index 0000000000..88f7fc1a9e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/Makefile.am @@ -0,0 +1,94 @@ +# 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${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 + +servicedir=$(rootdir)/services/tuscany +service_DATA = services.xml + +modulesdir=$(rootdir)/modules/tuscany +modules_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 $(modulesdir); 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 + +moduledir=$(prefix)/extensions/ws/service/module +extension = libtuscany_sca_ws_service$(libsuffix) + +install-exec-hook: + test -z $(moduledir) || $(mkdir_p) $(moduledir); + -rm -f $(moduledir)/$(extension) + $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/axis2.xml b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/axis2.xml new file mode 100644 index 0000000000..641085466e --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/axis2.xml @@ -0,0 +1,181 @@ + + + + + + false + false + false + true + + admin + axis2 + + . + + 127.0.0.1 + 5555 + + + + + + + + + + + + + + + + + + + + + + + + + 6060 + + + + + + + + + + + + HTTP/1.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/deploy.bat b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/deploy.bat new file mode 100644 index 0000000000..6493e1cec9 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/deploy.bat @@ -0,0 +1,39 @@ +@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/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/deploy.sh b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/deploy.sh new file mode 100755 index 0000000000..ffe571b0ee --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/deploy.sh @@ -0,0 +1,47 @@ +#!/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/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/module.xml b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/module.xml new file mode 100644 index 0000000000..97d4d43a86 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/module.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/services.xml b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/services.xml new file mode 100644 index 0000000000..335d4d96be --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/services.xml @@ -0,0 +1,25 @@ + + + + + tuscany_sca_ws_service + + + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Dispatcher.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Dispatcher.cpp new file mode 100644 index 0000000000..b6d2ac9225 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Dispatcher.cpp @@ -0,0 +1,177 @@ +/* + * 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 + +#include "tuscany/sca/util/Logging.h" + +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) + { + loginfo("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) + { + loginfo("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/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2DispatcherModule.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2DispatcherModule.cpp new file mode 100644 index 0000000000..0dc8f3358a --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2DispatcherModule.cpp @@ -0,0 +1,149 @@ +/* + * 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/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Service.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Service.cpp new file mode 100644 index 0000000000..9f1207dce8 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Service.cpp @@ -0,0 +1,553 @@ +/* + * 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 "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/util/Logging.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/WSDLMessagePart.h" +#include "tuscany/sca/model/WSDLInterface.h" +#include "tuscany/sca/model/Interface.h" +#include "tuscany/sca/core/SCARuntime.h" +#include "tuscany/sca/util/Utils.h" +#include "Axis2Utils.h" + +using namespace std; +using namespace commonj::sdo; +using namespace commonj::sdo_axiom; +using namespace tuscany::sca; +using namespace tuscany::sca::model; +using namespace tuscany::sca::util; + +namespace tuscany +{ + namespace sca + { + namespace ws + { + + int AXIS2_CALL + Axis2Service_free(axis2_svc_skeleton_t *svc_skeleton, + const axis2_env_t *env); + + 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->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 SCA runtime + */ + CompositeService* initializeSCARuntime(const char*home, const char* root, + const char* path, const char* baseURI, const char *component, const char* service) + { + logentry(); + loginfo("Home: %s", home); + loginfo("Root: %s", root); + loginfo("Path: %s", path); + loginfo("Base URI: %s", baseURI); + loginfo("Component: %s", component); + loginfo("Service: %s", service); + + try + { + SCARuntime* runtime = SCARuntime::initializeSharedRuntime(home, root, path, baseURI); + + string componentName; + if (strlen(component)) + { + componentName = component; + } + else + { + componentName = runtime->getDefaultComponentName(); + } + string serviceName = service; + + loginfo("Resolving composite: %s, service: %s", componentName.c_str(), serviceName.c_str()); + Component* compositeComponent = runtime->getSystem()->findComponent(componentName); + if (compositeComponent == NULL) + { + string msg = "Component not found " + componentName; + throwException(SystemConfigurationException, msg.c_str()); + } + runtime->setDefaultComponent(compositeComponent); + + Composite* composite = (Composite*)compositeComponent->getType(); + CompositeService* compositeService = (CompositeService*)composite->findComponent(serviceName); + if (compositeService == NULL) + { + string msg = "Composite service not found " + serviceName; + throwException(SystemConfigurationException, msg.c_str()); + } + + return compositeService; + } + catch(TuscanyRuntimeException &ex) + { + ostringstream msg; + msg << ex; + logerror("Failed to initialize SCA runtime: %s", msg.str().c_str()); + throw; + } + } + + + /* + * 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) + { + logentry(); + + try + { + 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 *addr = AXIS2_ENDPOINT_REF_GET_ADDRESS(endpoint_ref, env); + if (addr) + { + // REST request, the op name is the last segment of the path + string raddress = addr; + string path; + string query; + Utils::tokeniseString("?", raddress, path, query); + string uri; + Utils::rTokeniseString("/", path, uri, op_name); + } + } + } + else + { + // SOAP request + // Get 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 != "") + { + CompositeService* compositeService; + + // Get the Tuscany home, system root, path and composite service name from the Axis2 + // service parameters + char* homeParam = Axis2Utils::getAxisServiceParameterValue(env, msg_ctx, "TuscanyHome"); + if (homeParam == NULL) + homeParam = ""; + + char* rootParam = Axis2Utils::getAxisServiceParameterValue(env, msg_ctx, "TuscanyRoot"); + if (rootParam == NULL) + rootParam = ""; + + char* pathParam = Axis2Utils::getAxisServiceParameterValue(env, msg_ctx, "TuscanyPath"); + if (pathParam == NULL) + pathParam = ""; + + char* baseURIParam = Axis2Utils::getAxisServiceParameterValue(env, msg_ctx, "TuscanyBaseURI"); + if (baseURIParam == NULL) + baseURIParam = ""; + + char* serviceParam = Axis2Utils::getAxisServiceParameterValue(env, msg_ctx, "TuscanyService"); + if (serviceParam != NULL) + { + loginfo("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); + + compositeService = initializeSCARuntime(homeParam, rootParam, pathParam, baseURIParam, component.c_str(), service.c_str()); + } + else { + + // Use the default home, 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); + string address = AXIS2_ENDPOINT_REF_GET_ADDRESS(endpoint_ref, env); + + axis2_bool_t isrest = AXIS2_MSG_CTX_GET_DOING_REST(msg_ctx, env); + string path; + if (isrest) + { + string op; + Utils::rTokeniseString("/", address, path, op); + } + else + { + path = address; + } + + string path2; + string service; + Utils::rTokeniseString("/", path, path2, service); + + string path3; + string component; + Utils::rTokeniseString("/", path2, path3, component); + if (component == "services") + { + component = ""; + } + + loginfo("System root: %s, component name: %s, service name: %s, operation name: %s", + rootParam, component.c_str(), service.c_str(), op_name.c_str()); + + compositeService = initializeSCARuntime(homeParam, rootParam, pathParam, baseURIParam, component.c_str(), service.c_str()); + } + + if(!compositeService) + { + throwException(SystemConfigurationException, + "Failed to initialize SCA runtime, could not initialize CompositeService"); + } + + DataFactoryPtr dataFactory = compositeService->getComposite()->getDataFactory(); + if (dataFactory == 0) + { + throwException(SystemConfigurationException, + "Failed to initialize SCA runtime, could not get DataFactory"); + } + + // Get the WS binding and the WSDL operation + Composite* composite = compositeService->getComposite(); + Reference* reference = compositeService->getReference(); + WSReferenceBinding* binding = (WSReferenceBinding*)reference->getBinding(); + WSDLOperation wsdlOperation; + + // First use the WSDL definition specified in the binding + string wsdlNamespace = binding->getWSDLNamespaceURL(); + if (wsdlNamespace != "") + { + WSDLDefinition* wsdlDefinition = composite->findWSDLDefinition(wsdlNamespace); + if (wsdlDefinition == 0) + { + string msg = "WSDL not found for: " + wsdlNamespace; + throwException(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&) + { + throw; + } + + } + else + { + // Then use the WSDL definition specified in the WSDL interface, if any + 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) + { + string msg = "WSDL not found for: " + wsdlNamespace; + throwException(SystemConfigurationException, msg.c_str()); + } + + try + { + wsdlOperation = wsdl->findOperation(wsdlInterface->getName(), op_name.c_str()); + } + catch(SystemConfigurationException&) + { + throw; + } + } + } + } + + // No WSDL definition was specified in the binding or interface + // Create a default document literal wrapped WSDL operation + if (wsdlNamespace == "") + { + WSDLMessagePart inPart(op_name, "", "http://tempuri.org"); + WSDLMessagePart outPart((op_name+"Response"), "", "http://tempuri.org"); + 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.setInputEncoded(false); + wsdlOperation.setOutputEncoded(false); + wsdlOperation.setInputMessagePart(op_name, inPart); + wsdlOperation.setOutputMessagePart((op_name+"Response"), outPart); + } + else if (!wsdlOperation.isDocumentStyle() || !wsdlOperation.isWrappedStyle()) + { + throwException(ServiceInvocationException, + "Only wrapped document style WSDL operations are currentlysupported"); + } + + // 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) + { + loginfo("Received request Axis2 OM: %s", str); + } + + // Convert the SOAP body to an SDO DataObject + DataObjectPtr inputBodyDataObject = NULL; + DataObjectPtr inputDataObject = NULL; + + AxiomHelper* axiomHelper = AxiomHelper::getHelper(); + + try + { + inputBodyDataObject = axiomHelper->toSdo(body, dataFactory); + if(!inputBodyDataObject) + { + string msg = "Could not convert request Axis2 OM to SDO"; + throwException(ServiceInvocationException, msg.c_str()); + } + else + { + ostringstream os; + os << inputBodyDataObject; + loginfo("Converted Axis2 OM node to SDO: %s", os.str().c_str()); + } + + // Get the first body part representing the doc-lit-wrapped wrapper element + 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) + { + string msg = "Could not convert Axis2 body part to SDO"; + throwException(ServiceInvocationException, msg.c_str()); + } + } + catch(SDORuntimeException &ex) + { + throwException(ServiceDataException, ex); + } + + // Dispatch to the WS proxy + WSServiceProxy* proxy = (WSServiceProxy*)binding->getServiceProxy(); + + DataObjectPtr outputDataObject = proxy->invoke(wsdlOperation, inputDataObject); + + if(!outputDataObject) + { + return 0; + } + + try + { + std::list partList = + wsdlOperation.getOutputMessagePartNames(); + const WSDLMessagePart &outPart = + wsdlOperation.getOutputMessagePart(partList.front()); + // Convert the output DataObject to an Axiom node + axiom_node_t* outputNode = + axiomHelper->toAxiomNode(outputDataObject, + outPart.getPartUri().c_str(), + outPart.getPartName().c_str()); + + AxiomHelper::releaseHelper(axiomHelper); + + str = AXIOM_NODE_TO_STRING(outputNode, env); + if (str) + { + loginfo("Sending response Axis2 OM : %s", str); + } + + return outputNode; + } + catch(SDORuntimeException &ex) + { + throwException(ServiceDataException, ex); + } + } + } + } + } + + string msg = "Invalid parameters in Axis2 request OM"; + throwException(ServiceInvocationException, msg.c_str()); + + } + catch(TuscanyRuntimeException& ex) + { + ostringstream msg; + msg << ex; + logerror("Failed to process Web service invocation: %s", msg.str().c_str()); + } + return 0; + } + + } // End namespace ws + } // End namespace sca +} // End namespace tuscany + +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 = tuscany::sca::ws::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/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.cpp new file mode 100644 index 0000000000..09c3862590 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.cpp @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#pragma warning(disable: 4091) +#endif + +#include +#include + +#include "tuscany/sca/util/Logging.h" +#include "Axis2Utils.h" + +using namespace tuscany::sca; +using namespace tuscany::sca::ws; + +namespace tuscany +{ + namespace sca + { + namespace ws + { + + char* Axis2Utils::getAxisServiceParameterValue(const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx, char* parameterName) + { + logentry(); + + 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; + + 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) + { + logwarning("Axis parameter %s cannot be found", parameterName); + } + else + { + paramValue = (char*) AXIS2_PARAM_GET_VALUE(param, env); + } + + return paramValue; + } + + } // End namespace ws + } // End namespace sca +} // End namespace tuscany + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.h b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.h new file mode 100644 index 0000000000..4e8b069010 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.h @@ -0,0 +1,46 @@ +/* + * 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/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.cpp new file mode 100644 index 0000000000..24a7552bc4 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.cpp @@ -0,0 +1,119 @@ +/* + * 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" + +using namespace std; +using namespace tuscany::sca::model; +using namespace commonj::sdo; + +extern "C" +{ +#if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) +#endif + void tuscany_sca_ws_service_initialize() + { + tuscany::sca::ws::WSReferenceBindingExtension::initialize(); + } +} + +namespace tuscany +{ + namespace sca + { + namespace ws + { + // =================================================================== + // Constructor for the WSReferenceBinding class. + // =================================================================== + WSReferenceBindingExtension::WSReferenceBindingExtension() + { + logentry(); + } + + // =================================================================== + // Destructor for the WSReferenceBindingExtension class. + // =================================================================== + WSReferenceBindingExtension::~WSReferenceBindingExtension() + { + logentry(); + } + + 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) + { + logentry(); + + string uri = scdlBinding->getCString("uri"); + + string endpoint; + try + { + endpoint = scdlBinding->getCString("endpoint"); + } + catch (SDORuntimeException&) + { + endpoint = ""; + } + + string version; + try + { + commonj::sdo::DataObjectList& soap = scdlBinding->getList("soapbinding"); + if (soap.size()!=0) + { + version = soap.getCString(0); + } + else + { + version = ""; + } + } + catch (SDORuntimeException&) + { + version = ""; + } + + WSReferenceBinding* serviceBinding = new WSReferenceBinding(reference, uri, endpoint, version); + + return serviceBinding; + } + + void WSReferenceBindingExtension::initialize() + { + logentry(); + SCARuntime::getCurrentRuntime()->registerReferenceBindingExtension(new WSReferenceBindingExtension()); + } + + } // End namespace ws + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.h b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.h new file mode 100644 index 0000000000..712e7d2646 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.h @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#ifndef tuscany_sca_extension_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 std::string& getExtensionName() {return extensionName;} + + /** + * return the QName of schema elemant for this implementation extension + * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.ws") + */ + virtual const std::string& getExtensionTypeQName() {return typeQName;} + + virtual tuscany::sca::model::ReferenceBinding* getReferenceBinding( + tuscany::sca::model::Composite* composite, + tuscany::sca::model::Reference *reference, commonj::sdo::DataObjectPtr scdlBinding); + + static void initialize(); + + private: + static const std::string extensionName; + static const std::string typeQName; + + }; + + + } // End namespace ws + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_extension_ws_wsreferencebindingextension_h + diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp new file mode 100644 index 0000000000..bea4168984 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp @@ -0,0 +1,579 @@ +/* + * 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 "commonj/sdo/SDO.h" + +#include "WSServiceProxy.h" +#include "tuscany/sca/util/Logging.h" +#include "tuscany/sca/core/Exceptions.h" +#include "tuscany/sca/util/Utils.h" +#include "tuscany/sca/util/SDOUtils.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" + +using namespace std; +using namespace commonj::sdo; +using namespace tuscany::sca::model; +using namespace tuscany::sca::util; + +namespace tuscany +{ + namespace sca + { + namespace ws + { + + // ============================ + // Constructor: Create a proxy + // ============================ + WSServiceProxy::WSServiceProxy(Reference* reference) + : ServiceProxy(reference) + { + logentry(); + + // 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&) + { + + // 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); + } + + try { + const Type& tempType = dataFactory->getType("http://tempuri.org", "RootType"); + } catch (SDORuntimeException&) + { + dataFactory->addType("http://tempuri.org", "RootType", false, false, false); + dataFactory->addType("http://tempuri.org", "Wrapper", false, true, false); + dataFactory->addPropertyToType( + "http://tempuri.org", "RootType", + "Wrapper", + "http://tempuri.org", "Wrapper", + false, false, true); + dataFactory->addType("http://tempuri.org", "Part", false, true, false); + dataFactory->addPropertyToType( + "http://tempuri.org", "RootType", + "Part", + "http://tempuri.org", "Part", + false, false, true); + } + } + + // ========== + // Destructor + // ========== + WSServiceProxy::~WSServiceProxy() + { + logentry(); + } + + /// + /// This method will be called to process an operation invocation. + /// + DataObjectPtr WSServiceProxy::invoke(const WSDLOperation& wsdlOperation, DataObjectPtr inputDataObject) + { + logentry(); + + Reference* reference = getReference(); + Component* component = reference->getComponent(); + Composite* composite = component ->getComposite(); + + WSReferenceBinding* referenceBinding = (WSReferenceBinding*)reference->getBinding(); + DataFactoryPtr dataFactoryPtr = reference->getComponent()->getComposite()->getDataFactory(); + + // Since its Document wrapped, there will only be one message part + std::list partList = wsdlOperation.getOutputMessagePartNames(); + const WSDLMessagePart &part = wsdlOperation.getOutputMessagePart(partList.front()); + const char* outputTypeURI = part.getPartUri().c_str(); + const char* outputTypeName = part.getPartName().c_str(); + + loginfo("WSDLOperation input message Type: %s#%s", + wsdlOperation.getInputMessageUri().c_str(), + wsdlOperation.getInputMessageName().c_str()); + loginfo("WSDLOperation outputType: %s#%s", + outputTypeURI, + outputTypeName); + + try + { + + // 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(unsigned 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*; + *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::IntType: + { + long* intData = new long; + *intData = inputDataObject->getInt(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: + { + if (!strcmp(pl[i].getType().getURI(), SDOUtils::sdoURI) && + !strcmp(pl[i].getType().getName(), "OpenDataObject")) { + + /* + * 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(unsigned 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* dataObjectData = new DataObjectPtr; + *dataObjectData = sequence->getDataObjectValue(0); + if(!*dataObjectData) + { + loginfo("Null DataObject parameter named %s", name); + } + else + { + (*dataObjectData)->detach(); + } + operation.addParameter(dataObjectData); + } + } + else + { + // Empty content, add an empty string + loginfo("Empty OpenDataObject parameter named %s[%d]", name, j); + string* stringData = new string(""); + operation.addParameter(stringData); + } + } + } + } + else { + DataObjectPtr* dataObjectData = new DataObjectPtr; + *dataObjectData = inputDataObject->getDataObject(pl[i]); + if(!*dataObjectData) + { + loginfo("Null DataObject parameter named %s", name); + } + else + { + (*dataObjectData)->detach(); + } + operation.addParameter(dataObjectData); + } + } + break; + default: + { + ostringstream msg; + msg << "Unsupported param type: " << pl[i].getTypeEnum(); + throwException(SystemConfigurationException, msg.str().c_str()); + } + } + } + + // 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&) + { + try + { + // Create the output wrapper + const Type& outputType = dataFactoryPtr->getType(outputTypeURI, outputTypeName); + outputDataObject = dataFactoryPtr->create(outputType); + } + catch (SDORuntimeException&) + { + // The output wrapper type is not known, create an open DataObject + //outputDataObject = dataFactoryPtr->create("http://tempuri.org", "Wrapper"); + outputDataObject = dataFactoryPtr->create(SDOUtils::sdoURI, "OpenDataObject"); + } + } + + setOutputData(operation, outputDataObject, dataFactoryPtr); + + return outputDataObject; + + } + catch(SDORuntimeException& ex) + { + throwException(ServiceInvocationException, ex); + } + catch(TuscanyRuntimeException&) + { + throw; + } + } + + + void WSServiceProxy::setOutputData(Operation& operation, DataObjectPtr outputDataObject, DataFactoryPtr dataFactoryPtr) + { + logentry(); + + // 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: + { + // One way operation, no return value + break; + } + } + } + else + { + loginfo("No return values defined"); + } + } + else { + + // Should only be one return value.. This goes through all return values + for(unsigned 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->setInt(pl[i], *(int*)operation.getReturnValue()); + break; + } + case Operation::LONG: + { + outputDataObject->setInt(pl[i], *(long*)operation.getReturnValue()); + break; + } + case Operation::USHORT: + { + outputDataObject->setInt(pl[i], *(unsigned short*)operation.getReturnValue()); + break; + } + case Operation::UINT: + { + outputDataObject->setInt(pl[i], *(unsigned int*)operation.getReturnValue()); + break; + } + case Operation::ULONG: + { + outputDataObject->setInt(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("Null return value, 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("Null return value, leaving property %s unset", pl[i].getName()); + } + + break; + } + default: + { + // One way operation, no return value + break; + } + } + } + } + } + + } // End namespace ws + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.h b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.h new file mode 100644 index 0000000000..4d57514688 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.h @@ -0,0 +1,95 @@ +/* + * 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 "commonj/sdo/SDO.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" + + +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(tuscany::sca::model::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(tuscany::sca::model::Service* service); + + /** + * Destructor. + */ + virtual ~WSServiceProxy(); + + /** + * Invoke the specified operation + */ + commonj::sdo::DataObjectPtr invoke(const tuscany::sca::model::WSDLOperation& wsdlOperation, + commonj::sdo::DataObjectPtr inputDataObject); + + private: + + void setOutputData(Operation& operation, + commonj::sdo::DataObjectPtr outputDataObject, commonj::sdo::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/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/export.h b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/export.h new file mode 100644 index 0000000000..e52adf4db0 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/export.h @@ -0,0 +1,38 @@ +/* + * 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_ws_service_export_h +#define tuscany_sca_ws_service_export_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) + +#ifdef TUSCANY_SCA_WS_SERVICE_EXPORTS +#define SCA_WS_SERVICE_API __declspec(dllexport) +#else +#define SCA_WS_SERVICE_API __declspec(dllimport) +#endif + +#else +#define SCA_WS_SERVICE_API +#endif + +#endif // tuscany_sca_ws_service_export_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.cpp b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.cpp new file mode 100644 index 0000000000..4f170ebf52 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.cpp @@ -0,0 +1,151 @@ +/* + * 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" + +using namespace std; +using namespace tuscany::sca::model; + +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) + { + logentry(); + + parseEndpoint(); + } + + void WSReferenceBinding::parseEndpoint() + { + logentry(); + + // 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() + { + logentry(); + } + + void WSReferenceBinding::configure(ServiceBinding *binding) + { + logentry(); + + setTargetServiceBinding(binding); + + serviceProxy = new WSServiceProxy(getReference()); + } + + ServiceProxy* WSReferenceBinding::getServiceProxy() + { + logentry(); + + return serviceProxy; + } + + } // End namespace ws + } // End namespace sca +} // End namespace tuscany diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.h b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.h new file mode 100644 index 0000000000..14f17dbc3c --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.h @@ -0,0 +1,143 @@ +/* + * 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 + +#include "tuscany/sca/ws/export.h" +#include "tuscany/sca/model/ReferenceBinding.h" + + +namespace tuscany +{ + namespace sca + { + namespace ws + { + /** + * Information about a web service binding for service or a reference. + */ + class WSReferenceBinding : public tuscany::sca::model::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") + */ + SCA_WS_SERVICE_API WSReferenceBinding(tuscany::sca::model::Reference* reference, + const std::string&uri, const std::string& endpoint, const std::string& version); + + /** + * Destructor. + */ + SCA_WS_SERVICE_API virtual ~WSReferenceBinding(); + + /** + * Returns the type of binding. + */ + virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#WebServiceBinding"; }; + + /** + * Configure this binding from a service binding. + */ + SCA_WS_SERVICE_API virtual void configure(tuscany::sca::model::ServiceBinding* serviceBinding); + + /** + * Create a proxy representing the reference to the + * client component. + */ + SCA_WS_SERVICE_API virtual ServiceProxy* getServiceProxy(); + + /** + * Return the part of the endpoint definition describing the wsdl + * namespace. + * @return The wsdl namespace. + */ + std::string getWSDLNamespaceURL() const { return wsdlNamespaceURL; }; + + /** + * Return the service part of the endpoint definition. + * @return The service to use. + */ + std::string getServiceName() const { return serviceName; }; + + /** + * Return the endpoint name part of the endpoint definition. + * @return The endpoint name to use. + */ + std::string getEndpointName() const { return endpointName; }; + + /** + * Return the SOAP version. + * @return The SOAP version to use. + */ + std::string getSOAPVersion() const { return soapVersion; }; + + private: + + /** + * Parse the endpoint specification. + */ + void parseEndpoint(); + + /** + * The full endpoint string. + */ + std::string endpoint; + + /** + * Namespace from the endpoint. + */ + std::string wsdlNamespaceURL; + + /** + * Service name from the endpoint. + */ + std::string serviceName; + + /** + * Endpoint name from the endpoint. + */ + std::string endpointName; + + /** + * SOAP version. + */ + std::string soapVersion; + + /** + * The proxy representing the reference to the client + * component. + */ + ServiceProxy* serviceProxy; + }; + + } // End namespace ws + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_extension_ws_model_wsreferencebinding_h diff --git a/sca-cpp/trunk/contrib/runtime/extensions/ws/xsd/sca-binding-webservice.xsd b/sca-cpp/trunk/contrib/runtime/extensions/ws/xsd/sca-binding-webservice.xsd new file mode 100644 index 0000000000..680dd809a8 --- /dev/null +++ b/sca-cpp/trunk/contrib/runtime/extensions/ws/xsd/sca-binding-webservice.xsd @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/AUTHORS b/sca-cpp/trunk/contrib/samples/AUTHORS new file mode 100644 index 0000000000..e69de29bb2 diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/AlertAggregatorSCADiagram.png b/sca-cpp/trunk/contrib/samples/AlertAggregator/AlertAggregatorSCADiagram.png new file mode 100644 index 0000000000..4672a5e22e Binary files /dev/null and b/sca-cpp/trunk/contrib/samples/AlertAggregator/AlertAggregatorSCADiagram.png differ diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/Makefile.am b/sca-cpp/trunk/contrib/samples/AlertAggregator/Makefile.am new file mode 100644 index 0000000000..0b39db277d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/Makefile.am @@ -0,0 +1,21 @@ +# 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. + +deploydir=$(prefix)/AlertAggregator/deploy +SUBDIRS = sample.alerter sample.display httpserver +EXTRA_DIST = *.composite *.xml README.html +deploy_DATA = *.composite *.xml diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/README b/sca-cpp/trunk/contrib/samples/AlertAggregator/README new file mode 100644 index 0000000000..e605168052 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/README @@ -0,0 +1,38 @@ +Tuscany SCA for C++ Samples - Alert Aggregator Sample +===================================================== + +This is a sample that shows how a Web 2.0-style application can be built using +SCA. The Alert Aggregator Sample aggregates various data sources and presents +a unified view of data from these sources, served as XML and displayed via a +web page + +There are three sub-directories in this workspace: + - sample.alerter + This contains the source code and SCDL artifacts for the Alert + Aggregator. Includes components to retrieve emails from POP servers and + to retrieve items from RSS/Atom feeds, a component that aggregates these + alerts and a component that manages the configuration of which POP accounts + and which RSS feeds to read. + + - sample.display + Contains a single SCA component that provides a HTML display of the + Alert Aggregator data + + - httpserver + Configuration files and scripts to run the sample under Apache HTTPD. Also + includes the HTML file that calls the HTMLDisplay component + + +Additionally, there is the sample.alerter.app.composite file. This +describes the configuration of the Alerter and Display composites deployed to the +SCA runtime. + +This sample requires the following Tuscany extensions: +Python +REST service +REST reference + +It also requires the Python FeedParser library, available from http://feedparser.org/ + + + diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/README.html b/sca-cpp/trunk/contrib/samples/AlertAggregator/README.html new file mode 100644 index 0000000000..69d5434527 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/README.html @@ -0,0 +1,263 @@ + + + + + + + + + + + + Tuscany SCA Native Samples - Alert Aggregator Sample + + + +

      +
      +
      +

      Tuscany SCA Native Samples - Alert Aggregator Sample

      + +

      This is a more complex sample that shows how Tuscany and SCA can be used to + develop and run mash-up style web applications.

      +

      The Alert Aggregator sample aggregates items of information from various data + sources into a series of "alerts" that are displayed in an + automatically updating web page. Alert sources can currently include RSS/Atom + news feeds and POP3/IMAP email

      +

      The Alert Aggregator sample requires the following extensions: +

      + Please follow the documentation to ensure you have these extensions built and installed + on your system +

      +

      Additionally, the Alert Aggregator sample requires the Python FeedParser library, available from + http://feedparser.org. Please download and + install the library by following the documentation.

      +

      There are three sub-projects in this workspace: +

        +
      • sample.alerter
        + This contains the source code and SCDL artifacts for the SCA components + implementing the Alert Aggregator configuration and alert retrieval. +
      • +
      • sample.display
        + This contains the source code and SCDL artifacts for the SCA components + implementing the display and storage of the retrieved alerts. +
      • +
      • httpserver
        + This contains a minimal configuration for the Apache HTTP server used + to host the services as well as scripts to start and stop the server. +
      • +
      + Additionally, there is the sample.alerter.app.composite file. This + describes the configuration of the SCA composites deployed to the SCA + runtime.

      +

      The following SCA diagram shows the different components and composites and how the + wiring between them is specified. Not all of these components are currently + implemented in this sample.

      + Alert Aggregator SCA Diagram +
      + + + + +
      +

      Building the Alert Aggregator sample on Linux and Mac OS X

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>/samples - go directly to Running the sample on Linux and Mac OS X.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        +
      2. +
      3. As the Alert Aggregator sample is based on Python scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the Python samples only with the following command sequence: +
          +
        • cd <tuscany_sca_install_dir>/samples
        • +
        • ./configure --enable-python --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
        • +
        • make install
        • +
        + NOTE: If you don't provide the --prefix configure option, it will by default install into + /usr/local/tuscany/sca/samples/AlertAggregator
      4. +
      +
      + +
      +

      Running the Alert Aggregator sample on Linux and Mac OS X

      +
        +
      1. The Alert Aggregator sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
      2. +
      3. The Alert Aggregator sample requires the Python FeedParser library, available from + http://feedparser.org. Please download and + install the library by following the documentation.
      4. +
      5. Start the Apache HTTPD server: +
          +
        1. The following environment variables are required: +
            +
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • +
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • +
          • PYTHON_LIB=<path to the Python library>
            + Note: If you are using a default installation of Python 2.5 this is usually /usr/lib
          • +
          +
        2. +
        3. cd <tuscany_sca_install_dir>/samples/AlertAggregator/deploy/httpserver
        4. +
        5. ./startserver.sh
          + NOTE: Depending on your installation of Apache HTTPD you may need to log in as root before following + these steps. If so, you may also need to uncomment the User and Group directives in the + <tuscany_sca_install_dir>/samples/AlertAggregator/deploy/httpserver/conf/httpd.conf file + and set these to the appropriate username and group that the server should run as
        6. +
        +
      6. +
      7. Run the client from your web browser: +
          +
        1. Point your browser at http://localhost:9090/index.html
          + NOTE: If plain text is diplayed by your browser, rather than a rendered web page, you may need + to uncomment the LoadModule mime_module directive in the + <tuscany_sca_install_dir>/samples/AlertAggregator/deploy/httpserver/conf/httpd.conf file. Set the correct path to + the mod_mime.so library and restart the server
        2. +
        3. You should see the Alert Aggregator web interface that allows you to: +
            +
          • Read new alerts
          • +
          • Update alerts from all sources
          • +
          • Update alerts from a specific source
          • +
          • Edit the configuration of a data source
          • +
          • Add a new RSS/Atom or POP email data source
          • +
          • Remove a specific data source and all associated alerts
          • +
          +
        4. +
        +
      8. +
      +
      + +
      +

      Building the Alert Aggregator sample on Windows

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
      2. + +
      3. As this sample is based on Ruby scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>\samples\AlertAggregator
        • +
        • deploy.bat
        • +
        +
      4. +
      +
      + +
      +

      Running the Alert Aggregator sample on Windows

      +
        + +
      1. The Alert Aggregator sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
      2. +
      3. The Alert Aggregator sample requires the Python FeedParser library, available from + http://feedparser.org. Please download and + install the library by following the documentation.
      4. +
      5. Start the Apache HTTPD server: +
          +
        1. The following environment variables are required: +
            +
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • +
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • +
          • HTTPD_HOME=<path to installed Apache HTTPD server>
          • +
          +
        2. +
        3. cd <tuscany_sca_install_dir>\samples\AlertAggregator\deploy\httpserver
        4. +
        5. startserver.bat
        6. +
        +
      6. +
      7. Run the client from your web browser: +
          +
        1. Point your browser at http://localhost:9090/index.html
          + NOTE: If plain text is diplayed by your browser, rather than a rendered web page, you may need + to uncomment the LoadModule mime_module directive in the + <tuscany_sca_install_dir>\samples\AlertAggregator\deploy\httpserver\conf\httpd.conf file. Set the correct path to + the mod_mime.so library (e.g. C:\Apache2.2\modules\mod_mime.so) and restart the server
        2. +
        3. You should see the Alert Aggregator web interface that allows you to: +
            +
          • Read new alerts
          • +
          • Update alerts from all sources
          • +
          • Update alerts from a specific source
          • +
          • Edit the configuration of a data source
          • +
          • Add a new RSS/Atom or POP email data source
          • +
          • Remove a specific data source and all associated alerts
          • +
          +
        4. +
        +
      8. +
      +
      + + + +
      +

      Getting Help

      + +

      The first place to look is at the Tuscany SCA FAQ at + http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      + +

      Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      + +
      +
      +
      + + + + diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/config.xml b/sca-cpp/trunk/contrib/samples/AlertAggregator/config.xml new file mode 100644 index 0000000000..0b33cb7911 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/config.xml @@ -0,0 +1,33 @@ + + + + + BBC News + http://news.bbc.co.uk/ + 2007-02-07T17:11:16 + http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml + + + Engadget + http://www.engadget.com + 2007-02-07T17:11:14 + http://www.engadget.com/rss.xml + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/README b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/README new file mode 100644 index 0000000000..207e6394e1 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/README @@ -0,0 +1,33 @@ +Alert Aggregator - PHP Display Component +======================================== + +This httpserver configuration includes a PHP implementation of the display +component that replaces the python component in sample.display. + +The HTTPD configuration created by the startserver scrips relies on the +PHP_HOME environment variable in order to install PHP in Apache as follows: + +LoadModule php5_module %PHP_HOME%\php5apache2.dll +AddType application/x-httpd-php .php +PHPIniDir %PHP_HOME% + +PHP must be configured to include the PHP SCA_SDO extension from PECL. +This provides the SCA and SDO support that the display component relies on. +Currently you must have the version from the AVOCET branch as changes have +been made here that this application requires. + +To run the AlertAggregator sample with the PHP component you must start the +original HTTP server, e.g., on windows + +> cd AlertAggregator\httpserver +> startserver.bat + +and then start the HTTPD server that servers the PHP part of the application, e.g., + +> cd AlertAggregator\httpserver.php +> startserver.bat + +then point your browser at + +http://localhost:9091/index.html + diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/conf/httpd.conf b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/conf/httpd.conf new file mode 100644 index 0000000000..92026c9717 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/conf/httpd.conf @@ -0,0 +1,28 @@ +# 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 is the main Apache HTTP server configuration file. It contains the +# configuration directives that give the server its instructions. +# See for detailed information. + +Listen 9091 + +# Generated by the startserver script +Include conf/base.conf + +# SCA rest module not required for the PHP part +# Include conf/tuscany_sca_mod_rest.conf diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/conf/mime.types b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/conf/mime.types new file mode 100644 index 0000000000..4279f51bca --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/conf/mime.types @@ -0,0 +1,607 @@ +# 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 file controls what Internet media types are sent to the client for +# given file extension(s). Sending the correct media type to the client +# is important so they know how to handle the content of the file. +# Extra types can either be added here or by using an AddType directive +# in your config files. For more information about Internet media types, +# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type +# registry is at . + +# MIME type Extensions +application/activemessage +application/andrew-inset ez +application/applefile +application/atom+xml atom +application/atomicmail +application/batch-smtp +application/beep+xml +application/cals-1840 +application/cnrp+xml +application/commonground +application/cpl+xml +application/cybercash +application/dca-rft +application/dec-dx +application/dvcs +application/edi-consent +application/edifact +application/edi-x12 +application/eshop +application/font-tdpfr +application/http +application/hyperstudio +application/iges +application/index +application/index.cmd +application/index.obj +application/index.response +application/index.vnd +application/iotp +application/ipp +application/isup +application/mac-binhex40 hqx +application/mac-compactpro cpt +application/macwriteii +application/marc +application/mathematica +application/mathml+xml mathml +application/msword doc +application/news-message-id +application/news-transmission +application/ocsp-request +application/ocsp-response +application/octet-stream bin dms lha lzh exe class so dll dmg +application/oda oda +application/ogg ogg +application/parityfec +application/pdf pdf +application/pgp-encrypted +application/pgp-keys +application/pgp-signature +application/pkcs10 +application/pkcs7-mime +application/pkcs7-signature +application/pkix-cert +application/pkix-crl +application/pkixcmp +application/postscript ai eps ps +application/prs.alvestrand.titrax-sheet +application/prs.cww +application/prs.nprend +application/prs.plucker +application/qsig +application/rdf+xml rdf +application/reginfo+xml +application/remote-printing +application/riscos +application/rtf +application/sdp +application/set-payment +application/set-payment-initiation +application/set-registration +application/set-registration-initiation +application/sgml +application/sgml-open-catalog +application/sieve +application/slate +application/smil smi smil +application/srgs gram +application/srgs+xml grxml +application/timestamp-query +application/timestamp-reply +application/tve-trigger +application/vemmi +application/vnd.3gpp.pic-bw-large +application/vnd.3gpp.pic-bw-small +application/vnd.3gpp.pic-bw-var +application/vnd.3gpp.sms +application/vnd.3m.post-it-notes +application/vnd.accpac.simply.aso +application/vnd.accpac.simply.imp +application/vnd.acucobol +application/vnd.acucorp +application/vnd.adobe.xfdf +application/vnd.aether.imp +application/vnd.amiga.ami +application/vnd.anser-web-certificate-issue-initiation +application/vnd.anser-web-funds-transfer-initiation +application/vnd.audiograph +application/vnd.blueice.multipass +application/vnd.bmi +application/vnd.businessobjects +application/vnd.canon-cpdl +application/vnd.canon-lips +application/vnd.cinderella +application/vnd.claymore +application/vnd.commerce-battelle +application/vnd.commonspace +application/vnd.contact.cmsg +application/vnd.cosmocaller +application/vnd.criticaltools.wbs+xml +application/vnd.ctc-posml +application/vnd.cups-postscript +application/vnd.cups-raster +application/vnd.cups-raw +application/vnd.curl +application/vnd.cybank +application/vnd.data-vision.rdz +application/vnd.dna +application/vnd.dpgraph +application/vnd.dreamfactory +application/vnd.dxr +application/vnd.ecdis-update +application/vnd.ecowin.chart +application/vnd.ecowin.filerequest +application/vnd.ecowin.fileupdate +application/vnd.ecowin.series +application/vnd.ecowin.seriesrequest +application/vnd.ecowin.seriesupdate +application/vnd.enliven +application/vnd.epson.esf +application/vnd.epson.msf +application/vnd.epson.quickanime +application/vnd.epson.salt +application/vnd.epson.ssf +application/vnd.ericsson.quickcall +application/vnd.eudora.data +application/vnd.fdf +application/vnd.ffsns +application/vnd.fints +application/vnd.flographit +application/vnd.framemaker +application/vnd.fsc.weblaunch +application/vnd.fujitsu.oasys +application/vnd.fujitsu.oasys2 +application/vnd.fujitsu.oasys3 +application/vnd.fujitsu.oasysgp +application/vnd.fujitsu.oasysprs +application/vnd.fujixerox.ddd +application/vnd.fujixerox.docuworks +application/vnd.fujixerox.docuworks.binder +application/vnd.fut-misnet +application/vnd.grafeq +application/vnd.groove-account +application/vnd.groove-help +application/vnd.groove-identity-message +application/vnd.groove-injector +application/vnd.groove-tool-message +application/vnd.groove-tool-template +application/vnd.groove-vcard +application/vnd.hbci +application/vnd.hhe.lesson-player +application/vnd.hp-hpgl +application/vnd.hp-hpid +application/vnd.hp-hps +application/vnd.hp-pcl +application/vnd.hp-pclxl +application/vnd.httphone +application/vnd.hzn-3d-crossword +application/vnd.ibm.afplinedata +application/vnd.ibm.electronic-media +application/vnd.ibm.minipay +application/vnd.ibm.modcap +application/vnd.ibm.rights-management +application/vnd.ibm.secure-container +application/vnd.informix-visionary +application/vnd.intercon.formnet +application/vnd.intertrust.digibox +application/vnd.intertrust.nncp +application/vnd.intu.qbo +application/vnd.intu.qfx +application/vnd.irepository.package+xml +application/vnd.is-xpr +application/vnd.japannet-directory-service +application/vnd.japannet-jpnstore-wakeup +application/vnd.japannet-payment-wakeup +application/vnd.japannet-registration +application/vnd.japannet-registration-wakeup +application/vnd.japannet-setstore-wakeup +application/vnd.japannet-verification +application/vnd.japannet-verification-wakeup +application/vnd.jisp +application/vnd.kde.karbon +application/vnd.kde.kchart +application/vnd.kde.kformula +application/vnd.kde.kivio +application/vnd.kde.kontour +application/vnd.kde.kpresenter +application/vnd.kde.kspread +application/vnd.kde.kword +application/vnd.kenameaapp +application/vnd.koan +application/vnd.liberty-request+xml +application/vnd.llamagraphics.life-balance.desktop +application/vnd.llamagraphics.life-balance.exchange+xml +application/vnd.lotus-1-2-3 +application/vnd.lotus-approach +application/vnd.lotus-freelance +application/vnd.lotus-notes +application/vnd.lotus-organizer +application/vnd.lotus-screencam +application/vnd.lotus-wordpro +application/vnd.mcd +application/vnd.mediastation.cdkey +application/vnd.meridian-slingshot +application/vnd.micrografx.flo +application/vnd.micrografx.igx +application/vnd.mif mif +application/vnd.minisoft-hp3000-save +application/vnd.mitsubishi.misty-guard.trustweb +application/vnd.mobius.daf +application/vnd.mobius.dis +application/vnd.mobius.mbk +application/vnd.mobius.mqy +application/vnd.mobius.msl +application/vnd.mobius.plc +application/vnd.mobius.txf +application/vnd.mophun.application +application/vnd.mophun.certificate +application/vnd.motorola.flexsuite +application/vnd.motorola.flexsuite.adsi +application/vnd.motorola.flexsuite.fis +application/vnd.motorola.flexsuite.gotap +application/vnd.motorola.flexsuite.kmr +application/vnd.motorola.flexsuite.ttc +application/vnd.motorola.flexsuite.wem +application/vnd.mozilla.xul+xml xul +application/vnd.ms-artgalry +application/vnd.ms-asf +application/vnd.ms-excel xls +application/vnd.ms-lrm +application/vnd.ms-powerpoint ppt +application/vnd.ms-project +application/vnd.ms-tnef +application/vnd.ms-works +application/vnd.ms-wpl +application/vnd.mseq +application/vnd.msign +application/vnd.music-niff +application/vnd.musician +application/vnd.netfpx +application/vnd.noblenet-directory +application/vnd.noblenet-sealer +application/vnd.noblenet-web +application/vnd.novadigm.edm +application/vnd.novadigm.edx +application/vnd.novadigm.ext +application/vnd.obn +application/vnd.osa.netdeploy +application/vnd.palm +application/vnd.pg.format +application/vnd.pg.osasli +application/vnd.powerbuilder6 +application/vnd.powerbuilder6-s +application/vnd.powerbuilder7 +application/vnd.powerbuilder7-s +application/vnd.powerbuilder75 +application/vnd.powerbuilder75-s +application/vnd.previewsystems.box +application/vnd.publishare-delta-tree +application/vnd.pvi.ptid1 +application/vnd.pwg-multiplexed +application/vnd.pwg-xhtml-print+xml +application/vnd.quark.quarkxpress +application/vnd.rapid +application/vnd.s3sms +application/vnd.sealed.net +application/vnd.seemail +application/vnd.shana.informed.formdata +application/vnd.shana.informed.formtemplate +application/vnd.shana.informed.interchange +application/vnd.shana.informed.package +application/vnd.smaf +application/vnd.sss-cod +application/vnd.sss-dtf +application/vnd.sss-ntf +application/vnd.street-stream +application/vnd.svd +application/vnd.swiftview-ics +application/vnd.triscape.mxs +application/vnd.trueapp +application/vnd.truedoc +application/vnd.ufdl +application/vnd.uplanet.alert +application/vnd.uplanet.alert-wbxml +application/vnd.uplanet.bearer-choice +application/vnd.uplanet.bearer-choice-wbxml +application/vnd.uplanet.cacheop +application/vnd.uplanet.cacheop-wbxml +application/vnd.uplanet.channel +application/vnd.uplanet.channel-wbxml +application/vnd.uplanet.list +application/vnd.uplanet.list-wbxml +application/vnd.uplanet.listcmd +application/vnd.uplanet.listcmd-wbxml +application/vnd.uplanet.signal +application/vnd.vcx +application/vnd.vectorworks +application/vnd.vidsoft.vidconference +application/vnd.visio +application/vnd.visionary +application/vnd.vividence.scriptfile +application/vnd.vsf +application/vnd.wap.sic +application/vnd.wap.slc +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/vnd.webturbo +application/vnd.wrq-hp3000-labelled +application/vnd.wt.stf +application/vnd.wv.csp+wbxml +application/vnd.xara +application/vnd.xfdl +application/vnd.yamaha.hv-dic +application/vnd.yamaha.hv-script +application/vnd.yamaha.hv-voice +application/vnd.yellowriver-custom-menu +application/voicexml+xml vxml +application/watcherinfo+xml +application/whoispp-query +application/whoispp-response +application/wita +application/wordperfect5.1 +application/x-bcpio bcpio +application/x-cdlink vcd +application/x-chess-pgn pgn +application/x-compress +application/x-cpio cpio +application/x-csh csh +application/x-director dcr dir dxr +application/x-dvi dvi +application/x-futuresplash spl +application/x-gtar gtar +application/x-gzip +application/x-hdf hdf +application/x-javascript js +application/x-koan skp skd skt skm +application/x-latex latex +application/x-netcdf nc cdf +application/x-sh sh +application/x-shar shar +application/x-shockwave-flash swf +application/x-stuffit sit +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-tar tar +application/x-tcl tcl +application/x-tex tex +application/x-texinfo texinfo texi +application/x-troff t tr roff +application/x-troff-man man +application/x-troff-me me +application/x-troff-ms ms +application/x-ustar ustar +application/x-wais-source src +application/x400-bp +application/xhtml+xml xhtml xht +application/xslt+xml xslt +application/xml xml xsl +application/xml-dtd dtd +application/xml-external-parsed-entity +application/zip zip +audio/32kadpcm +audio/amr +audio/amr-wb +audio/basic au snd +audio/cn +audio/dat12 +audio/dsr-es201108 +audio/dvi4 +audio/evrc +audio/evrc0 +audio/g722 +audio/g.722.1 +audio/g723 +audio/g726-16 +audio/g726-24 +audio/g726-32 +audio/g726-40 +audio/g728 +audio/g729 +audio/g729D +audio/g729E +audio/gsm +audio/gsm-efr +audio/l8 +audio/l16 +audio/l20 +audio/l24 +audio/lpc +audio/midi mid midi kar +audio/mpa +audio/mpa-robust +audio/mp4a-latm +audio/mpeg mpga mp2 mp3 +audio/parityfec +audio/pcma +audio/pcmu +audio/prs.sid +audio/qcelp +audio/red +audio/smv +audio/smv0 +audio/telephone-event +audio/tone +audio/vdvi +audio/vnd.3gpp.iufp +audio/vnd.cisco.nse +audio/vnd.cns.anp1 +audio/vnd.cns.inf1 +audio/vnd.digital-winds +audio/vnd.everad.plj +audio/vnd.lucent.voice +audio/vnd.nortel.vbk +audio/vnd.nuera.ecelp4800 +audio/vnd.nuera.ecelp7470 +audio/vnd.nuera.ecelp9600 +audio/vnd.octel.sbc +audio/vnd.qcelp +audio/vnd.rhetorex.32kadpcm +audio/vnd.vmx.cvsd +audio/x-aiff aif aiff aifc +audio/x-alaw-basic +audio/x-mpegurl m3u +audio/x-pn-realaudio ram ra +audio/x-pn-realaudio-plugin +application/vnd.rn-realmedia rm +audio/x-wav wav +chemical/x-pdb pdb +chemical/x-xyz xyz +image/bmp bmp +image/cgm cgm +image/g3fax +image/gif gif +image/ief ief +image/jpeg jpeg jpg jpe +image/naplps +image/png png +image/prs.btif +image/prs.pti +image/svg+xml svg +image/t38 +image/tiff tiff tif +image/tiff-fx +image/vnd.cns.inf2 +image/vnd.djvu djvu djv +image/vnd.dwg +image/vnd.dxf +image/vnd.fastbidsheet +image/vnd.fpx +image/vnd.fst +image/vnd.fujixerox.edmics-mmr +image/vnd.fujixerox.edmics-rlc +image/vnd.globalgraphics.pgb +image/vnd.mix +image/vnd.ms-modi +image/vnd.net-fpx +image/vnd.svf +image/vnd.wap.wbmp wbmp +image/vnd.xiff +image/x-cmu-raster ras +image/x-icon ico +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-rgb rgb +image/x-xbitmap xbm +image/x-xpixmap xpm +image/x-xwindowdump xwd +message/delivery-status +message/disposition-notification +message/external-body +message/http +message/news +message/partial +message/rfc822 +message/s-http +message/sip +message/sipfrag +model/iges igs iges +model/mesh msh mesh silo +model/vnd.dwf +model/vnd.flatland.3dml +model/vnd.gdl +model/vnd.gs-gdl +model/vnd.gtw +model/vnd.mts +model/vnd.parasolid.transmit.binary +model/vnd.parasolid.transmit.text +model/vnd.vtu +model/vrml wrl vrml +multipart/alternative +multipart/appledouble +multipart/byteranges +multipart/digest +multipart/encrypted +multipart/form-data +multipart/header-set +multipart/mixed +multipart/parallel +multipart/related +multipart/report +multipart/signed +multipart/voice-message +text/calendar ics ifb +text/css css +text/directory +text/enriched +text/html html htm +text/parityfec +text/plain asc txt +text/prs.lines.tag +text/rfc822-headers +text/richtext rtx +text/rtf rtf +text/sgml sgml sgm +text/t140 +text/tab-separated-values tsv +text/uri-list +text/vnd.abc +text/vnd.curl +text/vnd.dmclientscript +text/vnd.fly +text/vnd.fmi.flexstor +text/vnd.in3d.3dml +text/vnd.in3d.spot +text/vnd.iptc.nitf +text/vnd.iptc.newsml +text/vnd.latex-z +text/vnd.motorola.reflex +text/vnd.ms-mediapackage +text/vnd.net2phone.commcenter.command +text/vnd.sun.j2me.app-descriptor +text/vnd.wap.si +text/vnd.wap.sl +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/x-setext etx +text/xml +text/xml-external-parsed-entity +video/bmpeg +video/bt656 +video/celb +video/dv +video/h261 +video/h263 +video/h263-1998 +video/h263-2000 +video/jpeg +video/mp1s +video/mp2p +video/mp2t +video/mp4v-es +video/mpv +video/mpeg mpeg mpg mpe +video/nv +video/parityfec +video/pointer +video/quicktime qt mov +video/smpte292m +video/vnd.fvt +video/vnd.motorola.video +video/vnd.motorola.videop +video/vnd.mpegurl mxu m4u +video/vnd.nokia.interleaved-multimedia +video/vnd.objectvideo +video/vnd.vivo +video/x-msvideo avi +video/x-sgi-movie movie +x-conference/x-cooltalk ice diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/AlertDisplay.php b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/AlertDisplay.php new file mode 100644 index 0000000000..2b9eb916a0 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/AlertDisplay.php @@ -0,0 +1,204 @@ + +loadFile("./Cached_Alerts.xml"); + $cached_alerts = $doc->getRootDataObject(); + + // Use the alertService reference + $new_alerts = $this->alert_service->getAllNewAlerts(); + + foreach($new_alerts->alert as $alert){ + $new_alert = $cached_alerts->createDataObject('alert'); + $new_alert->title = $alert->title; + $new_alert->summary = $alert->summary; + $new_alert->address = $alert->address; + $new_alert->date = $alert->date; + $new_alert->sourceid = $alert->sourceid; + $new_alert->unread = true; + } + + $return_table = ""; + $alert_id_number = 0; + foreach($cached_alerts->alert as $alert){ + $alert->id = "alert_" . $alert_id_number; + $title = substr($alert->title,0,80); + $summary = substr($alert->summary,0,40); + $unread_string = $alert->unread ? "unread_title" : "read_title"; + $return_row = << + + + +ALERTROW; + $return_table = $return_table . $return_row; + $alert_id_number += 1; + } + $return_table = $return_table . "
      + $title + - $summary ... + + $alert->date +
      "; + + // as php is one shot we have to save away the alerts we want to cache + $xmldas->saveFile($doc, "./Cached_Alerts.xml"); + + return $return_table; + } + + /** + * @param string $alert_id + * @return string + */ + public function readAlert($alert_id) + { + $xmldas = SDO_DAS_XML::create("./Alerter.xsd"); + $doc = $xmldas->loadFile("./Cached_Alerts.xml"); + $cached_alerts = $doc->getRootDataObject(); + + $return_summary = ""; + + foreach($cached_alerts->alert as $alert){ +SCA::$logger->log($alert->id . " vs " . $alert_id ); + if (strcmp($alert->id,$alert_id) == 0){ + SCA::$logger->log("Match"); + $alert->unread = false; + $return_summary = "
      " . $alert->summary . "
      "; + } + } + + // as php is one shot we have to save away the alerts we want to cache + $xmldas->saveFile($doc, "./Cached_Alerts.xml"); + + return $return_summary; + } + + /** + * @return string + */ + public function getAlertSourcesHTMLTable() + { + # Use the alertService reference + $alert_sources = $this->alert_service->getAlertSources(); + +// some debug +//ob_start(); +//print_r( $alert_sources ); +//$debug = ob_get_contents(); +//ob_end_clean(); +//SCA::$logger->log($debug); + + $return_table = "\n"; + + foreach ($alert_sources->source as $alert_source){ + $source_id = $alert_source->id; + $return_row = << + + + + + + + +SOURCEROW; + $return_table = $return_table . $return_row; + } + + $return_table = $return_table . "
      +   $alert_source->name +
      \n"; + return $return_table; + } + + /** + * @param integer $source_id + * @return string + */ + public function deleteAlertSource($source_id){ + # Use the alertService reference + $this->alertService->removeAlertSource($source_id); + + //TODO + } + + /** + * @param source $alert_source http://tuscany.apache.org/samples/alerter + */ + public function addAlertSource($alert_source){ + # Use the alertService reference + $this->alertService->addAlertSource($alert_source); + } + + /** + * @param source $alert_source http://tuscany.apache.org/samples/alerter + */ + public function updateAlertSource($alert_source){ + # Use the alertService reference + $this->alertService->updateAlertSource($alert_source); + } +} +?> + + + diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/Alerter.xsd b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/Alerter.xsd new file mode 100644 index 0000000000..58b9982d38 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/Alerter.xsd @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/Cached_Alerts.xml b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/Cached_Alerts.xml new file mode 100644 index 0000000000..03901c804c --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/Cached_Alerts.xml @@ -0,0 +1,214 @@ + + +Polymer Vision's Readius rollable display gets face timeFiled under: Cellphones, DisplaysTalk about a long time coming, as what is now Polymer Vision has seemed to finally put all the pieces together and produce an actual working product from the idea envisioned by Philips around two years ago. We knew the spinoff was looking to commercialize the product later this year, but after nearly 24 months of coming up empty, a bit of understandable skepticism begins to seep through. Nevertheless, the firm's rollable, pocket-friendly "Cellular-Book" was out and showing its stuff at 3GSM, proving that there's at least something there to put on store shelves. Although the unit on display was indeed a standalone device -- sporting 16 shades of grey, USB, "10-days" of battery life, 4GB of internal storage, and GPRS, EDGE, and DVB-H connectivity just like we'd heard -- Polymer Vision is actually hoping to integrate its e-paper technology into mobile handset displays in the near future. Sadly, there still didn't seem to be any hints of a release date for the nifty pocket reader, but be sure to click on through for the very long awaited pictures of the Readius in action.[Via Slashdot]Continue reading Polymer Vision's Readius rollable display gets face time Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92945682/
      2007-02-19T15:54:00
      Sirius and XM set to merge?Filed under: Portable Audio +Well, we can't exactly say that we didn't see this one coming, but for the deal to actually get inked would indeed be something special. According to the New York Post, Sirius and XM are all set to announce a merger deal after hammering out details all weekend long. Of course, it was noted that the somewhat shaky agreement "could fall apart at any time," and interestingly enough, both companies purportedly spent the majority of their (and their lawyers) time ironing out the good stuff while leaving "regulatory concerns" on the back burner. Unfortunately, those very issues could be insurmountable hurdles, as the typically stubborn FCC certainly has played hard ball with each company before, and having one overriding satellite provider with no competition in sight is ripe for monopoly arguments. Regardless, you won't find us complaining about a little Howard just a few channels down from Oprah, or a dash of MLB just a dozen notches from the NFL, but considering that gaining that oh-so-critical regulatory approval "could take up to 15 months," we wouldn't count on your lineup changing anytime soon no matter what. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92940034/
      2007-02-19T15:24:00
      Sony's Cybershot DSC-W80: their latest 7.2 megapixel camera?Filed under: Digital Cameras +Out of the gates early for PMA (Photo Marketing Association) 2007, we've got rumors of the latest Sony Cybershot, the DSC-W80. The cam's already made its appearance on a few German and Dutch web sites and certainly makes sense as the successor to the 7.2 megapixel W70 launched at last year's show. However, instead of 8 megapixels like you might expect, we're still talking that same 7.2-megapixel, 1/2.5-inch CCD (which won't help improve the high rates of noise above ISO 200 any), 3x optical zoom, and 2.5-inch LCD. Other than a new ISO 3200 sensitivity and slightly larger chassis -- up from 89 x 57 x 23-mm to 91 x 58 x 23-mm -- there isn't anything new on the surface to report. No one's sayin' but perhaps they've added some optical image stabilization to bring these in-line with most other compact shooters in this range. We've also got rumors of a new Cybershot DSC-W60 and Cybershot DSC-W90 -- both unannounced and both said to work with a new SPK-SA underwater case (pictured after the break). The W80 is expected to hit in April for around 280/$368. As to the rest... well, the PMA show starts March 8th so we'll know soon enough. [Via Let's Go Digital, thanks David]Continue reading Sony's Cybershot DSC-W80: their latest 7.2 megapixel camera? Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92929558/
      2007-02-19T14:42:00
      Gresso's Symphonia MP3 players for the nouveau richeFiled under: Portable AudioHow do you make a splash in the already saturated MP3 player market? Well, there's always limited-edition pink, or how 'bout a $4,000+ luxury player which touts "craftsmanship" (not sound quality or user experience) as its primary forte? Naturally, we're talking about Gresso, the Russian outfit already infamous for their luxury cellphones. Their new Symphonia audio players all measure in at 39 x 39 x 10.5-mm making them just a touch bigger than the iRiver S7 and iPod shuffle. Each features a RAZR-esque laser-etched keypad, built-in FM tuner, and 1GB of flash memory for your MP3, WMA, ASF and OGG files. In fact, the four models only differ in materials which range from ancient hardwoods to 18 carat gold. Expected in Q2 with too-beaucoup pricing in the area of $4,000 to $6,000. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92922919/
      2007-02-19T14:22:00
      Earth Trek's USB Tape DispenserFiled under: Misc. Gadgets, Peripherals +Ours is not to question why, only to accept the inevitable convergence of USB and pretty much everything else within the vicinity of our PCs. Meet the newly announced 4-port USB 2.0 hub and tape dispenser from Hong Kong's Earth Trek. It comes in large and small versions and can naturally be affixed with your very own logo for some good ol' corporate schwag. Sorry, these devices are not USB powered -- but if you're the type who finds it overly taxing to dispense tape, then maybe you should be looking into a bionic suit. "Coming soon" in several color options for an undisclosed price. + +[Via Akihabara News] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92922925/
      2007-02-19T14:02:00
      The do-it-yourself SSD adapterFiled under: Storage + If you can't afford the real deal, then prepare to get your jank on with this, the not-so-poor-man's solid state disk. The SDB25SD from GeekStuff4U can host up to 4x SD (not SDHC) cards for a maximum capacity of 8GB. Just slip the four cards into the 2.5-inch sled which then slots-in to any available IDE connector where -- presumably -- the total capacity is presented as a single disk volume... who knows? So how much would you pay for something like this: $50, $40, or maybe $20? Try $258.50 and you have to provide the SD flash. Word to the wise: SSD prices are dropping fast -- you'll pay about the same price for a full 16GB SSD card if you can hold on until June or so.[Via Akihabara News] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92910485/
      2007-02-19T13:32:00
      Sharp's EM ONE: a dual-sliding Pocket PC with HSDPA and WiFiFiled under: Handhelds, Wireless +Check it W-Zero3, Sharp just one-upped your azz with their new EM ONE handheld. This Windows Mobile 5.0 Pocket PC device brings 3.6Mbps HSDPA and 802.11b/g data to the game along with hot dual-sliding action under that 4.1-inch touch-screen display. Unlike Samsung's F520 dual-slider which combines a QWERTY and numeric keypad for making calls, Sharp's slab is a data-only device so they combine the QWERTY with a side-sliding navigation pad for scooting around the 800 x 480 pixel display. However, Sharp's EM ONE comes heavy on the chub at 140x70x18.9-mm compared to the F520's 105x54x17.4-mm or even Nokia's N800 which is about the same length and width but much thinner at 145x75x12.7-mm. The whole kit comes powered by a Marvell 520MHz PXA270 processor and nVidia GoForce 5500 graphics along with 512MB/128MB flash/SDRAM memory and miniSD expansion. The display boasts a rather anemic 65k color palette (albeit, the same as the N800) for viewing integrated 1-Seg mobile TV and WMV videos with WMA and MP3 audio playback supported by a pair of built-in stereo speakers. Rounding out the specs are Bluetooth 1.2, a 1.3 megapixel CMOS camera, stylus, and a 4-hour battery. On sale in Japan starting March 31st for 95,000 (about $797) without contract or 39,800 ($332) with 2-year commitment.Gallery: Sharp's EM ONE: a dual-sliding PocketPC with HSDPA and WiFi[Via Impress] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92903979/
      2007-02-19T13:02:00
      Leaders condemn India train blastIndia and Pakistan say a train bombing that killed at least 66 people will not disrupt their peace process.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6375749.stm
      2007-02-19T13:27:07
      At least 30 die in Iraq attacksA number of attacks in Iraq leave at least 30 dead, despite a security operation across the country.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6374909.stm
      2007-02-19T16:20:31
      Priest jailed for exorcism deathA Romanian priest who caused the death of a nun during an exorcism ritual is jailed for 14 years.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/europe/6376211.stm
      2007-02-19T16:29:36
      Czech-Polish OK for US missilesCzech and Polish leaders back a US plan to install missile defence facilities on their territory.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/europe/6376137.stm
      2007-02-19T15:02:36
      Mexico holds mine tragedy vigilMexico marks the anniversary of a blast that killed 65 miners, most of whose bodies have not been found.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6376267.stm
      2007-02-19T15:47:12
      'Anti-terror force' for SomaliaSomalia's government sets up a joint police and military unit to counter attacks by suspected Islamists.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/6375699.stm
      2007-02-19T12:33:12
      Row threatens Nigerian allianceTwo top Nigerian presidential candidates swap insults, casting doubt on the alliance between their two parties.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/6376521.stm
      2007-02-19T15:53:07
      Colombian foreign minister quitsColombia's foreign minister resigns after the arrest of her brother on suspicion of links with paramilitary groups.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6376359.stm
      2007-02-19T15:40:03
      Wrangling hits Airbus restructureAirbus shelves a key decision on a major overhaul of the business, amid strife between its European partners.
      http://news.bbc.co.uk/go/rss/-/1/hi/business/6375517.stm
      2007-02-19T13:04:02
      Nepal king 'takes responsibility'Nepal's King Gyanendra publicly accepts responsibility for "success and failure" under his period of direct rule.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6375207.stm
      2007-02-19T14:11:40
      More than 20 die in Iraq attacksA number of attacks in Iraq leave more than 20 dead, despite a security operation across the country.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6374909.stm
      2007-02-19T17:05:24
      Sling's upcoming SlingLink Turbo leaked?Filed under: Home Entertainment, Networking +When you're slinging media across the home, there's no such thing as "too much bandwidth," and it looks like Sling Media is beefing up its SlingLink line of home wiring network products with the SlingLink Turbo. The new device ups the bandwidth from 14Mbps to 85Mbps, and while the original SlingLinks were primarily designed for a single Slingbox connection, the Turbo vision should be able to handle more general purpose home media networking tasks. The SlingLink Turbo was spotted by a SlingCommunity member on Amazon.com, with an expected ship date of February 27th 2007 for $149. The device is interoperable with existing PowerLine adapters, and has four Ethernet ports beyond the PowerLine link. As far as rumors go, this one looks pretty legit, but with a February 27th date on the books, we should know exactly how legit before too terribly long.[Thanks TieGuy] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93021486/
      2007-02-19T20:55:00
      It's official: XM and Sirius plan to tie the knot + It's been more than two years since we first reported that XM and Sirius were in talks to merge, and although the New York Post may have jumped the gun a bit way back then, it was certainly on the money today, as the two satellite radio pioneers have just issued a joint press release stating their intention to become life partners. In the proposed $13 billion deal -- which they'd like to go down by the end of the year but which still must pass rather daunting regulatory scrutiny and opposition from such heavyweights as the National Association of Broadcasters -- investors would get 4.6 shares of Sirius stock for each share of XM, with current Sirius CEO Mel Karmazin and XM Chairman Gary Parsons retaining those roles, respectively, in the combined entity (whose name has yet to be decided). As you might imagine, the companies are already trying to spin this as a big win for everyone from Martha Stewart on down, arguing that consumers will end up benefiting from more programming choices and better hardware, manufacturers and retailers will see increased sales, and of course shareholders would gain value through the economies of scale and elimination of redundancies realized from a merger. The new pals also took an opportunity to sneak in a mention about the growing number of choices consumers have for receiving audio content, from old school AM/FM to internet radio to the the still-nascent technologies of cellphone streaming and HD radio, clearly hoping to sway public opinion on that whole anti-trust thing. Still, keep in mind that the FCC is gonna be taking a long, hard look at this one -- in fact, current regulations would need to be changed in order for the merger to gain approval -- so don't get your celebratin' started just yet. Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93011139/
      2007-02-19T20:30:00
      Details emerge on Sony's DSC-W90, W200 digital camerasFiled under: Digital CamerasThe big PMA 07 trade show is still weeks away, but we seem to be already getting a pretty good idea of what Sony will be showing off, first with word of its 7.2 megapixel DSC-W80 getting out earlier today, and now with details on two additional models appearing on SonyCenter.lu's discussion forums before not-so-mysteriously disappearing. Thankfully, good 'ol Google Cache has preserved all the relevant information so you won't have to wait until March to satisfy your curiosity. Apart from the difference in megapixels, with 12 on the W200 and 8 on the W90, the two cameras appear to be virtually identical, each boasting a 3x optical zoom, 2.5-inch LCD, Carl Zeiss Vario-Tessar optics, Sony's trademark SteadyShot and Face Recognition features, ISO settings up to 3200 and, perhaps most notable, HDMI outputs. Unfortunately, there's no pics of either camera, although they'll apparently be similar in design to the W55 (pictured here), only with a "finer," "more beautiful" case. There's also no word on price or availability, although that should be revealed at the official PMA launch next month.[Thanks, Rashid] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93004352/
      2007-02-19T19:48:00
      What tech would the Presidents rock in 2007?Filed under: Features, Misc. Gadgets + Sure, Washington had his dentures, Lincoln his ironclads and Jefferson his swivel chair, but what kind of kit would they be messing around with in 2007? In search of answers based on broad and most likely mis-guided and / or offensive stereotypes, we bring you the following list. Feel free to rip it to shreds in the comments, just make sure to keep it patriotic -- Big Brother is watching. Happy Presidents Day!#vistachart { border: 2px solid #333; border-collapse: collapse; } #vistachart td { padding: 3px; border: 1px solid #ccc; vertical-align: top; margin: 0; line-height: 1.3em; } #vistachart th { font-weight: bold; text-align: left; padding: 4px; background: #eee; } #vistachart th.mainth { border-bottom: 1px solid #333; font-size: 1.2em; } #vistachart td.red { background-color: #f08c85; } #vistachart td.green { background-color: #b3e2c4; + + + + Washington(rebel)Lincoln(uniter)Jefferson(hipster)Roosevelt(fearless) + + + OS + Linux (last night's build) + Mac OS X (with Vista in Parallels and Linux via Boot Camp) + Mac OS X + Vista (x64) + + + Computer + OQO (has an OLPC XO at home) + MBP + MacBook + Toughbook + + + Media player + Make Daisy + Sansa + iPod + Zune + + + HD format + HD DVD + LG BH100 hybrid player + Blu-ray + DivX + BitTorrent, dude + + + Carrier + T-Mobile + AT T + T-Mobile + VoIP over neighborFi + + + Console + Gamepark GP2X, SNES + Wii, Xbox 360, PS3 + Wii + PS3 + + + Vehicle + Homebrew biodiesel + Prius + Tesla Roadster + Segway + + + Phone + OpenMoko + 8525 + Sidekick 3 + Greenphone + + + Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92998051/
      2007-02-19T19:21:00
      Solar Technology's Freeloader saps power from USB, the SunFiled under: Misc. Gadgets, Peripherals +While it won't do your laptop any good, this new Freeloader gig from Solar Technology should be able to provide juice to just about every other gadget in your repertoire. The device contains its own li-ion rechargeable battery, which it can fill up from your laptop or desktop's power via USB, or using its 120mA crystalline solar cells. From there you've got a master cable and eleven adaptors to get the electricity into your phone, camera, PDA, GPS, gaming handheld or DAP. Solar Technology seems to have most of the big brands covered, and claims it can fuel an iPod for 18 hours, a mobile phone for 44 hours, PSP for 2.5 hours and a PDA for 22 hours -- not too shabby for the 6.5 ounce unit. Sure, we've seen plenty of similar chargers before, but the combination of device compatibility and relatively low price ( 30, about $59 US) makes this a decent option for those sun-drenched road warriors out there. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92990699/
      2007-02-19T18:54:00
      Sony's 1/1.8-inch high-speed CMOS sensor outputs 60fpsFiled under: Digital CamerasThankfully, it looks like Sony has come through yet again, and while it wasn't exactly in the timeliest of manners, the high-speed CMOS sensor that it promised would deliver 60fps of video output is finally upon us. The 1/1.8-inch IMX017CQE sensor boasts 6.4-megapixels of resolution and the uncanny ability to "output this resolution at 60 frames per second (a data rate of around 384 megapixels per second)." In layman's terms, this chip has the ability to capture full motion video and grab high-quality stills without dropping a single frame, giving users a seamless transition between the two. Additionally, the 1/1.8-inch size and its ability to deliver 300 frames per second at lower resolutions moves it a bit further from the pack, not to mention the 12-bit A/D converter for each column. No word just yet on when these video-centric chips will hit Sony's CyberShot lineup, but it's an awful lot closer to reality than the last time we caught wind of it. [Warning: PDF read link][Via DPReview] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92983675/
      2007-02-19T18:24:00
      Is "3X DVD" HD DVD's secret weapon against Blu-ray?Filed under: HDTV While the Blu-ray camp is busy claiming victory, recently HD DVD supporters seem to be circling the wagons around an old friend, the -- 'til now -- unused 3X DVD technology. HD DVD has always claimed it holds a price advantage over Blu-ray, by way of offering low cost upgrades for existing DVD manufacturing processes. The 3X DVD spec takes that a step further, while it's a part of the HD DVD format and apparently only compatible with HD DVD players, the discs themselves are physically exactly the same as standard red-laser DVDs. Throw in a software upgrade to support high definition content, HD DVD's UDF 2.5 file structure and AACS and you have a way to deliver HDTV content on a 9.4 GB DVD. By using newer encoding technologies like MPEG-4 and VC-1 and/or lowering the resolution to say, 720p, full length movies easily fit on a standard DVD. Eclipse Data Technologies, a supplier of HD DVD mastering equipment just announced it is offering free upgrades to its customers in order to support 3X DVD manufacturing. This was followed today by DCA Inc. announcing it has mastered the first 3X DVD disc, and that several manufacturers are looking at it as a possible low cost path into HD video. 3X DVD's potential to allow for noticeably lower-priced HD content to come to market is definitely there, but it still remains to be seen if this, like combo DVD/HD DVDs and Total Hi-Def discs will find a home and support in the marketplace. Read - First 3X DVD-ROM Disc Cut with DCA Equipment Read - Eclipse Provides Free HD DVD Upgrade to Replication Facilities Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92975896/
      2007-02-19T17:54:00
      Leaders condemn India train blastIndia and Pakistan say a train bombing that killed at least 66 people will not disrupt their peace process.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6375749.stm
      2007-02-19T18:39:31
      Iran, Russia in nuclear plant rowTehran denies Russian claims it is late on payments for work on a nuclear reactor in southern Iran.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6375477.stm
      2007-02-19T18:33:05
      Colombian foreign minister quitsColombia's foreign minister resigns after the arrest of her brother on suspicion of links with paramilitary groups.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6376359.stm
      2007-02-19T18:39:55
      Five US troops die in Iraq raidsFive US soldiers die in two attacks in Iraq on a day violence claims more than 25 lives across the country.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6374909.stm
      2007-02-19T20:24:32
      Iran hangs man for attack on busIran executes a man over a bomb attack which killed 11 members of its elite Revolutionary Guards last week.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6377101.stm
      2007-02-19T20:15:50
      Flood aid struggle in MozambiqueMozambique says it has the use of only one UN helicopter to help thousands of people displaced by severe floods.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/6377427.stm
      2007-02-19T21:57:46
      Manhunt for train fire suspectsPolice in India issue sketches of two men they believe got off a train minutes before a deadly bomb attack.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6377471.stm
      2007-02-20T07:32:59
      Miami baby sets premature recordA baby believed to have spent the shortest time in her mother's womb is set to leave hospital in the US.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6377639.stm
      2007-02-20T08:14:18
      Nato troops raid Karadzic homesNato troops in Bosnia search the homes of the children of indicted war criminal Radovan Karadzic.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/europe/6377711.stm
      2007-02-20T08:19:29
      Cheney ready for US-Japan talksUS Vice-President Dick Cheney arrives in Tokyo to discuss regional security issues and Iraq.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/asia-pacific/6377649.stm
      2007-02-20T08:25:12
      LG's 17-inch W1PRO EXPRESS DUAL laptop packs DVB-T, VistaFiled under: LaptopsIf you've been eying a Vista-equipped laptop to treat yourself after all that chocolate you dutifully resisted last week, you might as well get a TV tuner built right in. LG Electronics' latest 17-inch behemoth packs a silver / black enclosure, integrated DVB-T tuner, and your choice of Intel Core 2 Duo processors to boot. Under the hood you'll find a WSXGA+ display, support for 5.1 Dolby Digital audio, dual 1.2-watt stereo speakers, ATI's Mobility Radeon X1600 graphics set, Bluetooth 2.0, WiFi, and of course, Windows Vista Home Premium pre-installed. While the W1PRO EXPRESS DUAL isn't exactly the lightest machine out there, it weighs in at a respectable 6.8-pounds and shouldn't make a half bad media-centric portable, but considering the nearly $2,600 pricetag LG has slapped on it, bargain hunters needn't look here long.[Via Gizmag] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93370051/
      2007-02-20T15:38:00
      GlobalTop intros GPS HUD Speed MeterFiled under: GPS, TransportationIt's practically a foregone conclusion that eying your handy GPS unit a bit too much whilst cruising down the freeway can indeed put you and your fellow motorists in peril, and while robotic turn-by-turn voiceovers do quell the staring fits somewhat, we still tend to rely a tad too much on sheer visuals. GlobalTop is hoping to make the roads a safer place to navigate with its forthcoming GPS HUD Speed Meter, which will supposedly makes its debut at CeBIT. This Bluetooth-enabled device purportedly "displays your speed and other navigational info, like direction, onto your car's windshield," and also enables handsfree communications with your BT-equipped cellphone. Moreover, the speed meter can be setup to alert the driver when exceeding a user-set limit, and while you may not be familiar with the brand, it's reportedly a spinoff of f-tech, which bodes fairly well for us actually seeing this thing beyond the Photoshop stage. As expected, there's no pricing or availability deets surfacing just yet, but all that should change come next month.[Via NaviGadget] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93355876/
      2007-02-20T15:08:00
      Cylo's 3style jog wheel / mouse spins it upFiled under: PeripheralsWhile we've seen more than a few folks get a little mod-happy when it comes to crafting their own mousing devices, Cylo Technology is offering up an apparently well thought-out device that should have audio / video editors going wild. If you feel more comfortable spinning a jog wheel than you ever have manually moving a cursor, the "three-dimensional" 3style mouse is right down your alley, as the hybrid input peripheral handles the typical X and Y axes as well as giving users the ability to scroll in any direction with a simple spin. Utilizing a ball bearing pad, the knob can spin freely with just a nudge, and can interpret Z-axis data as well as offering up right-click functionality by squeezing the edges. While some may envision faint similarities to the iMac's hockey puck mouse of days past, this rendition could probably last a bit more than 30 seconds before becoming destined for the trash bin. Nevertheless, the 3style mouse can be used wirelessly as well as in a wired form, and can purportedly work seamlessly with any application that supports a scroll wheel or jog dial, but we'll have to wait until this thing actually hits store shelves before testing out these bold claims ourselves. Click on through for a live demonstration.[Via HackedGadgets]Continue reading Cylo's 3style jog wheel / mouse spins it up Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93350237/
      2007-02-20T14:42:00
      Segway's RMP platform for nerdy robotsFiled under: Robots, TransportationWhat do you do when your overly hyped Human Transporter skids off the plateau of human interest only to be pummeled by archaic transportation laws? Why, start building mobility solutions for robots, of course. We've already seen a few lazy robots riding Segways around the lab; soon enough, we'll be seeing a lot more what with the Segway RMP (Robotic Mobility Platform) now launched in Japan. The RMP is meant to provide a quick and easy transportation underpinning for new domestic and military robots. RMPs range in price from 6,037,500 to 1,376,550 ($50,000 to about $11,500) and vary by maximum load, speed, size, max angle of climb, and battery capacity. Let the robot crusades begin! Via Robot Watch] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93336617/
      2007-02-20T14:12:00
      Century's Dolphin waterproof MP3 playerFiled under: Cellphones, Portable Audio + Wrap an MP3 player in a silicon tube held secure with cable-ties and what do you get? Well, if you're Japan's Century then you've got yourselves a waterproof MP3 player dubbed the Dolphin. Ok, the player does carry an IPX7 Ingress protection rating which means it really is waterproof (not just splash-proof) up to a depth of about 1 meter -- ideal for laps around the Coral Key Park Marine Preserve. Inside, the Dolphin packs 1GB of flash, USB 2.0, and support for MP3/WMA playback off 8-hour battery. Looks aside, at 12,800 (about $107) -- which includes a pair of unusually decent looking waterproof headphones -- it'll save you a healthy chunk-o-change compared to the $250 waterproof iPod shuffle we showed you last week. [Via Impress] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93336618/
      2007-02-20T13:52:00
      Sharp's AQUOS R-series of LCDs announcedFiled under: Displays, HDTV +Step aside AQOUS D-Series of LCDs, Sharp just unveiled their new flagship R-series of LCD panels for Japan. The new line-up ranges in size from 42- to 65-inches with each packing a 120Hz ASV LCD panel, 3x 1080p HDMI inputs, 1x DVI for that quick all-digital hook-up to your PC, and 2x Firewire for connecting your DV camera and one of Sharp's line-up of hi-def recorders including their new BD-HP1 Blu-ray recorder for on-the-quick dubbing. Just for kicks, Sharp also added their favorite new pet technology, IrSS (AKA, IrSimple) high-speed infrared for throwing up images from like-equipped cellphones and digital cameras. Of course, they also feature dual, integrated analog and digital tuners and 10/100Mbps Ethernet to access Japan's acTVila TV Internet service. The big, bad 65-inch LC-65RX1W (pictured above) mama of the bunch features a 450cd/m2 brightness, 3000:1 contrast ratio, 176-degree angle of visibility, while tipping the scales at 66kg (146-pounds) at just 9.6~12.4-cm (3.78~4.88-inches) thin. It's available March 10th in Japan for 1,000,000 or about $8,361. Expect the rest to hit no later than April with the 57-inch LC-57RX1W demanding 900,000 ($7,524), the 52-inch LC-52RX1W 650,000 ($5,434), the 46-inch LC-46RX1W 550,000 ($4,598), and the 42-inch LC-42RX1W 500,000 ($4,180). [Via Impress] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93330298/
      2007-02-20T13:22:00
      Sharp's BD-MPC70 Blu-ray theater in a boxFiled under: HDTV, Home Entertainment +We already caught their 2.1 channel home theater back at the CEDIA show in September. This time however, Sharp gets official with their new 7.1 Blu-ray in a box home theater kit. The BD-MPC70 pumps 175W across a full 7.1 channels of 8-ohm phallus with playback support for single-layer BD-R/RE media in addition to DVD video, DVD R/RW, DVD-RAM, music CDs, and CD-RW/-R discs. It delivers a 12bit/148.5MHz video DAC and 24bit/192kHz audio DAC with a healthy smattering of the ol' in and outs including 2x digital and 2x analog audio inputs and 1080p video output over HDMI. Available June 25th in Japan for 1,050,000 or about $8,779 whenever these come Stateside. [Via Impress] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93314228/
      2007-02-20T12:42:00
      Engadget Exclusive: Sony's 2007 Cybershot lineupFiled under: Digital Cameras + That's right, we've got 'em -- catalog shots for Sony's 2007 Cybershot line-up of digital cameras. Go ahead, check the new T20HDPR, T100, T20, H9, H7, G1 (pictured), W200, and W90 Cybershots -- you won't be sorry. All the new cams bring Sony's Super SteadyShot image stabilization and HD output to the show in addition to a hot mix of features spread out across the line; these include such notables as 802.11b/g WiFi with DLNA support, 2GB on-board memory for music playback, a 3-inch tilt-screen LCD, 3.5-inch (yes, 3.5-inch!) LCD, a couple of 15x optical zooms, face-detection technology, and BIONZ image processing -- good to know. Judging by the pics, we can expect a formal, pre-PMA show announcement from Sony on 27 February. Check the gallery below for all the details.Gallery: Engadget Exclusive: Sony's 2007 Cybershot lineup[Thanks, anonymous tipster] Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93308137/
      2007-02-20T12:07:00
      Woman plummets onto subway tracks while carelessly textingFiled under: Cellphones Granted, texting just might be bigger than Hollywood these days, but bigger than concern for one's own life? Apparently a Kawanishi woman was taking her well-being for granted during her daily route to work, as she collided with a man in a subway station whilst texting away at 8:30 in the morning. Subsequently, she plummeted a few feet down onto the subway tracks, only to be saved by a station worker who fearlessly hopped down to rescue her SMS-focused mind (and body, too) as the oncoming train screeched to a halt just 20 meters before running her over. Thankfully, the dame suffered just minor injuries in the fall, but an estimated 4,500 employees were blaming her for holding up their progress when clocking in late. Notably, there was no word on whether or not the phone was saved, or more importantly, whether or not the presumably urgent SMS ever got sent -- but considering this is the second case in a matter of days in which a human being nearly lost their life to a cellphone, we beg you: text responsibly, dear friends.[Via TokyoMango] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93274207/
      2007-02-20T10:27:00
      Iran defiant on nuclear programmeIran's president rejects calls to suspend uranium enrichment, a day before a UN deadline runs out.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6378289.stm
      2007-02-20T15:33:54
      Tobacco firm wins payout appealThe US supreme court throws out a ruling that Philip Morris must pay $79.5m to the widow of a dead smoker.
      http://news.bbc.co.uk/go/rss/-/1/hi/business/6379767.stm
      2007-02-20T15:48:25
      New footage of JFK's last momentsA previously unreleased film of John F Kennedy's motorcade shows new details of the final moments before his killing.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6378463.stm
      2007-02-20T11:04:18
      Heavy shelling in Somali capitalAt least 12 people are killed in the heaviest fighting in the Somali capital Mogadishu this year.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/6377941.stm
      2007-02-20T13:22:09
      Pakistan FM visits bomb survivorsPakistan's foreign minister, in India for peace talks, visits survivors of an attack on a cross-border train.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6379119.stm
      2007-02-20T14:41:38
      EU reaches emissions cuts dealEU environment ministers agree in principle to cut emissions by 20% by 2020, and seek a global 30% cut.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/europe/6377983.stm
      2007-02-20T13:45:47
      Most premature baby going homeA baby believed to have spent the shortest time in her mother's womb is set to leave hospital in the US.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6377639.stm
      2007-02-20T09:48:15
      Experts tackle the devil's tumourScientists meet to discuss ways of saving the Tasmanian devil, which is being ravaged by an unusual cancer.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/asia-pacific/6378279.stm
      2007-02-20T11:40:00
      Nato troops raid Karadzic homesNato troops in Bosnia search the homes of the children of indicted war criminal Radovan Karadzic.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/europe/6377711.stm
      2007-02-20T12:53:35
      Nigerian VP 'cannot be removed'A court rules President Olusegun Obasanjo cannot sack his deputy for joining an opposition party.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/6378625.stm
      2007-02-20T11:50:56
      Kenya's 'most wanted' shot deadPolice kill a man believed to be behind a string of murders and armed robberies in Nairobi.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/6378315.stm
      2007-02-20T11:09:37
      Salvador politicians found deadThe bodies of three politicians from El Salvador and their driver are found in a bullet-riddled car in Guatemala.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6378645.stm
      2007-02-20T11:48:56
      Philippines approves terror billThe Philippine Congress passes a controversial anti-terror bill aimed at tackling militants in the south.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/asia-pacific/6374875.stm
      2007-02-20T11:21:43
      Australia pulls plug on old bulbsAustralia plans to ditch traditional incandescent filament light bulbs in favour of a greener alternative.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/asia-pacific/6378161.stm
      2007-02-20T10:56:33
      Royal seeks to revive French bidFrance's Socialist candidate Segolene Royal tries to revive her presidential bid in a televised appearance.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/europe/6377503.stm
      2007-02-20T13:02:05
      Rape claim splits Iraq governmentAllegations Iraqi police raped a Sunni woman threaten to eclipse the government's new security drive in Baghdad.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6378821.stm
      2007-02-20T13:09:02
      US 'Iran attack plans' revealedUS contingency plans for possible air strikes on Iran include most of its military infrastructure, the BBC learns.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6376639.stm
      2007-02-20T10:28:34
      Gunman kills Pakistani ministerA Pakistani provincial government minister is shot dead as she prepares to address a political meeting.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6379169.stm
      2007-02-20T14:30:35
      Bird flu outbreak in Pakistan zooAn outbreak of the deadly H5N1 strain of bird flu kills four peacocks and a goose in an Islamabad zoo.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6378045.stm
      2007-02-20T09:34:56
      Canon EOS 40D rumors aboundFiled under: Digital CamerasIt all started with an EOS 40D splash page posted (and later pulled) from Canon's official Hong Kong web site. Now the 40D's specs are popping on digicam retail sites all over the Intertubes. Most interesting is the supposed spec sheet posted, pulled, and then extracted from a Belgian site by our tireless Engadget interns; here's what it says: 10.1 megapixel CMOS sensor measuring 22.5 x 15-mm, 5fps burst mode, integrated anti-dust cleaning system, 2.5-inch LCD, and sadly... DIGIC II (not III) image processing. It's that last bit of information which makes us a bit skeptical. Although the DIGIC II can be found in their full-frame 400D, the improved DIGIC III is already loosed thereby bringing the whole spec sheet into question. No worries, if Canon is ready to push the 40D out the door then it'll be soon. The big PMA show kicks off in just a few weeks. Now quit staring at that picture, it's not the 40D.[Via Digital Photography Blog] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93789980/
      2007-02-21T13:17:00
      Blackberry 8800 now on CingularFiled under: CellphonesStraighten your ties and button your suit jackets, RIM's promiscuous debutante -- the Blackberry 8800 -- is up and dancin' on on Cingular's website. $500 list, or $300 after $50 mail-in rebate and 2-year contract, the 8800 brings everything we expected: quad-band EDGE, GPS, microSD expansion, Bluetooth 2.0, push-to-talk support, and 5-hours talk / 24-days standby in a 0.55-inch device weighing just 4.73-ounces. 3G data? No. WiFi? Not this time. For that we'll have to hold tight for the anticipated mid-year launch of the 8820. [Thanks, President and everyone who sent this in] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93789982/
      2007-02-21T12:47:00
      Ubixon's Lubix Bluetooth stereo headsets: the magnets make the magicFiled under: Portable Audio +Here's an interesting twist to the Bluetooth headset from Ubixon -- the UBHS-LC1-3D and UBHS-NC1-3D. These Lubix headsets consist of two, magnetically held halves which can be separated and bunged into the ears or slung around the neck, connected for easy toting. They both simulated 3D sound and Bluetooth 2.0 with support for the A2DP, AVRCP, HSP, and HFP profiles. In other words, they support stereo Bluetooth audio while allowing you to control your like-profiled audio device from up to 10-meters away. They'll even work seamlessly (as seamless as Bluetooth gets anyway) with your cellphone although the LC1 does it a bit better (and bulkier) by flashing the caller's ID on that one-line LCD screen. The 28-gram LC1 delivers 10 hours of talk or 9 hours of music while the NC1 goes 6-hours or 5-hours in a lighter, 22-gram package. The LC1 hits Korea for 79,000KRW ($84) while the NC1 slips in at about 59,000KRW ($63). [Via AVING] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93781795/
      2007-02-21T11:47:00
      Cellphone-packing smoke detector dials for dangerFiled under: Cellphones, Misc. GadgetsWhile most smoke detectors will handle the basic job of detecting smoke just fine (providing you check that batt regularly), there's plenty of options out there for those wanting a little something extra, be it added style or additional functionality. Joining those other over-achieving smoke detectors is this new unit from Japanese manufacturer Keisoku Giken, which will automatically phone you at the first whiff of smoke to inform you of its impending demise. Unfortunately, you'll have to supply your own cellphone and service for it (it doesn't appear to support landlines), which makes the device's already hefty 16,800 yen price tag (about $140) even less of a bargain.[Via Textually.org] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93743515/
      2007-02-21T09:24:00
      TDK's Xa-10 mini flat panel speakersFiled under: Peripherals, Portable Audio +TDK just slipped NXT's crazy-thin SoundVu technology into your pocket. That's right, the 80 117 x 16-mm (3.15 x 4.6 x 0.63-inch) Xa-10 flat panel speaker brings a 1.2W x 2ch waft of breathy bass you might otherwise choose not to float from your trou. The speakers will accept USB power (or batteries) and a mini-stereo input when they hit Japan in March for just 2,980 or about $25. [Via Impress] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93727030/
      2007-02-21T08:02:00
      Lexar intros 300x UDMA CompactFlash cards, readersFiled under: Digital Cameras, StorageLexar has already given its SDHC cards a boost this year, and the company doesn't seem to be wasting any time bringing its CompactFlash offerings up to speed as well, today introducing a series of new 300x UDMA CompactFlash cards, as well as a pair of card readers to go along with 'em. Available in 2, 4, and 8GB varities, the cards are said to be 125% faster than the company's current CompactFlash cards, delivering a sustained write time of 45MB per second. To hit that top speed, however, you'll need to use them with a UDMA-enabled device, which are currently a rare breed, although Lexar says it expects "several" UDMA-enabled digital cameras to be announced later this year. In addition those mystery cameras, you'll also be able to get the most out of the cards using one of the two UDMA card readers Lexar's set to release this spring, available in your choice of FireWire or USB 2.0 models for $80 and $50 respectively. The cards themselves should also be released about the same time, although Lexar doesn't seem willing to spill the details on how much they're gonna cost just yet.Read - Photography Blog, Lexar Professional UDMA 300x Memory CardsRead - Photography Blog, Lexar UDMA Card Readers Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93699645/
      2007-02-21T06:31:00
      Fon wants you to help steal business from Starbucks and T-MobileFiled under: Wireless, Networking +Oh tricky, sneaky Fon. Fresh off their 10,000 Fonero giveaway, they're stepping up the ante with how they give away their loss-leader routers. Their newest campaign is sure to strike a chord with armchair entrepreneurs and Adbusters fans alike: if you live within the immediate vicinity of a Starbucks (read: WiFi range), Fon would like to send you one of their Foneros. Why? Because, if you recall, when you allow users to connect with your internet connection over your Fonero, Fon splits the profit with you -- $1 for every user (who pays $2 to use your connection). So for every $10 T-Mobile / Starbucks WiFi user you swipe, Fon gives you a buck; now, granted this still isn't a scheme for those paranoid about home network security, bandwidth usage, or nefarious hax0rs type with a spoofed MAC and a keen eye for easy hotspot access, but who knows, for those near Starbucks (yes, they'll be checking against known locations) it might even be worth it to buy a budget DSL line just to profit with Fon. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93662859/
      2007-02-21T05:01:00
      Vonage to become Vonage Wireless?Filed under: Cellphones, WirelessVoIP provider Vonage has already cut a deal with EarthLink to resell WiFi, presumably to go along with some sort of WiFi phone service, but could they have something way crazier (and more costly) on tap? BusinessWeek speculates that Vonage might be getting into the cellular game by launching an MVNO (Mobile Virtual Network Operator). It's not hard to imagine them offering something similar to T-Mobile's HotSpot @Home service, which lets you use a WiFi-enabled cellphone to make VoIP calls over WiFi and and then seamlessly switch over to cellular networks whenever you're outside WiFi range. The problem is that launching an MVNO is no small undertaking. ESPN shuttered MobileESPN last year after failing to attract more than a handful of subscribers, and Amp'd and Helio have spent hundreds of millions of dollars to carve out a slice of what is an incredibly competitive wireless market (Apple was working on an MVNO to accompany the launch of the iPhone, but scrapped the whole thing once it became obvious how difficult it would be to gain marketshare). Could they do it? Maybe, but not without spending a TON of money, which is why it's more likely that they'll introduce a more modest Voice over WiFi service.[Via GigaOm] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93658206/
      2007-02-21T04:25:00
      Desktop Digital Photo Cube shows photos on diminutive LCDFiled under: Displays, Misc. Gadgets +Here's one from the same folks who brought you the USB Sound Flash Drive, and while eNECESSITIES' Desktop Digital Photo Cube may not adorn your wall as fashionably as a digiframe might, this piece is made for conversation. Ready to perch atop your living room table or office desk, the cube sports a squint-inducing 1- x 1-inch color LCD display, power / brightness / skip buttons, USB 2.0 connectivity, and the ability to internally store "up to 30 digital photos" for cycling through on the built-in screen. Additionally, the "mood light" should set the tone for the upcoming photo, and those looking for the ultimate party favor can toss their own logo on here for an additional charge. Unfortunately, we're not quite sure just how this snapshot showin' block gets its juice, but those looking to snag 25 or more (sorry, non-bulk customers) can find out for themselves at $51.34 a pop.[Via Everything USB] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93640955/
      2007-02-21T03:42:00
      IEEE pushing 802.16m WiMAX to 1Gbps, hopes to converge with 4GFiled under: Cellphones, WirelessIf there's one thing that we'll never be satisfied with, it's finding out just how many nanoseconds we can shave off our download times from year to year, and thankfully, the IEEE seems to get that. While it has certainly taken its sweet time with 802.11n, the task force has already voted to make 100G the next Ethernet speed, and now it's pushing to make WiMAX implementations even quicker. Reportedly announced at 3GSM, the IEEE has began working on a new version of the 802.16 standard, dubbed 802.16m, which "could push data transfer speeds up to 1Gbps while maintaining backwards compatibility with existing WiMAX radios." Potentially more interesting than cheering for speed boosts is the group's outright assurance that this protocol will meet the ITU's requirements for 4G, insinuating that it should be the token choice for further 4G developments. Nevertheless, the increased bandwidth is supposedly needed due to convergence between VoIP and various forms of multimedia (IPTV, streaming video, digital downloads, etc.), and however true that may be, some skeptics are still understandably doubting the whole "backwards compatibility" aspect. Still, the IEEE hopes to have this together by "the end of 2009," but considering the team's less-than-stellar track record in the deadline department, we're not holding our collective breath.[Via DailyWireless] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93621068/
      2007-02-21T02:42:00
      GPS-enabled wind chimes sound off while geo-trackingFiled under: GPS +If you think the Dandellas were outlandish uses of GPS technology, here's one that comes mighty close to one-upping even those. The GPS-enabled wind chimes have DIY written all over them, and while the chimes themselves where purchased (after a failed attempt at creating his own, notably), basically everything else that makes the system tick was homegrown. Utilizing Mologogo, servos, circuit boards, and a good bit of coding, the GPS chimes emit their music whenever the tracked individual's cellphone moves in a user-selected path, essentially acting as an alert that someone's headed to their domicile. Of course, the actual options here are a tad limited (albeit very intriguing), but the foundation of the project could indeed be used for a much broader geo-tracking scenario. Regardless, we know there are folks out there eager to give this a whirl, and thankfully for you, everything you need to know (including the oh-so-critical code) is just a Read link away.[Via MAKE] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93596281/
      2007-02-21T01:42:00
      Sigma finally cops to a release date for its SD14 DSLRFiled under: Digital Cameras +Well it'll have been over six months between the time we first heard about it and when it actually hits store shelves, but we finally have a solid release date for the somewhat-anticipated, Foveon-packing Sigma SD14 DSLR. If it's possible for you to remember back that far, you may recall that Sigma attempted to drum up some interest in this 14 megapixel shooter with a teaser campaign in late August of last year, just before it was officially announced at Photokina 2006. The disappointment came a few months later when Sigma pushed back the SD14's street launch to March, citing some hardware issue that the company wouldn't disclose. And according to a press release on Sigma's website, the problem has indeed been addressed, with the camera scheduled to ship starting on the 6th of next month. Keep in mind, though, that this model isn't for the thrifty -- it's gonna cost you over $2,000 to get in on this action. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93572592/
      2007-02-21T00:42:00
      Quantum strikes again, charging iPhone touchscreen infringementFiled under: Cellphones, DisplaysIt's not just Apple's ubiquitous click-wheel that Quantum Research is bothering Apple about these days, Quantum is also fussing about the iPhone's touchscreen technology. "We will be looking very carefully at the iPhone," says Duncan Bryan, licensing director at QR. And wouldn't you know: "The description of the iPhone suggests it uses a rear-surface touch screen, and has proximity sensing which can tell if it is held to the ear. That's a QR capability." No formal lawsuit has been filed yet, but based on Apple's complete denial and counterclaims of QR's December 2005 click-wheel allegations, we're guessing it won't be backing down on this one anytime soon. Apparently this "charge transfer capacitive sensing" stuff has been licensed to Motorola and was invented by QR's founder and CEO Hal Philipp. Usually we'd be content to sit back and watch, but all these Apple-related lawsuits and copycats are getting a little tried -- remember those good old fashioned RIM / NTP days?[Via AppleInsider] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93553936/
      2007-02-20T23:42:00
      Motion Computing unveils RFID-reading C5 medical tablet PCFiled under: Tablet PCs, WirelessAlthough we sincerely hope your only encounter with a clinical assistant tablet PC comes by way of your occupation, it looks like Motion Computing is busting out a medically-focused device to help the dear LPNs keep things in order for the high-falutin' doctors. The C5 touts a vertically centered design, top-mounted carry handle, handwriting recognition, built-in digital camera for documenting wounds, time-stamp / voice-tag capabilities, and even an optional RFID reader to easily check patients in by scanning their wrist straps. Claiming to be the world's first device in the new mobile clinical assistant (MCA) category of PCs, it packs a 1.2GHz Intel Core Solo U1400 processor, Windows Vista Business or Windows XP Tablet PC Edition, a 10.4-inch XGA touchscreen, up to 1.5GB of DDR2 RAM, 30 / 60GB 1.8-inch hard drive options, 802.11a/b/g, Bluetooth, and a rechargeable Li-ion to boot. Furthermore, it weighs in at just 3.1-pounds, so toting this bad boy around the office shouldn't be too much of a burden, and the "durable, semi-sealed enclosure" shouldn't have any issues handling the daily mishaps of your average doctor's lounge. So if you've been looking for a way to digitize your office and get far, far away from those paper-filled drawers, we're sure your IT rep will be hitting you up soon to sneak a peek at this $2,199 tablet.[Via GottaBeMobile] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93548878/
      2007-02-20T23:08:00
      Prober P360 GPS / PMP handheld does it allFiled under: GPS +These fanciful all-in-one devices just don't seem to come Europe or North America's way very often, and unfortunately for most, Prober's P360 doesn't seem to be breaking that mold anytime soon. Packing a respectable mix of multimedia and GPS capabilities, this pocket-friendly device packs a 3.5-inch touchscreen display, 400MHz Samsung S3C2440A processor, 64MB of NAND Flash ROM, 64MB of SDRAM, WinCE 4.2 runnin' the show, a SiRF Star III chipset, and a built-in speaker to boot. Furthermore, you'll find a dual-mode map for wrapping your brain around POI locations, voice guidance, a rechargeable five-hour Li-ion battery, SD card slot, USB 1.1, wired remote / headphones, audio out, and the ability to play back WMV, WMA, and WAV files on the AV front, while handling a bevy of snapshot formats and even boasting a text viewer. Unfortunately, we've no idea how much the P360 will run folks who are lucky enough to acquire it in four to six weeks, but just know that most of the world will probably envy you.[Via NaviGadget] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93531504/
      2007-02-20T22:38:00
      Shredz64 project bringing Guitar Hero to the Commodore 64Filed under: Gaming We've already seen the Guitar Hero controller hooked up to a PC, but hardware hacker Toni has decided up the difficultly level even further, endeavoring to wire the ubiquitous plastic axe to his Commodore 64, complete with an all new "Guitar Hero-like" C64 game. While he's still quite a ways from fully realizing that goal, as the pic above and audio clip on the page linked below show, he is making considerable progress, with all of the guitar's buttons working, although the whammy bar, sadly, remains silent. Unfortunately, it's also been over a month since the last update on the project, so we can only hope that he hasn't given up on it -- there's undoubtedly countless C64s just waiting to be dusted off as soon as the DIY guide is ready.[Thanks, Joseph S] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93511887/
      2007-02-20T22:08:00
      Thrustmaster unveils bevy of Wiimote accessoriesFiled under: Gaming +If you can't penetrate the market early, you might as well arrive fashionably late with a tempting pricetag, right?. Apparently, Thrustmaster's trying to do just that with its latest barrage of Wiimote accessories, as the firm's charging (and non-charging) docking stations arrive a few months after JoyTech and Nyko's renditions, and the Wiimote sleeves are almost an afterthought at this point. Nevertheless, the T-Charge NW comes in black or white finishes, charges two AA cells via USB (four included), sports a blue status LED, and of course, neatly holds your dear Wiimote / nunchuck combo. The T-Care NW removes the charging functionality, but still manages to include a set of silicone protector sleeves for one Wiimote / nunchuck tandem, and if you're already set in the dock department, the controller covers are available all by their lonesome as well. Thrustmaster's lineup seems to hit all the main areas of concern, including price, as a set of sleeves will run you $9.99 while the T-Care NW and T-Charge NW demand $14.99 and $24.99, respectively. So if you're intrigued about these budget-friendly offerings and just adore high-resolution shots, head on over to Joystiq for a gallery of photos while you wait for these to land in April.[Via Joystiq] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93508830/
      2007-02-20T21:38:00
      Sony Cybershot G1 digital camera detailedFiled under: Digital CamerasThat batch of new Sony Cybershots let loose this morning was quite a bit to digest all at once, so we thought we'd take a minute to go over one of the more interesting of the still-to-be-officially-announced cameras in greater detail, namely, the Cybershot G1. Apart from that new (for Sony) model name, the camera's particularly notable for its big 3.5-inch (or possibly 3-inch) LCD and uncommonly spacious 2GB of internal memory. Though less unusual, the camera's other specs are also nothing to sneeze at, with a decent 6 megapixel resolution, 3x optical zoom, Carl Zeiss Vario-Tesar lens, built-in WiFi, and Sony's usual SteadyShot and Anti-Blur features. Still not clear, unfortunately, is the price, although as we mentioned earlier, that should be revealed by the end of the month. Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93489405/
      2007-02-20T21:08:00
      Magellan preps Maestro 4000, 4040, and 4050 GPS units for releaseFiled under: GPS +Magellan's been known to toss out GPS units three at a time before, and while the company hasn't come forward yet about its presumably forthcoming trio of navigation devices, we've got the skinny anyway. All three Maestro units will sport a 4.3-inch WQVGA touchscreen display, SiRF Star III chipset, and an in-car mounting kit, but the similarities basically end there. On the low-end, you'll find NAVTEQ maps for the 48 contiguous United States, QuickSpell, 1.6 million POIs, and a rechargeable battery with around three hours of juice. The 4040 steps it up by adding more detailed map coverage, 4.5 million POIs, text-to-speech / Bluetooth capabilities, and by playing nice with the real-time traffic add-on service. The flagship unit boasts all the capabilities of its lesser siblings, but also adds traffic functions right out of the box as well as voice recognition software. The Maestro 4000 / 4040 are each slated to land in "early April" for $449.99 / $599.99, respectively, while the high-end 4050 will demand a somewhat steep $799.99 for its niceties when it arrives in May.Read - Magellan Maestro 4000Read - Magellan Maestro 4040Read - Magellan Maestro 4050[Via GPSGazette] Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93486827/
      2007-02-20T20:38:00
      AMD's new consumer flagship proc, the X2 6000+Filed under: Desktops +The 90nm Athlon 64 X2 processor line looks close to its last breath with the X2 6000+, a 3GHz monstrosity designed as a consumer equivalent to the FX-74. The 6000+ is limited to single processor systems, none of those quad-core frivolities the FX-74 is known to partake in, but the chip can still suck down a maximum of 125 watts, and carries 1MB of L2 cache per core. Where the 6000+ processor really departs from its enthusiast sibling is the $464 pricetag, less than half the cost of a FX-74. The chip is a few months late -- it was slated for Q4 2006 originally -- and will be followed by an 89 watt version in the third quarter of this year, along with a slightly less beefy 5800+ edition, but then its quitsville for AMD's 90nm creations. 65nm here we come! Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93476480/
      2007-02-20T20:08:00
      ACCS GRAViTONUS gives quadriplegics tongue-controlled computer interfaceFiled under: Desktops, Misc. Gadgets +While other forms of alternative computing are certainly available, yet another group of researchers are touting their own rendition as a radical new way for quadriplegics to engage in computerized learning and entertainment. Dubbed the Alternative Computer Control System (ACCS) GRAViTONUS, the proposed hands-free system would enable folks who have suffered spinal cord injuries or other forms of paralysis to dictate basic computer functions entirely with their tongue. The prototype looks to be quite non-invasive, and when worn around one's head, can enable users to mouse around and navigate within applications by way of a precise tongue-controllable interface. Interestingly, it's even stated that the device won't hinder one's ability to drink, speak, or breathe, but we assume you'd have to give the mouthpiece a good washing after every use to avoid bacterial buildup. Nevertheless, the ACCS GRAViTONUS backers are now scouting VCs who'd like to get this creation to market, so if you've been looking for something intriguing to get wrapped up in, give these blokes a ring. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93458983/
      2007-02-20T19:38:00
      Hello Kitty embraces warming blankets, gets fired up via USBFiled under: Misc. Gadgets +If you think we were baffled after seeing Hello Kitty USB foot warmers, you probably can't imagine the speechlessness we all feel when seeing the USB-powered lap warmer. Considering that anyone who would actually toss out their hard-earned dollars on feline feet heaters would likely not have the will power to resist this mat, it's fairly to say to say that this is a must-have for hardcore fans braving the tail end of winter. No word on just how large this thing is, nor if poses any eruption capabilities like one of its siblings (clones?), but judging by the mat-to-USB-connector ratio, this kitty ought to warmly cover a litter or two at least. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93453293/
      2007-02-20T19:08:00
      Graffiti Research Lab's L.A.S.E.R. TagFiled under: Displays + Lessee here, we've got lasers, creative input devices, a "stick it to The Man" aesthetic and a Mooninite -- sounds like a successful night of hacking to us. Graffiti Research Lab and friends hacked together a high powered projector with some computer components and a camera to track the writings of a 60mW Green Laser on the side of a building in Rotterdam and project it as blue graffiti. The resulting art looks surprisingly good, and the perpetrators were kind enough to document the event, along with providing instructions for doing up your own version. It's hard to describe, so we recommend peeping the video after the break, or the better quality vids and pics over at the read link.[Thanks, Teferri]Continue reading Graffiti Research Lab's L.A.S.E.R. Tag Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93438390/
      2007-02-20T18:42:00
      Australia to phase out incandescent bulbs by 2010Filed under: HouseholdWhile some US cities like Raleigh are already planning steps to cut back on energy wastes by converting to more efficient lighting systems, it looks like the entire continent of Australia could be following suit. Claiming to be the "world's first" national government to phase out incandescent light bulbs in favor of the more "fuel-efficient, compact fluorescent bulb," environment minister Malcolm Turnbull is hoping to "cut Australia's greenhouse gas emissions by four million metric tonnes a year by 2015." Citing the "climate changes" the world is facing as a "global challenge," Turnbell also urged other nations to follow suit in making a difference, but didn't exactly open up his personal wallet to stock our households with those uber-pricey bulbs. Interestingly, some environmentalists feel that the bulk of greenhouse gas emissions come from government and business-related activities, which should presumably take priority over swapping out a country's light bulbs. Still, we've got no complaints with hooking homes up with LED / fluorescent options to help Mother Earth, but shouldn't Australia (and America, too) ink its name on the Kyoto Protocol before getting all high and mighty about saving the planet? Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93432534/
      2007-02-20T18:08:00
      Palm makes Treo 700wx official for VerizonFiled under: Cellphones, Handhelds +Palm and Verizon have made official today what we've known now for a while (as have Sprint and Alltel): 32MB of RAM in a Windows Mobile 5 device just doesn't really cut it. The Treo 700wx rights the 700w's wrongs with an extra 32MB of memory for a grand total of 64MB; otherwise, though, the device is all but identical to its older sibling, with Windows Mobile 6 sadly nowhere in sight. Get it now while it's hot at Verizon stores or online for a stiff $399 on 2-year contract after $100 rebate. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93414274/
      2007-02-20T17:40:00
      Powered bumpers defend your smart car when all else failsFiled under: Robots, Transportation +Smart cars are all well and good until you start to think of the horrible consequences if something should go wrong. Honestly, we're willing to take that risk just for the rewards of cruising along in a robotic car "platoon": saving gas, skipping traffic and perhaps getting in a bit of Gears of War while we're at it. Luckily, more judicious minds than ours are hard at work at the problem, and just might've discovered a way to keep smart car-filled roads from becoming riddled with the bodies of overly-optimistic bloggers. Alasdair Renfrew of Manchester University, UK, along with a couple of colleagues, has devised an extendable fender that can keep you safe and humming along the freeway, even when traditional wireless communications fail. The smart cars will traditionally be communicating with each other and roadside beacons wirelessly, and if one of those elements breaks down, the cars bust out powered bumpers to feel the car in front and navigate accordingly. That way, as long as the front car of a pack keeps to the speed limit and in its lane, the group should be fine -- and your Xbox session needn't be interrupted. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93410533/
      2007-02-20T17:08:00
      GoogleFi gives 360 addicts Xbox Live on the goFiled under: Gaming, Transportation, Wireless + Obviously, quite a few possibilities open up when your whole town is wired for WiFi, but we can't say we really pegged drive-by 360 play as one of them. Mountain View, CA residents Brandon Wirtz and Jake Ludington fixed up Brandon's Jeep with 23-inch Samsung LCD and an Xbox connected to Google WiFi via Jake's laptop. The total cost of wire-free 360 action is about $4000 if starting from scratch, but isn't that a small price to pay for the freedom to frag?[Via BBC News] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93394047/
      2007-02-20T16:38:00
      Cingular's BlackBerry 8800 unboxedFiled under: Cellphones +He got us those original BlackBerry 8800 shots, so we're guessing these unboxing pics of the phone here were no sweat for Boy Genius. We still can't claim to be crazy about the device, which launched last week, but we're sure plenty of suits will be glad to replace their aging CrackBerries with this fancy new QWERTY version. As a side note -- could Cingular's boxes be any more boring? Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93388948/
      2007-02-20T16:08:00
      Blair announces Iraq troops cutTony Blair says he hopes to cut the number of UK troops in Iraq from 7,100 to 5,000 within months.
      http://news.bbc.co.uk/go/rss/-/1/hi/uk_politics/6380933.stm
      2007-02-21T13:15:15
      Tehran dismisses threat of forceIran's top nuclear negotiator dismisses threats of force against it, as the UN prepares to make a crucial report.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6380879.stm
      2007-02-21T02:38:26
      Zimbabwe's police ban protestsZimbabwe police ban protests as Robert Mugabe marks his 83rd birthday by vowing to stay on as president.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/6382405.stm
      2007-02-21T11:35:20
      S Asia rivals sign nuclear pactIndia and Pakistan sign an agreement to reduce the risk of accidental nuclear conflict in the region.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6381261.stm
      2007-02-21T11:54:32
      Iraq PM sacks 'rape case' criticIraq's prime minister moves to put an end to disquiet about an alleged rape of a Sunni women by police.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6382119.stm
      2007-02-21T13:01:17
      Maoists walk out of Nepal campHundreds of former Maoist rebels walk out of a holding camp in Nepal, complaining of poor conditions.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6382093.stm
      2007-02-21T12:16:21
      Philippines army is 'in denial'A UN envoy says the Philippines army is in "almost total denial" about a wave of extra-judicial killings.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/asia-pacific/6381291.stm
      2007-02-21T05:15:15
      Stars raise $1.3m for ObamaCelebrities donate $1.3m to Democrat Barack Obama's presidential campaign at a lavish Beverly Hills fund-raiser.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6381375.stm
      2007-02-21T07:55:03
      Britney Spears 'back into rehab'Pop star Britney Spears is back in rehab, days after shaving her head, US media reports say.
      http://news.bbc.co.uk/go/rss/-/1/hi/entertainment/6380827.stm
      2007-02-21T09:02:53
      Football: Lille 0-1 Man UtdRyan Giggs' controversial late winner for Man Utd almost sparks a Champions League walk-out by Lille.
      http://news.bbc.co.uk/go/rss/-/sport1/hi/football/europe/6371329.stm
      2007-02-20T21:38:44
      UN backs peace force for SomaliaThe UN Security Council approves the deployment of an African peacekeeping force to tackle unrest in Somalia.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/6381189.stm
      2007-02-21T08:39:08
      Big Anglo American profits jumpMining giant Anglo American is to return $3bn to shareholders after reporting a 46% rise in annual profits.
      http://news.bbc.co.uk/go/rss/-/1/hi/business/6381739.stm
      2007-02-21T09:36:52
      US probes troops' neglect claimsThe US says it is reviewing the way its wounded soldiers are cared for at hospitals, after critical media reports.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6381453.stm
      2007-02-21T09:17:06
      No end to deadly Bolivian floodsUp to 340,000 people have been affected by continuing flooding in Bolivia, which has left 35 people dead.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6380331.stm
      2007-02-20T18:25:36
      Japan ups interest rates to 0.5%Japan's central bank shows signs of confidence in the country's economy, raising interest rates to 0.5%.
      http://news.bbc.co.uk/go/rss/-/1/hi/business/6381335.stm
      2007-02-21T08:07:26
      Prison demand for Poso suspectsIndonesia prosecutors seek 20 year jail terms for three men accused of beheading Christian schoolgirls.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/asia-pacific/6381511.stm
      2007-02-21T08:40:06
      Denmark to pull troops from IraqDenmark will withdraw its troops from Iraq by August, Danish Prime Minister Anders Fogh Rasmussen says.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6382675.stm
      2007-02-21T13:07:30
      Leaders discuss UN's Kosovo planSerbian and ethnic Albanian leaders are holding final talks in Vienna on the UN plan for Kosovo's future.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/europe/6380565.stm
      2007-02-21T11:48:45
      Iran 'swiftly seeks nuclear goal'Iran's president says he wants nuclear power as soon as possible, as critics in Iran urge him to accept UN demands.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6381477.stm
      2007-02-21T12:10:51
      Militant dies in Israeli ambushIsraeli undercover agents kill a commander of the militant Islamic Jihad group in the northern West Bank.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6381653.stm
      2007-02-21T08:49:42
      India eyes Scotch takeoverAn Indian businessman is set to complete a deal to buy Scottish whisky firm Whyte and Mackay for ?550m.
      http://news.bbc.co.uk/go/rss/-/1/hi/business/6381339.stm
      2007-02-21T13:04:47
      India boat capsize bodies foundRescue workers recover bodies of 15 children and three men from a school trip boat accident in India.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6381289.stm
      2007-02-21T04:57:46
      Blair announces Iraq troops cutTony Blair says he hopes to cut the number of UK troops in Iraq from 7,100 to 5,000 within months.
      http://news.bbc.co.uk/go/rss/-/1/hi/uk_politics/6380933.stm
      2007-02-21T13:44:46
      Fear as cyclone nears MozambiqueMozambique is on the highest level of alert as a cyclone with winds of up to 175km/h approaches.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/6383675.stm
      2007-02-21T17:06:58
      Italian PM faces coalition crisisItaly's Romano Prodi calls a special cabinet session after his fragile coalition loses a key foreign policy vote.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/6383051.stm
      2007-02-21T17:22:45
      Fujifilm's FinePix S5700Filed under: Digital Cameras + Another hot off the pre-PMA presses, Fujifilm's got their new FinePix S5600 followup ready to go, the S5700. It's got a 10x zoom, 7.1 megapixel sensor, 2.5-inch display, 1600 ISO setting, image stabilization, 27MB internal memory, and, you're not going to believe this, xD and SD support. Unfortunately it uses four AA cells instead of a nice Li-ion battery. No price just yet, but the black model lands (somewhere) at the end of March, with the silver following in April.Gallery: Fujifilm's FinePix S5700 Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94150403/
      2007-02-22T06:14:00
      Fujifilm's FinePix A820 and A900 for consumersFiled under: Digital Cameras + Just like Canon's new PMA-bound A Series cameras, Fujifilm's new A820 and A900 cameras don't really break a lot of new ground, but there sure is a lot more megapixel bang-for-buck going on here. For $180 and $200, respectively, the A820 brings 8 megapixels and the A900 goes for 9, while both camera have 4x zooms and 2.5-inch LCDs. Unfortunately, there doesn't seem to be any form of optical image stabilisation here, nor any of those much-hyped Face Recognition AF/AE features we've been seeing in other PMA offerings, but if all you're looking for is pixels and lots of 'em, you can't go far wrong with this pair of FinePix, which will be hitting shelves in March. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94137650/
      2007-02-22T05:46:00
      Canon's new PowerShot A570 and A560Filed under: Digital Cameras + Canon sure likes to yuk it up with the "A Series" puns. "A" for affordable, for the AA batteries you can stick in these things, for the "A" Team the cameras represent -- it's a real riot. Luckily, "affordable" doesn't have to mean "boring" anymore, and these two PowerShots include fancy 4x zooms, 7.1 megapixel CCDs, 2.5-inch LCDs and that DIGIC III processor for speedier operation, along with 1600 ISO and Face Detection. Sound familiar? You can have it all for a few more bucks, 1x less zoom and quite a bit more pocketability in the Digital ELPH series. What the A570 adds that the A560 and those ELPH cousins lack is optical image stabilisation. You can pick one up for $280, or if you don't mind the blur, grab an A560 for $230. Both will be out in March.Gallery: Canon's new PowerShot A570 and A560 Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94115873/
      2007-02-22T04:43:00
      Canon's compact PowerShot TX1 captures 7.1 megapixel stills and HD videoFiled under: Digital Cameras + Watch out, Sanyo, because your diminutive HD2 camcorder is about to face some very daunting competition from Canon. Like the recently announced Sanyo, the PowerShot TX1 packs a 7.1 megapixel CCD into a tiny little package capable of capturing 720p HD video as well -- but unlike the $700 HD2, Canon is hanging just a $500 pricetag on this model. Besides its one-two punch of high resolution stills and videos, this device offers a 10x optical zoom (with an optically-stabilized lens), a 115,000 pixel LCD, and ISO settings ranging from 80 to 1600. You're also getting the latest Digic image processor, advanced face detection and red eye reduction, Vista-compatibility, 14 shooting modes, and a so-called "Intelligent Orientation Sensor" to keep the display looking right no matter how you're holding the cam. No word so far on a release date, but with all this functionality at a very attractive price, you can probably expect the TX1 to fly off shelves when it finally makes its debut.Gallery: Canon's compact PowerShot TX1 captures 7.1 megapixel stills and HD video Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94113961/
      2007-02-22T04:25:00
      Canon debuts SD750 and SD1000 Digital ELPH camerasFiled under: Digital Cameras + Two new compact and fashionable PowerShot Digital ELPHs from big C, the SD750 and SD1000. Canon seems to be mostly focused on the looks here: we've never seen a growed-up digicam manufacturer be so proud of "Dynamic Dual-Tone Elegance," but there's decent stuff under the hood. Like most of the PMA-bound cameras we've spotted, these include Face Detection-based auto focus, auto exposure and red-eye correction. There's also the DIGIC III Image processor, and ISO as high as 1600, but everybody comes for the basics: 3x zoom, 7.1 megapixel CCD and a 2.5-inch LCD in each shooter. The $300 SD750 gets a bit fancy on form factor, but manages to be a mere 0.75-inches thick, while the 4.5 ounce SD1000 keeps the the classic ELPH look and also retails for $300. Both should be out in March, and include 32MB SD cards for good luck, though no mention is made of SDHC. Remember, it's fashion first for this line.Gallery: Canon debuts SD750 and SD1000 Digital ELPH cameras Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94113962/
      2007-02-22T04:23:00
      Canon's EOS-1D Mark III DSLR with live LCDFiled under: Digital Cameras + Canon's latest pro DSLR is officially here as of tonight: welcome the EOS-1D Mark III. This 10.1 megapixel shooter can fire 10fps in bursts of up to 110 large JPEGs or 30 RAW files with is dual DIGIC III processor. It also features a really friggin light sensitive APS-H size 28.1 x 18.7mm CMOS sensor with ISO modes up to 3200 (it's also got a "highly usable" just-in-case 6400 mode sure to kill image quality), but the real winner here is the 3-inch live LCD (with 5 and 10x magnification for locking that zoom). There's also a new WFT- E2A Wireless File Transmitter option for dumping to external storage and even GPS geotagging, the OSK-E3 Original Data Security Kit for file encryption and verification (if your images are just that valuable), the Speedlite 580EX II flash, and EF 16-35mm f/2.8L II USM lens. We don't yet have word on price or release date, but you know what they say about having to ask.Gallery: Canon's EOS-1D Mark III DSLR with live LCD Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94110286/
      2007-02-22T04:16:00
      S1Digital's impressive new lineup of Media CentersFiled under: Home Entertainment, Media PCsMedia Centers are so in now and that you have to really do something to make your black box stand out, and S1Digital's new lineup of media centers and servers does just that. Actually there are two series, the ProLine for professional installers and home automation companies and the Home Series for the rest of us. The Home Series includes the Platinum, Gold and Mighty editions, all running Core 2 Duo processors and Vista Home Premium. The Mighty is the size of a book and includes built in WiFi and DVD burner. Up next is the Gold, which is a more traditional size and adds up to 1TB of storage, HDMI, 2 ATSC and 2 NTSC tuners (sorry no CableCARD here), 7.1 audio and Viiv. The Platinum tops the Home Series, adding a quiet design an internal scaler and optional HD DVD or Blu-ray drive. But they don't stop there and are trying to join Niveus in the high end market with the ProLine Series, which of course does everything the Home series does, but with Vista Ultimate, rack mountable, a silent design and two-way control for all your favorite home automation systems like Crestron and AMX. As impressive as this lineup is, we are once again left wonder, where are the CableCARDs?Read: S1Digital Introduces the Home Series Line of Media CentersRead: S1Digital Sets a New Reference Standard with ProLine Series Media Centers Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94110287/
      2007-02-22T04:04:00
      Apple and Cisco settle! iPhone name to be used by bothFiled under: Cellphones + + +Here's one we didn't exactly see coming (at least not like this): Apple and Cisco have settled that "silly" lawsuit, with Apple agreeing to guarantee the exploration of "interoperability in the areas of security, and consumer and enterprise communications" according to the WSJ. We don't know exactly what that means, but it doesn't sound fantastic for Jobs, who we're sure wanted to have exclusivity over the name without cutting a partnership with Cisco, and didn't want to have to pay a red cent for it. But this does sound a lot like what Cisco wanted initially from Apple, and might possibly wind up in some kind of SIP / VoIP solution that allows iPhones and iPhones to communicate. Apparently both will make use of the trademark in the market (i.e. Apple's and Cisco's iPhones will both continue to be iPhones), and all's well that ends non-litigious.[Thanks, Nick and Jay] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94075975/
      2007-02-22T02:42:00
      Nintendo Wii beats up on the competition in power savingsFiled under: Gaming, Home Entertainment +So, the graphics might just be warmed over GameCube fare, but the Wii sure does take those wimpy specs and runs with 'em. A new showdown between the big three home consoles and a mid-range PC doesn't compare games or GPUs, but rather power consumption, and the Wii wins by a landslide. The watts don't just bleed during gameplay, DVD playback seems to require immense effort from the 360 and PS3, and even the consoles in "idle" mode consume about ten times the watts of the Wii. Of course, the consoles consume a minimal amount of power in standby, which is substantially more when the Wii's Connect24 service is on, but not quite a deal breaker, just about a $1 a month of power. So if you're looking to shave a few bucks off your power bill or do your treehuggin' duty to the environment, it looks like the choice is fairly obvious -- though you'll naturally have to look elsewhere than the Wii to get your video playback kicks.[Via Joystiq] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94066659/
      2007-02-22T02:09:00
      Frenzy Rumble transforming headphones: lamer it soundsFiled under: Misc. Gadgets, Portable Audio +You know, a Transformers movie was really its own reward, but all these transforming gadgets -- movie related and no -- are really making it all the more exciting, especially when we're talking completely superfluous fluff. Take these new Frenzy Rumble Earphones, for example. There's no reason you'd want 'em on your head, and there's no way they push out an adequate volume for desktop use when in that transformed state. A perfect blend of uselessness and inconvenience. You can get yours in July for about $37.[Thanks, Aaron D] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94046982/
      2007-02-22T01:14:00
      Bill Gates clamps down on daughter's internet timeFiled under: Desktops, Laptops, Tablet PCsSure, we've seen individuals getting their hand slapped (or worse) for browsing the internet a bit too often, but you'd assume that having a dad who envisioned the Redmond powerhouse and pays the bills by way of computing would be the perfect father figure for the computer-addicted. Apparently, that's not exactly so, as a recent Reuters report tells of Bill Gates himself clamping down on his 10-year old daughter's internet and gaming time. According to Bill, his oldest gal wasn't even into the 'net until this school year, where tablet PCs became a necessary tool, but now that she's found access to a never-ending supply of information, her habits have suddenly changed. She latched onto Viva Pi ata, purportedly playing for "two to three hours per day," after which her health started deteriorating and her chore accomplishments plummeted. Although we mention those last bits in jest, Mr. Gates slapped down a "45-minutes per day" law for non-school related computing tasks on the weekdays, and added just 15 minutes for weekends, probably garnering quite the evil eye and stirring up early thoughts of rebellion in his youngster. Seriously Bill, if you're that worried about daddy's little girl stumbling upon some form of cyber predator, there's always the parent-approved IM-Me, but throwing time restrictions on your own products is just a tad illogical, no?[Via BloggingStocks, thanks Randall] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94027868/
      2007-02-22T00:19:00
      Pentax busts out Hasselbladian 31.6 megapixel 645 DigitalFiled under: Digital Cameras + Pentax has apparently tapped Kodak to provide its 31.6 megapixel KAF-31600 medium format CCD for the upcoming 645 Digital, which would seem to be the company's highest resolution digital camera to date. So far all that's known from the pre-PMA announcement is that the 645 will sport both SD and CF slots, and will ship with a specially-built 55mm lens that's also compatible with 645-series SLR film cameras. We should find out more about this behemoth in early March -- although possibly not pricing and release info -- but one thing we can say for sure is that if it's priced anything like the Hasselblad H3D-31 whose sensor it shares, expect to pay out well into five figures.[Thanks, David N.] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94009335/
      2007-02-21T23:24:00
      Pentax pops out the Optio W30 and A30Filed under: Digital Cameras +There's some heated competition already for our PMA eyeballs, and Pentax sure wants a slice. They don't have anything terribly outstanding on the consumer end, but these W30 and A30 Optio shooters still do pretty well for themselves. The A30 (pictured) takes a pretty traditional approach to the compact genre, boosting the megapixels to 10 and offering up 2.5-inches of LCD. There's also ISO 3200 and some fancy gyro-based shake reduction, along with face recognition auto focus and auto exposure, all in a pretty dang compact SDHC-munching body. The W30 steps it back a bit, with a 7.1 megapixel CCD and mere digital shake reduction, but the rest of the specs are there, along with a waterproof and dustproof housing that can handle being up to three meters under water for two hours. No word on price or availability for either camera, but we're sure we'll be finding out soon enough. Peep the W30 after the break.[Thanks, David N]Read - Optio A30Read - Optio W30Continue reading Pentax pops out the Optio W30 and A30 Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94000890/
      2007-02-21T23:09:00
      Xbox 360 Wireless Receiver for Windows now availableFiled under: Desktops, Gaming, Peripherals, Wireless +It sure took its own sweet time to make it to market -- we first saw this thing at E3 in 2006 -- but the Xbox 360 Wireless Receiver for Windows is finally available for purchase. The adapter lets you use your standard wireless 360 peripherals, such as the Xbox 360 Wireless Controller and Wireless Headset, with your Windows PC. That means Windows users, which have been enjoying the fruits of a USB 360 controller since before the console launched, can finally get in on some wireless action, and it'll only cost them $20 for the privilege. It also means that much more fun for upcoming Games for Windows titles such as Shadowrun, UNO and Halo 2, along with generic game controls and VoIP functionality. Microsoft is also releasing a $60 package which includes a receiver and a wireless controller. Both items should be available at retail now. Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93985665/
      2007-02-21T22:24:00
      Engadget Podcast 100 - 02.21.2007Engadget Podcast 100
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93966098/
      2007-02-21T21:49:00
      Switched On: What of the Wii-buked?Filed under: Features, Gaming +Each week Ross Rubin contributes Switched On, a column about technology, multimedia, and digital entertainment: + +Nintendo has been on an Apple-like hit parade since the disappointing market performance of the GameCube. The DS and DS Lite handily staved off highly touted competition from Sony. The PSP may have appealed to a different, if for now narrower, demographic, but units are units, and there's no escaping them when you're marketing a platform. +The launch of the Wii has been nothing but magic mushrooms from the hype around the controller to the E3 reception to late-night Wii Tennis face-offs between Conan and Serena Williams. Check out this apologetic fan comment on Amazon's product page: "Graphics might not be high definition, but it looks very close to the Xbox 360 and PS3 when not running in HD mode. And definitively better than the original Xbox and PS2." Better than the Xbox and PS2, eh? That's setting the sensor bar pretty low for a system that shipped six years after the PS2. +Yet, it's no suprise that the Wii has been highly sought. I thought it was the best consumer technology product of 2006. The Nintendo team has executed almost flawlessly, but the company has brushed aside criticisms regarding product shortages without so much as a flick from a Wiimote. Commenting earlier this month on the mayhem surrounding Sony's PlayStation 3's product launch shortages, Nintendo of America vice president of marketing and corporate affairs Perrin Kaplan noted that "we didn't have anyone in line that got shot waiting for our system. So there's one sign of the different approaches between our two companies."Continue reading Switched On: What of the Wii-buked? Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93966099/
      2007-02-21T21:34:00
      Sirius' and XM's merger presentation revealedFiled under: Portable Audio, Portable Video + Brace yourself: corporate speak ahead. We normally aren't in for all this "cost synergies" and "roadmap" hogwash that all the suits seem to get so hot for, but when it comes to a merger of two cutthroat competitors like this, we couldn't help but take a peek. Other than the technology improvements we mentioned, there isn't much talk about consumer benefits in here, and there's absolutely no mention of creating some sort of single satellite radio provider, just the power of combined resources. Most of the talk is directed at shareholders and those "synergies" that help out the bottom line -- to the tune of an estimated $3-7 billion in savings, though a $4 billion "flex" does seem to cast a bit of doubt on those numbers. The rest of the slides deal with plans for getting regulatory approval, which basically amount to arguing the case of intense competition from radio, iPods and other emerging wireless standards (see above). That said, XM and Sirius seem quite confident of success on the regulatory end of things, and look to have put a quite a bit of thought into it. Pending approval from the feds, along with respective shareholder go-ahead, XM and Sirius plan on sealing the deal by the end of 2007.Gallery: Sirius and XM's merger presentation revealed Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93959647/
      2007-02-21T21:12:00
      Art Lebedev intros Verbarius electronic clockFiled under: Misc. GadgetsArt Lebedev may be best known these days for its various display-ridden peripherals, and the delays and uncertainty surrounding each, but the prolific design firm's got plenty more on its plate, to which it's now added the Verbarius electronic clock. As you can see above, the clock does away with the usual time-telling tools in favor of spelling things out, in five different languages no less. What's more, it changes up its verbiage each time you ask it the time, displaying variations like "forty-five minutes past four," "fifteen minutes to five," "four forty-five", and "a quarter to five." This being Lebedev, of course, they're also taking their time to build up anticipation in the device, with the clock supposedly set to only begin shipping in November. You can get your pre-orders in now, however, with a discount price of $158.25 available to those who order before September 1st, after which it'll set you back about $180. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93944802/
      2007-02-21T20:44:00
      HTC "Gene" makes FCC appearanceFiled under: Cellphones, Handhelds +After a fairly productive 3GSM last week showing off new Windows Mobile 6 wares in the form of the Vox and the Advantage, everyone's favorite Taiwanese Windows Mobile ODM has graced us with this here "Gene" (or at least we think that's what it's called, based on its model number, GENE100) via our usual Tipster Extraordinare, the FCC. The specs aren't really enough to knock our socks off -- data tops out with quadband EDGE, the cam is a simple 2 megapixel unit, plus the usual Bluetooth 2.0, 128MB of ROM, 64MB of RAM, and QVGA display atop a 201MHz TI OMAP850 -- but at this point, we're still happy to get whatever new Professional hardware we can get. Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93941965/
      2007-02-21T20:24:00
      Helio's Pantech PN-810 QWERTY device pops up in FCCFiled under: Cellphones, Handhelds +And here it is, Helio's coup de gr ce. The QWERTY handset we'd heard Helio was cookin' up with Korea's Pantech actually hit the FCC some time ago, but the shots we were able to glean from the test apparatus documentation were teasers at best. Thanks to the wonders of expired confientiality agreements, that same FCC documentation now yields a bounty of goodness, including a user's manual and a full array of pictures. The so-called PN-810 gives the illusion of a dual slider, but actually employs two distinct layers to provide two completely different keypads depending on the slide direction: QWERTY in one, numeric in the other. Key features (other than the unusual form factor, of course) include a 2.1 megapixel cam, Bluetooth, and the full array of goodies that comes with Helio membership. A release date remains uncertain, but the PN-810's been chilling with the feds for some time now, so we wouldn't be terribly surprised to see it hit in the near term.Gallery: Helio's Pantech PN-810 QWERTY device pops up in FCC Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93938442/
      2007-02-21T20:05:00
      ATI's R600 graphics chip hits snagFiled under: Desktops, GamingWe've had our eye on ATI"s new top-end R600 graphics chip for some time now, first getting a look at some impressive early benchmarks and then being taken aback by the foot-long graphics card the chips will call home (at least in some configurations). Sadly, it seems that those with money and power (as in 270W) to spare will have to wait a bit longer to slot one of the behemoths into their own PCs, with The Inquirer reporting that the R600 chips, and consequently the graphics cards based on 'em, have been delayed yet again, now pushed back to sometime in the second quarter of this year. There doesn't seem to be any word on the reason for the delay, but the news apparently came straight from ATI parent company AMD. Given what the cards are likely to cost, however, we're guessing that at least some won't be too disappointed in the delay, with the extra time allowing you to save up some more money and make some more excuses for why you're spending so much on a graphics card.[Via TG Daily] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93920986/
      2007-02-21T19:32:00
      Russians congregate over internet, drink via USB shot glassesFiled under: Misc. Gadgets + Considering that we've all some of us have been enjoying online chats, poker, and dating for quite some while, it's not too shocking to see the Russians utilize the power of the web to bring alcoholics and social drinkers together in inebriated harmony. Sergey Mikheev, head of e-generator, has devised a USB shot glass to allow lonely, alcohol-needing individuals to get their drink on while safely at home. While we don't consider ourselves experts in Russian culture, it's apparently not tactful to get plastered solo, and while online drinking might be stretching the rules just a bit, we're sure those vodka-lovin' internet dwellers aren't complaining. The idea is to join a group of drinkers in an online lounge, where the USB shot glass levels are shown on each person's screen; once the go-ahead is given, the folks turn up their glasses and chug it down, ideally showing an empty glass after a random smashing of keys somehow spells out congratulatory phrases. As interesting and novel as this may be, let it remind us all how "getting a life" should be taken oh-so-seriously.[Via ChipChick] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93918114/
      2007-02-21T19:02:00
      Samsung's 19-inch SyncMaster 940UX LCD picks USBFiled under: Displays +After DisplayLink hit us up with a cordless monitor care of Wireless USB, things really can't get much simpler for connecting LCDs with PC towers, but for those not quite ready to jump into all that, Samsung is reportedly readying a USB-only monitor that'll be showcased at CeBIT. Yep, according to reports, the 19-inch SyncMaster 940UX will be axing the DVI and VGA inputs in favor of a USB 2.0 connector, which means you can finally do away with those flakey USB to VGA adapters of days past. Slated for a May release, the display should sync up with Windows XP initially, with Vista drivers (no OS X love?) to follow shortly thereafter. No other details regarding contrast ratio, resolution, or whether a 0.25-page installation manual will be included is currently available, and more importantly, we're not so sure how your CPU is going to feel about its newfangled processing duties when you plug this sucka in. Still, Samsung claims between "three and five" of these monitors can be plugged in and used at any given time based on the amount of processing requirements your applications have, but the real question is how quickly can ATI / NVIDIA can crank out a next-generation GPU with USB 2.0 outputs, eh?[Via Slashgear] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93898699/
      2007-02-21T18:32:00
      Latest BlackBerry OS confirms 8820 with WiFiFiled under: Cellphones, Handhelds, Wireless + A feature notoriously missing from RIM's range, WiFi is one add-on we can pretty much all agree would make the average BlackBerry user's life noticeably better. We'd heard rumblings ahead of the 8800's release that Canada's newest handset would sport some manner of 802.11 out of the box, but alas -- the release came and went with no 2.4GHz (or 5GHz, for that matter) goodness in sight, allegedly due to technical glitches on RIM's side that the company was unwilling to delay the initial model for. No worries, though -- well, maybe a few worries if you're AT T and you're trying to push the 8800 out the door -- the WiFi-enabled 8820 looks pretty official now thanks to a cameo in RIM's latest BlackBerry OS offering. Other changes should be minimal from its predecessor; a camera still isn't in the cards, leaving shutterbugs who like their BlackBerry served QWERTY style up the same creek they are now. No word on a release, but rumblings have the device launching mid-year. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! +
      http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93882167/
      2007-02-21T18:02:00
      Italian crisis talks as PM quitsItalian President Giorgio Napolitano is to begin crisis talks after the resignation of PM Romano Prodi.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/europe/6384953.stm
      2007-02-22T07:09:56
      Iraq leader welcomes troops' exitThe Iraqi president welcomes Tony Blair's plans to cut UK troops in Iraq from 7,100 to 5,000 within months.
      http://news.bbc.co.uk/go/rss/-/1/hi/uk_politics/6384685.stm
      2007-02-22T01:06:14
      Apple and Cisco share iPhoneApple and Cisco Systems agree to share the iPhone trademark, allowing both firms to use the name.
      http://news.bbc.co.uk/go/rss/-/1/hi/business/6384875.stm
      2007-02-22T04:52:01
      Indonesia ferry fire kills sixAt least seven people - two of them children - die as fire breaks out on a ferry sailing from Indonesia's capital.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/asia-pacific/6384859.stm
      2007-02-22T07:29:35
      Clinton and Obama row eruptsA row erupts between two leading contenders for the US Democratic Party's presidential nomination.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6384821.stm
      2007-02-22T02:02:19
      Menchu to stand in GuatemalaIndigenous activist and Nobel winner Rigoberta Menchu says she will run for president in Guatemala.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6384845.stm
      2007-02-22T03:33:05
      Most-premature baby goes homeThe world's most-premature baby leaves a Miami hospital, four months after weighing in at just 280 grams.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6384621.stm
      2007-02-21T22:33:54
      US wants tougher Iran sanctionsWashington says it will now push for tougher sanctions against Iran over its nuclear activities.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6384725.stm
      2007-02-21T23:43:08
      US soldier admits murdering girlA second US soldier admits to the gang rape and murder of a 14-year-old Iraqi girl and her family.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6384781.stm
      2007-02-22T01:40:53
      Football: Barca 1-2 L'poolCraig Bellamy and John Arne Riise both score as Liverpool beat holders Barcelona in the first leg of their Champions League tie.
      http://news.bbc.co.uk/go/rss/-/sport1/hi/football/europe/6371395.stm
      2007-02-21T21:37:03
      Football: Porto 1-1 ChelseaAndriy Shevchenko's goal earns Chelsea a draw, but the Blues lose John Terry to an ankle injury in Porto.
      http://news.bbc.co.uk/go/rss/-/sport1/hi/football/europe/6371399.stm
      2007-02-21T21:36:15
      Crisis talks over Bolivian floodsThe Bolivian government is holding emergency talks over the severe flooding in much of the country.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6384267.stm
      2007-02-21T20:54:40
      Spears 'leaves rehab after a day'Pop star Britney Spears has left a rehab centre after just one day for the second time, according to US reports.
      http://news.bbc.co.uk/go/rss/-/1/hi/entertainment/6384081.stm
      2007-02-21T18:31:01
      Australia may lift Afghan forceAustralia studies sending 450 more troops to Afghanistan, as US Vice-President Dick Cheney prepares to visit.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/asia-pacific/6384965.stm
      2007-02-22T06:43:29
      Blair announces Iraq troops cutTony Blair says he hopes to cut the number of UK troops in Iraq from 7,100 to 5,000 within months.
      http://news.bbc.co.uk/go/rss/-/1/hi/uk_politics/6380933.stm
      2007-02-21T18:15:55
      India ban on Iran nuclear exportsIndian officials say exports to Iran that could be used in the country's nuclear programme have been banned.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6384919.stm
      2007-02-22T05:52:36
      Quartet warning to PalestiniansThe Quartet of Mid-East peace negotiators says the new Palestinian government must recognise Israel.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6384189.stm
      2007-02-21T20:30:30
      Three 'detained' over train blastPolice in India say they are holding three people after Sunday's bomb attack on a train to Pakistan.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6384867.stm
      2007-02-22T05:20:31
      India state airlines set to mergeAir India and Indian, India's two main state-owned airlines, are to merge to compete with private rivals.
      http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6384881.stm
      2007-02-22T05:11:16
      diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/index.html b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/index.html new file mode 100644 index 0000000000..2ecd0434b6 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/index.html @@ -0,0 +1,280 @@ + + + + + Apache Tuscany Alert Aggregator Sample + + + + + +

      Apache Tuscany Alert Aggregator Sample

      +

      Alert Sources:

      +
      +

      Recent Alerts (Refresh):

      +
      +

      Back to top

      +
      + + + + diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/pop.png b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/pop.png new file mode 100644 index 0000000000..1cf1df24a7 Binary files /dev/null and b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/pop.png differ diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/rss.png b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/rss.png new file mode 100644 index 0000000000..b3c949d224 Binary files /dev/null and b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/rss.png differ diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/style.css b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/style.css new file mode 100644 index 0000000000..cd377e90e5 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/htdocs/style.css @@ -0,0 +1,166 @@ +/* + * 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. + */ + +p,table,li,h1,h2,h3 +{ +font-family: verdana, arial, 'sans serif'; +} + +p, h1, h2, h3, table, li, hr +{ +margin-left: 10pt; +} + +table +{ +border-color: black; +border-collapse: separate; +border-spacing: 0px 1px; + +margin-right: 10pt; +margin-left: 10pt; +width: 800px; +} + +.sourceDetailsTable +{ +width: 600px; +} + +tr, td +{ +margin-left: 0pt; +margin-right: 0pt; +padding-left: 10pt; +font-size: 90%; +} + +p,li,th +{ +font-size: 90%; +margin-left: 10pt; +} + +pre +{ +margin-left: 10pt; +} + +body +{ +#ffffff; +} + +h1,h2,h3,hr +{ +color: firebrick; +} + +a:link {COLOR: firebrick;} +a:visited {COLOR: firebrick;} +a:active {COLOR: navy;} + +.link +{ +COLOR: firebrick; +text-decoration: underline; +} + +.clickable +{ +cursor: pointer +} + +.unread_title +{ +font-weight: bold; +} + +.read_title +{ +font-weight: normal; +} + +.summary +{ +color: DimGrey; +} + +.hidden +{ +display: none; +} + +.alert_data +{ +margin-left: 10px; +width: 800px; +height: 800px; +} + +.source_0 +{ +background-color: LightGreen; +} + +.source_1 +{ +background-color: LightSkyBlue; +} + +.source_2 +{ +background-color: Khaki; +} + +.source_3 +{ +background-color: LightPink; +} + +.source_4 +{ +background-color: Orange; +} + +.source_5 +{ +background-color: LightCoral; +} + +.source_6 +{ +background-color: Orchid; +} + +.source_7 +{ +background-color: Peru; +} + +.source_8 +{ +background-color: SpringGreen; +} + +.source_9 +{ +background-color: LightGrey; +} + diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/startserver.bat b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/startserver.bat new file mode 100644 index 0000000000..dab8cd6c61 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver.php/startserver.bat @@ -0,0 +1,76 @@ +@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 APFULLDIR=%~d0%~p0 +echo Running from %APFULLDIR% + +if "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) +echo Using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) +echo Using SDO installed at %TUSCANY_SDOCPP% + +if "%HTTPD_HOME%" == "" ( +echo "HTTPD_HOME not set" +goto end +) +echo Using HTTPD installed at %HTTPD_HOME% + +set PATH=%TUSCANY_SCACPP%\extensions\python\bin;%TUSCANY_SCACPP%\extensions\rest\interface\bin;%TUSCANY_SCACPP%\extensions\rest\service\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%HTTPD_HOME%\bin;%PATH% +set PYTHONPATH=%TUSCANY_SCACPP%\extensions\python\bin + +set TUSCANY_SCACPP_ROOT=%APFULLDIR%\..\ +set TUSCANY_SCACPP_BASE_URI=http://localhost:9091 + +@REM Generate the tuscany_sca_mod_rest configuration +if not exist %APFULLDIR%\conf\tuscany_sca_mod_rest.conf ( + echo LoadModule sca_rest_module %TUSCANY_SCACPP%/extensions/rest\service/bin/tuscany_sca_mod_rest.dll > %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo TuscanyHome %TUSCANY_SCACPP% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo SetHandler sca_rest_module >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo TuscanyRoot %TUSCANY_SCACPP_ROOT% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf +) + +@REM Generate the base HTTPD configuration +if not exist %APFULLDIR%\conf\base.conf ( + echo LoadModule mime_module %HTTPD_HOME%\modules\mod_mime.so > %APFULLDIR%\conf\base.conf + echo LoadModule dir_module %HTTPD_HOME%\modules\mod_dir.so >> %APFULLDIR%\conf\base.conf + echo DocumentRoot %APFULLDIR%\htdocs >> %APFULLDIR%\conf\base.conf + echo LoadModule php5_module %PHP_HOME%\php5apache2.dll >> %APFULLDIR%\conf\base.conf + echo AddType application/x-httpd-php .php >> %APFULLDIR%\conf\base.conf + echo PHPIniDir %PHP_HOME% >> %APFULLDIR%\conf\base.conf +) + +@REM Create logs directory +if not exist %APFULLDIR%\logs mkdir %APFULLDIR%\logs +set TUSCANY_SCACPP_LOG=%APFULLDIR%\logs\tuscany-server.log +set TUSCANY_SCACPP_LOGGING=9 + +@REM Start the HTTP server +echo Starting Apache httpd +httpd -d %APFULLDIR% diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/Makefile.am b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/Makefile.am new file mode 100644 index 0000000000..5db11696dc --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/Makefile.am @@ -0,0 +1,23 @@ +# 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. + +deploydir=$(prefix)/AlertAggregator/deploy +serverdir=$(deploydir)/httpserver + +server_SCRIPTS = startserver.sh stopserver.sh +EXTRA_DIST = startserver.sh stopserver.sh conf htdocs +nobase_server_DATA = conf/httpd.conf conf/mime.types htdocs/index.html htdocs/style.css htdocs/*.png diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/conf/httpd.conf b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/conf/httpd.conf new file mode 100644 index 0000000000..d243f85fbf --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/conf/httpd.conf @@ -0,0 +1,43 @@ +# 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 is the main Apache HTTP server configuration file. It contains the +# configuration directives that give the server its instructions. +# See for detailed information. + +Listen 9090 + +# Generated by the startserver script +Include conf/base.conf +Include conf/tuscany_sca_mod_rest.conf + +# User and Group directives may be required if the server must be +# started from the root account. Uncomment the following lines and +# set the correct username and group +# +# User myusername +# Group mygroupname + + +# The Mime module may need to be specifically loaded if +# text rather than a web page is displayed when the web browser goes to +# http://localhost:9090/index.html. Uncomment the following LoadModule +# directive and ensure that the path to mod_mime.so is correct +# +# LoadModule mime_module /usr/lib/httpd/modules/mod_mime.so + + diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/conf/mime.types b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/conf/mime.types new file mode 100644 index 0000000000..4279f51bca --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/conf/mime.types @@ -0,0 +1,607 @@ +# 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 file controls what Internet media types are sent to the client for +# given file extension(s). Sending the correct media type to the client +# is important so they know how to handle the content of the file. +# Extra types can either be added here or by using an AddType directive +# in your config files. For more information about Internet media types, +# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type +# registry is at . + +# MIME type Extensions +application/activemessage +application/andrew-inset ez +application/applefile +application/atom+xml atom +application/atomicmail +application/batch-smtp +application/beep+xml +application/cals-1840 +application/cnrp+xml +application/commonground +application/cpl+xml +application/cybercash +application/dca-rft +application/dec-dx +application/dvcs +application/edi-consent +application/edifact +application/edi-x12 +application/eshop +application/font-tdpfr +application/http +application/hyperstudio +application/iges +application/index +application/index.cmd +application/index.obj +application/index.response +application/index.vnd +application/iotp +application/ipp +application/isup +application/mac-binhex40 hqx +application/mac-compactpro cpt +application/macwriteii +application/marc +application/mathematica +application/mathml+xml mathml +application/msword doc +application/news-message-id +application/news-transmission +application/ocsp-request +application/ocsp-response +application/octet-stream bin dms lha lzh exe class so dll dmg +application/oda oda +application/ogg ogg +application/parityfec +application/pdf pdf +application/pgp-encrypted +application/pgp-keys +application/pgp-signature +application/pkcs10 +application/pkcs7-mime +application/pkcs7-signature +application/pkix-cert +application/pkix-crl +application/pkixcmp +application/postscript ai eps ps +application/prs.alvestrand.titrax-sheet +application/prs.cww +application/prs.nprend +application/prs.plucker +application/qsig +application/rdf+xml rdf +application/reginfo+xml +application/remote-printing +application/riscos +application/rtf +application/sdp +application/set-payment +application/set-payment-initiation +application/set-registration +application/set-registration-initiation +application/sgml +application/sgml-open-catalog +application/sieve +application/slate +application/smil smi smil +application/srgs gram +application/srgs+xml grxml +application/timestamp-query +application/timestamp-reply +application/tve-trigger +application/vemmi +application/vnd.3gpp.pic-bw-large +application/vnd.3gpp.pic-bw-small +application/vnd.3gpp.pic-bw-var +application/vnd.3gpp.sms +application/vnd.3m.post-it-notes +application/vnd.accpac.simply.aso +application/vnd.accpac.simply.imp +application/vnd.acucobol +application/vnd.acucorp +application/vnd.adobe.xfdf +application/vnd.aether.imp +application/vnd.amiga.ami +application/vnd.anser-web-certificate-issue-initiation +application/vnd.anser-web-funds-transfer-initiation +application/vnd.audiograph +application/vnd.blueice.multipass +application/vnd.bmi +application/vnd.businessobjects +application/vnd.canon-cpdl +application/vnd.canon-lips +application/vnd.cinderella +application/vnd.claymore +application/vnd.commerce-battelle +application/vnd.commonspace +application/vnd.contact.cmsg +application/vnd.cosmocaller +application/vnd.criticaltools.wbs+xml +application/vnd.ctc-posml +application/vnd.cups-postscript +application/vnd.cups-raster +application/vnd.cups-raw +application/vnd.curl +application/vnd.cybank +application/vnd.data-vision.rdz +application/vnd.dna +application/vnd.dpgraph +application/vnd.dreamfactory +application/vnd.dxr +application/vnd.ecdis-update +application/vnd.ecowin.chart +application/vnd.ecowin.filerequest +application/vnd.ecowin.fileupdate +application/vnd.ecowin.series +application/vnd.ecowin.seriesrequest +application/vnd.ecowin.seriesupdate +application/vnd.enliven +application/vnd.epson.esf +application/vnd.epson.msf +application/vnd.epson.quickanime +application/vnd.epson.salt +application/vnd.epson.ssf +application/vnd.ericsson.quickcall +application/vnd.eudora.data +application/vnd.fdf +application/vnd.ffsns +application/vnd.fints +application/vnd.flographit +application/vnd.framemaker +application/vnd.fsc.weblaunch +application/vnd.fujitsu.oasys +application/vnd.fujitsu.oasys2 +application/vnd.fujitsu.oasys3 +application/vnd.fujitsu.oasysgp +application/vnd.fujitsu.oasysprs +application/vnd.fujixerox.ddd +application/vnd.fujixerox.docuworks +application/vnd.fujixerox.docuworks.binder +application/vnd.fut-misnet +application/vnd.grafeq +application/vnd.groove-account +application/vnd.groove-help +application/vnd.groove-identity-message +application/vnd.groove-injector +application/vnd.groove-tool-message +application/vnd.groove-tool-template +application/vnd.groove-vcard +application/vnd.hbci +application/vnd.hhe.lesson-player +application/vnd.hp-hpgl +application/vnd.hp-hpid +application/vnd.hp-hps +application/vnd.hp-pcl +application/vnd.hp-pclxl +application/vnd.httphone +application/vnd.hzn-3d-crossword +application/vnd.ibm.afplinedata +application/vnd.ibm.electronic-media +application/vnd.ibm.minipay +application/vnd.ibm.modcap +application/vnd.ibm.rights-management +application/vnd.ibm.secure-container +application/vnd.informix-visionary +application/vnd.intercon.formnet +application/vnd.intertrust.digibox +application/vnd.intertrust.nncp +application/vnd.intu.qbo +application/vnd.intu.qfx +application/vnd.irepository.package+xml +application/vnd.is-xpr +application/vnd.japannet-directory-service +application/vnd.japannet-jpnstore-wakeup +application/vnd.japannet-payment-wakeup +application/vnd.japannet-registration +application/vnd.japannet-registration-wakeup +application/vnd.japannet-setstore-wakeup +application/vnd.japannet-verification +application/vnd.japannet-verification-wakeup +application/vnd.jisp +application/vnd.kde.karbon +application/vnd.kde.kchart +application/vnd.kde.kformula +application/vnd.kde.kivio +application/vnd.kde.kontour +application/vnd.kde.kpresenter +application/vnd.kde.kspread +application/vnd.kde.kword +application/vnd.kenameaapp +application/vnd.koan +application/vnd.liberty-request+xml +application/vnd.llamagraphics.life-balance.desktop +application/vnd.llamagraphics.life-balance.exchange+xml +application/vnd.lotus-1-2-3 +application/vnd.lotus-approach +application/vnd.lotus-freelance +application/vnd.lotus-notes +application/vnd.lotus-organizer +application/vnd.lotus-screencam +application/vnd.lotus-wordpro +application/vnd.mcd +application/vnd.mediastation.cdkey +application/vnd.meridian-slingshot +application/vnd.micrografx.flo +application/vnd.micrografx.igx +application/vnd.mif mif +application/vnd.minisoft-hp3000-save +application/vnd.mitsubishi.misty-guard.trustweb +application/vnd.mobius.daf +application/vnd.mobius.dis +application/vnd.mobius.mbk +application/vnd.mobius.mqy +application/vnd.mobius.msl +application/vnd.mobius.plc +application/vnd.mobius.txf +application/vnd.mophun.application +application/vnd.mophun.certificate +application/vnd.motorola.flexsuite +application/vnd.motorola.flexsuite.adsi +application/vnd.motorola.flexsuite.fis +application/vnd.motorola.flexsuite.gotap +application/vnd.motorola.flexsuite.kmr +application/vnd.motorola.flexsuite.ttc +application/vnd.motorola.flexsuite.wem +application/vnd.mozilla.xul+xml xul +application/vnd.ms-artgalry +application/vnd.ms-asf +application/vnd.ms-excel xls +application/vnd.ms-lrm +application/vnd.ms-powerpoint ppt +application/vnd.ms-project +application/vnd.ms-tnef +application/vnd.ms-works +application/vnd.ms-wpl +application/vnd.mseq +application/vnd.msign +application/vnd.music-niff +application/vnd.musician +application/vnd.netfpx +application/vnd.noblenet-directory +application/vnd.noblenet-sealer +application/vnd.noblenet-web +application/vnd.novadigm.edm +application/vnd.novadigm.edx +application/vnd.novadigm.ext +application/vnd.obn +application/vnd.osa.netdeploy +application/vnd.palm +application/vnd.pg.format +application/vnd.pg.osasli +application/vnd.powerbuilder6 +application/vnd.powerbuilder6-s +application/vnd.powerbuilder7 +application/vnd.powerbuilder7-s +application/vnd.powerbuilder75 +application/vnd.powerbuilder75-s +application/vnd.previewsystems.box +application/vnd.publishare-delta-tree +application/vnd.pvi.ptid1 +application/vnd.pwg-multiplexed +application/vnd.pwg-xhtml-print+xml +application/vnd.quark.quarkxpress +application/vnd.rapid +application/vnd.s3sms +application/vnd.sealed.net +application/vnd.seemail +application/vnd.shana.informed.formdata +application/vnd.shana.informed.formtemplate +application/vnd.shana.informed.interchange +application/vnd.shana.informed.package +application/vnd.smaf +application/vnd.sss-cod +application/vnd.sss-dtf +application/vnd.sss-ntf +application/vnd.street-stream +application/vnd.svd +application/vnd.swiftview-ics +application/vnd.triscape.mxs +application/vnd.trueapp +application/vnd.truedoc +application/vnd.ufdl +application/vnd.uplanet.alert +application/vnd.uplanet.alert-wbxml +application/vnd.uplanet.bearer-choice +application/vnd.uplanet.bearer-choice-wbxml +application/vnd.uplanet.cacheop +application/vnd.uplanet.cacheop-wbxml +application/vnd.uplanet.channel +application/vnd.uplanet.channel-wbxml +application/vnd.uplanet.list +application/vnd.uplanet.list-wbxml +application/vnd.uplanet.listcmd +application/vnd.uplanet.listcmd-wbxml +application/vnd.uplanet.signal +application/vnd.vcx +application/vnd.vectorworks +application/vnd.vidsoft.vidconference +application/vnd.visio +application/vnd.visionary +application/vnd.vividence.scriptfile +application/vnd.vsf +application/vnd.wap.sic +application/vnd.wap.slc +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/vnd.webturbo +application/vnd.wrq-hp3000-labelled +application/vnd.wt.stf +application/vnd.wv.csp+wbxml +application/vnd.xara +application/vnd.xfdl +application/vnd.yamaha.hv-dic +application/vnd.yamaha.hv-script +application/vnd.yamaha.hv-voice +application/vnd.yellowriver-custom-menu +application/voicexml+xml vxml +application/watcherinfo+xml +application/whoispp-query +application/whoispp-response +application/wita +application/wordperfect5.1 +application/x-bcpio bcpio +application/x-cdlink vcd +application/x-chess-pgn pgn +application/x-compress +application/x-cpio cpio +application/x-csh csh +application/x-director dcr dir dxr +application/x-dvi dvi +application/x-futuresplash spl +application/x-gtar gtar +application/x-gzip +application/x-hdf hdf +application/x-javascript js +application/x-koan skp skd skt skm +application/x-latex latex +application/x-netcdf nc cdf +application/x-sh sh +application/x-shar shar +application/x-shockwave-flash swf +application/x-stuffit sit +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-tar tar +application/x-tcl tcl +application/x-tex tex +application/x-texinfo texinfo texi +application/x-troff t tr roff +application/x-troff-man man +application/x-troff-me me +application/x-troff-ms ms +application/x-ustar ustar +application/x-wais-source src +application/x400-bp +application/xhtml+xml xhtml xht +application/xslt+xml xslt +application/xml xml xsl +application/xml-dtd dtd +application/xml-external-parsed-entity +application/zip zip +audio/32kadpcm +audio/amr +audio/amr-wb +audio/basic au snd +audio/cn +audio/dat12 +audio/dsr-es201108 +audio/dvi4 +audio/evrc +audio/evrc0 +audio/g722 +audio/g.722.1 +audio/g723 +audio/g726-16 +audio/g726-24 +audio/g726-32 +audio/g726-40 +audio/g728 +audio/g729 +audio/g729D +audio/g729E +audio/gsm +audio/gsm-efr +audio/l8 +audio/l16 +audio/l20 +audio/l24 +audio/lpc +audio/midi mid midi kar +audio/mpa +audio/mpa-robust +audio/mp4a-latm +audio/mpeg mpga mp2 mp3 +audio/parityfec +audio/pcma +audio/pcmu +audio/prs.sid +audio/qcelp +audio/red +audio/smv +audio/smv0 +audio/telephone-event +audio/tone +audio/vdvi +audio/vnd.3gpp.iufp +audio/vnd.cisco.nse +audio/vnd.cns.anp1 +audio/vnd.cns.inf1 +audio/vnd.digital-winds +audio/vnd.everad.plj +audio/vnd.lucent.voice +audio/vnd.nortel.vbk +audio/vnd.nuera.ecelp4800 +audio/vnd.nuera.ecelp7470 +audio/vnd.nuera.ecelp9600 +audio/vnd.octel.sbc +audio/vnd.qcelp +audio/vnd.rhetorex.32kadpcm +audio/vnd.vmx.cvsd +audio/x-aiff aif aiff aifc +audio/x-alaw-basic +audio/x-mpegurl m3u +audio/x-pn-realaudio ram ra +audio/x-pn-realaudio-plugin +application/vnd.rn-realmedia rm +audio/x-wav wav +chemical/x-pdb pdb +chemical/x-xyz xyz +image/bmp bmp +image/cgm cgm +image/g3fax +image/gif gif +image/ief ief +image/jpeg jpeg jpg jpe +image/naplps +image/png png +image/prs.btif +image/prs.pti +image/svg+xml svg +image/t38 +image/tiff tiff tif +image/tiff-fx +image/vnd.cns.inf2 +image/vnd.djvu djvu djv +image/vnd.dwg +image/vnd.dxf +image/vnd.fastbidsheet +image/vnd.fpx +image/vnd.fst +image/vnd.fujixerox.edmics-mmr +image/vnd.fujixerox.edmics-rlc +image/vnd.globalgraphics.pgb +image/vnd.mix +image/vnd.ms-modi +image/vnd.net-fpx +image/vnd.svf +image/vnd.wap.wbmp wbmp +image/vnd.xiff +image/x-cmu-raster ras +image/x-icon ico +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-rgb rgb +image/x-xbitmap xbm +image/x-xpixmap xpm +image/x-xwindowdump xwd +message/delivery-status +message/disposition-notification +message/external-body +message/http +message/news +message/partial +message/rfc822 +message/s-http +message/sip +message/sipfrag +model/iges igs iges +model/mesh msh mesh silo +model/vnd.dwf +model/vnd.flatland.3dml +model/vnd.gdl +model/vnd.gs-gdl +model/vnd.gtw +model/vnd.mts +model/vnd.parasolid.transmit.binary +model/vnd.parasolid.transmit.text +model/vnd.vtu +model/vrml wrl vrml +multipart/alternative +multipart/appledouble +multipart/byteranges +multipart/digest +multipart/encrypted +multipart/form-data +multipart/header-set +multipart/mixed +multipart/parallel +multipart/related +multipart/report +multipart/signed +multipart/voice-message +text/calendar ics ifb +text/css css +text/directory +text/enriched +text/html html htm +text/parityfec +text/plain asc txt +text/prs.lines.tag +text/rfc822-headers +text/richtext rtx +text/rtf rtf +text/sgml sgml sgm +text/t140 +text/tab-separated-values tsv +text/uri-list +text/vnd.abc +text/vnd.curl +text/vnd.dmclientscript +text/vnd.fly +text/vnd.fmi.flexstor +text/vnd.in3d.3dml +text/vnd.in3d.spot +text/vnd.iptc.nitf +text/vnd.iptc.newsml +text/vnd.latex-z +text/vnd.motorola.reflex +text/vnd.ms-mediapackage +text/vnd.net2phone.commcenter.command +text/vnd.sun.j2me.app-descriptor +text/vnd.wap.si +text/vnd.wap.sl +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/x-setext etx +text/xml +text/xml-external-parsed-entity +video/bmpeg +video/bt656 +video/celb +video/dv +video/h261 +video/h263 +video/h263-1998 +video/h263-2000 +video/jpeg +video/mp1s +video/mp2p +video/mp2t +video/mp4v-es +video/mpv +video/mpeg mpeg mpg mpe +video/nv +video/parityfec +video/pointer +video/quicktime qt mov +video/smpte292m +video/vnd.fvt +video/vnd.motorola.video +video/vnd.motorola.videop +video/vnd.mpegurl mxu m4u +video/vnd.nokia.interleaved-multimedia +video/vnd.objectvideo +video/vnd.vivo +video/x-msvideo avi +video/x-sgi-movie movie +x-conference/x-cooltalk ice diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/htdocs/index.html b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/htdocs/index.html new file mode 100644 index 0000000000..911f66e013 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/htdocs/index.html @@ -0,0 +1,290 @@ + + + + + Apache Tuscany Alert Aggregator Sample + + + + + +

      Apache Tuscany Alert Aggregator Sample

      +

      Alert Sources:

      +
      +

      Recent Alerts (Refresh):

      +
      +
      +

      Back to top

      +
      + + + + diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/htdocs/pop.png b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/htdocs/pop.png new file mode 100644 index 0000000000..1cf1df24a7 Binary files /dev/null and b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/htdocs/pop.png differ diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/htdocs/rss.png b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/htdocs/rss.png new file mode 100644 index 0000000000..b3c949d224 Binary files /dev/null and b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/htdocs/rss.png differ diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/htdocs/style.css b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/htdocs/style.css new file mode 100644 index 0000000000..cd377e90e5 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/htdocs/style.css @@ -0,0 +1,166 @@ +/* + * 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. + */ + +p,table,li,h1,h2,h3 +{ +font-family: verdana, arial, 'sans serif'; +} + +p, h1, h2, h3, table, li, hr +{ +margin-left: 10pt; +} + +table +{ +border-color: black; +border-collapse: separate; +border-spacing: 0px 1px; + +margin-right: 10pt; +margin-left: 10pt; +width: 800px; +} + +.sourceDetailsTable +{ +width: 600px; +} + +tr, td +{ +margin-left: 0pt; +margin-right: 0pt; +padding-left: 10pt; +font-size: 90%; +} + +p,li,th +{ +font-size: 90%; +margin-left: 10pt; +} + +pre +{ +margin-left: 10pt; +} + +body +{ +#ffffff; +} + +h1,h2,h3,hr +{ +color: firebrick; +} + +a:link {COLOR: firebrick;} +a:visited {COLOR: firebrick;} +a:active {COLOR: navy;} + +.link +{ +COLOR: firebrick; +text-decoration: underline; +} + +.clickable +{ +cursor: pointer +} + +.unread_title +{ +font-weight: bold; +} + +.read_title +{ +font-weight: normal; +} + +.summary +{ +color: DimGrey; +} + +.hidden +{ +display: none; +} + +.alert_data +{ +margin-left: 10px; +width: 800px; +height: 800px; +} + +.source_0 +{ +background-color: LightGreen; +} + +.source_1 +{ +background-color: LightSkyBlue; +} + +.source_2 +{ +background-color: Khaki; +} + +.source_3 +{ +background-color: LightPink; +} + +.source_4 +{ +background-color: Orange; +} + +.source_5 +{ +background-color: LightCoral; +} + +.source_6 +{ +background-color: Orchid; +} + +.source_7 +{ +background-color: Peru; +} + +.source_8 +{ +background-color: SpringGreen; +} + +.source_9 +{ +background-color: LightGrey; +} + diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/startserver.bat b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/startserver.bat new file mode 100644 index 0000000000..fa4d66df31 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/startserver.bat @@ -0,0 +1,73 @@ +@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 APFULLDIR=%~d0%~p0 +echo Running from %APFULLDIR% + +if "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) +echo Using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) +echo Using SDO installed at %TUSCANY_SDOCPP% + +if "%HTTPD_HOME%" == "" ( +echo "HTTPD_HOME not set" +goto end +) +echo Using HTTPD installed at %HTTPD_HOME% + +set PATH=%TUSCANY_SCACPP%\extensions\python\bin;%TUSCANY_SCACPP%\extensions\rest\interface\bin;%TUSCANY_SCACPP%\extensions\rest\service\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%HTTPD_HOME%\bin;%PATH% +set PYTHONPATH=%TUSCANY_SCACPP%\extensions\python\bin + +set TUSCANY_SCACPP_ROOT=%APFULLDIR%\..\ +set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +@REM Generate the tuscany_sca_mod_rest configuration +if not exist %APFULLDIR%\conf\tuscany_sca_mod_rest.conf ( + echo LoadModule sca_rest_module %TUSCANY_SCACPP%/extensions/rest\service/bin/tuscany_sca_mod_rest.dll > %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo TuscanyHome %TUSCANY_SCACPP% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo SetHandler sca_rest_module >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo TuscanyRoot %TUSCANY_SCACPP_ROOT% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf +) + +@REM Generate the base HTTPD configuration +if not exist %APFULLDIR%\conf\base.conf ( + echo LoadModule mime_module %HTTPD_HOME%\modules\mod_mime.so > %APFULLDIR%\conf\base.conf + echo LoadModule dir_module %HTTPD_HOME%\modules\mod_dir.so >> %APFULLDIR%\conf\base.conf + echo DocumentRoot %APFULLDIR%\htdocs >> %APFULLDIR%\conf\base.conf +) + +@REM Create logs directory +if not exist %APFULLDIR%\logs mkdir %APFULLDIR%\logs +set TUSCANY_SCACPP_LOG=%APFULLDIR%\logs\tuscany-server.log +set TUSCANY_SCACPP_LOGGING=9 + +@REM Start the HTTP server +echo Starting Apache httpd +httpd -d %APFULLDIR% diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/startserver.sh b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/startserver.sh new file mode 100755 index 0000000000..d197b94245 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/startserver.sh @@ -0,0 +1,78 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$PYTHON_LIB != x ]; then +echo "Using Python library installed at $PYTHON_LIB" +export LD_LIBRARY_PATH=$PYTHON_LIB:$LD_LIBRARY_PATH +export PATH=$PYTHON_LIB/../bin:$PATH +fi + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/python/lib:$TUSCANY_SCACPP/extensions/ruby/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH +export PYTHONPATH=$TUSCANY_SCACPP/extensions/python/lib:$PYTHONPATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ +export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +libsuffix=.so +UNAME=`uname -s` +if [ "x$UNAME" = "xDarwin" ]; then + libsuffix=.dylib +fi + +# Generate the mod_rest configuration +if [ ! -f conf/tuscany_sca_mod_rest.conf ]; then + echo "LoadModule sca_rest_module $TUSCANY_SCACPP/extensions/rest/service/lib/libtuscany_sca_mod_rest$libsuffix" >conf/tuscany_sca_mod_rest.conf + echo "TuscanyHome $TUSCANY_SCACPP" >>conf/tuscany_sca_mod_rest.conf + echo "" >>conf/tuscany_sca_mod_rest.conf + echo " SetHandler sca_rest_module" >>conf/tuscany_sca_mod_rest.conf + echo " TuscanyRoot $TUSCANY_SCACPP_ROOT" >>conf/tuscany_sca_mod_rest.conf + echo "" >>conf/tuscany_sca_mod_rest.conf +fi + +if [ ! -f conf/base.conf ]; then + echo "DocumentRoot $APFULLDIR/htdocs" >conf/base.conf +fi + +# Create logs directory +if [ ! -d logs ]; then + mkdir logs +fi + +# Start the HTTP server +echo "Starting Apache httpd" + +# Set LD_PRELOAD to use the expat included in Python to avoid incompatibilities +export LD_PRELOAD=$TUSCANY_SCACPP/extensions/python/lib/libtuscany_sca_python$libsuffix + +apachectl -k start -d $APFULLDIR + diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/stopserver.sh b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/stopserver.sh new file mode 100755 index 0000000000..c17f632a3e --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/httpserver/stopserver.sh @@ -0,0 +1,25 @@ +#!/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` + +# Stop the HTTP server +echo "Stopping Apache httpd" +apachectl -k stop -d $APFULLDIR + diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter.app.composite b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter.app.composite new file mode 100644 index 0000000000..4c0d4ccd1a --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter.app.composite @@ -0,0 +1,33 @@ + + + + + + + + sample.alerter.AlerterComponent/AlerterService + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/AlertCheckerImpl.py b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/AlertCheckerImpl.py new file mode 100644 index 0000000000..d9aab820ac --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/AlertCheckerImpl.py @@ -0,0 +1,116 @@ +# 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. +# +import xml.etree.ElementTree, datetime + +def getAllNewAlerts (): + + returnXML = "\n" + returnElem = xml.etree.ElementTree.XML(returnXML) + + # Use the alertConfigService to get the configuration + configElem = alertConfigService.getAlertConfig() + + for sourceElem in configElem.findall("./{http://tuscany.apache.org/samples/alerter}source"): + + sourceid = sourceElem.attrib["id"] + + newAlerts = getAlerts(sourceElem) + if xml.etree.ElementTree.iselement(newAlerts): + # Add the sourceid to each alert and append to the entire list + for alert in newAlerts.findall("./{http://tuscany.apache.org/samples/alerter}alert"): + alert.attrib["sourceid"] = sourceid + returnElem.append(alert) + + return returnElem + +def getAlerts (sourceElem): + + lastcheckedElem = sourceElem.find("./{http://tuscany.apache.org/samples/alerter}lastChecked") + if not xml.etree.ElementTree.iselement(lastcheckedElem): + lastcheckedElem = xml.etree.ElementTree.SubElement(sourceElem, "lastChecked") + lastcheckedElem.text = "" + + if sourceElem.attrib["type"] == "rss": + + feedaddress = sourceElem.find("./{http://tuscany.apache.org/samples/alerter}feedAddress").text + + if feedaddress: + # Use the rssCheckerService to get new articles for this config + newAlerts = rssCheckerService.getNewAlerts(feedaddress, lastcheckedElem.text) + + lastcheckedElem.text = datetime.datetime.now().replace(microsecond=0).isoformat() + alertConfigService.updateSourceConfig(sourceElem) + return newAlerts + + elif sourceElem.attrib["type"] == "pop": + + popserver = sourceElem.find("./{http://tuscany.apache.org/samples/alerter}popServer").text + popusername = sourceElem.find("./{http://tuscany.apache.org/samples/alerter}popUsername").text + poppassword = sourceElem.find("./{http://tuscany.apache.org/samples/alerter}popPassword").text + + if popserver and popusername and poppassword: + # Use the popCheckerService to get new emails for this config + newAlerts = popCheckerService.getNewAlerts(popserver, popusername, poppassword, lastcheckedElem.text) + + lastcheckedElem.text = datetime.datetime.now().replace(microsecond=0).isoformat() + alertConfigService.updateSourceConfig(sourceElem) + return newAlerts + + else: + print "Source type not supported: ", sourceElem.attrib["type"] + + return None + + +def getNewAlerts (sourceId): + # Use the alertConfigService to get the configuration + sourceConfigElem = alertConfigService.getSourceConfig(sourceId) + + # Get the alerts + newAlerts = getAlerts(sourceConfigElem) + + if xml.etree.ElementTree.iselement(newAlerts): + # Add the sourceid to each alert + for alert in newAlerts.findall("./{http://tuscany.apache.org/samples/alerter}alert"): + alert.attrib["sourceid"] = sourceId + + return newAlerts + +def addAlertSource (sourceElem): + # Add the source directly to the configuration + return alertConfigService.addSourceConfig(sourceElem) + +def updateAlertSource (sourceElem): + # Update the source in the configuration + return alertConfigService.updateSourceConfig(sourceElem) + +def removeAlertSource (sourceId): + # Remove the source from the configuration + alertConfigService.removeSourceConfig(sourceId) + +def getAlertSources (): + # Get the config for all the sources + return alertConfigService.getAlertConfig() + +# # Testing +# import AlertConfigImpl as alertConfigService +# import RSSCheckerImpl as rssCheckerService +# import POPCheckerImpl as popCheckerService +# +# print xml.etree.ElementTree.tostring(getAlertSources()) +# print xml.etree.ElementTree.tostring(getAllNewAlerts()) diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/AlertConfigImpl.py b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/AlertConfigImpl.py new file mode 100644 index 0000000000..2800a940b4 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/AlertConfigImpl.py @@ -0,0 +1,175 @@ +# 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. +# + +import xml.etree.ElementTree, os.path, os + +def getAlertConfig (): + + # Set up some default config data + configData = "\n" + + if os.path.isfile(os.environ['TUSCANY_SCACPP_ROOT']+"/config.xml"): + # Retrieve the configuration from a file + f = open(os.environ['TUSCANY_SCACPP_ROOT']+"/config.xml") + try: + configData = f.read() + finally: + f.close() + + configElem = xml.etree.ElementTree.XML(configData) + + return configElem + +def getSourceConfig (sourceId): + + configElem = getAlertConfig() + + for sourceElem in configElem.findall("./{http://tuscany.apache.org/samples/alerter}source"): + if sourceElem.attrib["id"] == sourceId: + return sourceElem + + print "Source with id matching",sourceId,"not found" + return + +def updateSourceConfig (alertSourceConfigElem): + + configElem = getAlertConfig() + sourceId = alertSourceConfigElem.attrib["id"] + + for sourceElem in configElem.findall("./{http://tuscany.apache.org/samples/alerter}source"): + if sourceElem.attrib["id"] == sourceId: + configElem.remove(sourceElem) + configElem.append(alertSourceConfigElem) + saveConfigData(configElem) + return + print "Source with id matching",sourceId,"not found" + return + +def addSourceConfig (alertSourceConfigElem): + configElem = getAlertConfig() + + #check for source ID, make sure it's not the same as others and create one if it's missing + if "id" in alertSourceConfigElem.attrib: + configId = alertSourceConfigElem.attrib["id"] + else: + configId = "0" + + gotConfigId = False + + while gotConfigId == False: + + config = getSourceConfig(configId) + if config: + configId = str( int(configId)+1 ) + else: + gotConfigId = True + + + alertSourceConfigElem.attrib["id"] = configId + + configElem.append(alertSourceConfigElem) + saveConfigData(configElem) + + return configId + +def saveConfigData (configElem): + configData = xml.etree.ElementTree.tostring(configElem) + + # Save the configuration to a file + f = open(os.environ['TUSCANY_SCACPP_ROOT']+"/config.xml", "w") + + if not f: + print "Failed to open config file for writing" + try: + f.write(configData) + finally: + f.close() + +def removeSourceConfig(sourceId): + configElem = getAlertConfig() + for sourceElem in configElem.findall("./{http://tuscany.apache.org/samples/alerter}source"): + if sourceElem.attrib["id"] == sourceId: + configElem.remove(sourceElem) + saveConfigData(configElem) + return + +# # Testing +# if os.path.isfile("config.xml"): +# os.remove("config.xml") +# data = getAlertConfig() +# print xml.etree.ElementTree.tostring(data), "\n" +# +# newsrcxml = "\n" +# newsrcxml += "PSP Updates\n" +# newsrcxml += "
      http://pspupdates.qj.net
      \n" +# newsrcxml += "http://pspupdates.qj.net/rss.xml" +# +# newsrc = xml.etree.ElementTree.XML(newsrcxml) +# ID = addSourceConfig(newsrc) +# print "Added src with ID:", ID, "\n" +# +# newsrcxml = "\n" +# newsrcxml += "PSP Updates\n" +# newsrcxml += "
      http://pspupdates.qj.net!
      \n" +# newsrcxml += "http://pspupdates.qj.net/atom.xml" +# +# newsrc = xml.etree.ElementTree.XML(newsrcxml) +# ID = addSourceConfig(newsrc) +# print "Added src with ID:", ID, "\n" +# +# data = getAlertConfig() +# print xml.etree.ElementTree.tostring(data), "\n" +# +# data = getSourceConfig("0") +# print xml.etree.ElementTree.tostring(data), "\n" +# print dir(data), "\n" +# +# name = data.find("./{http://tuscany.apache.org/samples/alerter}name") +# name.text = "Hello world!" +# +# updateSourceConfig(data) +# data = getSourceConfig("1") +# print xml.etree.ElementTree.tostring(data), "\n" +# +# removeSourceConfig("1") +# data = getAlertConfig() +# print xml.etree.ElementTree.tostring(data), "\n" +# +# ID = addSourceConfig(newsrc) +# print "Added src with ID:", ID, "\n" +# +# ID = addSourceConfig(newsrc) +# print "Added src with ID:", ID, "\n" +# +# data = getAlertConfig() +# print xml.etree.ElementTree.tostring(data), "\n" +# +# +# newsrcxml = "\n" +# newsrcxml += "PSP Updates\n" +# newsrcxml += "
      http://pspupdates.qj.net!
      \n" +# newsrcxml += "http://pspupdates.qj.net/atom.xml" +# +# newsrc = xml.etree.ElementTree.XML(newsrcxml) +# ID = addSourceConfig(newsrc) +# print "Added src with ID:", ID, "\n" +# +# data = getAlertConfig() +# print xml.etree.ElementTree.tostring(data), "\n" +# + diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/Alerter.xsd b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/Alerter.xsd new file mode 100644 index 0000000000..c59460995d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/Alerter.xsd @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/Makefile.am b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/Makefile.am new file mode 100644 index 0000000000..9a0ca276a0 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/Makefile.am @@ -0,0 +1,23 @@ +# 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. + +deploydir=$(prefix)/AlertAggregator/deploy +compositedir=$(deploydir)/sample.alerter + +composite_DATA = *.composite *.py *.rb *.xsd +EXTRA_DIST = *.composite *.py *.rb *.xsd + diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/POPCheckerImpl.py b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/POPCheckerImpl.py new file mode 100644 index 0000000000..0ae115ac2e --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/POPCheckerImpl.py @@ -0,0 +1,104 @@ +# 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. +# + +import poplib, email, datetime, re, xml.etree.ElementTree + +def getNewAlerts(popserver, username, password, lastchecktimestamp): + + print "POPCheckerImpl getting new POP e-mail alerts\n" + + alertsXML = "\n" + + # initially set lastchecked to the epoch before trying to use the lastchecked string + lastcheckdate = datetime.datetime.min + if lastchecktimestamp: + lastcheckdate = datetime.datetime.strptime(lastchecktimestamp, "%Y-%m-%dT%H:%M:%S") + + numberOfNewEmails = 0 + + mail = poplib.POP3(popserver) + mail.user(username) + mail.pass_(password) + msgCount, inboxSize = mail.stat() + + for msgNum in range(msgCount): + + print "getting msg", msgNum+1, "of", msgCount + + data = "" + for line in mail.retr(msgNum+1)[1]: + data += str(line) + data += "\n" + + msg = email.message_from_string(data) + + # date is of form "Sun, 21 Jan 2007 13:51:53 -0500" + msgDateString = msg.get("Date") + msgDateString, tz = msgDateString.rsplit(None, 1) + + timezoneadjust = datetime.timedelta(0, (int(tz)/100)*60*60 + int(tz[3:5])*60) + + msgdate = datetime.datetime.strptime(msgDateString, "%a, %d %b %Y %H:%M:%S") + timezoneadjust + + if msgdate >= lastcheckdate: + msgTo = msg.get("To") + msgFrom = msg.get("From") + msgSubject = msg.get("Subject") + + msgBody = "" + if msg.is_multipart(): + for msgPart in msg.get_payload(): + if msgPart.get_content_type() == "text/plain" or (msgPart.get_content_type() == "text/html" and msgBody == ""): + msgBody = msgPart.get_payload() + else: + msgBody = msg.get_payload() + + alertsXML += "" + encodeXML(msgFrom) + " - "+encodeXML(msgSubject)+"\n" + alertsXML += "
      \n" + alertsXML += "" + msgdate.isoformat() + "\n" + alertsXML += "From: " + encodeXML(msgFrom) + alertsXML += "\nTo: "+encodeXML(msgTo) + alertsXML += "\nSubject: "+encodeXML(msgSubject) + alertsXML += "\nDate: " + msgdate.isoformat() + alertsXML += "\n\n" + stripXML(msgBody) + "
      \n" + + + mail.quit() + + alertsXML += "
      " + + return xml.etree.ElementTree.XML(alertsXML) + + +def encodeXML(data): + data = re.sub("<","[", data) + data = re.sub(">","]", data) + return data + +def stripXML(data): + elementsRemoved = re.sub("<.*?>","", data) + entitiesRemoved = re.sub("&.*?;", " ", elementsRemoved) + asciiEncoded = entitiesRemoved.encode('ASCII', 'replace') + returnData = asciiEncoded.replace('&', 'and') + return returnData + + + +# Testing + +# print getNewAlerts("mail.eclipse.co.uk", "andrew@borley-hall.eclipse.co.uk", "app73sauc3", "2007-01-29T02:15:53") diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/POPCheckerImpl.rb b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/POPCheckerImpl.rb new file mode 100644 index 0000000000..e61046cb84 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/POPCheckerImpl.rb @@ -0,0 +1,122 @@ +# 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. +# + +require 'net/pop' +require "rexml/document" +include REXML + +# class POPChecker +# +# def initialize() +# print "POPCheckerImpl.initialize\n" +# end + +def getNewAlerts(popserver, username, password, lastchecked) + + print "POPCheckerImpl getting new POP e-mail alerts\n" + + alertsXML = "\n" + + # initially set lastchecked to the epoch before trying to use the lastchecked string + lastcheckedtime = Time.at(0) + if lastchecked != '' + # lastchecked (if provided) is of form 2007-02-17T23:34:56 + year , month, day, hour, min, sec = lastchecked.split(/[-T:]/) + lastcheckedtime = Time.gm(year , month, day, hour, min, sec, nil) + end + + numberOfEmails = 0 + + Net::POP3.start(popserver, 110, username, password) do |pop| + + if !pop.mails.empty? + pop.each_mail do |m| + msg = m.pop + + header, body = msg.split("\r\n\r\n", 2) + date = getMessageField("Date", header) + # date is of form "Sun, 21 Jan 2007 13:51:53 -0500" + parts = date.split(' ') + timeparts = parts[4].split(':') + timezoneSecs = (parts[5].to_i()/100)*60*60 + (parts[5].slice(-2,0).to_i())*60 + + msgtime = Time.gm(timeparts[2], timeparts[1], timeparts[0], parts[1], parts[2], parts[3], nil, nil, nil, nil) + timezoneSecs + + + if msgtime >= lastcheckedtime + from = getMessageField("From", header) + subject = getMessageField("Subject", header) + + alertsXML += "From: " + encodeXML(from) + "\nSubject: "+encodeXML(subject)+"\n" + alertsXML += "
      \n" + alertsXML += "" + msgtime.strftime("%Y-%m-%dT%H:%M:%S") + "\n" + alertsXML += "" + stripXML(body) + "
      \n" + + numberOfEmails += 1 + end + + end + end + end + alertsXML += "
      " + + # Print XML + # puts alertsXML + print "POPCheckerImpl retrieved "+numberOfEmails.to_s+" new POP e-mail alerts\n" + + # Return data as REXML document + result = Document.new(alertsXML) + + return result +end + + +def getMessageField(field, message) + + # Use a regex to get the field + pattern = '^'+field+': (.*?)$' + + re = Regexp.new(pattern) + re =~ message + + if $1 == nil + return '' + end + + return $1 +end + +def encodeXML(data) + data = data.gsub(//,'>') + return data +end + +def stripXML(data) + data = data.gsub(/<.*?>/m,'') + data = data.gsub(/&.*?;/, ' ') + data = data.gsub(/&/, 'and') + data = encodeXML(data) + return data +end + + + +# # Testing +# pop = POPChecker.new() +# print pop.getNewAlerts("mail.eclipse.co.uk", "andrew@borley-hall.eclipse.co.uk", "app73sauc3", "2007-01-29T02:15:53") diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/RSSCheckerImpl.py b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/RSSCheckerImpl.py new file mode 100644 index 0000000000..2e320c0b22 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/RSSCheckerImpl.py @@ -0,0 +1,76 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +import feedparser, datetime, xml.etree.ElementTree, re + +def getNewAlerts(rssaddress, lastchecktimestamp): + + print "RSSCheckerImpl.getNewAlerts() called", rssaddress, lastchecktimestamp + + #Get and parse the RSS/Atom data + d = feedparser.parse(rssaddress) + + newalertsxml = "\n" + + lastcheckdate = datetime.datetime.min + if lastchecktimestamp: + lastcheckdate = datetime.datetime.strptime(lastchecktimestamp, "%Y-%m-%dT%H:%M:%S") + + defaultTitle = d.feed.get('title', 'RSS feed article') + defaultLink = d.feed.get('link', 'http://incubator.apache.org/tuscany') + defaultSummary = 'No information provided' + + for entry in d.entries: + + if entry.has_key('date'): + (year, month, day, hour, minute, second, millisecond, microsecond, tzinfo) = entry.date_parsed + entrydate = datetime.datetime(year, month, day, hour, minute, second) + else: + entrydate = datetime.datetime.now() + + + if (entrydate > lastcheckdate) : + + newalertsxml += "" + stripXML(entry.get('title', defaultTitle)) + "\n" + newalertsxml += "
      " + entry.get('link', defaultLink) + "
      \n" + newalertsxml += "" + entrydate.isoformat() + "\n" + newalertsxml += "" + stripXML(entry.get('description', defaultSummary)) + "
      \n" + newalertsxml += "
      " + + return xml.etree.ElementTree.XML(newalertsxml) + +def stripXML(data): + elementsRemoved = re.sub("<.*?>","", data) + entitiesRemoved = re.sub("&.*?;", " ", elementsRemoved) + asciiEncoded = entitiesRemoved.encode('ASCII', 'replace') + returnData = asciiEncoded.replace('&', 'and') + return returnData + + +# Testing +# print xml.etree.ElementTree.tostring(getNewAlerts("http://www.engadget.com/rss.xml", "2007-02-07T17:11:14")) +# +# +# today = datetime.datetime.now().replace(hour=0, minute=0, second=0, microsecond=0) +# data2 = getNewAlerts("http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml", today.isoformat()) +# print xml.etree.ElementTree.tostring(data2) +# +# print "1st call returned", len(data.findall("./{http://tuscany.apache.org/samples/alerter}alert")), "elements" +# print "2nd call returned", len(data2.findall("./{http://tuscany.apache.org/samples/alerter}alert")), "elements" + + diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/sample.alerter.composite b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/sample.alerter.composite new file mode 100644 index 0000000000..21c4ee1093 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.alerter/sample.alerter.composite @@ -0,0 +1,49 @@ + + + + + + + + AlertCheckerComponent + + + + + AlertConfigComponent + RSSCheckerComponent + POPCheckerComponent + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.display/Alerter.xsd b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.display/Alerter.xsd new file mode 100644 index 0000000000..c59460995d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.display/Alerter.xsd @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.display/HTMLDisplayImpl.py b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.display/HTMLDisplayImpl.py new file mode 100644 index 0000000000..0122701063 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.display/HTMLDisplayImpl.py @@ -0,0 +1,379 @@ +# 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. +# +# + + +import xml.etree.ElementTree, datetime, os.path, os + +ns = "./{http://tuscany.apache.org/samples/alerter}" + +def getSavedAlerts(): + + # Set up some default config data + alertsData = "\n" + + if os.path.isfile(os.environ['TUSCANY_SCACPP_ROOT']+"/sample.display/alerts.xml"): + # Retrieve the configuration from a file + f = open(os.environ['TUSCANY_SCACPP_ROOT']+"/sample.display/alerts.xml") + try: + alertsData = f.read() + finally: + f.close() + + alertsElem = xml.etree.ElementTree.XML(alertsData) + + return alertsElem + +def saveAlerts(alertsElem): + alertsData = xml.etree.ElementTree.tostring(alertsElem) + + # Save the configuration to a file + f = open(os.environ['TUSCANY_SCACPP_ROOT']+"/sample.display/alerts.xml", "w") + + if not f: + print "Failed to open alerts file for writing" + try: + f.write(alertsData) + finally: + f.close() + + +def updateAllAlertsHTMLTable (): + + alertsElem = getSavedAlerts() + + # Use the alertService reference + newAlertsElem = alertService.getAllNewAlerts() + #newAlertsElem = getAllNewAlerts(); # For testing + + for alert in newAlertsElem.findall(ns+"alert"): + + alert.attrib["unread"]="True" + alertsElem.append(alert) + + return generateHTMLTable(alertsElem) + + +def updateSourceAlertsHTMLTable (sourceId): + + alertsElem = getSavedAlerts() + + # Use the alertService reference + newAlertsElem = alertService.getNewAlerts(sourceId); + #newAlertsElem = getAllNewAlerts(); # For testing + + for alert in newAlertsElem.findall(ns+"alert"): + + alert.attrib["unread"]="True" + alertsElem.append(alert) + + return generateHTMLTable(alertsElem) + + + +def generateHTMLTable (alertsElem): + + returnData = "" + + # If we have more than x alerts, clear out any that have been read + # x is determined by the showNumberOfReadAlerts property + alerts = alertsElem.findall(ns+"alert") + if len(alerts) > int(showNumberOfReadAlerts): + for alert in alerts: + if alert.attrib["unread"]!="True": + alertsElem.remove(alert) + + alertIDNumber = 0 + for alert in alertsElem.findall(ns+"alert"): + + date = datetime.datetime.strptime(alert.find(ns+"date").text, "%Y-%m-%dT%H:%M:%S") + alertID = "alert_"+str(alertIDNumber) + alert.attrib["id"]= alertID + alertIDNumber += 1 + + returnData += "\n" + + returnData += "
      " + title = alert.find(ns+"title").text + noOfChars = 75-len(title) + + if noOfChars>0: + returnData += title + returnData += " - " + returnData += alert.find(ns+"summary").text[0:noOfChars] + returnData += "..." + else: + returnData += title[0:80] + returnData += "" + + returnData += date.strftime("%d/%m/%Y %I:%M %p") + returnData += "
      " + + saveAlerts(alertsElem) + #print xml.etree.ElementTree.tostring(alertsElem) + return returnData + +def readAlert (alertID): + + alertsElem = getSavedAlerts() + + returnData = "" + for alert in alertsElem.findall(ns+"alert"): + + if alert.attrib["id"]==alertID: + alert.attrib["unread"] = "False" + + saveAlerts(alertsElem) + + srcType = getSourceType(alert.attrib["sourceid"]) + + if srcType=="pop": + returnData += "
      "
      +                returnData += alert.find(ns+"summary").text
      +                returnData += "
      " + return returnData + + return + +def getSourceType(sourceid): + # Use the alertService reference + alertSources = alertService.getAlertSources() + #alertSources = getAlertSources() #testing + + for source in alertSources.findall(ns+"source"): + + if sourceid == source.attrib["id"]: + return source.attrib["type"] + + return "none" + + +def getAlertSourcesHTMLTable(): + + returnData = "\n" + + # Use the alertService reference + alertSources = alertService.getAlertSources() + #alertSources = getAlertSources() #testing + + srcIdList = [] + + for source in alertSources.findall(ns+"source"): + + srcId = source.attrib["id"] + srcIdList.append(srcId) + srcType = source.attrib["type"] + + # Write out the source data row + returnData += "\n" + + # Now write out the row that gets shown when "edit" is pressed + returnData += "" + + # Get the first unused srcId + srcId = "0" + while srcId in srcIdList: + srcId = str(int(srcId)+1) + + # Now write out the "add new source" row + returnData += "" + # Add the (initially hidden) new source details row + returnData += "" + returnData += "
      " + returnData += "  " + returnData += source.find(ns+"name").text + returnData += "Update AlertsEdit SourceDelete Source
      " + if srcType=="rss": + returnData += "" + elif srcType=="pop": + returnData += "" + returnData += "" + returnData += "" + returnData += "
      Source name:
      Source address:
      Feed address:
      POP3 server:
      Username:
      Password:
      Add new Alert Source
      " + # Section for RSS feeds + returnData += "" + # Section for POP3 email + returnData += "" + # Last row for buttons + returnData += "
      Source name:
      Source address:
      Source type:
      Feed address:
      " + returnData += "" + returnData += "
      POP3 server:
      Username:
      Password:
      \n" + return returnData + + +def deleteAlertSource (sourceId): + # Use the alertService reference + alertService.removeAlertSource(sourceId) + + + # Remove all alerts with this sourceid + alertsElem = getSavedAlerts() + for alert in alertsElem.findall(ns+"alert"): + if alert.attrib["sourceid"]==sourceId: + alertsElem.remove(alert) + + saveAlerts(alertsElem) + +def addAlertSource(alertSourceElem): + if xml.etree.ElementTree.iselement(alertSourceElem): + # Use the alertService reference + alertService.addAlertSource(alertSourceElem) + return + +def updateAlertSource(alertSourceElem): + + if xml.etree.ElementTree.iselement(alertSourceElem): + + alertsElem = getSavedAlerts() + + # Get the sourceid + sourceId = alertSourceElem.attrib["id"] + + # Remove all alerts with this sourceid - they may have changed + for alert in alertsElem.findall(ns+"alert"): + if alert.attrib["sourceid"]==sourceId: + alertsElem.remove(alert) + + # Use the alertService reference to update the config + alertService.updateAlertSource(alertSourceElem) + + saveAlerts(alertsElem) + + return + + +# # For testing +# showNumberOfReadAlerts = 3 +# +# def getAllNewAlerts (): +# +# data = "" +# +# data += "Arrests over 'terror kidnap plot'" +# data += "Anti-terror police arrest eight people in Birmingham over an alleged plot to kidnap a member of the armed forces." +# data += "
      http://news.bbc.co.uk/go/rss/-/1/hi/uk/6315989.stm
      2007-01-31T15:34:18
      " +# +# data += "
      " +# +# return xml.etree.ElementTree.XML(data) +# +# print getAlertsHTMLTable () + "\n" +# +# readAlert("http://news.bbc.co.uk/go/rss/-/1/hi/uk/6315989.stm") +# +# print getAlertsHTMLTable () + "\n" +# +# def getAlertSources (): +# +# data = "" +# data += "BBC News" +# data += "
      http://news.bbc.co.uk/
      " +# data += "2007-02-02T10:08:40" +# data += "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml" +# data += "
      " +# return xml.etree.ElementTree.XML(data) +# +# print getAlertSourcesHTMLTable() diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.display/Makefile.am b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.display/Makefile.am new file mode 100644 index 0000000000..6ac781c7df --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.display/Makefile.am @@ -0,0 +1,23 @@ +# 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. + +deploydir=$(prefix)/AlertAggregator/deploy +compositedir=$(deploydir)/sample.display + +composite_DATA = *.composite *.py *.xsd +EXTRA_DIST = *.composite *.py *.xsd + diff --git a/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.display/sample.display.composite b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.display/sample.display.composite new file mode 100644 index 0000000000..593c53c15f --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/AlertAggregator/sample.display/sample.display.composite @@ -0,0 +1,39 @@ + + + + + + + + HTMLDisplayComponent + + + + + AlerterService + 20 + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/COPYING b/sca-cpp/trunk/contrib/samples/COPYING new file mode 100755 index 0000000000..6b0b1270ff --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/COPYING @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/sca-cpp/trunk/contrib/samples/ChangeLog b/sca-cpp/trunk/contrib/samples/ChangeLog new file mode 100644 index 0000000000..e69de29bb2 diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/Makefile.am b/sca-cpp/trunk/contrib/samples/CppBigBank/Makefile.am new file mode 100644 index 0000000000..95045e0be6 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/Makefile.am @@ -0,0 +1,21 @@ +# 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. + +deploydir=$(prefix)/CppBigBank/deploy +SUBDIRS = bigbank.account bigbank.client bigbank.phpwsclient +EXTRA_DIST = *.composite README.html +deploy_DATA = *.composite diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/README b/sca-cpp/trunk/contrib/samples/CppBigBank/README new file mode 100644 index 0000000000..341db17b63 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/README @@ -0,0 +1,26 @@ +Tuscany SCA for C++ Samples - C++ BigBank Sample +=============================================== + +This sample implements the "Simplified BigBank" scenario. A whitepaper +describing the scenario based on the SCA 0.9 Assembly specification can be +found here. This sample uses multiple C++ components, calls out to an +external Web Service via a reference, exposes the service as a Web Service +and also provides a PHP based client. + +There are three sub projects in this workspace: + - bigbank.account + This contains the source code and SCDL artifacts for the SCA BigBank + composite implementing the account services. + + - bigbank.client + A sample client which does a local call to the BigBank service. + + - bigbank.phpclient + A sample PHP client which calls the BigBank Web service and then + deconstructs and displays the result by using the SDO for PHP extension. + +Additionally, there is the bigbank.app.composite file. This describes the +configuration of the SCA BigBank composite deployed to the SCA runtime. + +See the README.html file for instructions to build and run this sample + diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/README.html b/sca-cpp/trunk/contrib/samples/CppBigBank/README.html new file mode 100644 index 0000000000..4720dd7b57 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/README.html @@ -0,0 +1,389 @@ + + + + + + + + + + + + Tuscany SCA Native Samples - C++ BigBank Sample + + + +
      +
      +
      +

      Tuscany SCA Native Samples - C++ BigBank Sample

      + +

      This sample implements the "Simplified BigBank" scenario. A whitepaper describing + the scenario based on the SCA 0.9 Assembly specification can be found + here. + This sample uses multiple C++ components, calls out to an external Web Service via a reference, + exposes the service as a Web Service and also provides a PHP based client. +

      +

      There are three sub projects in this workspace:

      +
        +
      • bigbank.account
        + This contains the source code and SCDL artifacts for the SCA BigBank + composite implementing the account services. +
      • +
      • bigbank.client
        + A sample client which does a local call to the BigBank service. +
      • +
      • bigbank.phpclient
        + A sample PHP client which calls the BigBank Web service and then deconstructs + and displays the result by using the + SDO for PHP extension. +

        This is a pair of very simple PHP scripts to demonstrate how the Accounts service + that the C++ Big Bank sample exposes can be used from within the PHP scripting + language. +

        +

        bigwelcome.php
        + A bootstrap script that shows a form and allows the user to press a button + in order to invoke the bigaccount.php script +

        +

        bigaccount.php
        + Makes a call to a locally installed BigBank Accounts service. The script + shows how to use PHP SDO and SOAP extensions to construct the call + and interpret the result. +

        +
      • +
      +

      Additionally, there is the bigbank.app.composite file. This describes the + configuration of the SCA BigBank composite deployed to the SCA runtime. +

      + +
      + + + + +
      +

      Building the C++ samples on Linux and Mac OS X

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
      2. + +
      3. Build the C++ samples with the following command sequence: +
          +
        • cd <tuscany_sca_install_dir>/samples
        • +
        • ./configure --prefix=$TUSCANY_SCACPP/samples --enable-static=no
        • +
        • make
        • +
        • make install
        • +
        + NOTE: If you don't provide the --prefix configure option, it will by default install into + /usr/local/tuscany/sca/samples/CppBigBank
      4. +
      +
      + +
      +

      Running the C++ BigBank sample on Linux and Mac OS X

      +

      BigBank with basic client

      +
        +
      1. The C++ BigBank sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
      2. +
      3. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        • AXIS2C_HOME=<path to Axis2/C version 0.96>
        • +
        +
      4. +
      5. Run the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>/samples/CppBigBank/deploy/bigbank.client
        • +
        • ./runclient.sh
        • +
        +
      6. +
      +

      BigBank with PHP web client

      +
        +
      1. The C++ BigBank sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
      2. +
      3. Ensure you have enabled Axis2/C to run Tuscany SCA services. Follow the instructions + found here. +
      4. +
      5. Start the Axis2/C simple http server: +
          +
        1. The following environment variables are required: +
            +
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • +
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • +
          • AXIS2C_HOME=<path to Axis2/C version 0.96>
          • +
          +
        2. +
        3. cd <tuscany_sca_install_dir>/samples/CppBigBank/deploy/bin +
        4. +
        5. ./runwsserver.sh
        6. +
        +
      6. +
      7. To run the php scripts requires some configuration and setup of a php runtime with + the SDO and SimpleXML extensions enabled. The bits you will need are: + +

        Follow + these instructions to + install SDO and DAS. +

        +
      8. +
      9. You need to configure Apache to run PHP of course. This is well documented but this + is what to put at the end of httpd.conf: +
        # PHP5 Support
        +LoadModule php5_module "/home/php/php5.1.6/php5apache2.so"
        +AddType application/x-httpd-php .php
        +
        +# configure the path to php.ini
        +PHPIniDir "/home/php/php5.1.6"
        +
      10. +
      11. Copy the <tuscany_sca_install_dir>/samples/CppBigBank/bigbank.phpwsclient + directory to your Apache document root directory (by default this is named 'htdocs'). +
      12. +
      13. Finally, start your Apache web server. +
      14. +
      15. Run the PHP web client by pointing your browser at + http://localhost/bigbank.phpwsclient/welcome.php. + You should now be able to press the "GetAccount" button and see the values + returned from the BigBank SCA application. +
      16. + +
      +
      + +
      +

      Building the C++ BigBank sample on Windows

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
      2. + +
      3. You must have set up the environment for Microsoft Visual C++ tools. + The build command will call vcvars32 to set the environment. Ensure the + directory containing this is on your path. This will be where you + installed the compiler. +
      4. +
      5. Build the source, either via the Visual Studio Express projects under + <tuscany_sca_install_dir>\samples\CppBigBank\VSExpress\CppBigBank.sln or via the command-line build file + found at <tuscany_sca_install_dir>\samples\CppBigBank\VSExpress\CppBigBank\build.bat + which will build and deploy the samples. +
      6. +
      +
      + +
      +

      Running the C++ BigBank sample on Windows

      +

      BigBank with basic client

      +
        +
      1. The C++ BigBank sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
      2. +
      3. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        +
      4. +
      5. Run the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>\samples\CppBigBank\deploy\bigbank.client
        • +
        • runclient.bat
        • +
        +
      6. +
      +

      BigBank with PHP web client

      +
        +
      1. The C++ BigBank sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
      2. +
      3. Ensure you have enabled Axis2/C to run Tuscany SCA services. Follow the instructions + found here. +
      4. +
      5. Start the Axis2/C simple http server: +
          +
        1. The following environment variables are required: +
            +
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • +
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • +
          • AXIS2C_HOME=<path to Axis2/C version 0.96>
          • +
          +
        2. +
        3. cd <tuscany_sca_install_dir>\samples\CppBigBank\deploy\bigbank.account +
        4. +
        5. runwsserver.bat
        6. +
        +
      6. +
      7. To run the php scripts requires some configuration and setup of a php runtime with + the SDO and SimpleXML extensions enabled. The bits you will need are: + +

        You can get Windows binary builds from + http://www.php.net/downloads.php. + For SDO you need two dlls as follows: +

        + +

        Copy these to the php5.1.6\ext dir ( php_soap.dll is already there) and add the + following to php.ini file (having already renamed php.ini-recommended to php.ini + of course) +

        extension=php_soap.dll
        +extension=php_sdo.dll
        +extension=php_sdo_das_xml.dll
        + I also changed the extension_dir directive to point to my extensions directory: +
        extension_dir="C:\php5.1.6\ext"
        +

        +

        Asking PHP to list what modules are active gives the following: +

        C:\php5.1.6>php -m
        +[PHP Modules]
        +bcmath
        +calendar
        +com_dotnet
        +ctype
        +date
        +dom
        +ftp
        +hash
        +iconv
        +libxml
        +odbc
        +pcre
        +Reflection
        +sdo
        +sdo_das_xml
        +session
        +SimpleXML
        +soap
        +SPL
        +standard
        +tokenizer
        +wddx
        +xml
        +xmlreader
        +xmlwriter
        +zlib
        +
        +[Zend Modules]
        + Of particular relevance to these scripts note that soap, sdo and sdo_das_xml are active. +

        +
      8. +
      9. You need to configure Apache to run PHP of course. This is well documented but this + is what to put at the end of httpd.conf: +
        # PHP5 Support
        +LoadModule php5_module "C:\php5.1.6\php5apache2.dll"
        +AddType application/x-httpd-php .php
        +
        +# configure the path to php.ini
        +PHPIniDir "C:\php5.1.6"
        +
      10. +
      11. Copy the <tuscany_sca_install_dir>\samples\CppBigBank\bigbank.phpwsclient + directory to your Apache document root directory (by default this is named 'htdocs'). +
      12. +
      13. Finally, start your Apache web server. +
      14. +
      15. Run the PHP web client by pointing your browser at + http://localhost/bigbank.phpwsclient/welcome.php. + You should now be able to press the "GetAccount" button and see the values + returned from the BigBank SCA application. +
      16. +
      +
      + + + +
      +

      Getting Help

      + +

      The first place to look is at the Tuscany SCA FAQ at + http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      + +

      Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      + +
      +
      +
      + + + + diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountDataService.h b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountDataService.h new file mode 100644 index 0000000000..64d093ac6f --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountDataService.h @@ -0,0 +1,63 @@ +/* + * 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 "commonj/sdo/SDO.h" + +namespace services +{ + namespace accountdata + { + + /** + * AccountDataService business interface + */ + class AccountDataService + { + public: + + // CheckingAccount is a data object containing + // string accountNumber + // float balance + + virtual commonj::sdo::DataObjectPtr /* CheckingAccount*/ getCheckingAccount( + const std::string id) = 0; + + // SavingsAccount is a data object containing + // string accountNumber + // float balance + + virtual commonj::sdo::DataObjectPtr /* SavingsAccount */ getSavingsAccount( + const std::string id) = 0; + + // StockAccount is a data object containing + // string accountNumber + // string symbol + // int quantity + + virtual commonj::sdo::DataObjectPtr /* StockAccount */ getStockAccount ( + const std::string id) = 0; + + }; + + } // End accountdata +} // End services diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.componentType b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.componentType new file mode 100644 index 0000000000..b1cab9e1f9 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.componentType @@ -0,0 +1,28 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.cpp b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.cpp new file mode 100644 index 0000000000..2deee17eb2 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.cpp @@ -0,0 +1,137 @@ +/* + * 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) +#endif + +#include "commonj/sdo/SDO.h" +#include "osoa/sca/sca.h" + +#include "AccountDataServiceImpl.h" + +using namespace std; +using namespace commonj::sdo; +using namespace osoa::sca; + +/** + * AccountDataServiceImpl component implementation + */ + +namespace services +{ + namespace accountdata + { + + DataObjectPtr /* CheckingAccount*/ + AccountDataServiceImpl::getCheckingAccount(const string id) + { + try { + + DataFactoryPtr factory = ComponentContext::getCurrent().getDataFactory(); + + DataObjectPtr newaccount = + factory->create("http://www.bigbank.com/AccountService","CheckingAccount"); + + char* name = new char[id.size() + 10]; + strcpy(name,id.c_str()); + strcat(name,"_CHA12345"); + + newaccount->setCString("accountNumber",name); + + delete name; + + newaccount->setFloat("balance",1500.0f); + + return newaccount; + + } + catch (SDORuntimeException&) + { + return 0; + } + } + + + + DataObjectPtr /* SavingsAccount */ + AccountDataServiceImpl::getSavingsAccount(const string id) + { + try { + + DataFactoryPtr factory = ComponentContext::getCurrent().getDataFactory(); + + DataObjectPtr newaccount = + factory->create("http://www.bigbank.com/AccountService","SavingsAccount"); + + char* name = new char[id.size() + 10]; + strcpy(name,id.c_str()); + strcat(name,"_SAA12345"); + + newaccount->setCString("accountNumber",name); + + delete name; + + newaccount->setFloat("balance",1500.0f); + + return newaccount; + + } + catch (SDORuntimeException&) + { + return 0; + } + } + + + DataObjectPtr /* StockAccount */ + AccountDataServiceImpl::getStockAccount (const string id) + { + try { + + DataFactoryPtr factory = ComponentContext::getCurrent().getDataFactory(); + + DataObjectPtr newaccount = + factory->create("http://www.bigbank.com/AccountService","StockAccount"); + + char* name = new char[id.size() + 10]; + strcpy(name,id.c_str()); + strcat(name,"_STA12345"); + + newaccount->setCString("accountNumber",name); + + delete name; + + newaccount->setCString("symbol","IBM"); + + newaccount->setInt("quantity",100); + + return newaccount; + + } + catch (SDORuntimeException&) + { + return 0; + } + } + + } // End accountdata +} // End services diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.h b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.h new file mode 100644 index 0000000000..9312175540 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.h @@ -0,0 +1,61 @@ +/* + * 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 "AccountDataService.h" + +namespace services +{ + namespace accountdata + { + + /** + * AccountDataServiceImpl component implementation class + */ + class AccountDataServiceImpl : public AccountDataService + { + public: + + // CheckingAccount is a data object containing + // string accountNumber + // float balance + + virtual commonj::sdo::DataObjectPtr /* CheckingAccount*/ getCheckingAccount( + const std::string id); + + // SavingsAccount is a data object containing + // string accountNumber + // float balance + + virtual commonj::sdo::DataObjectPtr /* SavingsAccount */ getSavingsAccount( + const std::string id); + + // StockAccount is a data object containing + // string accountNumber + // string symbol + // int quantity + + virtual commonj::sdo::DataObjectPtr /* StockAccount */ getStockAccount ( + const std::string id); + + }; + + } // End accountdata +} // End services diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountService.h b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountService.h new file mode 100644 index 0000000000..85337d37a9 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountService.h @@ -0,0 +1,51 @@ +/* + * 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 "commonj/sdo/SDO.h" + +namespace services +{ + namespace account + { + + /** + * AccountService business interface + */ + class AccountService + { + public: + + // The account report data object has one many-valued + // property "accountSummaries", containing the following + // properties: + // string accountNumber + // string accountType + // float balance. + + virtual commonj::sdo::DataObjectPtr /*AccountReport*/ + getAccountReport(const std::string customerID) = 0; + + }; + + } // End account +} // End services diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountService.wsdl b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountService.wsdl new file mode 100644 index 0000000000..b83c453462 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountService.wsdl @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountServiceImpl.componentType b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountServiceImpl.componentType new file mode 100644 index 0000000000..b65fa1dc18 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountServiceImpl.componentType @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + USD + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountServiceImpl.cpp b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountServiceImpl.cpp new file mode 100644 index 0000000000..e9fcace81f --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountServiceImpl.cpp @@ -0,0 +1,132 @@ +/* + * 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) +#endif + +#include "osoa/sca/sca.h" + +#include "AccountServiceImpl.h" +#include "StockQuoteService.h" +#include "AccountDataService.h" + +using namespace std; +using namespace commonj::sdo; +using namespace osoa::sca; +using namespace services::accountdata; +using namespace services::stockquote; + +/** + * AccountServiceImpl component implementation + */ +namespace services +{ + namespace account + { + + DataObjectPtr /*AccountReport**/ + AccountServiceImpl::getAccountReport(const string customerID) + { + ComponentContext theContext = ComponentContext::getCurrent(); + + commonj::sdo::DataFactoryPtr factory = theContext.getDataFactory(); + + commonj::sdo::DataObjectPtr newReport = + factory->create("http://www.bigbank.com/AccountService","AccountReport"); + + // Get the accountDataService service + AccountDataService *dataService = + (AccountDataService*)theContext.getService("accountDataService"); + + // would be better to return a list of accounts - this only + // gets the first of each. + + commonj::sdo::DataObjectPtr checking = + dataService->getCheckingAccount(customerID); + + if (checking != 0) + { + commonj::sdo::DataObjectList& dl = newReport->getList("checking"); + checking->setFloat("balance", + fromUSDollarToCurrency(checking->getFloat("balance"))); + dl.append(checking); + } + + commonj::sdo::DataObjectPtr savings = dataService->getSavingsAccount(customerID); + + if (savings != 0) + { + commonj::sdo::DataObjectList& dl = newReport->getList("savings"); + savings->setFloat("balance", + fromUSDollarToCurrency(savings->getFloat("balance"))); + dl.append(savings); + } + + // Get the stockQuoteService service + StockQuoteService* stockService = + (StockQuoteService*)theContext.getService("stockQuoteService"); + + commonj::sdo::DataObjectPtr stocks = dataService->getStockAccount(customerID); + + if (stocks != 0) + { + commonj::sdo::DataObjectList& dl = newReport->getList("stocks"); + + float value = 10.0f; + try { + value = stockService->getQuote( + stocks->getCString("symbol")); + } + catch (ServiceRuntimeException& e) + { + std::cout << "Fault from stock quote service" << e << std::endl; + } + stocks->setFloat("balance", + fromUSDollarToCurrency(stocks->getInt("quantity") * + value)); + dl.append(stocks); + } + + return newReport; + } + + float AccountServiceImpl::fromUSDollarToCurrency(float value) + { + // Get the "currency" property + ComponentContext myContext = ComponentContext::getCurrent(); + + commonj::sdo::DataObjectPtr properties = myContext.getProperties(); + if (properties) + { + const char* currency = properties->getCString("currency"); + if (currency != 0) + { + std::cout << "Currency is : " << currency << std::endl; + if (!strcmp(currency,"USD")) return value; + if (!strcmp(currency,"EURO")) return 0.8f * value; + } + } + return 0.0f; + } + + } // End account +} // End services diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountServiceImpl.h b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountServiceImpl.h new file mode 100644 index 0000000000..0c172823fb --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/AccountServiceImpl.h @@ -0,0 +1,44 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AccountService.h" + + +namespace services +{ + namespace account + { + + /** + * AccountServiceImpl component implementation class + */ + class AccountServiceImpl: public AccountService + { + public: + + virtual commonj::sdo::DataObjectPtr /*AccountReport*/ + getAccountReport(const std::string customerID); + + private: + + float fromUSDollarToCurrency(float value); + + }; + + } // End account +} // End services + diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/Makefile.am b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/Makefile.am new file mode 100644 index 0000000000..e9af461312 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/Makefile.am @@ -0,0 +1,59 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +deploydir=$(prefix)/CppBigBank/deploy +compositedir=$(deploydir)/bigbank.account + +BUILT_SOURCES = scagen + +noinst_HEADERS = *.h + +composite_SCRIPTS = runwsserver.sh + +scagen: + java -jar $(TUSCANY_SCACPP)/bin/scagen.jar -dir . -output . + +composite_LTLIBRARIES = libAccount.la +composite_DATA = *.composite *.componentType *.wsdl *.xsd +EXTRA_DIST = *.composite *.componentType *.wsdl *.xsd runwsserver.sh + +dist_libAccount_la_SOURCES = \ +AccountDataServiceImpl.cpp \ +AccountServiceImpl.cpp \ +StockQuoteServiceImpl.cpp + +nodist_libAccount_la_SOURCES = \ +AccountDataServiceImpl_AccountDataService_Proxy.cpp \ +AccountDataServiceImpl_AccountDataService_Wrapper.cpp \ +AccountServiceImpl_accountDataService_Proxy.cpp \ +AccountServiceImpl_AccountService_Proxy.cpp \ +AccountServiceImpl_AccountService_Wrapper.cpp \ +AccountServiceImpl_stockQuoteService_Proxy.cpp \ +StockQuoteServiceImpl_StockQuoteService_Proxy.cpp \ +StockQuoteServiceImpl_StockQuoteService_Wrapper.cpp \ +StockQuoteServiceImpl_webService_Proxy.cpp + +libAccount_la_LIBADD = \ +-L${TUSCANY_SCACPP}/lib \ + -ltuscany_sca \ +-L${TUSCANY_SCACPP}/extensions/cpp/lib \ + -ltuscany_sca_cpp + +INCLUDES = \ + -I$(TUSCANY_SCACPP)/extensions/cpp/include \ + -I$(TUSCANY_SCACPP)/include \ + -I${TUSCANY_SDOCPP}/include diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteService.h b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteService.h new file mode 100644 index 0000000000..379af5b425 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteService.h @@ -0,0 +1,36 @@ +/* + * + * Copyright 2006 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +namespace services +{ + namespace stockquote + { + /** + * StockQuoteService business interface + */ + class StockQuoteService + { + public: + + virtual float getQuote(const std::string symbol) = 0; + + }; + + } // End stockquote +} // End services diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.componentType b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.componentType new file mode 100644 index 0000000000..6ac2b77255 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.componentType @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.cpp b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.cpp new file mode 100644 index 0000000000..8332730d73 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.cpp @@ -0,0 +1,73 @@ +/* + * + * Copyright 2006 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "osoa/sca/sca.h" +#include "commonj/sdo/SDO.h" + +#include "StockQuoteServiceImpl.h" +#include "StockQuoteWebService.h" + +using namespace std; +using namespace osoa::sca; +using namespace commonj::sdo; + +/** + * StockQuoteServiceImpl component implementation + */ +namespace services { + namespace stockquote { + + // Map the format returned by the StockQuote Web service to + // the format expected in the BigBank application + float StockQuoteServiceImpl::getQuote(const string symbol) + { + ComponentContext myContext = ComponentContext::getCurrent(); + + // Get the StockQuote Web service + StockQuoteWebService* webService = + (StockQuoteWebService*)myContext.getService("webService"); + + // Invoke the service + const string result = webService->GetQuote(symbol); + + float stockPrice = 0.0f; + + // Get the stock price out of the document returned by the StockQuote + // Web service + try + { + XMLHelperPtr xmlHelper = HelperProvider::getXMLHelper(myContext.getDataFactory()); + XMLDocumentPtr stockDoc = xmlHelper->load(result); + if (stockDoc->getRootDataObject()) + { + stockPrice=stockDoc->getRootDataObject()->getFloat("Stock.0/Last"); + } + } + catch (SDORuntimeException& e) + { + std::cout << e << std::endl; + return 0.0f; + } + return stockPrice; + } + + } // End stockquote +} // End services diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.h b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.h new file mode 100644 index 0000000000..9b0ac69b0c --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.h @@ -0,0 +1,36 @@ +/* + * + * Copyright 2006 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "StockQuoteService.h" + +namespace services +{ + namespace stockquote + { + + /** + * StockQuoteServiceImpl component implementation class + */ + class StockQuoteServiceImpl : public StockQuoteService + { + public: + + virtual float getQuote(const std::string symbol); + }; + + } // End stockquote +} // End services diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteTypes.xsd b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteTypes.xsd new file mode 100644 index 0000000000..5bce3a63dc --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteTypes.xsd @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteWebService.h b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteWebService.h new file mode 100644 index 0000000000..5c32ff8eaa --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteWebService.h @@ -0,0 +1,40 @@ +/* + * + * Copyright 2006 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +namespace services +{ + namespace stockquote + { + + /** + * StockQuoteWebService business interface + * + * This is the interface of the Web service used to get + * live stock quotes. + */ + class StockQuoteWebService + { + public: + + virtual const std::string GetQuote(const std::string symbol) = 0; + + }; + + } // End stockquote +} // End services diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteWebService.wsdl b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteWebService.wsdl new file mode 100644 index 0000000000..c14f97c87b --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/StockQuoteWebService.wsdl @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get Stock quote for a company Symbol + + + + + + + + + + Get Stock quote for a company Symbol + + + + + + + + + + Get Stock quote for a company Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/bigbank.account.composite b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/bigbank.account.composite new file mode 100644 index 0000000000..7173d584d2 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/bigbank.account.composite @@ -0,0 +1,49 @@ + + + + + + + + + + AccountServiceComponent + + + + + AccountDataServiceComponent + StockQuoteServiceComponent + EURO + + + + + + + + + StockQuoteWebService + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/runwsserver.bat b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/runwsserver.bat new file mode 100644 index 0000000000..c08a8fc5d9 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/runwsserver.bat @@ -0,0 +1,50 @@ +@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 "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) +echo Using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) +echo Using SDO installed at %TUSCANY_SDOCPP% + +if "%AXIS2C_HOME%" == "" ( +echo "AXIS2C_HOME not set" +goto end +) +echo Using Axis2C installed at %AXIS2C_HOME% + +rem Run the server +set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SCACPP%\extensions\cpp\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% + +set APFULLDIR=%~d0%~p0 +set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ + +cd %AXIS2C_HOME%\bin +.\axis2_http_server.exe + +:end +endlocal diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/runwsserver.sh b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/runwsserver.sh new file mode 100755 index 0000000000..047e541360 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.account/runwsserver.sh @@ -0,0 +1,45 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$AXIS2C_HOME = x ]; then +echo "AXIS2C_HOME not set" +exit; +fi +echo "Using Axis2C installed at $AXIS2C_HOME" + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/cpp/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ + +cd $AXIS2C_HOME/bin +./axis2_http_server diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.app.composite b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.app.composite new file mode 100644 index 0000000000..5d68e0ae1a --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.app.composite @@ -0,0 +1,29 @@ + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.client/AccountClient.cpp b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.client/AccountClient.cpp new file mode 100644 index 0000000000..009c2d0c4d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.client/AccountClient.cpp @@ -0,0 +1,127 @@ +/* + * 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) +#endif + +#include +#include + +#include "osoa/sca/sca.h" + +#include "AccountService.h" + +using namespace std; +using namespace commonj::sdo; +using namespace osoa::sca; +using namespace services::account; + +int main(int argc, char* argv[]) +{ + + if (argc != 2) + { + cout << "account_client: Argument must be the name of the account" << endl; + return 0; + } + try + { + + // Locate a service + CompositeContext myContext = CompositeContext::getCurrent(); + AccountService *accountService = + (AccountService*) myContext.locateService("AccountServiceComponent"); + if (accountService == 0) + { + cout << "account_client: Unable to find Account service" << endl; + } + else + { + try + { + // exercise the account service + + DataObjectPtr report = + accountService->getAccountReport(argv[1]); + + XMLHelperPtr xmlHelper = HelperProvider::getXMLHelper(myContext.getDataFactory()); + char* doc = xmlHelper->save(report, report->getType().getURI(), report->getType().getName()); + cout << "XML: " << doc <getList("stocks"); + + for (i=0;i< stocks.size() ;i++) + { + cout << "Stock Account " << stocks[i]->getCString("accountNumber") << endl; + cout << "Stock Symbol : " << stocks[i]->getCString("symbol") << endl; + cout << " Holding : " << stocks[i]->getCString("quantity") << endl; + balance = stocks[i]->getFloat("balance"); + sprintf(balanceStr,"%.2f",balance); + cout << " Value : " << balanceStr << endl << endl; + } + + DataObjectList& checking = report->getList("checking"); + + for (i=0;i< checking.size() ;i++) + { + cout << "Checking Account " << checking[i]->getCString("accountNumber") << endl; + balance = checking[i]->getFloat("balance"); + sprintf(balanceStr,"%.2f",balance); + cout << " Balance : " << balanceStr << endl << endl; + } + + DataObjectList& savings = report->getList("savings"); + + for (i=0;i< savings.size() ;i++) + { + cout << "Savings Account " << savings[i]->getCString("accountNumber") << endl; + balance = savings[i]->getFloat("balance"); + sprintf(balanceStr,"%.2f",balance); + cout << " Balance : " << balanceStr << endl << endl; + } + + cout << endl; + } + } + catch (SDORuntimeException& e) + { + cout << e << endl; + } + } + + } + catch (ServiceRuntimeException& ex) + { + cout << ex << endl; + } + return 0; +} + diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.client/Makefile.am b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.client/Makefile.am new file mode 100644 index 0000000000..cfc5e8a661 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.client/Makefile.am @@ -0,0 +1,35 @@ +# 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. + +deploydir=$(prefix)/CppBigBank/deploy +clientdir=$(deploydir)/bigbank.client + +client_PROGRAMS = account_client +client_SCRIPTS = runclient.sh +EXTRA_DIST = runclient.sh + +account_client_SOURCES = AccountClient.cpp + +account_client_LDADD = -L${TUSCANY_SCACPP}/lib -ltuscany_sca \ + -L${TUSCANY_SCACPP}/extensions/cpp/lib -ltuscany_sca_cpp \ + -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo + + +INCLUDES = -I$(TUSCANY_SCACPP)/extensions/cpp/include \ + -I${TUSCANY_SCACPP}/include \ + -I${TUSCANY_SDOCPP}/include \ + -I../bigbank.account diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.client/runclient.bat b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.client/runclient.bat new file mode 100644 index 0000000000..069463ba2d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.client/runclient.bat @@ -0,0 +1,50 @@ +@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 "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) +echo Using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) +echo Using SDO installed at %TUSCANY_SDOCPP% + +if "%AXIS2C_HOME%" == "" ( +echo "AXIS2C_HOME not set" +goto end +) +echo Using Axis2C installed at %AXIS2C_HOME% + +rem Run the client +set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SCACPP%\extensions\cpp\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% + +set APFULLDIR=%~d0%~p0 +set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ +set TUSCANY_SCACPP_COMPONENT=bigbank.AccountManagementComponent + +.\AccountClient.exe 1234 + +:end +endlocal diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.client/runclient.sh b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.client/runclient.sh new file mode 100755 index 0000000000..1cf924a008 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.client/runclient.sh @@ -0,0 +1,46 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$AXIS2C_HOME = x ]; then +echo "AXIS2C_HOME not set" +exit; +fi +echo "Using Axis2C installed at $AXIS2C_HOME" + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/cpp/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ +export TUSCANY_SCACPP_COMPONENT=bigbank.AccountManagementComponent + +./AccountClient 1234 + diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/AccountService.wsdl b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/AccountService.wsdl new file mode 100644 index 0000000000..b83c453462 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/AccountService.wsdl @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/Makefile.am b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/Makefile.am new file mode 100644 index 0000000000..bdc846e58c --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/Makefile.am @@ -0,0 +1,22 @@ +# 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. + +deploydir=$(prefix)/CppBigBank/deploy +phpwsclientdir=$(deploydir)/bigbank.phpwsclient + +phpwsclient_DATA = *.php *.wsdl README +EXTRA_DIST = *.php *.wsdl README diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/README b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/README new file mode 100644 index 0000000000..d02873e860 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/README @@ -0,0 +1,137 @@ +Big Bank PHP Client +=================== + +Overview +-------- + +This is a pair of very simple PHP scripts to demonstrate how the Accounts service +that the C++ Big Bank sample exposes can be used from within the PHP scripting +language. + +bigwelcome.php + A bootstrap script that shows a form and allows the user to press a button + in order to invoke the bigaccount.php script + +bigaccount.php + Makes a call to a locally installed BigBank Accounts service. The script + shows how to use PHP SDO and SOAP extensions to construct the call + and interpret the result. + +As this is a very simple test client once you have reached bigaccount.php you are done. +So there are no further buttons other than the browser back button. + +Installation +------------ + +This assumes that you have the BigBank sample runnig as a web service in your local +Axis2C container at http://localhost:9090/axis2/services/AccountService + +To run the php scripts requires some configuration and setup of a php runtime with +the SDO and SimpleXML extensions enabled. The bits you will need are: + +Apache web server - http://httpd.apache.org/ (I'm currently at 2.0.55) +PHP 5.1.6 - http://www.php.net/downloads.php (I'm currently at 5.1.6) +PHP SDO - http://pecl.php.net/package/sdo (I'm currently at 1.0.3) + +Windows +------- +If you are on windows you can get binary builds from http://www.php.net/downloads.php. +For SDO you need two dlls as followd + +php_sdo.dll http://pecl4win.php.net/ext.php/php_sdo.dll +php_sdo_das_xml.dll http://pecl4win.php.net/ext.php/php_sdo_das_xml.dll + +I copied these to my php5.1.6/ext dir ( php_soap.dll is already there) + +And added the following to my php.ini file (having already renamed php.ini-recommended to +php.ini of course) + +extension=php_soap.dll +extension=php_sdo.dll +extension=php_sdo_das_xml.dll + +I also changed the extension_dir directive to point to my extensions directory: + +extension_dir="C:/simon/apps/php5.1.6/ext" + +When I ask PHP to list what modules are active in my version of PHP I get the +following + +C:\simon\apps\php5.1.6>php -m +[PHP Modules] +bcmath +calendar +com_dotnet +ctype +date +dom +ftp +hash +iconv +libxml +odbc +pcre +Reflection +sdo +sdo_das_xml +session +SimpleXML +soap +SPL +standard +tokenizer +wddx +xml +xmlreader +xmlwriter +zlib + +[Zend Modules] + +Of particular relevance to these scripts note that soap, sdo and sd_das_xml are active. + +Other Platforms +--------------- + +If your on on another platform, such as Linux, then you will need to compile the +SDO extension. The documentation at the SDO extension page (http://livedocs.phpdoc.info/index.php?l=en&q=ref.sdo) +is currently a bit missleading and needs updating. What you need to do is do a +phpize build of the SDO PECL extension. This is discussed in the SDO documentation +but is also discussed in many other places, for example, http://www.php.net/manual/en/install.pecl.phpize.php. +Here is not the time to go into the details of how to build PHP extensions using +phpize but if you are familar with the process I use the following configure line +on windows. + +cscript configure.js --with-extra-includes=c:\simon\projects\tuscany\php\win32build\include; + c:\simon\apps\libxml2-2.6.23.win32\include; + c:\simon\apps\iconv-1.9.1.win32\include + --with-extra-libs=c:\simon\projects\tuscany\php\win32build\lib; + c:\simon\apps\libxml2-2.6.23.win32\lib; + c:\simon\apps\iconv-1.9.1.win32\lib + --enable-sdo=shared + --enable-soap + +There are no newlines in my command line by the way. I've just included them +here so you can see the command. + +Running +------- + +You need to configure Apache to run PHP of course. This is well documented but this +is what I put at the end of httpd.conf + +# PHP5 Support +LoadModule php5_module "C:/simon/apps/php5.1.6/php5apache2.dll" +AddType application/x-httpd-php .php + +# configure the path to php.ini +PHPIniDir "C:/simon/apps/php5.1.6" + +Having set up Apache all that remains is to + +- put the bigbank.phpwsclient directory in your web server's root documents directory +- start up the Axis2C runtime configured to run BigBank +- point your browser at http://myserver:port/bigbank.phpwsclient/bigwelcome.php + +You should now be able to press the "GetAccount" button and see the values +returned from the BigBank SCA application. diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/bigaccount.php b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/bigaccount.php new file mode 100644 index 0000000000..b9f77d3297 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/bigaccount.php @@ -0,0 +1,113 @@ + + + BigBank Sample + + + + + + +getAccountReport($accountname); + // we have to construct an object hierarchy that matches the + // WSDL request. We can use SDO to do this for us + + // configure SDO based on the WSDL + $xmldas = SDO_DAS_XML::create("AccountService.wsdl"); + + // Get a document that represents the request + // and get the root element + $requestxdoc = $xmldas->createDocument("getAccountReport"); + $requestsdo = $requestxdoc->getRootDataObject(); + + // add the parameter + $requestsdo['customerID'] = $accountname; + + // make the call + $result = $client->getAccountReport($requestsdo); + + // now we have the result as a PHP object + // we can turn this into an SDO but we have to do it manually + // as the SOAP extension won't generate types for us + // automatically just yet + $responsexdoc = $xmldas->createDocument("getAccountReportResponse"); + $responsesdo = $responsexdoc->getRootDataObject(); + + // flesh out the object hierarchy + $account = $responsesdo->createDataObject ('result'); + $checking = $account->createDataObject ('checking'); + $saving = $account->createDataObject ('savings'); + $stocks = $account->createDataObject ('stocks'); + + //copy the data + $checking['accountNumber'] = $result->result->checking->accountNumber; + $checking['balance'] = $result->result->checking->balance; + //etc.. + // This is a bit rubbish as we would want this to happen automatically + + // Now just put the data on the screen + // To do this we don't need to use SDO as you can see but + // it would be really handy if we wanted to pass the XML doc + // onto another service or if we wanted to do some other + // more complex XML manipulation or XPath searches + echo "

      Account $accountname

      "; + echo "

      Checking Account

      "; + echo ""; + echo ""; + echo "
      Account Number $checking->accountNumber
      Balance $checking->balance

      Saving Account

      "; + echo ""; + echo ""; + echo "
      Account Number" . $result->result->savings->accountNumber . "
      Balance" . $result->result->savings->balance . "

      Stock Account

      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      Account Number" . $result->result->stocks->accountNumber . "
      Symbol" . $result->result->stocks->symbol . "
      Quantity" . $result->result->stocks->quantity . "
      Banalce" . $result->result->stocks->balance . "
      "; + } + catch (SoapFault $f) + { + echo "Caught soap exception: \n"; + print_r ( $f ); + } + } + catch ( Exception $e ) + { + echo "Caught exception: \n"; + print_r ( $e ); + + } +?> diff --git a/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/bigwelcome.php b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/bigwelcome.php new file mode 100644 index 0000000000..32159ddc16 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppBigBank/bigbank.phpwsclient/bigwelcome.php @@ -0,0 +1,44 @@ + + + + BigBank Sample + + + + + + + + +

      Welcome To The BigBank Sample

      + +
      + Please enter your account ID + + +
      + +
      + + diff --git a/sca-cpp/trunk/contrib/samples/CppCalculator/Makefile.am b/sca-cpp/trunk/contrib/samples/CppCalculator/Makefile.am new file mode 100644 index 0000000000..d9d4b499b7 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppCalculator/Makefile.am @@ -0,0 +1,21 @@ +# 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. + +deploydir=$(prefix)/CppCalculator/deploy +SUBDIRS = sample.calculator sample.calculator.client +EXTRA_DIST = *.composite README.html +deploy_DATA = *.composite diff --git a/sca-cpp/trunk/contrib/samples/CppCalculator/README b/sca-cpp/trunk/contrib/samples/CppCalculator/README new file mode 100644 index 0000000000..b9dedd2da3 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppCalculator/README @@ -0,0 +1,4 @@ +Tuscany SCA for C++ Samples - C++ Calculator Sample +=================================================== + +See the README.html file for instructions to build and run this sample diff --git a/sca-cpp/trunk/contrib/samples/CppCalculator/README.html b/sca-cpp/trunk/contrib/samples/CppCalculator/README.html new file mode 100644 index 0000000000..264ba3d881 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppCalculator/README.html @@ -0,0 +1,176 @@ + + + + + + + + + + + + Tuscany SCA Native Samples - C++ Calculator Sample + + + +
      +
      +
      +

      Tuscany SCA Native Samples - C++ Calculator Sample

      + +

      This is a very simple sample to show how an SCA composite can wire + together two C++ components to implement a Calculator service and invoke + the service via a local client. +

      +

      There are two sub projects in this workspace:

      +
        +
      • sample.calculator
        + This contains the source code and SCDL artifacts for the SCA Calculator + composite implementing the sample Calculator. +
      • +
      • sample.calculator.client
        + A sample client which does a local call to the Calculator service. +
      • +
      +

      Additionally, there is the sample.calculator.app.composite file. This + describes the configuration of the SCA Calculator composite deployed to the SCA + runtime. +

      +
      + + + + +
      +

      Building the C++ samples on Linux and Mac OS X

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
      2. + +
      3. Build the C++ samples with the following command sequence: +
          +
        • cd <tuscany_sca_install_dir>/samples
        • +
        • ./configure --prefix=$TUSCANY_SCACPP/samples --enable-static=no
        • +
        • make
        • +
        • make install
        • +
        + NOTE: If you don't provide the --prefix configure option, it will by default install into + /usr/local/tuscany/sca/samples/CppCalculator
      4. +
      +
      + +
      +

      Running the C++ Calculator sample on Linux and Mac OS X

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        +
      2. +
      3. Run the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>/samples/CppCalculator/deploy/sample.calculator.client
        • +
        • ./runclient.sh
        • +
        +
      4. +
      +
      + +
      +

      Building the C++ Calculator sample on Windows

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
      2. + +
      3. You must have set up the environment for Microsoft Visual C++ tools. + The build command will call vcvars32 to set the environment. Ensure the + directory containing this is on your path. This will be where you + installed the compiler. +
      4. +
      5. Build the source, either via the Visual Studio Express projects under + <tuscany_sca_install_dir>\samples\CppCalculator\VSExpress\CppCalculator.sln or via the command-line build file + found at <tuscany_sca_install_dir>\samples\CppCalculator\VSExpress\CppCalculator\build.bat + which will build and deploy the samples. +
      6. +
      +
      + +
      +

      Running the C++ Calculator sample on Windows

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        +
      2. +
      3. Run the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>\samples\CppCalculator\deploy\sample.calculator.client
        • +
        • runclient.bat
        • +
        +
      4. +
      + + + +
      +

      Getting Help

      + +

      The first place to look is at the Tuscany SCA FAQ at + http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      + +

      Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      + +
      +
      +
      + + + + diff --git a/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.app.composite b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.app.composite new file mode 100644 index 0000000000..5753b3c593 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.app.composite @@ -0,0 +1,29 @@ + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.client/CalculatorClient.cpp b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.client/CalculatorClient.cpp new file mode 100644 index 0000000000..37e9d40f66 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.client/CalculatorClient.cpp @@ -0,0 +1,150 @@ +/* + * 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 + +#include "osoa/sca/sca.h" + +#include "Calculator.h" + +using namespace std; +using namespace osoa::sca; + + +void usage(); +bool IsNumber(const char *p); + +int main(int argc, char* argv[]) +{ + const char *operation; + float arg1 = 0; + float arg2 = 0; + + if (argc == 4) + { + operation = argv[1]; + + if (!IsNumber(argv[2])) + { + cout << "calculator_client: Argument 1 is not a number" << endl; + usage(); + } + else + { + arg1 = atof(argv[2]); + } + + if (!IsNumber(argv[3])) + { + cout << "calculator_client: Argument 2 is not a number" << endl; + usage(); + } + else + { + arg2 = atof(argv[3]); + } + } + else + { + usage(); + } + + try + { + // Locate a service + CompositeContext myContext = CompositeContext::getCurrent(); + Calculator *calcService = (Calculator*) myContext.locateService("CalculatorComponent/CalculatorService"); + if (calcService == 0) + { + cout << "calculator_client: Unable to find Calculator service" << endl; + } + else + { + float result = 0; + if (strcmp(operation, "add") == 0) + { + result = calcService->add(arg1, arg2); + cout << "calculator_client: add(" << arg1 << "," << arg2 << ") = " << result << endl; + } + else + if (strcmp(operation, "sub") == 0) + { + result = calcService->sub(arg1, arg2); + cout << "calculator_client: sub(" << arg1 << "," << arg2 << ") = " << result << endl; + } + else + if (strcmp(operation, "mul") == 0) + { + result = calcService->mul(arg1, arg2); + cout << "calculator_client: mul(" << arg1 << "," << arg2 << ") = " << result << endl; + } + else + if (strcmp(operation, "div") == 0) + { + result = calcService->div(arg1, arg2); + cout << "calculator_client: div(" << arg1 << "," << arg2 << ") = " << result << endl; + } + else + { + cout << "calculator_client: Unrecognized operation: " << operation << endl; + } + } + } + catch (ServiceRuntimeException& ex) + { + cout << "calculator_client: exception caught: " << ex << endl; + } + return 0; +} + +void usage() +{ + cout << "Usage: calculator_client add|sub|mul|div arg1 arg2" << endl; + exit(1); +} + +bool IsNumber (const char *p) +{ + int len = strlen(p); + int pointcount = 0; + + if (!isdigit (p[0]) && p[0] != '-' && p[0] != '+') + { + return false; + } + for (int i = 1; i < len; i++) + { + if (!isdigit (p[i])) + { + if (p[i] == '.') + { + if (pointcount > 0) return false; + pointcount++; + } + else + { + return false; + } + } + } + return true; +} diff --git a/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.client/Makefile.am b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.client/Makefile.am new file mode 100644 index 0000000000..9782bf5041 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.client/Makefile.am @@ -0,0 +1,40 @@ +# 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. + +deploydir=$(prefix)/CppCalculator/deploy +clientdir=$(deploydir)/sample.calculator.client + +client_PROGRAMS = calculator_client +client_SCRIPTS = runclient.sh +EXTRA_DIST = runclient.sh + +calculator_client_SOURCES = \ +CalculatorClient.cpp + +calculator_client_LDADD = \ +-L${TUSCANY_SCACPP}/lib \ + -ltuscany_sca \ +-L${TUSCANY_SCACPP}/extensions/cpp/lib \ + -ltuscany_sca_cpp \ +-L${TUSCANY_SDOCPP}/lib \ + -ltuscany_sdo + +INCLUDES = \ +-I$(TUSCANY_SCACPP)/extensions/cpp/include \ +-I${TUSCANY_SCACPP}/include \ +-I${TUSCANY_SDOCPP}/include \ +-I../sample.calculator diff --git a/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.client/runclient.bat b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.client/runclient.bat new file mode 100644 index 0000000000..795325ab52 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.client/runclient.bat @@ -0,0 +1,42 @@ +@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 "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) +echo using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) +echo using SDO installed at %TUSCANY_SDOCPP% + +set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SCACPP%\extensions\cpp\bin;%TUSCANY_SDOCPP%\bin;%PATH% + +set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ +set TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent + +.\calculator_client.exe div 5 2 + +:end +endlocal diff --git a/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.client/runclient.sh b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.client/runclient.sh new file mode 100755 index 0000000000..feae29d557 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator.client/runclient.sh @@ -0,0 +1,39 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/cpp/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ +export TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent + +./calculator_client div 5 2 diff --git a/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/Calculator.h b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/Calculator.h new file mode 100644 index 0000000000..90e97b5319 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/Calculator.h @@ -0,0 +1,34 @@ +/* + * 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 sample_calculator_h +#define sample_calculator_h + +class Calculator +{ +public: + virtual float add(float arg1, float arg2) = 0; + virtual float sub(float arg1, float arg2) = 0; + virtual float mul(float arg1, float arg2) = 0; + virtual float div(float arg1, float arg2) = 0; +}; + +#endif // sample_calculator_h diff --git a/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/CalculatorImpl.componentType b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/CalculatorImpl.componentType new file mode 100644 index 0000000000..72fe9842e8 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/CalculatorImpl.componentType @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/CalculatorImpl.cpp b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/CalculatorImpl.cpp new file mode 100644 index 0000000000..01dac77c92 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/CalculatorImpl.cpp @@ -0,0 +1,90 @@ +/* + * 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 "osoa/sca/ComponentContext.h" +#include "osoa/sca/ServiceRuntimeException.h" + +#include "CalculatorImpl.h" +#include "Divide.h" + +CalculatorImpl::CalculatorImpl() +{ +} + +CalculatorImpl::~CalculatorImpl() +{ +} + +// Calculator interface +float CalculatorImpl::add(float arg1, float arg2) +{ + float result = arg1 + arg2; + + printf("CalculatorImpl::add %f + %f = %f\n", arg1, arg2, result); + return result; +} + +float CalculatorImpl::sub(float arg1, float arg2) +{ + float result = arg1 - arg2; + printf("CalculatorImpl::sub %f - %f = %f\n", arg1, arg2, result); + return result; +} + +float CalculatorImpl::mul(float arg1, float arg2) +{ + float result = arg1 * arg2; + printf("CalculatorImpl::mul %f * %f = %f\n", arg1, arg2, result); + return result; +} + +float CalculatorImpl::div(float arg1, float arg2) +{ + float result = 0; + + // This method shows how to invoke a service on a different component from within a component + + // First, get the current ComponentContext + osoa::sca::ComponentContext myContext = osoa::sca::ComponentContext::getCurrent(); + + try + { + // Find the required service, as referenced in CalculatorImpl.componentType + Divide* divideService = (Divide*)myContext.getService("divideService"); + + // Finally, invoke the service + result = divideService->divide(arg1, arg2); + + printf("CalculatorImpl::div Divide returned result: %f\n", result); + + } + catch (osoa::sca::ServiceRuntimeException& e) + { + // Print out error message and carry on + printf("CalculatorImpl::div Error whilst invoking Divide: %s", e.getMessageText()); + } + + return result; +} + + diff --git a/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/CalculatorImpl.h b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/CalculatorImpl.h new file mode 100644 index 0000000000..af8a5eeab1 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/CalculatorImpl.h @@ -0,0 +1,41 @@ +/* + * 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 sample_calculatorimpl_h +#define sample_calculatorimpl_h + +#include "Calculator.h" + +class CalculatorImpl : public Calculator +{ +public: + CalculatorImpl(); + virtual ~CalculatorImpl(); + + // Calculator interface + virtual float add(float arg1, float arg2); + virtual float sub(float arg1, float arg2); + virtual float mul(float arg1, float arg2); + virtual float div(float arg1, float arg2); +}; + +#endif // sample_calculatorimpl_h + diff --git a/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/Divide.h b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/Divide.h new file mode 100644 index 0000000000..6e171ed733 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/Divide.h @@ -0,0 +1,34 @@ +/* + * 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 sample_divide_h +#define sample_divide_h + +class Divide +{ +public: + virtual float divide(float arg1, float arg2) = 0; +}; + +#endif // sample_divide_h + + diff --git a/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/DivideImpl.componentType b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/DivideImpl.componentType new file mode 100644 index 0000000000..d7369e3ff0 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/DivideImpl.componentType @@ -0,0 +1,27 @@ + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/DivideImpl.cpp b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/DivideImpl.cpp new file mode 100644 index 0000000000..f1a927cf4c --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/DivideImpl.cpp @@ -0,0 +1,48 @@ +/* + * 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 "DivideImpl.h" + +DivideImpl::DivideImpl() +{ +} + +DivideImpl::~DivideImpl() +{ +} + +// Divide interface +float DivideImpl::divide(float arg1, float arg2) +{ + if(arg2 == 0.0) + { + printf("DivideImpl::div %f / %f !! Cannot divide by zero, so returning 0\n", arg1, arg2); + return 0; + } + + float result = arg1 / arg2; + printf("DivideImpl::div %f / %f = %f\n", arg1, arg2, result); + return result; +} + + diff --git a/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/DivideImpl.h b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/DivideImpl.h new file mode 100644 index 0000000000..64045f1899 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/DivideImpl.h @@ -0,0 +1,39 @@ +/* + * 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 sample_divideimpl_h +#define sample_divideimpl_h + +#include "Divide.h" + +class DivideImpl : public Divide +{ +public: + DivideImpl(); + virtual ~DivideImpl(); + + // Divide interface + virtual float divide(float arg1, float arg2); +}; + +#endif // sample_divideimpl_h + diff --git a/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/Makefile.am b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/Makefile.am new file mode 100644 index 0000000000..de6dad787d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/Makefile.am @@ -0,0 +1,53 @@ +# 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. + +deploydir=$(prefix)/CppCalculator/deploy +compositedir=$(deploydir)/sample.calculator + +BUILT_SOURCES = scagen + +noinst_HEADERS = *.h + +scagen: + java -jar $(TUSCANY_SCACPP)/bin/scagen.jar -dir . -output . + +composite_LTLIBRARIES = libCalculator.la +composite_DATA = *.composite *.componentType +EXTRA_DIST = *.composite *.componentType + +dist_libCalculator_la_SOURCES = \ +CalculatorImpl.cpp \ +DivideImpl.cpp + +nodist_libCalculator_la_SOURCES = \ +CalculatorImpl_CalculatorService_Proxy.cpp \ +CalculatorImpl_CalculatorService_Wrapper.cpp \ +CalculatorImpl_divideService_Proxy.cpp \ +DivideImpl_DivideService_Proxy.cpp \ +DivideImpl_DivideService_Wrapper.cpp + +libCalculator_la_LIBADD = \ +-L${TUSCANY_SCACPP}/lib \ + -ltuscany_sca \ +-L${TUSCANY_SCACPP}/extensions/cpp/lib \ + -ltuscany_sca_cpp + +INCLUDES = \ +-I$(TUSCANY_SCACPP)/extensions/cpp/include \ +-I$(TUSCANY_SCACPP)/include \ +-I${TUSCANY_SDOCPP}/include + diff --git a/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/sample.calculator.composite b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/sample.calculator.composite new file mode 100644 index 0000000000..6903cf21d8 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/CppCalculator/sample.calculator/sample.calculator.composite @@ -0,0 +1,33 @@ + + + + + + + + DivideComponent/DivideService + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/GettingStarted.html b/sca-cpp/trunk/contrib/samples/GettingStarted.html new file mode 100644 index 0000000000..dcb2cfd19c --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/GettingStarted.html @@ -0,0 +1,513 @@ + + + + + + + + + + + Tuscany SCA Native Samples - Getting Started + + + +
      +
      +
      +

      Tuscany Samples - Getting Started - SCA Native Milestone release 3

      + +

      Tuscany SCA Native includes a set of simple technology samples that demonstrates some of the functionality of + the Tuscany SCA Native runtime. This page describes the samples and links to the documents that describe how to + build and run them +

      +
      + +
      +

      Samples

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      CppCalculatorA very simple sample to show how an SCA composite can wire + together two C++ components to implement a Calculator service +
      PythonCalculatorA very simple sample to show how an SCA composite can wire + together two Python components to implement a Calculator service +
      RubyCalculatorA very simple sample to show how an SCA composite can wire + together two Ruby components to implement a Calculator service +
      RESTCalculatorThis sample is based on RubyCalculator but exposes the Calculator service as a REST Service + running under the Apache HTTPD server
      CppBigBankA more complex sample that implements the "Simplified BigBank" scenario. A whitepaper describing + the scenario based on the SCA 0.9 Assembly specification can be found + here. + This sample uses multiple C++ components, calls out to an external Web Service via a reference, + exposes the service as a Web Service and also provides a PHP based client. +
      RubyBigBankA more complex sample that implements the "Simplified BigBank" scenario. This sample uses multiple + Ruby components, calls out to an external Web Service via a reference and exposes the service as a + Web Service. +
      HTTPDBigBankA more complex sample that implements the "Simplified BigBank" scenario. This sample contains the same + SCA components and calls as RubyBigBank, but demonstrates running the sample under the Apache HTTPD server +
      PythonWeatherForecastThis sample makes calls to an external Web Service via a reference, demonstrating how Python + ElementTree objects are used in Tuscany to access the XML data returned from the service.
      RestCustomerThis sample demonstrates a Python component exposed as a REST Service either with or without the REST + interface (which specifies whether the service uses CRUD operations that translate to HTTP POST, GET, PUT + and DELETE or uses HTTP GET and XML over HTTP POST to invoke named operations) running under the Apache + HTTPD server
      RestYahooThis sample demonstrates a Python component that is wired to make REST calls out to the external + Yahoo! Web Search service. This sample uses a Ruby local client to invoke the Python component.
      AlertAggregatorA more complex sample that shows how a Web 2.0-style application can be built using SCA. The Alert + Aggregator Sample aggregates various data sources and presents a unified view of data from these sources, + served as XML and displayed via a web page
      +
      +
      +
      +

      Sample Dependencies

      +

      The Tuscany samples each demonstrate different aspects of functionality provided by Tuscany, often in + particular extensions. The table below documents the extension dependencies that each sample has. + Please see the extension documentation for more details on the dependencies that particular extensions have. +

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      C++ ExtensionPython ExtensionRuby ExtensionAxis2C Web Service Service ExtensionAxis2C Web Service Reference ExtensionREST Service ExtensionREST Reference ExtensionREST Interface ExtensionSCA Service ExtensionSCA Reference Extension
      CppCalculatorYes
      PythonCalculator Yes
      RubyCalculator Yes
      RESTCalculator Yes Yes Yes
      CppBigBankYes Yes Yes
      RubyBigBank Yes Yes Yes
      HTTPDBigBank Yes Yes Yes Yes Yes
      PythonWeatherForecast Yes Yes
      RestCustomer Yes Yes Yes Yes
      RestYahoo Yes Yes Yes
      AlertAggregator Yes Yes Yes
      +
      +

      The table below documents the libraries or environments necessary to build and/or run each sample. These are generally + required by the Tuscany extensions that the sample employs. + Please see the extension documentation for more details (such as the version required) about the dependencies that particular + extensions require. +

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Java runtimePython runtimeRuby runtimeAxis2/C libraryAxis2/C HTTP serverlibcurl libraryHTTPD serverUniversal Feed Parser library
      CppCalculatorBuild
      PythonCalculator Run
      RubyCalculator Run
      RESTCalculator Run Run Run
      CppBigBankBuild Run
      RubyBigBank Run Run Run
      HTTPDBigBank Run Run Run
      PythonWeatherForecast Run Run
      RestCustomer Run Run Run
      RestYahoo Run Run Run
      AlertAggregator Run Run Run Run
      +
      +
      + +
      +

      Getting Help

      + +

      The first place to look is at the Tuscany SCA FAQ at + http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      + +

      Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      + + +

       

      + +

       

      + +

       

      + + + + + + +
      + +

      Thank you for your interest in Tuscany.

      -The + Tuscany Development Team +
      +
      + +
      + +
      + + + diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/Makefile.am b/sca-cpp/trunk/contrib/samples/HttpdBigBank/Makefile.am new file mode 100644 index 0000000000..7ae86e6d2c --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/Makefile.am @@ -0,0 +1,21 @@ +# 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. + +deploydir=$(prefix)/HttpdBigBank/deploy +SUBDIRS = bigbank.account bigbank.accountdata bigbank.wsclient httpserver +EXTRA_DIST = *.composite +deploy_DATA = *.composite diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/README b/sca-cpp/trunk/contrib/samples/HttpdBigBank/README new file mode 100644 index 0000000000..a3442236bd --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/README @@ -0,0 +1,37 @@ +# 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 sample shows how to run the Bigbank app with the Apache HTTP server + +This is a more modular version of the original Bigbank app, the account +service and the account data service are in different composites. + +The httpserver directory contains a minimal httpd configuration. +Make sure that Apache apachectl and httpd 2.2.x are on the PATH. + +To start the server, cd to httpserver, and run ./startserver.sh. + +To verify that the server is working, point your Web browser to +http://localhost:9090. + +To verify that Axis2C is working, point your Web browser to +http://localhost:9090/axis2, you should see a list of deployed services. + +To stop the server, cd to httpserver, and run ./stopserver.sh. + +To run the sample go to bigbank.wsclient, and run ./runwsclient.sh. + diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/README.html b/sca-cpp/trunk/contrib/samples/HttpdBigBank/README.html new file mode 100644 index 0000000000..bfd33ee1cd --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/README.html @@ -0,0 +1,197 @@ + + + + + + + + + + + + Tuscany SCA Native Samples - HTTPD BigBank Sample + + + +
      +
      +
      +

      Tuscany SCA Native Samples - HTTPD BigBank Sample

      + +

      This sample implements the "Simplified BigBank" scenario. A whitepaper describing + the scenario based on the SCA 0.9 Assembly specification can be found + here. + This is a more modular version of the original Bigbank app, with the account + service and the account data service are in different composites. +

      +

      The HTTPD BigBank sample requires the following extensions: +

      + Please follow the documentation to ensure you have these extensions built and installed + on your system +

      +

      There are three sub-projects in this workspace:

      +
        +
      • bigbank.account
        + This contains the source code and SCDL artifacts for the SCA HTTPD BigBank + composite implementing the account services. +
      • +
      • bigbank.accountdata
        + This contains the source code and SCDL artifacts for the SCA HTTPD BigBank + composite implementing the account data services. +
      • +
      • bigbank.wsclient
        + A sample client which uses an SCA Web Service reference to make a remote + call to the BigBank service. +
      • +
      +

      Additionally, there is the bigbank.app.composite file. This + describes the configuration of the SCA BigBank composite deployed to the SCA + runtime. +

      +

      Note that this sample does not run on Windows, due to threading incompatibilities + between Apache HTTPD and the Ruby runtime

      +
      + + + + +
      +

      Building the HTTPD BigBank sample on Linux and Mac OS X

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
      2. + +
      3. As the HTTPD BigBank sample is based on Ruby scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the Ruby samples only with the following command sequence: +
          +
        • cd <tuscany_sca_install_dir>/samples
        • +
        • ./configure --enable-ruby --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
        • +
        • make install
        • +
        + NOTE: If you don't provide the --prefix configure option, it will by default install into + /usr/local/tuscany/sca/samples/HttpdBigBank +
      4. +
      +
      + +
      +

      Running the HTTPD BigBank sample on Linux and Mac OS X

      +
        +
      1. The HTTPD BigBank sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
      2. +
      3. Ensure you have enabled Axis2/C to run Tuscany SCA services. Follow the instructions + found here. +
      4. +
      5. Start the Apache HTTPD server: +
          +
        1. The following environment variables are required: +
            +
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • +
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • +
          • AXIS2C_HOME=<path to Axis2/C version 0.96>
          • +
          +
        2. +
        3. cd <tuscany_sca_install_dir>/samples/HttpdBigBank/deploy/httpserver
        4. +
        5. ./startserver.sh
          + NOTE: Depending on your installation of Apache HTTPD you may need to log in as root before following + these steps. If so, you may also need to uncomment the User and Group directives in the + <tuscany_sca_install_dir>/samples/HttpdBigBank/deploy/httpserver/conf/httpd.conf file + and set these to the appropriate username and group that the server should run as
        6. +
        +
      6. +
      7. Now run the Web Service client: +
          +
        1. The following environment variables are required: +
            +
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • +
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • +
          • AXIS2C_HOME=<path to Axis2/C version 0.96>
          • +
          +
        2. +
        3. Run the sample with the following commands: +
            +
          • cd <tuscany_sca_install_dir>/samples/HttpdBigBank/deploy/bigbank.wsclient
          • +
          • ./runwsclient.sh
          • +
          +
        4. +
        +
      8. +
      9. The PHP web client detailed in the + CppBigBank sample can also be used + with the HTTPD BigBank service that is served by the HTTPD server started above. +
      10. +
      +
      + +
      +

      The HTTPD BigBank sample on Windows

      +

      The HttpdBigBank sample does not currently run on Windows, due to the sample being based on Ruby + components running under Apache HTTPD. The Ruby runtime is single-threaded and, on Windows, HTTPD + is multi-threaded, which means that Ruby throws "cross-thread violation" errors when Tuscany + attempts to run a Ruby script under HTTPD.

      +
      + +
      +

      Getting Help

      + +

      The first place to look is at the Tuscany SCA FAQ at + http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      + +

      Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      + +
      +
      +
      + + + + diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/AccountService.wsdl b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/AccountService.wsdl new file mode 100644 index 0000000000..b83c453462 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/AccountService.wsdl @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/AccountServiceImpl.rb b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/AccountServiceImpl.rb new file mode 100644 index 0000000000..20af2cfedb --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/AccountServiceImpl.rb @@ -0,0 +1,83 @@ +# 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. +# + +require "rexml/document" +include REXML + +class AccountServiceImpl + + attr_writer :accountDataService + attr_writer :stockQuoteService + attr_writer :currency + + def initialize() + print "Ruby - AccountServiceImpl.initialize\n" + end + + def getAccountReport(customerID) + + # Get the checking account info + checking = @accountDataService.getCheckingAccount(customerID) + + # Get the savings account info + savings = @accountDataService.getSavingsAccount(customerID) + + # Get the stocks account info + stock = @accountDataService.getStockAccount(customerID); + + symbol = stock.root.elements["symbol"].text + quantity = stock.root.elements["quantity"].text + + # Get the stock price + price = @stockQuoteService.getQuote(symbol); + + # Convert to the configured currency + price = price.to_f * 0.80 if @currency == "EUR" + + # Calculate the balance + balance = price.to_f * quantity.to_f + + # Form the AccountReport document + report = Document.new <<-eof + + + + #{ checking.root.elements["accountNumber"].text } + #{ checking.root.elements["balance"].text } + + + + #{ savings.root.elements["accountNumber"].text } + #{ savings.root.elements["balance"].text } + + + + #{ stock.root.elements["accountNumber"].text } + #{ symbol } + #{ quantity } + #{ balance } + + + + eof + + return report + end + +end diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/Makefile.am b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/Makefile.am new file mode 100644 index 0000000000..01c8681555 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/Makefile.am @@ -0,0 +1,22 @@ +# 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. + +deploydir=$(prefix)/HttpdBigBank/deploy +compositedir=$(deploydir)/bigbank.account + +composite_DATA = *.composite *.wsdl *.xsd *.rb +EXTRA_DIST = *.composite *.wsdl *.xsd *.rb diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/StockQuoteServiceImpl.rb b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/StockQuoteServiceImpl.rb new file mode 100644 index 0000000000..7f8634072c --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/StockQuoteServiceImpl.rb @@ -0,0 +1,52 @@ +# 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. +# + +require "rexml/document" +include REXML + +class StockQuoteServiceImpl + + attr_writer :webService + + def initialize() + print "Ruby - StockQuoteServiceImpl.initialize\n" + end + + def getQuote(symbol) + print "Ruby - StockQuoteServiceImpl.getQuote ", symbol, "\n" + + price = 0 + catch (:RuntimeError) do + begin + + result = @webService.GetQuote(symbol) + doc = Document.new(result) + price = doc.root.elements["Stock"].elements["Last"].text; + + rescue + # offline or StockQuote web service is down + price = 95.0 + end + end + + print "Ruby - stock price = ", price, "\n" + + return price.to_f + end + +end \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/StockQuoteTypes.xsd b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/StockQuoteTypes.xsd new file mode 100644 index 0000000000..2f7012b5fb --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/StockQuoteTypes.xsd @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/StockQuoteWebService.wsdl b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/StockQuoteWebService.wsdl new file mode 100644 index 0000000000..c14f97c87b --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/StockQuoteWebService.wsdl @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get Stock quote for a company Symbol + + + + + + + + + + Get Stock quote for a company Symbol + + + + + + + + + + Get Stock quote for a company Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/bigbank.account.composite b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/bigbank.account.composite new file mode 100644 index 0000000000..208402cdb3 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.account/bigbank.account.composite @@ -0,0 +1,51 @@ + + + + + + + + + AccountServiceComponent + + + + + AccountDataService + StockQuoteServiceComponent + USD + + + + + StockQuoteWebService + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.accountdata/AccountData.xsd b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.accountdata/AccountData.xsd new file mode 100644 index 0000000000..8c8ff7c637 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.accountdata/AccountData.xsd @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.accountdata/AccountDataServiceImpl.rb b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.accountdata/AccountDataServiceImpl.rb new file mode 100644 index 0000000000..8ae0e23bab --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.accountdata/AccountDataServiceImpl.rb @@ -0,0 +1,72 @@ +# 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. +# + +require "rexml/document" +include REXML + +class AccountDataServiceImpl + + def initialize() + print "Ruby - AccountDataServiceImpl.initialize\n" + end + + def getCheckingAccount(id) + print "Ruby - AccountDataServiceImpl.getCheckingAccount ", id, "\n" + + result = Document.new <<-eof + + #{ id.to_s + "_CHA12345"} + 1500.0 + + eof + + return result + end + + def getSavingsAccount(id) + print "Ruby - AccountDataServiceImpl.getSavingsAccount ", id, "\n" + + result = Document.new <<-eof + + #{ id.to_s + "_SAA12345"} + 1500.0 + + eof + + return result + end + + def getStockAccount(id) + print "Ruby - AccountDataServiceImpl.getStockAccount ", id, "\n" + + result = Document.new <<-eof + + #{ id.to_s + "_STA12345"} + IBM + 100 + + + eof + + return result + end + +end diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.accountdata/Makefile.am b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.accountdata/Makefile.am new file mode 100644 index 0000000000..7735720b26 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.accountdata/Makefile.am @@ -0,0 +1,22 @@ +# 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. + +deploydir=$(prefix)/HttpdBigBank/deploy +compositedir=$(deploydir)/bigbank.accountdata + +composite_DATA = *.composite *.xsd *.rb +EXTRA_DIST = *.composite *.xsd *.rb diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.accountdata/bigbank.accountdata.composite b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.accountdata/bigbank.accountdata.composite new file mode 100644 index 0000000000..30c2802d5b --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.accountdata/bigbank.accountdata.composite @@ -0,0 +1,33 @@ + + + + + + + + AccountDataServiceComponent + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.app.composite b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.app.composite new file mode 100644 index 0000000000..9507997464 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.app.composite @@ -0,0 +1,39 @@ + + + + + + + + bigbank.AccountDataManagementComponent/AccountDataService + + + + + + + + + bigbank.AccountManagementComponent/AccountService + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/AccountService.wsdl b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/AccountService.wsdl new file mode 100644 index 0000000000..b83c453462 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/AccountService.wsdl @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/AccountWSClient.rb b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/AccountWSClient.rb new file mode 100644 index 0000000000..6775b80f7a --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/AccountWSClient.rb @@ -0,0 +1,40 @@ +# 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. +# +# + +require("tuscany_sca_ruby") + +accountService = SCA::locateService("AccountService") + +report = accountService.getAccountReport(1234) + +checking = report.root.elements["checking"] +savings = report.root.elements["savings"] +stocks = report.root.elements["stocks"] + +print "\n\n" +print "Checking account #: ", checking.elements["accountNumber"].text.strip, "\n" +print "Balance: ", checking.elements["balance"].text.strip, "\n" + +print "Savings account #: ", savings.elements["accountNumber"].text.strip, "\n" +print "Balance: ", savings.elements["balance"].text.strip, "\n" + +print "Stocks account #:", stocks.elements["accountNumber"].text.strip, "\n" +print "Symbol: ", stocks.elements["symbol"].text.strip, "\n" +print "Quantity: ", stocks.elements["quantity"].text.strip, "\n" +print "Balance: ", stocks.elements["balance"].text.strip, "\n" diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/Makefile.am b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/Makefile.am new file mode 100644 index 0000000000..b1f1cfff0e --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/Makefile.am @@ -0,0 +1,6 @@ +deploydir=$(prefix)/HttpdBigBank/deploy +clientdir=$(deploydir)/bigbank.wsclient + +client_DATA = *.rb *.composite *.wsdl +client_SCRIPTS = runwsclient.sh +EXTRA_DIST = runwsclient.sh *.rb *.composite *.wsdl diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/bigbank.wsclient.composite b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/bigbank.wsclient.composite new file mode 100644 index 0000000000..f484a2fc7c --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/bigbank.wsclient.composite @@ -0,0 +1,29 @@ + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/runwsclient.bat b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/runwsclient.bat new file mode 100644 index 0000000000..05d0ee2153 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/runwsclient.bat @@ -0,0 +1,51 @@ +@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 "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) +echo Using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) +echo Using SDO installed at %TUSCANY_SDOCPP% + +if "%AXIS2C_HOME%" == "" ( +echo "AXIS2C_HOME not set" +goto end +) +echo Using Axis2C installed at %AXIS2C_HOME% + +rem Run the client +set PATH=%TUSCANY_SCACPP%\extensions\ruby\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SCACPP%\extensions\ws\reference\bin;%TUSCANY_SCACPP%\extensions\ws\service\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% + +set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ +set TUSCANY_SCACPP_COMPONENT=bigbank.AccountWSClientComponent +set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +cd %TUSCANY_SCACPP_ROOT%\bigbank.wsclient +ruby -I%TUSCANY_SCACPP%\extensions\ruby\bin AccountWSClient.rb + +:end +endlocal diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/runwsclient.sh b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/runwsclient.sh new file mode 100755 index 0000000000..d50e6a4b0a --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/bigbank.wsclient/runwsclient.sh @@ -0,0 +1,48 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$AXIS2C_HOME = x ]; then +echo "AXIS2C_HOME not set" +exit; +fi +echo "Using Axis2C installed at $AXIS2C_HOME" + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/ruby/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ +export TUSCANY_SCACPP_COMPONENT=bigbank.AccountWSClientComponent +export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +cd $TUSCANY_SCACPP_ROOT/bigbank.wsclient +ruby -I$TUSCANY_SCACPP/extensions/ruby/lib AccountWSClient.rb diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/Makefile.am b/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/Makefile.am new file mode 100644 index 0000000000..1195ee1aae --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/Makefile.am @@ -0,0 +1,6 @@ +deploydir=$(prefix)/HttpdBigBank/deploy +serverdir=$(deploydir)/httpserver + +server_SCRIPTS = startserver.sh stopserver.sh +EXTRA_DIST = startserver.sh stopserver.sh conf htdocs +nobase_server_DATA = conf/httpd.conf conf/mime.types htdocs/index.html diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/conf/httpd.conf b/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/conf/httpd.conf new file mode 100644 index 0000000000..e9a438dc85 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/conf/httpd.conf @@ -0,0 +1,35 @@ +# 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 is the main Apache HTTP server configuration file. It contains the +# configuration directives that give the server its instructions. +# See for detailed information. + +Listen 9090 + +# Generated by the startserver script +Include conf/base.conf +Include conf/mod_axis2.conf +# Include conf/tuscany_sca_mod_rest.conf + +# User and Group directives may be required if the server must be +# started from the root account. Uncomment the following lines and +# set the correct username and group +# +# User myusername +# Group mygroupname + diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/conf/mime.types b/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/conf/mime.types new file mode 100644 index 0000000000..4279f51bca --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/conf/mime.types @@ -0,0 +1,607 @@ +# 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 file controls what Internet media types are sent to the client for +# given file extension(s). Sending the correct media type to the client +# is important so they know how to handle the content of the file. +# Extra types can either be added here or by using an AddType directive +# in your config files. For more information about Internet media types, +# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type +# registry is at . + +# MIME type Extensions +application/activemessage +application/andrew-inset ez +application/applefile +application/atom+xml atom +application/atomicmail +application/batch-smtp +application/beep+xml +application/cals-1840 +application/cnrp+xml +application/commonground +application/cpl+xml +application/cybercash +application/dca-rft +application/dec-dx +application/dvcs +application/edi-consent +application/edifact +application/edi-x12 +application/eshop +application/font-tdpfr +application/http +application/hyperstudio +application/iges +application/index +application/index.cmd +application/index.obj +application/index.response +application/index.vnd +application/iotp +application/ipp +application/isup +application/mac-binhex40 hqx +application/mac-compactpro cpt +application/macwriteii +application/marc +application/mathematica +application/mathml+xml mathml +application/msword doc +application/news-message-id +application/news-transmission +application/ocsp-request +application/ocsp-response +application/octet-stream bin dms lha lzh exe class so dll dmg +application/oda oda +application/ogg ogg +application/parityfec +application/pdf pdf +application/pgp-encrypted +application/pgp-keys +application/pgp-signature +application/pkcs10 +application/pkcs7-mime +application/pkcs7-signature +application/pkix-cert +application/pkix-crl +application/pkixcmp +application/postscript ai eps ps +application/prs.alvestrand.titrax-sheet +application/prs.cww +application/prs.nprend +application/prs.plucker +application/qsig +application/rdf+xml rdf +application/reginfo+xml +application/remote-printing +application/riscos +application/rtf +application/sdp +application/set-payment +application/set-payment-initiation +application/set-registration +application/set-registration-initiation +application/sgml +application/sgml-open-catalog +application/sieve +application/slate +application/smil smi smil +application/srgs gram +application/srgs+xml grxml +application/timestamp-query +application/timestamp-reply +application/tve-trigger +application/vemmi +application/vnd.3gpp.pic-bw-large +application/vnd.3gpp.pic-bw-small +application/vnd.3gpp.pic-bw-var +application/vnd.3gpp.sms +application/vnd.3m.post-it-notes +application/vnd.accpac.simply.aso +application/vnd.accpac.simply.imp +application/vnd.acucobol +application/vnd.acucorp +application/vnd.adobe.xfdf +application/vnd.aether.imp +application/vnd.amiga.ami +application/vnd.anser-web-certificate-issue-initiation +application/vnd.anser-web-funds-transfer-initiation +application/vnd.audiograph +application/vnd.blueice.multipass +application/vnd.bmi +application/vnd.businessobjects +application/vnd.canon-cpdl +application/vnd.canon-lips +application/vnd.cinderella +application/vnd.claymore +application/vnd.commerce-battelle +application/vnd.commonspace +application/vnd.contact.cmsg +application/vnd.cosmocaller +application/vnd.criticaltools.wbs+xml +application/vnd.ctc-posml +application/vnd.cups-postscript +application/vnd.cups-raster +application/vnd.cups-raw +application/vnd.curl +application/vnd.cybank +application/vnd.data-vision.rdz +application/vnd.dna +application/vnd.dpgraph +application/vnd.dreamfactory +application/vnd.dxr +application/vnd.ecdis-update +application/vnd.ecowin.chart +application/vnd.ecowin.filerequest +application/vnd.ecowin.fileupdate +application/vnd.ecowin.series +application/vnd.ecowin.seriesrequest +application/vnd.ecowin.seriesupdate +application/vnd.enliven +application/vnd.epson.esf +application/vnd.epson.msf +application/vnd.epson.quickanime +application/vnd.epson.salt +application/vnd.epson.ssf +application/vnd.ericsson.quickcall +application/vnd.eudora.data +application/vnd.fdf +application/vnd.ffsns +application/vnd.fints +application/vnd.flographit +application/vnd.framemaker +application/vnd.fsc.weblaunch +application/vnd.fujitsu.oasys +application/vnd.fujitsu.oasys2 +application/vnd.fujitsu.oasys3 +application/vnd.fujitsu.oasysgp +application/vnd.fujitsu.oasysprs +application/vnd.fujixerox.ddd +application/vnd.fujixerox.docuworks +application/vnd.fujixerox.docuworks.binder +application/vnd.fut-misnet +application/vnd.grafeq +application/vnd.groove-account +application/vnd.groove-help +application/vnd.groove-identity-message +application/vnd.groove-injector +application/vnd.groove-tool-message +application/vnd.groove-tool-template +application/vnd.groove-vcard +application/vnd.hbci +application/vnd.hhe.lesson-player +application/vnd.hp-hpgl +application/vnd.hp-hpid +application/vnd.hp-hps +application/vnd.hp-pcl +application/vnd.hp-pclxl +application/vnd.httphone +application/vnd.hzn-3d-crossword +application/vnd.ibm.afplinedata +application/vnd.ibm.electronic-media +application/vnd.ibm.minipay +application/vnd.ibm.modcap +application/vnd.ibm.rights-management +application/vnd.ibm.secure-container +application/vnd.informix-visionary +application/vnd.intercon.formnet +application/vnd.intertrust.digibox +application/vnd.intertrust.nncp +application/vnd.intu.qbo +application/vnd.intu.qfx +application/vnd.irepository.package+xml +application/vnd.is-xpr +application/vnd.japannet-directory-service +application/vnd.japannet-jpnstore-wakeup +application/vnd.japannet-payment-wakeup +application/vnd.japannet-registration +application/vnd.japannet-registration-wakeup +application/vnd.japannet-setstore-wakeup +application/vnd.japannet-verification +application/vnd.japannet-verification-wakeup +application/vnd.jisp +application/vnd.kde.karbon +application/vnd.kde.kchart +application/vnd.kde.kformula +application/vnd.kde.kivio +application/vnd.kde.kontour +application/vnd.kde.kpresenter +application/vnd.kde.kspread +application/vnd.kde.kword +application/vnd.kenameaapp +application/vnd.koan +application/vnd.liberty-request+xml +application/vnd.llamagraphics.life-balance.desktop +application/vnd.llamagraphics.life-balance.exchange+xml +application/vnd.lotus-1-2-3 +application/vnd.lotus-approach +application/vnd.lotus-freelance +application/vnd.lotus-notes +application/vnd.lotus-organizer +application/vnd.lotus-screencam +application/vnd.lotus-wordpro +application/vnd.mcd +application/vnd.mediastation.cdkey +application/vnd.meridian-slingshot +application/vnd.micrografx.flo +application/vnd.micrografx.igx +application/vnd.mif mif +application/vnd.minisoft-hp3000-save +application/vnd.mitsubishi.misty-guard.trustweb +application/vnd.mobius.daf +application/vnd.mobius.dis +application/vnd.mobius.mbk +application/vnd.mobius.mqy +application/vnd.mobius.msl +application/vnd.mobius.plc +application/vnd.mobius.txf +application/vnd.mophun.application +application/vnd.mophun.certificate +application/vnd.motorola.flexsuite +application/vnd.motorola.flexsuite.adsi +application/vnd.motorola.flexsuite.fis +application/vnd.motorola.flexsuite.gotap +application/vnd.motorola.flexsuite.kmr +application/vnd.motorola.flexsuite.ttc +application/vnd.motorola.flexsuite.wem +application/vnd.mozilla.xul+xml xul +application/vnd.ms-artgalry +application/vnd.ms-asf +application/vnd.ms-excel xls +application/vnd.ms-lrm +application/vnd.ms-powerpoint ppt +application/vnd.ms-project +application/vnd.ms-tnef +application/vnd.ms-works +application/vnd.ms-wpl +application/vnd.mseq +application/vnd.msign +application/vnd.music-niff +application/vnd.musician +application/vnd.netfpx +application/vnd.noblenet-directory +application/vnd.noblenet-sealer +application/vnd.noblenet-web +application/vnd.novadigm.edm +application/vnd.novadigm.edx +application/vnd.novadigm.ext +application/vnd.obn +application/vnd.osa.netdeploy +application/vnd.palm +application/vnd.pg.format +application/vnd.pg.osasli +application/vnd.powerbuilder6 +application/vnd.powerbuilder6-s +application/vnd.powerbuilder7 +application/vnd.powerbuilder7-s +application/vnd.powerbuilder75 +application/vnd.powerbuilder75-s +application/vnd.previewsystems.box +application/vnd.publishare-delta-tree +application/vnd.pvi.ptid1 +application/vnd.pwg-multiplexed +application/vnd.pwg-xhtml-print+xml +application/vnd.quark.quarkxpress +application/vnd.rapid +application/vnd.s3sms +application/vnd.sealed.net +application/vnd.seemail +application/vnd.shana.informed.formdata +application/vnd.shana.informed.formtemplate +application/vnd.shana.informed.interchange +application/vnd.shana.informed.package +application/vnd.smaf +application/vnd.sss-cod +application/vnd.sss-dtf +application/vnd.sss-ntf +application/vnd.street-stream +application/vnd.svd +application/vnd.swiftview-ics +application/vnd.triscape.mxs +application/vnd.trueapp +application/vnd.truedoc +application/vnd.ufdl +application/vnd.uplanet.alert +application/vnd.uplanet.alert-wbxml +application/vnd.uplanet.bearer-choice +application/vnd.uplanet.bearer-choice-wbxml +application/vnd.uplanet.cacheop +application/vnd.uplanet.cacheop-wbxml +application/vnd.uplanet.channel +application/vnd.uplanet.channel-wbxml +application/vnd.uplanet.list +application/vnd.uplanet.list-wbxml +application/vnd.uplanet.listcmd +application/vnd.uplanet.listcmd-wbxml +application/vnd.uplanet.signal +application/vnd.vcx +application/vnd.vectorworks +application/vnd.vidsoft.vidconference +application/vnd.visio +application/vnd.visionary +application/vnd.vividence.scriptfile +application/vnd.vsf +application/vnd.wap.sic +application/vnd.wap.slc +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/vnd.webturbo +application/vnd.wrq-hp3000-labelled +application/vnd.wt.stf +application/vnd.wv.csp+wbxml +application/vnd.xara +application/vnd.xfdl +application/vnd.yamaha.hv-dic +application/vnd.yamaha.hv-script +application/vnd.yamaha.hv-voice +application/vnd.yellowriver-custom-menu +application/voicexml+xml vxml +application/watcherinfo+xml +application/whoispp-query +application/whoispp-response +application/wita +application/wordperfect5.1 +application/x-bcpio bcpio +application/x-cdlink vcd +application/x-chess-pgn pgn +application/x-compress +application/x-cpio cpio +application/x-csh csh +application/x-director dcr dir dxr +application/x-dvi dvi +application/x-futuresplash spl +application/x-gtar gtar +application/x-gzip +application/x-hdf hdf +application/x-javascript js +application/x-koan skp skd skt skm +application/x-latex latex +application/x-netcdf nc cdf +application/x-sh sh +application/x-shar shar +application/x-shockwave-flash swf +application/x-stuffit sit +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-tar tar +application/x-tcl tcl +application/x-tex tex +application/x-texinfo texinfo texi +application/x-troff t tr roff +application/x-troff-man man +application/x-troff-me me +application/x-troff-ms ms +application/x-ustar ustar +application/x-wais-source src +application/x400-bp +application/xhtml+xml xhtml xht +application/xslt+xml xslt +application/xml xml xsl +application/xml-dtd dtd +application/xml-external-parsed-entity +application/zip zip +audio/32kadpcm +audio/amr +audio/amr-wb +audio/basic au snd +audio/cn +audio/dat12 +audio/dsr-es201108 +audio/dvi4 +audio/evrc +audio/evrc0 +audio/g722 +audio/g.722.1 +audio/g723 +audio/g726-16 +audio/g726-24 +audio/g726-32 +audio/g726-40 +audio/g728 +audio/g729 +audio/g729D +audio/g729E +audio/gsm +audio/gsm-efr +audio/l8 +audio/l16 +audio/l20 +audio/l24 +audio/lpc +audio/midi mid midi kar +audio/mpa +audio/mpa-robust +audio/mp4a-latm +audio/mpeg mpga mp2 mp3 +audio/parityfec +audio/pcma +audio/pcmu +audio/prs.sid +audio/qcelp +audio/red +audio/smv +audio/smv0 +audio/telephone-event +audio/tone +audio/vdvi +audio/vnd.3gpp.iufp +audio/vnd.cisco.nse +audio/vnd.cns.anp1 +audio/vnd.cns.inf1 +audio/vnd.digital-winds +audio/vnd.everad.plj +audio/vnd.lucent.voice +audio/vnd.nortel.vbk +audio/vnd.nuera.ecelp4800 +audio/vnd.nuera.ecelp7470 +audio/vnd.nuera.ecelp9600 +audio/vnd.octel.sbc +audio/vnd.qcelp +audio/vnd.rhetorex.32kadpcm +audio/vnd.vmx.cvsd +audio/x-aiff aif aiff aifc +audio/x-alaw-basic +audio/x-mpegurl m3u +audio/x-pn-realaudio ram ra +audio/x-pn-realaudio-plugin +application/vnd.rn-realmedia rm +audio/x-wav wav +chemical/x-pdb pdb +chemical/x-xyz xyz +image/bmp bmp +image/cgm cgm +image/g3fax +image/gif gif +image/ief ief +image/jpeg jpeg jpg jpe +image/naplps +image/png png +image/prs.btif +image/prs.pti +image/svg+xml svg +image/t38 +image/tiff tiff tif +image/tiff-fx +image/vnd.cns.inf2 +image/vnd.djvu djvu djv +image/vnd.dwg +image/vnd.dxf +image/vnd.fastbidsheet +image/vnd.fpx +image/vnd.fst +image/vnd.fujixerox.edmics-mmr +image/vnd.fujixerox.edmics-rlc +image/vnd.globalgraphics.pgb +image/vnd.mix +image/vnd.ms-modi +image/vnd.net-fpx +image/vnd.svf +image/vnd.wap.wbmp wbmp +image/vnd.xiff +image/x-cmu-raster ras +image/x-icon ico +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-rgb rgb +image/x-xbitmap xbm +image/x-xpixmap xpm +image/x-xwindowdump xwd +message/delivery-status +message/disposition-notification +message/external-body +message/http +message/news +message/partial +message/rfc822 +message/s-http +message/sip +message/sipfrag +model/iges igs iges +model/mesh msh mesh silo +model/vnd.dwf +model/vnd.flatland.3dml +model/vnd.gdl +model/vnd.gs-gdl +model/vnd.gtw +model/vnd.mts +model/vnd.parasolid.transmit.binary +model/vnd.parasolid.transmit.text +model/vnd.vtu +model/vrml wrl vrml +multipart/alternative +multipart/appledouble +multipart/byteranges +multipart/digest +multipart/encrypted +multipart/form-data +multipart/header-set +multipart/mixed +multipart/parallel +multipart/related +multipart/report +multipart/signed +multipart/voice-message +text/calendar ics ifb +text/css css +text/directory +text/enriched +text/html html htm +text/parityfec +text/plain asc txt +text/prs.lines.tag +text/rfc822-headers +text/richtext rtx +text/rtf rtf +text/sgml sgml sgm +text/t140 +text/tab-separated-values tsv +text/uri-list +text/vnd.abc +text/vnd.curl +text/vnd.dmclientscript +text/vnd.fly +text/vnd.fmi.flexstor +text/vnd.in3d.3dml +text/vnd.in3d.spot +text/vnd.iptc.nitf +text/vnd.iptc.newsml +text/vnd.latex-z +text/vnd.motorola.reflex +text/vnd.ms-mediapackage +text/vnd.net2phone.commcenter.command +text/vnd.sun.j2me.app-descriptor +text/vnd.wap.si +text/vnd.wap.sl +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/x-setext etx +text/xml +text/xml-external-parsed-entity +video/bmpeg +video/bt656 +video/celb +video/dv +video/h261 +video/h263 +video/h263-1998 +video/h263-2000 +video/jpeg +video/mp1s +video/mp2p +video/mp2t +video/mp4v-es +video/mpv +video/mpeg mpeg mpg mpe +video/nv +video/parityfec +video/pointer +video/quicktime qt mov +video/smpte292m +video/vnd.fvt +video/vnd.motorola.video +video/vnd.motorola.videop +video/vnd.mpegurl mxu m4u +video/vnd.nokia.interleaved-multimedia +video/vnd.objectvideo +video/vnd.vivo +video/x-msvideo avi +video/x-sgi-movie movie +x-conference/x-cooltalk ice diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/htdocs/index.html b/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/htdocs/index.html new file mode 100644 index 0000000000..1bfb3e30c2 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/htdocs/index.html @@ -0,0 +1,21 @@ + + +

      It works!

      + diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/startserver.bat b/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/startserver.bat new file mode 100644 index 0000000000..fe319248f5 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/startserver.bat @@ -0,0 +1,89 @@ +@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 APFULLDIR=%~d0%~p0 +echo Running from %APFULLDIR% + +if "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) +echo Using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) +echo Using SDO installed at %TUSCANY_SDOCPP% + +if "%AXIS2C_HOME%" == "" ( +echo "AXIS2C_HOME not set" +goto end +) +echo Using Axis2C installed at %AXIS2C_HOME% + +if "%HTTPD_HOME%" == "" ( +echo "HTTPD_HOME not set" +goto end +) +echo Using HTTPD installed at %HTTPD_HOME% + +set PATH=%TUSCANY_SCACPP%\extensions\sca\reference\bin;%TUSCANY_SCACPP%\extensions\sca\service\bin;%TUSCANY_SCACPP%\extensions\ws\reference\bin;%TUSCANY_SCACPP%\extensions\ws\service\bin;%TUSCANY_SCACPP%\extensions\ruby\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%HTTPD_HOME%\bin;%PATH% + +set TUSCANY_SCACPP_ROOT=%APFULLDIR%\..\ +set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +@REM Generate the mod_axis2 configuration +if not exist %APFULLDIR%\conf\mod_axis2.conf ( + echo LoadModule axis2_module %AXIS2C_HOME%\lib\mod_axis2.dll > %APFULLDIR%\conf\mod_axis2.conf + echo Axis2RepoPath %AXIS2C_HOME% >> %APFULLDIR%\conf\mod_axis2.conf + echo Axis2LogFile %AXIS2C_HOME%\logs\httpd.log >> %APFULLDIR%\conf\mod_axis2.conf + echo Axis2LogLevel AXIS2_LOG_LEVEL_DEBUG >> %APFULLDIR%\conf\mod_axis2.conf + echo ^ >> %APFULLDIR%\conf\mod_axis2.conf + echo SetHandler axis2_module >> %APFULLDIR%\conf\mod_axis2.conf + echo ^ >> %APFULLDIR%\conf\mod_axis2.conf +) + +@REM Generate the tuscany_sca_mod_rest configuration +@REM if not exist %APFULLDIR%\conf\tuscany_sca_mod_rest.conf ( +@REM echo LoadModule sca_rest_module %TUSCANY_SCACPP%/extensions/rest\service/bin/tuscany_sca_mod_rest.dll > %APFULLDIR%\conf\tuscany_sca_mod_rest.conf +@REM echo TuscanyHome %TUSCANY_SCACPP% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf +@REM echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf +@REM echo SetHandler sca_rest_module >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf +@REM echo TuscanyRoot %TUSCANY_SCACPP_ROOT% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf +@REM echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf +@REM ) + +@REM Generate the base HTTPD configuration +if not exist %APFULLDIR%\conf\base.conf ( + echo LoadModule mime_module %HTTPD_HOME%\modules\mod_mime.so > %APFULLDIR%\conf\base.conf + echo LoadModule dir_module %HTTPD_HOME%\modules\mod_dir.so >> %APFULLDIR%\conf\base.conf + echo DocumentRoot %APFULLDIR%\htdocs >> %APFULLDIR%\conf\base.conf +) + +@REM Create logs directory +if not exist %APFULLDIR%\logs mkdir %APFULLDIR%\logs +@rem set TUSCANY_SCACPP_LOG=%APFULLDIR%\logs\tuscany-server.log +set TUSCANY_SCACPP_LOGGING=9 + +@REM Start the HTTP server +echo Starting Apache httpd +httpd -X -d %APFULLDIR% diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/startserver.sh b/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/startserver.sh new file mode 100755 index 0000000000..cca8472b75 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/startserver.sh @@ -0,0 +1,78 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$AXIS2C_HOME = x ]; then +echo "AXIS2C_HOME not set" +exit; +fi +echo "Using Axis2C installed at $AXIS2C_HOME" + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/cpp/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ +export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +# Generate the mod_axis2 configuration +if [ ! -f conf/mod_axis2.conf ]; then + echo "LoadModule axis2_module $AXIS2C_HOME/lib/libmod_axis2.so.0.0.0" >conf/mod_axis2.conf + echo "Axis2RepoPath $AXIS2C_HOME" >>conf/mod_axis2.conf + echo "Axis2LogFile $AXIS2C_HOME/logs/httpd.log" >>conf/mod_axis2.conf + echo "Axis2LogLevel AXIS2_LOG_LEVEL_INFO" >>conf/mod_axis2.conf + echo "" >>conf/mod_axis2.conf + echo " SetHandler axis2_module" >>conf/mod_axis2.conf + echo "" >>conf/mod_axis2.conf +fi + +# Generate the mod_rest configuration +if [ ! -f conf/tuscany_sca_mod_rest.conf ]; then + echo "LoadModule sca_rest_module $TUSCANY_SCACPP/extensions/rest/service/lib/libtuscany_sca_mod_rest.so.0.0.0" >conf/tuscany_sca_mod_rest.conf + echo "TuscanyHome $TUSCANY_SCACPP" >>conf/tuscany_sca_mod_rest.conf + echo "" >>conf/tuscany_sca_mod_rest.conf + echo " SetHandler sca_rest_module" >>conf/tuscany_sca_mod_rest.conf + echo " TuscanyRoot $TUSCANY_SCACPP_ROOT" >>conf/tuscany_sca_mod_rest.conf + echo "" >>conf/tuscany_sca_mod_rest.conf +fi + +# Generate the HTTPD base configuration +if [ ! -f conf/base.conf ]; then + echo "DocumentRoot $APFULLDIR/htdocs" >conf/base.conf +fi + +# Create logs directory +if [ ! -d logs ]; then + mkdir logs +fi + +# Start the HTTP server +echo "Starting Apache httpd" +apachectl -k start -d $APFULLDIR diff --git a/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/stopserver.sh b/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/stopserver.sh new file mode 100755 index 0000000000..c17f632a3e --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/HttpdBigBank/httpserver/stopserver.sh @@ -0,0 +1,25 @@ +#!/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` + +# Stop the HTTP server +echo "Stopping Apache httpd" +apachectl -k stop -d $APFULLDIR + diff --git a/sca-cpp/trunk/contrib/samples/INSTALL b/sca-cpp/trunk/contrib/samples/INSTALL new file mode 100644 index 0000000000..3d7155367d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/INSTALL @@ -0,0 +1,2 @@ +Please read the GettingStarted.html document for information on +building, installing and running Tuscany SCA for C++ Samples \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/LICENSE b/sca-cpp/trunk/contrib/samples/LICENSE new file mode 100755 index 0000000000..f433b1a53f --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/sca-cpp/trunk/contrib/samples/Makefile.am b/sca-cpp/trunk/contrib/samples/Makefile.am new file mode 100644 index 0000000000..0fdf524cc1 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/Makefile.am @@ -0,0 +1,40 @@ +# 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_SAMPLES + CPP_SAMPLES = CppCalculator CppBigBank + PYTHON_SAMPLES = PythonCalculator PythonWeatherForecast RestCustomer AlertAggregator + RUBY_SAMPLES = RubyCalculator RubyBigBank HttpdBigBank RestCalculator + PYTHON_RUBY_SAMPLES = RestYahoo +else +if WANT_CPP_SAMPLES + CPP_SAMPLES = CppCalculator CppBigBank +endif +if WANT_PYTHON_SAMPLES + PYTHON_SAMPLES = PythonCalculator PythonWeatherForecast RestCustomer AlertAggregator +if WANT_RUBY_SAMPLES + PYTHON_RUBY_SAMPLES = RestYahoo +endif +endif +if WANT_RUBY_SAMPLES + RUBY_SAMPLES = RubyCalculator RubyBigBank HttpdBigBank RestCalculator +endif +endif +SUBDIRS = ${CPP_SAMPLES} ${PYTHON_SAMPLES} ${RUBY_SAMPLES} ${PYTHON_RUBY_SAMPLES} + +EXTRA_DIST = autogen.sh build.sh GettingStarted.html + diff --git a/sca-cpp/trunk/contrib/samples/NEWS b/sca-cpp/trunk/contrib/samples/NEWS new file mode 100644 index 0000000000..e69de29bb2 diff --git a/sca-cpp/trunk/contrib/samples/NOTICE b/sca-cpp/trunk/contrib/samples/NOTICE new file mode 100644 index 0000000000..44befbee63 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/NOTICE @@ -0,0 +1,5 @@ +Apache Tuscany SCA Native +Copyright 2005, 2007 The Apache Software Foundation + +This product includes software developed by +The Apache Software Foundation (http://www.apache.org/) \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/Makefile.am b/sca-cpp/trunk/contrib/samples/PHPCalculator/Makefile.am new file mode 100644 index 0000000000..3277f97e6e --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/Makefile.am @@ -0,0 +1,22 @@ +# 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. + +deploydir=$(prefix)/PHPCalculator/deploy +# SUBDIRS = sample.calculator sample.calculator.client +SUBDIRS = sample.calculator +EXTRA_DIST = *.composite +deploy_DATA = *.composite diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/README b/sca-cpp/trunk/contrib/samples/PHPCalculator/README new file mode 100644 index 0000000000..d91c958763 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/README @@ -0,0 +1,122 @@ +Tuscany SCA for C++ Samples - PHP Calculator Sample +=================================================== + +This is a simple sample to show how an SCA composite can wire together +a number of components to implement a Calculator service and expose that service as +to a number of different tpyes of client. The sample components are implemented in various +ways to demonstrate the different features of the PHP SCA extension. + +There are three sub projects in this workspace: + - sample.calculator + This contains the source code and SCDL artifacts for the SCA Calculator + composite implementing the sample Calculator + + - sample.calculator.client + A sample client which does a local call to the Calculator service + + - sample.calculator.wsclient + A sample PHP SCA Web Service client which calls the Calculator Web service. + +Additionally, there is the sample.calculator.app.composite file. This +describes the configuration of the SCA Calculator composite deployed to the +SCA runtime. + +(See the README.html file for instructions to build and run this sample - TODO) + +The file phpcalculator.png is a picture of the sample. Given the restrictions on the +current PHP extension (see TODOs in the PHP Extension README) some parts of this +have not been tested yet. + +The path that has been tested is as follows: + +Local CPP client -> CPP Calculator -> PHP Divide -> PHP Add ------> PHP Log + |-------> PHP Subtract -> PHP Log + |-------> PHP Multiple -> PHP Log + |-------> PHP Divide ---> PHP Log + +The local CPP client is used because + - the work to enable PHP to host SCA is not done yet + - running with the axis service causes missing symbols errors on my box + +The CPP Calculator component is used because + - The local CPP client can only talk directly to a CPP component + +To run the sample in this configuration use the CalculatorClient.cpp found in the +sample.calculator.client directory + +Windows +======= + +Hasn't yet been tests on windows in this configuration so ignore the following + +I use the following bat file to start the stand alone axis server and include +appropriate references to PHP dependencies. This needs turning into a proper +run script but I haven't got to this yet + +set TUSCANY_SCACPP_LOGGING=9 +set AXIS2C_HOME=C:\axis2c-bin-0.95-win32 +set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%TUSCANY_SCACPP%\extensions\php\bin;%AXIS2C_HOME%\lib;c:\libxml2-2.6.23.win32\bin;c:\apps\iconv-1.9.1.win32\bin;c:\apps\zlib-1.2.3.win32\bin;C:\php-5.2.0\ +set TUSCANY_SCACPP_ROOT=%TUSCANY_SCACPP%\samples\PHPCalculator +rem set TUSCANY_SCACPP_DEFAULT_COMPONENT=sample.calculator.CalculatorComponent + +%AXIS2C_HOME%\bin\axis2_http_server.exe -l 9 + +I then + +cd %TUSCANY_SCACPP%\samples\PHPCalculator\samples.calculator.wsclient +runwsclient.bat + +This has the effect of runing a PHP/SCA client (no C++ SCA content at all) +to generate a web service request to the C++ SCA runtime hosting the calculator +application. + +Currently this doesn't run all the way through due to a WSDL bug in PHP SCA +(http://pecl.php.net/bugs/bug.php?id=9572). But it gets 99% of the way there. +You will see the server doing all of its stuff and returning the correct result. + +Linux +===== + +I find the following environment variables useful when running PHP embedded inside of +Tuscany SCA. + +# the library path use to locate shared libraries +export LD_LIBRARY_PATH=$LIBXML2_LIB:\ +$AXIS2C_HOME/lib:\ +$PHP_LIB:\ +$TUSCANY_SDOCPP/lib:\ +$TUSCANY_SCACPP/lib:\ +$TUSCANY_SCACPP/extensions/cpp/lib:\ +$TUSCANY_SCACPP/extensions/php/lib:\ +$TUSCANY_SCACPP/extensions/ws/lib:\ +$TUSCANY_SCACPP/samples/PHPCalculator/deploy/sample.calculator:\ +$PHP_SCA_SDO_LIB + +# tell PHP specifically where to find php.ini rather than relying on the default +set PHPRC=/usr/local/lib + +# tell Tuscany SCA which composite appplication to run +export TUSCANY_SCACPP_ROOT=/usr/local/tuscany/cpp/sca/deploy/samples/PHPCalculator + +# tell Tuscany SCA which is the default component in this composite +export TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent + +# turn on logging so you can see what's going on +export TUSCANY_SCACPP_LOGGING=9 + +There is an env.sh file that can be edited and used to set your environment. One edited +to reflect your environment do: + +source env.sh + +The CPP client currently has an independent Makefile due to build problems with the automake +build on my box. If you have your environment configured as above you should be able to do: + +make + +This will produce a.out which can be run using the provided script. + +runclient_cpp.sh + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/phpcalculator.png b/sca-cpp/trunk/contrib/samples/PHPCalculator/phpcalculator.png new file mode 100644 index 0000000000..c251364548 Binary files /dev/null and b/sca-cpp/trunk/contrib/samples/PHPCalculator/phpcalculator.png differ diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.app.composite b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.app.composite new file mode 100644 index 0000000000..1450ad687b --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.app.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/CalculatorClient.cpp b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/CalculatorClient.cpp new file mode 100644 index 0000000000..e72b52f87e --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/CalculatorClient.cpp @@ -0,0 +1,61 @@ +/* + * 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 + +#include + +#include + +#include "commonj/sdo/SDO.h" + +#include "osoa/sca/sca.h" + +#include "Calculator.h" + + +using namespace std; +using namespace commonj::sdo; +using namespace osoa::sca; + + +int main (int argc, char** argv) +{ + + try + { + CompositeContext myContext = CompositeContext::getCurrent(); + Calculator *calcService = (Calculator*) myContext.locateService("CalculatorCPPComponent/CalculatorService"); + float result = calcService->div(10, 2); + cout << "calculator_client: div(10,2) = " << result << endl; + } + catch (...) + { + printf("Got and exception"); + } + + return 0; +} diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/CalculatorClient.php b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/CalculatorClient.php new file mode 100644 index 0000000000..7a512260ae --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/CalculatorClient.php @@ -0,0 +1,32 @@ +add(1.23, 4.56) . "\n"; +echo "sub(1.23, 4.56) = " . $service->sub(1.23, 4.56) . "\n"; +echo "mul(1.23, 4.56) = " . $service->mul(1.23, 4.56) . "\n"; +echo "div(1.23, 4.56) = " . $service->div(1.23, 4.56) . "\n"; + +?> diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/env.sh b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/env.sh new file mode 100755 index 0000000000..de34f1b42a --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/env.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +# 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. + +export AXIS2C_HOME=/home/slaws/apps/axis2c-bin-0.96-linux + +export LIBXML2_LIB=/usr/lib +export LIBXML2_INCLUDE=/usr/include/libxml2 + +export PHP_LIB=/usr/local/lib +export PHP_INCLUDE=/usr/local/include/php + +export PHP_SCA_SDO_INCLUDE=/home/slaws/phpbuild-5-2/pecl/SDO +export PHP_SCA_SDO_LIB=$PHP_LIB/php/extensions/no-debug-zts-20060613/ + +export TUSCANY_SDOCPP=/sdo/deploy +export TUSCANY_SCACPP=/usr/local/tuscany/cpp/sca/deploy + +export LD_LIBRARY_PATH=$LIBXML2_LIB:\ +$AXIS2C_HOME/lib:\ +$PHP_LIB:\ +$TUSCANY_SDOCPP/lib:\ +$TUSCANY_SCACPP/lib:\ +$TUSCANY_SCACPP/extensions/cpp/lib:\ +$TUSCANY_SCACPP/extensions/php/lib:\ +$TUSCANY_SCACPP/extensions/ws/lib:\ +$TUSCANY_SCACPP/samples/PHPCalculator/deploy/sample.calculator:\ +$PHP_SCA_SDO_LIB + +export TUSCANY_SCACPP_LOGGING=9 +export TUSCANY_SCACPP_ROOT=/usr/local/tuscany/cpp/sca/deploy/samples/PHPCalculator + +export PATH=.:$PATH diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/runclient_cpp.bat b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/runclient_cpp.bat new file mode 100644 index 0000000000..0493d7410d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/runclient_cpp.bat @@ -0,0 +1,26 @@ +@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. + +set TUSCANY_SCACPP_ROOT=%TUSCANY_SCACPP%\samples\PHPCalculator\deploy +set TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent +set TUSCANY_SCACPP_LOGGING=9 +set PHRC=C:\simon\Projects\Tuscany\php\php-5.2.0\Debug_TS + +calculator_client.exe + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/runclient_cpp.sh b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/runclient_cpp.sh new file mode 100755 index 0000000000..85a472b7fb --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/runclient_cpp.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# 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. + +export TUSCANY_SCACPP_ROOT=/usr/local/tuscany/cpp/sca/deploy/samples/PHPCalculator +export TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent + +a.out +# gdb a.out +# strace a.out &> strace.txt +# valgrind a.out diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/runclient_php.bat b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/runclient_php.bat new file mode 100644 index 0000000000..815c4fb58e --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.client/runclient_php.bat @@ -0,0 +1,25 @@ +@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 + +php TuscanyTest.php + +:end +endlocal diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.wsclient/Calculator.wsdl b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.wsclient/Calculator.wsdl new file mode 100644 index 0000000000..4d6904b687 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.wsclient/Calculator.wsdl @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.wsclient/CalculatorWSClient.php b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.wsclient/CalculatorWSClient.php new file mode 100644 index 0000000000..82faf1ef19 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.wsclient/CalculatorWSClient.php @@ -0,0 +1,31 @@ +add(1.23, 4.56) . "\n"; +//echo "sub(1.23, 4.56) = " . $service->sub(1.23, 4.56) . "\n"; +//echo "mul(1.23, 4.56) = " . $service->mul(1.23, 4.56) . "\n"; +echo "div(1.23, 4.56) = " . $service->div(1.23, 4.56) . "\n"; + +?> diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.wsclient/runwsclient.bat b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.wsclient/runwsclient.bat new file mode 100644 index 0000000000..a1482be5db --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator.wsclient/runwsclient.bat @@ -0,0 +1,25 @@ +@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 + +php CalculatorWSClient.php + +:end +endlocal diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.componentType b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.componentType new file mode 100644 index 0000000000..aca0b2a6e4 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.componentType @@ -0,0 +1,29 @@ + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.h new file mode 100644 index 0000000000..4abfe9af6b --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.h @@ -0,0 +1,34 @@ +/* + * 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 sample_add_h +#define sample_add_h + +class Add +{ + public: + virtual float add(float num1, float num2) = 0; +}; + +#endif // sample_add_h + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.php b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.php new file mode 100644 index 0000000000..4b5747e10f --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.php @@ -0,0 +1,32 @@ +log_message($result); + +echo $result; +?> diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.componentType b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.componentType new file mode 100644 index 0000000000..7767c663bf --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.componentType @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.h new file mode 100644 index 0000000000..90e97b5319 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.h @@ -0,0 +1,34 @@ +/* + * 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 sample_calculator_h +#define sample_calculator_h + +class Calculator +{ +public: + virtual float add(float arg1, float arg2) = 0; + virtual float sub(float arg1, float arg2) = 0; + virtual float mul(float arg1, float arg2) = 0; + virtual float div(float arg1, float arg2) = 0; +}; + +#endif // sample_calculator_h diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.php b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.php new file mode 100644 index 0000000000..ce8f7899da --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.php @@ -0,0 +1,97 @@ +mul_service->add($num1, $num2); + } + + /** + * Subtraction + * + * @param float $num1 (the first number) + * @param float $num2 (the second number) + * @return float The result + */ + function sub($num1, $num2) { + return $this->mul_service->sub($num1, $num2); + } + + /** + * Multiplication + * + * @param float $num1 (the first number) + * @param float $num2 (the second number) + * @return float The result + */ + function mul($num1, $num2) { + return $this->mul_service->mul($num1, $num2); + } + + /** + * Division + * + * @param float $num1 (the first number) + * @param float $num2 (the second number) + * @return float The result + */ + function div($num1, $num2) { + return $this->div_service->div($num1, $num2); + } +} + +?> diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.wsdl b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.wsdl new file mode 100644 index 0000000000..331b996ba2 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.wsdl @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.componentType b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.componentType new file mode 100644 index 0000000000..e2799af955 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.componentType @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.cpp b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.cpp new file mode 100644 index 0000000000..2d880de72d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.cpp @@ -0,0 +1,90 @@ +/* + * 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 "osoa/sca/ComponentContext.h" +#include "osoa/sca/ServiceRuntimeException.h" + +#include "CalculatorImpl.h" +#include "Divide.h" + +CalculatorImpl::CalculatorImpl() +{ +} + +CalculatorImpl::~CalculatorImpl() +{ +} + +// Calculator interface +float CalculatorImpl::add(float arg1, float arg2) +{ + float result = arg1 + arg2; + + printf("CalculatorImpl::add %f + %f = %f\n", arg1, arg2, result); + return result; +} + +float CalculatorImpl::sub(float arg1, float arg2) +{ + float result = arg1 - arg2; + printf("CalculatorImpl::sub %f - %f = %f\n", arg1, arg2, result); + return result; +} + +float CalculatorImpl::mul(float arg1, float arg2) +{ + float result = arg1 * arg2; + printf("CalculatorImpl::mul %f * %f = %f\n", arg1, arg2, result); + return result; +} + +float CalculatorImpl::div(float arg1, float arg2) +{ + float result = 0; + + // This method shows how to invoke a service on a different component from within a component + + // First, get the current ComponentContext + osoa::sca::ComponentContext myContext = osoa::sca::ComponentContext::getCurrent(); + + try + { + // Find the required service, as referenced in CalculatorImpl.componentType + Divide* divideService = (Divide*)myContext.getService("divideService"); + + // Finally, invoke the service + result = divideService->div(arg1, arg2); + + printf("CalculatorImpl::div Divide returned result: %f\n", result); + + } + catch (osoa::sca::ServiceRuntimeException& e) + { + // Print out error message and carry on + printf("CalculatorImpl::div Error whilst invoking Divide: %s", e.getMessageText()); + } + + return result; +} + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.h new file mode 100644 index 0000000000..af8a5eeab1 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.h @@ -0,0 +1,41 @@ +/* + * 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 sample_calculatorimpl_h +#define sample_calculatorimpl_h + +#include "Calculator.h" + +class CalculatorImpl : public Calculator +{ +public: + CalculatorImpl(); + virtual ~CalculatorImpl(); + + // Calculator interface + virtual float add(float arg1, float arg2); + virtual float sub(float arg1, float arg2); + virtual float mul(float arg1, float arg2); + virtual float div(float arg1, float arg2); +}; + +#endif // sample_calculatorimpl_h + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.cpp b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.cpp new file mode 100644 index 0000000000..084e6fbf2f --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.cpp @@ -0,0 +1,98 @@ +/* + * 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. + */ + +#include "CalculatorImpl_CalculatorService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CalculatorImpl_CalculatorService_Proxy* CalculatorImpl_CalculatorService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new CalculatorImpl_CalculatorService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void CalculatorImpl_CalculatorService_Proxy_Destructor(void* proxy) + { + delete (CalculatorImpl_CalculatorService_Proxy*)proxy; + } +} + +CalculatorImpl_CalculatorService_Proxy::CalculatorImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +CalculatorImpl_CalculatorService_Proxy::~CalculatorImpl_CalculatorService_Proxy() +{ + if (target) + delete target; +} + +float CalculatorImpl_CalculatorService_Proxy::add( float arg0, float arg1) +{ + tuscany::sca::Operation operation("add"); + operation.addParameter("arg1", &arg0); + operation.addParameter("arg2", &arg1); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + +float CalculatorImpl_CalculatorService_Proxy::sub( float arg0, float arg1) +{ + tuscany::sca::Operation operation("sub"); + operation.addParameter("arg1", &arg0); + operation.addParameter("arg2", &arg1); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + +float CalculatorImpl_CalculatorService_Proxy::mul( float arg0, float arg1) +{ + tuscany::sca::Operation operation("mul"); + operation.addParameter("arg1", &arg0); + operation.addParameter("arg2", &arg1); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + +float CalculatorImpl_CalculatorService_Proxy::div( float arg0, float arg1) +{ + tuscany::sca::Operation operation("div"); + operation.addParameter("arg1", &arg0); + operation.addParameter("arg2", &arg1); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.h new file mode 100644 index 0000000000..700a060636 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.h @@ -0,0 +1,44 @@ +/* + * 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. + */ + +#ifndef CalculatorImpl_CalculatorService_Proxy_h +#define CalculatorImpl_CalculatorService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "Calculator.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class CalculatorImpl_CalculatorService_Proxy : public Calculator +{ +public: + CalculatorImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~CalculatorImpl_CalculatorService_Proxy(); + virtual float add( float arg1, float arg2); + virtual float sub( float arg1, float arg2); + virtual float mul( float arg1, float arg2); + virtual float div( float arg1, float arg2); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // CalculatorImpl_CalculatorService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.cpp b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.cpp new file mode 100644 index 0000000000..82114b4d6d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.cpp @@ -0,0 +1,135 @@ +/* + * 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. + */ + +#include "CalculatorImpl_CalculatorService_Wrapper.h" + +#include "osoa/sca/sca.h" + + + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CalculatorImpl_CalculatorService_Wrapper* CalculatorImpl_CalculatorService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new CalculatorImpl_CalculatorService_Wrapper(target); + } +} + +CalculatorImpl_CalculatorService_Wrapper::CalculatorImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (CalculatorImpl*)getImplementation(); +} + +CalculatorImpl_CalculatorService_Wrapper::~CalculatorImpl_CalculatorService_Wrapper() +{ + releaseImplementation(); +} + +void* CalculatorImpl_CalculatorService_Wrapper::newImplementation() +{ + return new CalculatorImpl; +} + +void CalculatorImpl_CalculatorService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void CalculatorImpl_CalculatorService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "add") + { + float& p0 = *( float*)operation.getParameterValue(0); + float& p1 = *( float*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->add(p0, p1); + } + else + { + float* ret = new float; + *ret = impl->add(p0, p1); + operation.setReturnValue((const float*)ret); + } + return; + } + if (operationName == "sub") + { + float& p0 = *( float*)operation.getParameterValue(0); + float& p1 = *( float*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->sub(p0, p1); + } + else + { + float* ret = new float; + *ret = impl->sub(p0, p1); + operation.setReturnValue((const float*)ret); + } + return; + } + if (operationName == "mul") + { + float& p0 = *( float*)operation.getParameterValue(0); + float& p1 = *( float*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->mul(p0, p1); + } + else + { + float* ret = new float; + *ret = impl->mul(p0, p1); + operation.setReturnValue((const float*)ret); + } + return; + } + if (operationName == "div") + { + float& p0 = *( float*)operation.getParameterValue(0); + float& p1 = *( float*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->div(p0, p1); + } + else + { + float* ret = new float; + *ret = impl->div(p0, p1); + operation.setReturnValue((const float*)ret); + } + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.h new file mode 100644 index 0000000000..63bae2f75c --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef CalculatorImpl_CalculatorService_Wrapper_h +#define CalculatorImpl_CalculatorService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "CalculatorImpl.h" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class CalculatorImpl_CalculatorService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + CalculatorImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target); + virtual ~CalculatorImpl_CalculatorService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + CalculatorImpl* impl; +}; + +#endif // CalculatorImpl_CalculatorService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.cpp b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.cpp new file mode 100644 index 0000000000..510069c331 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.cpp @@ -0,0 +1,65 @@ +/* + * 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. + */ + +#include "CalculatorImpl_divideService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CalculatorImpl_divideService_Proxy* CalculatorImpl_divideService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new CalculatorImpl_divideService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void CalculatorImpl_divideService_Proxy_Destructor(void* proxy) + { + delete (CalculatorImpl_divideService_Proxy*)proxy; + } +} + +CalculatorImpl_divideService_Proxy::CalculatorImpl_divideService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +CalculatorImpl_divideService_Proxy::~CalculatorImpl_divideService_Proxy() +{ + if (target) + delete target; +} + +float CalculatorImpl_divideService_Proxy::div( float arg0, float arg1) +{ + tuscany::sca::Operation operation("div"); + operation.addParameter("num1", &arg0); + operation.addParameter("num2", &arg1); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.h new file mode 100644 index 0000000000..0459e70f33 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.h @@ -0,0 +1,41 @@ +/* + * 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. + */ + +#ifndef CalculatorImpl_divideService_Proxy_h +#define CalculatorImpl_divideService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "Divide.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class CalculatorImpl_divideService_Proxy : public Divide +{ +public: + CalculatorImpl_divideService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~CalculatorImpl_divideService_Proxy(); + virtual float div( float num1, float num2); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // CalculatorImpl_divideService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.componentType b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.componentType new file mode 100644 index 0000000000..428d19f8bc --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.componentType @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.h new file mode 100644 index 0000000000..c2ab3b816c --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.h @@ -0,0 +1,34 @@ +/* + * 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 sample_divide_h +#define sample_divide_h + +class Divide +{ + public: + virtual float div(float num1, float num2) = 0; +}; + +#endif // sample_divide_h + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.php b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.php new file mode 100644 index 0000000000..c2e9adda70 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.php @@ -0,0 +1,71 @@ +add_service->add(12.0, 27.0); + //$this->subtract_service->sub(12.0, 27.0); + $this->multiply_service->mul(12.0, 27.0); + + $result = $this->another_divide->div($num1, $num2); + + return $result; + } + +} + +?> diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.componentType b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.componentType new file mode 100644 index 0000000000..d7369e3ff0 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.componentType @@ -0,0 +1,27 @@ + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.cpp b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.cpp new file mode 100644 index 0000000000..88b9065171 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.cpp @@ -0,0 +1,48 @@ +/* + * 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 "DivideImpl.h" + +DivideImpl::DivideImpl() +{ +} + +DivideImpl::~DivideImpl() +{ +} + +// Divide interface +float DivideImpl::div(float arg1, float arg2) +{ + if(arg2 == 0.0) + { + printf("DivideImpl::div %f / %f !! Cannot divide by zero, so returning 0\n", arg1, arg2); + return 0; + } + + float result = arg1 / arg2; + printf("DivideImpl::div %f / %f = %f\n", arg1, arg2, result); + return result; +} + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.h new file mode 100644 index 0000000000..42cf47b1d4 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.h @@ -0,0 +1,39 @@ +/* + * 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 sample_divideimpl_h +#define sample_divideimpl_h + +#include "Divide.h" + +class DivideImpl : public Divide +{ +public: + DivideImpl(); + virtual ~DivideImpl(); + + // Divide interface + virtual float div(float arg1, float arg2); +}; + +#endif // sample_divideimpl_h + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.cpp b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.cpp new file mode 100644 index 0000000000..e8dbeb2e0d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.cpp @@ -0,0 +1,65 @@ +/* + * 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. + */ + +#include "DivideImpl_DivideService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + DivideImpl_DivideService_Proxy* DivideImpl_DivideService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new DivideImpl_DivideService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void DivideImpl_DivideService_Proxy_Destructor(void* proxy) + { + delete (DivideImpl_DivideService_Proxy*)proxy; + } +} + +DivideImpl_DivideService_Proxy::DivideImpl_DivideService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +DivideImpl_DivideService_Proxy::~DivideImpl_DivideService_Proxy() +{ + if (target) + delete target; +} + +float DivideImpl_DivideService_Proxy::div( float arg0, float arg1) +{ + tuscany::sca::Operation operation("div"); + operation.addParameter("num1", &arg0); + operation.addParameter("num2", &arg1); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.h new file mode 100644 index 0000000000..d66cde1c06 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.h @@ -0,0 +1,41 @@ +/* + * 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. + */ + +#ifndef DivideImpl_DivideService_Proxy_h +#define DivideImpl_DivideService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "Divide.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class DivideImpl_DivideService_Proxy : public Divide +{ +public: + DivideImpl_DivideService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~DivideImpl_DivideService_Proxy(); + virtual float div( float num1, float num2); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // DivideImpl_DivideService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.cpp b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.cpp new file mode 100644 index 0000000000..9c6f2101fe --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.cpp @@ -0,0 +1,84 @@ +/* + * 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. + */ + +#include "DivideImpl_DivideService_Wrapper.h" + +#include "osoa/sca/sca.h" + + + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + DivideImpl_DivideService_Wrapper* DivideImpl_DivideService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new DivideImpl_DivideService_Wrapper(target); + } +} + +DivideImpl_DivideService_Wrapper::DivideImpl_DivideService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (DivideImpl*)getImplementation(); +} + +DivideImpl_DivideService_Wrapper::~DivideImpl_DivideService_Wrapper() +{ + releaseImplementation(); +} + +void* DivideImpl_DivideService_Wrapper::newImplementation() +{ + return new DivideImpl; +} + +void DivideImpl_DivideService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void DivideImpl_DivideService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "div") + { + float& p0 = *( float*)operation.getParameterValue(0); + float& p1 = *( float*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->div(p0, p1); + } + else + { + float* ret = new float; + *ret = impl->div(p0, p1); + operation.setReturnValue((const float*)ret); + } + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.h new file mode 100644 index 0000000000..5cd10f5188 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef DivideImpl_DivideService_Wrapper_h +#define DivideImpl_DivideService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "DivideImpl.h" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class DivideImpl_DivideService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + DivideImpl_DivideService_Wrapper(tuscany::sca::model::Service* target); + virtual ~DivideImpl_DivideService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + DivideImpl* impl; +}; + +#endif // DivideImpl_DivideService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.componentType b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.componentType new file mode 100644 index 0000000000..0b4423300d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.componentType @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.h new file mode 100644 index 0000000000..c21da1bddf --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.h @@ -0,0 +1,34 @@ +/* + * 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 sample_log_h +#define sample_log_h + +class Log +{ + public: + virtual void div(char *message) = 0; +}; + +#endif // sample_log_h + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.php b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.php new file mode 100644 index 0000000000..0a955f36d3 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.php @@ -0,0 +1,36 @@ +toLog('>>> ' . $message); + } +} + +?> diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Makefile.am b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Makefile.am new file mode 100644 index 0000000000..84567a5add --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Makefile.am @@ -0,0 +1,56 @@ +# 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. + +deploydir=$(prefix)/PHPCalculator/deploy +compositedir=$(deploydir)/sample.calculator + +BUILT_SOURCES = scagen + +noinst_HEADERS = *.h + +scagen: + java -jar $(TUSCANY_SCACPP)/bin/scagen.jar -dir . -output . + +composite_SCRIPTS = runwsserver.sh + +composite_LTLIBRARIES = libCalculator.la +composite_DATA = *.composite *.componentType *.wsdl *.php +EXTRA_DIST = *.composite *.componentType *.wsdl *.php runwsserver.sh + +dist_libCalculator_la_SOURCES = \ +CalculatorImpl.cpp \ +DivideImpl.cpp + +nodist_libCalculator_la_SOURCES = \ +CalculatorImpl_CalculatorService_Proxy.cpp \ +CalculatorImpl_CalculatorService_Wrapper.cpp \ +CalculatorImpl_divideService_Proxy.cpp \ +DivideImpl_DivideService_Proxy.cpp \ +DivideImpl_DivideService_Wrapper.cpp + + +libCalculator_la_LIBADD = \ +-L${TUSCANY_SCACPP}/lib \ + -ltuscany_sca \ +-L${TUSCANY_SCACPP}/extensions/cpp/lib \ + -ltuscany_sca_cpp + +INCLUDES = \ +-I$(TUSCANY_SCACPP)/extensions/cpp/include \ +-I$(TUSCANY_SCACPP)/include \ +-I${TUSCANY_SDOCPP}/include + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.componentType b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.componentType new file mode 100644 index 0000000000..af1631518a --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.componentType @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.h new file mode 100644 index 0000000000..94de825f62 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.h @@ -0,0 +1,34 @@ +/* + * 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 sample_multiply_h +#define sample_multiply_h + +class Multiply +{ + public: + virtual float mul(float num1, float num2) = 0; +}; + +#endif // sample_multiply_h + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.php b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.php new file mode 100644 index 0000000000..8ffe02675d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.php @@ -0,0 +1,33 @@ +log_message($result); + + return $result; + } +} + +?> diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.componentType b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.componentType new file mode 100644 index 0000000000..35dab8bb9b --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.componentType @@ -0,0 +1,29 @@ + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.h new file mode 100644 index 0000000000..a50b79ccc6 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.h @@ -0,0 +1,34 @@ +/* + * 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 sample_subtract_h +#define sample_subtract_h + +class Subtract +{ + public: + virtual float sub(float num1, float num2) = 0; +}; + +#endif // sample_subtract_h + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.php b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.php new file mode 100644 index 0000000000..8d3a1b3ddf --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.php @@ -0,0 +1,30 @@ +log_message($result); + + return $result; +} +?> diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/runwsserver.sh b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/runwsserver.sh new file mode 100755 index 0000000000..069d734fea --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/runwsserver.sh @@ -0,0 +1,45 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$AXIS2C_HOME = x ]; then +echo "AXIS2C_HOME not set" +exit; +fi +echo "Using Axis2C installed at $AXIS2C_HOME" + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SCACPP/extensions/cpp/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ + +cd $AXIS2C_HOME/bin +./axis2_http_server diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/sample.calculator.composite b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/sample.calculator.composite new file mode 100644 index 0000000000..09b7070fb8 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/sample.calculator.composite @@ -0,0 +1,81 @@ + + + + + + + + + DivideComponent/DivideService + + + + + AddComponent + SubtractComponent + MultiplyComponent + DivideComponent + + + + + LogComponent + + + + + LogComponent + + + + + LogComponent + + + + + DivideCPPComponent/DivideService + AddComponent + MultiplyComponent + SubtractComponent + AddComponent + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PythonCalculator/Makefile.am b/sca-cpp/trunk/contrib/samples/PythonCalculator/Makefile.am new file mode 100644 index 0000000000..21952e3df4 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonCalculator/Makefile.am @@ -0,0 +1,21 @@ +# 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. + +deploydir=$(prefix)/PythonCalculator/deploy +SUBDIRS = sample.calculator sample.calculator.client +EXTRA_DIST = *.composite README.html +deploy_DATA = *.composite diff --git a/sca-cpp/trunk/contrib/samples/PythonCalculator/README b/sca-cpp/trunk/contrib/samples/PythonCalculator/README new file mode 100644 index 0000000000..670f561dc1 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonCalculator/README @@ -0,0 +1,20 @@ +Tuscany SCA for C++ Samples - Calculator Sample +=============================================== + +This is a very simple sample to show how an SCA composite can wire together +two components to implement a Calculator service and expose that service as +a Web Service. + +There are two sub projects in this workspace: + - sample.calculator + This contains the source code and SCDL artifacts for the SCA Calculator. + composite implementing the sample Calculator. + + - sample.calculator.client + A sample client which does a local call to the Calculator service. + +Additionally, there is the sample.calculator.app.composite file. This +describes the configuration of the SCA Calculator composite deployed to the +SCA runtime. + +See the README.html file for instructions to build and run this sample diff --git a/sca-cpp/trunk/contrib/samples/PythonCalculator/README.html b/sca-cpp/trunk/contrib/samples/PythonCalculator/README.html new file mode 100644 index 0000000000..3b9f72864e --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonCalculator/README.html @@ -0,0 +1,191 @@ + + + + + + + + + + + + Tuscany SCA Native Samples - Python Calculator Sample + + + +
      +
      +
      +

      Tuscany SCA Native Samples - Python Calculator Sample

      + +

      This is a very simple sample to show how an SCA composite can wire + together two Python components to implement a Calculator service and invoke + the service via a local client. +

      +

      See the Python extension + documentation for information about building the Tuscany Python extension + and using Python in SCA composites. +

      +

      There are two sub projects in this workspace:

      +
        +
      • sample.calculator
        + This contains the Python scripts and SCDL artifacts for the SCA Calculator + composite implementing the sample Calculator. +
      • +
      • sample.calculator.client
        + A sample client which does a local call to the Calculator service. +
      • +
      +

      Additionally, there is the sample.calculator.app.composite file. This + describes the configuration of the SCA Calculator composite deployed to the SCA + runtime. +

      + +
      + + + + +
      +

      Building the Python samples on Linux and Mac OS X

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
      2. + +
      3. As the Python Calculator sample is based on Python scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the Python samples only with the following command sequence: +
          +
        • cd <tuscany_sca_install_dir>/samples
        • +
        • ./configure --enable-python --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
        • +
        • make install
        • +
        + NOTE: If you don't provide the --prefix configure option, it will by default install into + /usr/local/tuscany/sca/samples/PythonCalculator
      4. +
      +
      + +
      +

      Running the Python Calculator sample on Linux and Mac OS X

      +
        +
      1. The Python Calculator sample requires the following extension: + + Please follow the documentation to ensure you have this extension built and installed + on your system +
      2. +
      3. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        +
      4. +
      5. Run the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>/samples/PythonCalculator/deploy/sample.calculator.client
        • +
        • ./runclient.sh
        • +
        +
      6. +
      +
      + +
      +

      Building the Python Calculator sample on Windows

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
      2. + +
      3. As this sample is based on Python scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>\samples\PythonCalculator
        • +
        • deploy.bat
        • +
        +
      4. +
      +
      + +
      +

      Running the Python Calculator sample on Windows

      +
        +
      1. The Python Calculator sample requires the following extension: + + Please follow the documentation to ensure you have this extension built and installed + on your system +
      2. +
      3. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        +
      4. +
      5. Run the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>\samples\PythonCalculator\deploy\sample.calculator.client
        • +
        • runclient.bat
        • +
        +
      6. +
      +
      + +
      +

      Getting Help

      + +

      The first place to look is at the Tuscany SCA FAQ at + http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      + +

      Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      + +
      +
      +
      + + + + diff --git a/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.app.composite b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.app.composite new file mode 100644 index 0000000000..ea4e3e118d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.app.composite @@ -0,0 +1,28 @@ + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.client/Makefile.am b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.client/Makefile.am new file mode 100644 index 0000000000..df1187aab1 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.client/Makefile.am @@ -0,0 +1,23 @@ +# 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. + +deploydir=$(prefix)/PythonCalculator/deploy +clientdir=$(deploydir)/sample.calculator.client + +client_DATA = *.py +client_SCRIPTS = runclient.sh +EXTRA_DIST = runclient.sh *.py diff --git a/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.client/calculator_client.py b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.client/calculator_client.py new file mode 100644 index 0000000000..58d6f45606 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.client/calculator_client.py @@ -0,0 +1,50 @@ +# 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 a simple sample that provides a Python +# client for the Calculator sample + + +import sys +import sca + +op = sys.argv[1] +val1 = sys.argv[2] +val2 = sys.argv[3] + +# Locate the calculator service +calc = sca.locateservice("CalculatorComponent") + +# Invoke the calculator operations +if op == 'add': + result = calc.add(val1, val2) + +elif op == 'sub': + result = calc.sub(val1, val2) + +elif op == 'mul': + result = calc.mul(val1, val2) + +elif op == 'div': + result = calc.div(val1, val2) + + +print "calculator_client: ",op,"(",val1,",",val2,") = ",result + diff --git a/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.client/runclient.bat b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.client/runclient.bat new file mode 100644 index 0000000000..206b1e5a59 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.client/runclient.bat @@ -0,0 +1,45 @@ +@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 "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) +echo using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) +echo using SDO installed at %TUSCANY_SDOCPP% + +set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SCACPP%\extensions\python\bin;%TUSCANY_SDOCPP%\bin;%PATH% +set PYTHONPATH=%TUSCANY_SCACPP%\extensions\python\bin + +set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ +set TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent +set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +cd %TUSCANY_SCACPP_ROOT%\sample.calculator.client +python calculator_client.py div 5 2 + +:end +endlocal diff --git a/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.client/runclient.sh b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.client/runclient.sh new file mode 100755 index 0000000000..d500d3d132 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator.client/runclient.sh @@ -0,0 +1,48 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$PYTHON_LIB != x ]; then +echo "Using Python library installed at $PYTHON_LIB" +export LD_LIBRARY_PATH=$PYTHON_LIB:$LD_LIBRARY_PATH +export PATH=$PYTHON_LIB/../bin:$PATH +fi + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SCACPP/extensions/python/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH +export PYTHONPATH=$TUSCANY_SCACPP/extensions/python/lib:$PYTHONPATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ +export TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent +export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +cd $TUSCANY_SCACPP_ROOT/sample.calculator.client +python calculator_client.py div 5 2 diff --git a/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/Calculator.wsdl b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/Calculator.wsdl new file mode 100644 index 0000000000..331b996ba2 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/Calculator.wsdl @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/CalculatorImpl.py b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/CalculatorImpl.py new file mode 100644 index 0000000000..86dbef9e4d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/CalculatorImpl.py @@ -0,0 +1,56 @@ +# 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 a simple sample that provides a Python implementation of +# the Calculator sample +# + + +# The module-level add function +def add(val1, val2): + result = float(val1) + float(val2) + print "Python - CalculatorImpl.add " + str(val1) + " + " + str(val2) + " = " + str(result) + return result + +# The module-level sub function +def sub(val1, val2): + result = float(val1) - float(val2) + print "Python - CalculatorImpl.sub " + str(val1) + " - " + str(val2) + " = " + str(result) + return result + +# The module-level mul function +def mul(val1, val2): + result = float(val1) * float(val2) + print "Python - CalculatorImpl.mul " + str(val1) + " * " + str(val2) + " = " + str(result) + return result + +# The module-level div function +def div(val1, val2): + + + print "Python - CalculatorImpl.div calling divideService to determine " + str(val1) + " / " + str(val2) + + # Use the divideService reference + result = divideService.divide(val1, val2) + + print "Python - CalculatorImpl.div divideService returned " + str(result) + + return result + diff --git a/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/DivideImpl.py b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/DivideImpl.py new file mode 100644 index 0000000000..3921731de6 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/DivideImpl.py @@ -0,0 +1,65 @@ +# 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 a simple sample that provides a Python implementation of +# the Divide Service used in the Calculator sample +# +# Either use the divide function in the DivideClass class (using classes allows +# composite scoping to be used) +# e.g. in CalculatorComposite.composite use the line: +# +# +# Or just use the module-level divide function +# e.g. in CalculatorComposite.composite use the line: +# +# + + +class DivideClass: + "A class to handle dividing" + + def __init__(self): + print "Python - DivideImpl.DivideClass constructor" + + # The class-level divide function + def divide(self, val1, val2): + result = float(val1) / float(val2) + + print "Python - DivideImpl.DivideClass.divide " + str( val1 ) + " / " + str(val2) + " = " + str(result) + + # Use the doRounding property + if doRounding: + result = round(result) + print "Python - DivideImpl.DivideClass.divide is rounding the result to " + str(result) + + return result + +# The module-level divide function +def divide(val1, val2): + result = float(val1) / float(val2) + print "Python - DivideImpl.divide " + str(val1) + " / " + str(val2) + " = " + str(result) + + # Use the doRounding property + if doRounding: + result = round(result) + print "Python - DivideImpl.divide is rounding the result to " + str(result) + + return result + diff --git a/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/Makefile.am b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/Makefile.am new file mode 100644 index 0000000000..ec7cf8a8ad --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/Makefile.am @@ -0,0 +1,23 @@ +# 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. + +deploydir=$(prefix)/PythonCalculator/deploy +compositedir=$(deploydir)/sample.calculator + +composite_DATA = *.composite *.wsdl *.py + +EXTRA_DIST = *.composite *.wsdl *.py diff --git a/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/sample.calculator.composite b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/sample.calculator.composite new file mode 100644 index 0000000000..7f2221b696 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonCalculator/sample.calculator/sample.calculator.composite @@ -0,0 +1,34 @@ + + + + + + + + DivideComponent + + + + + true + + + diff --git a/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/Makefile.am b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/Makefile.am new file mode 100644 index 0000000000..6b2d218134 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/Makefile.am @@ -0,0 +1,21 @@ +# 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. + +deploydir=$(prefix)/PythonWeatherForecast/deploy +SUBDIRS = sample.weather sample.weather.client +EXTRA_DIST = *.composite README.html +deploy_DATA = *.composite diff --git a/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/README b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/README new file mode 100644 index 0000000000..c590973f5f --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/README @@ -0,0 +1,20 @@ +Tuscany SCA for C++ Samples - Weather Sample +============================================ + +This is a very simple sample to show how an SCA composite can wire together +two components to implement calls to a Weather Forecast web service + +There are three sub projects in this workspace: + - sample.weather + This contains the source code and SCDL artifacts for the SCA Weather + composite implementing the calls to the Weather web services. + + - sample.weather.client + A sample client which does a local call to the SCA Weather service. + + +Additionally, there is the sample.weather.app.composite file. This +describes the configuration of the SCA Weather composite deployed to the +SCA runtime. + +See the README.html file for instructions to build and run this sample diff --git a/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/README.html b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/README.html new file mode 100644 index 0000000000..c52cb6ec86 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/README.html @@ -0,0 +1,200 @@ + + + + + + + + + + + + Tuscany SCA Native Samples - PythonWeatherForecast Sample + + + +
      +
      +
      +

      Tuscany SCA Native Samples - PythonWeatherForecast Sample

      + +

      This is a very simple sample to show how an SCA composite can wire + together two components to implement calls to a Weather Forecast web service. +

      +

      The PythonWeatherForecast sample requires the following extensions: +

      + Please follow the documentation to ensure you have these extensions built and installed + on your system +

      +

      There are two sub projects in this workspace:

      +
        +
      • sample.weather
        + This contains the source code and SCDL artifacts for the SCA Weather + composite implementing the calls to the Weather web services. +
      • +
      • sample.weather.client
        + A sample client which does a local call to the SCA Weather service. +
      • +
      +

      Additionally, there is the sample.weather.app.composite file. This + describes the configuration of the SCA Weather composite deployed to the SCA + runtime. +

      + +
      + + + + +
      +

      Building the PythonWeatherForecast sample on Linux and Mac OS X

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        +
      2. +
      3. As the PythonWeatherForecast sample is based on Python scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the Python samples only with the following command sequence: +
          +
        • cd <tuscany_sca_install_dir>/samples
        • +
        • ./configure --enable-python --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
        • +
        • make install
        • +
        + NOTE: If you don't provide the --prefix configure option, it will by default install into + /usr/local/tuscany/sca/samples/PythonWeatherForecast
      4. +
      +
      + +
      +

      Running the PythonWeatherForecast sample on Linux and Mac OS X

      +
        +
      1. The PythonWeatherForecast sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
      2. +
      3. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        • AXIS2C_HOME=<path to Axis2/C version 0.96>
        • +
        • PYTHON_LIB=<path to the Python library>
          + Note: If you are using a default installation of Python 2.5 this is usually /usr/lib
        • +
        +
      4. +
      5. Run the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>/samples/PythonWeatherForecast/deploy/sample.weather.client
        • +
        • ./runclient.sh
        • +
        +
      6. +
      +
      + +
      +

      Building the PythonWeatherForecast sample on Windows

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
      2. + +
      3. As this sample is based on Python scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>\samples\PythonWeatherForecast
        • +
        • deploy.bat
        • +
        +
      4. +
      +
      + +
      +

      Running the PythonWeatherForecast sample on Windows

      +
        +
      1. The PythonWeatherForecast sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
      2. +
      3. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        • AXIS2C_HOME=<path to Axis2/C version 0.96>
        • +
        +
      4. +
      5. Run the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>\samples\PythonWeatherForecast\deploy\sample.weather.client
        • +
        • runclient.bat
        • +
        +
      6. +
      +
      + +
      +

      Getting Help

      + +

      The first place to look is at the Tuscany SCA FAQ at + http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      + +

      Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      + +
      +
      +
      + + + + diff --git a/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.app.composite b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.app.composite new file mode 100644 index 0000000000..522a2fc0c8 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.app.composite @@ -0,0 +1,28 @@ + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.client/Makefile.am b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.client/Makefile.am new file mode 100644 index 0000000000..8c4781759e --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.client/Makefile.am @@ -0,0 +1,23 @@ +# 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. + +deploydir=$(prefix)/PythonWeatherForecast/deploy +clientdir=$(deploydir)/sample.weather.client + +client_DATA = *.py +client_SCRIPTS = runclient.sh +EXTRA_DIST = runclient.sh *.py diff --git a/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.client/runclient.bat b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.client/runclient.bat new file mode 100644 index 0000000000..93c044ed82 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.client/runclient.bat @@ -0,0 +1,50 @@ +@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 "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) +echo using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) +echo using SDO installed at %TUSCANY_SDOCPP% + +if "%AXIS2C_HOME%" == "" ( +echo "AXIS2C_HOME not set" +goto end +) +echo using Axis2C installed at %AXIS2C_HOME% + +set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SCACPP%\extensions\python\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% +set PYTHONPATH=%TUSCANY_SCACPP%\extensions\python\bin + +set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ +set TUSCANY_SCACPP_COMPONENT=sample.weather.WeatherForecastComponent + +cd %TUSCANY_SCACPP_ROOT%\sample.weather.client +python weather_forecast_client.py + +:end +endlocal diff --git a/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.client/runclient.sh b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.client/runclient.sh new file mode 100755 index 0000000000..e6ec73b209 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.client/runclient.sh @@ -0,0 +1,54 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$AXIS2C_HOME = x ]; then +echo "AXIS2C_HOME not set" +exit; +fi +echo "Using Axis2C installed at $AXIS2C_HOME" + +if [ x$PYTHON_LIB != x ]; then +echo "Using Python library installed at $PYTHON_LIB" +export LD_LIBRARY_PATH=$PYTHON_LIB:$LD_LIBRARY_PATH +export PATH=$PYTHON_LIB/../bin:$PATH +fi + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SCACPP/extensions/python/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH +export PYTHONPATH=$TUSCANY_SCACPP/extensions/python/lib:$PYTHONPATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ +export TUSCANY_SCACPP_COMPONENT=sample.weather.WeatherForecastComponent + +cd $TUSCANY_SCACPP_ROOT/sample.weather.client +python weather_forecast_client.py + diff --git a/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.client/weather_forecast_client.py b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.client/weather_forecast_client.py new file mode 100644 index 0000000000..5de99fcf8e --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather.client/weather_forecast_client.py @@ -0,0 +1,49 @@ +# 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 a simple sample that provides a Python +# client for the WeatherForecast sample + + +import sys +import sca +import xml.etree.ElementTree + + + +# The main script: + +# Locate the Weather service +weatherService = sca.locateservice("WeatherComponent") + +place = "San Jose" +print "\nFinding Weather Forecast for", place +weatherText = weatherService.getForecastByPlaceName(place) +print weatherText + +zip = 90210 +print "\nFinding Weather Forecast for zip code", zip +weatherText = weatherService.getForecastByZipCode(zip) +print weatherText + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather/Makefile.am b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather/Makefile.am new file mode 100644 index 0000000000..d0450ef707 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather/Makefile.am @@ -0,0 +1,23 @@ +# 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. + +deploydir=$(prefix)/PythonWeatherForecast/deploy +compositedir=$(deploydir)/sample.weather + +composite_DATA = *.composite *.wsdl *.py +EXTRA_DIST = *.composite *.wsdl *.py + diff --git a/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather/WeatherForecast.wsdl b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather/WeatherForecast.wsdl new file mode 100644 index 0000000000..ec39e2287a --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather/WeatherForecast.wsdl @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather/WeatherForecastImpl.py b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather/WeatherForecastImpl.py new file mode 100644 index 0000000000..6e3775de0b --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather/WeatherForecastImpl.py @@ -0,0 +1,65 @@ +# 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 a simple sample that calls a service that returns an +# SDO which has been converted into an ElementTree Element object. The Element +# object is then converted into formatted text + +import xml.etree.ElementTree + +def getForecastByPlaceName(placeName): + + print "Python - WeatherForecastImpl.getForecastByPlaceName:", placeName + + xmlResult = weatherWebService.GetWeatherByPlaceName(placeName) + + print "Python - Formatting result from weatherService:", xmlResult + + return formatWeather(xmlResult, placeName) + + +def getForecastByZipCode(zipCode): + + print "Python - WeatherForecastImpl.getForecastByZipCode:", zipCode + + xmlResult = weatherWebService.GetWeatherByZipCode(zipCode) + + print "Python - Formatting result from weatherService:", xmlResult + + return formatWeather(xmlResult, zipCode) + + +def formatWeather(weather, name): + + result = "Could not retrieve Weather Forecast for " + str(name) + + pathAndNS = "./{http://www.webservicex.net}" + + if weather.findtext(pathAndNS+"PlaceName"): + + result = "\n\nWeather Forecast for "+ weather.findtext(pathAndNS+"PlaceName")+ ", "+ weather.findtext(pathAndNS+"StateCode")+"\n" + result += "Latitude: "+ weather.findtext(pathAndNS+"Latitude")+ " Longitude: "+ weather.findtext(pathAndNS+"Longitude")+"\n\n" + + for node in weather.findall(".//{http://www.webservicex.net}WeatherData"): + if node.findtext(pathAndNS+"Day"): result += node.findtext(pathAndNS+"Day") + if node.findtext(pathAndNS+"MaxTemperatureC"): result += ":\tMax "+ node.findtext(pathAndNS+"MaxTemperatureC") + if node.findtext(pathAndNS+"MinTemperatureC"): result += "C. Min "+ node.findtext(pathAndNS+"MinTemperatureC")+ "C.\n" + + return result diff --git a/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather/sample.weather.composite b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather/sample.weather.composite new file mode 100644 index 0000000000..70e9674d23 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PythonWeatherForecast/sample.weather/sample.weather.composite @@ -0,0 +1,36 @@ + + + + + + + + + WeatherService + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/README b/sca-cpp/trunk/contrib/samples/README new file mode 100644 index 0000000000..3d7155367d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/README @@ -0,0 +1,2 @@ +Please read the GettingStarted.html document for information on +building, installing and running Tuscany SCA for C++ Samples \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/Makefile.am b/sca-cpp/trunk/contrib/samples/RestCalculator/Makefile.am new file mode 100644 index 0000000000..e3b215ad90 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/Makefile.am @@ -0,0 +1,23 @@ +# 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. + +deploydir=$(prefix)/RestCalculator/deploy +SUBDIRS = sample.calculator sample.calculator.restclient httpserver + +EXTRA_DIST = *.composite README.html +deploy_DATA = *.composite + diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/README b/sca-cpp/trunk/contrib/samples/RestCalculator/README new file mode 100644 index 0000000000..03c6b6a325 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/README @@ -0,0 +1,23 @@ +Tuscany SCA for C++ Samples - REST Calculator Sample +=============================================== + +This is a very simple sample to show how to use the SCA REST binding to +expose a Calculator service as a REST service and invoke that service. + +There are three sub projects in this workspace: + - sample.calculator + This contains the source code and SCDL artifacts for the SCA Calculator. + composite implementing the sample Calculator. + + - sample.calculator.restclient + A sample REST client which calls the Calculator service. + + - httpserver + This contains a minimal configuration for the Apache HTTP server used + to host the REST service as well as scripts to start and stop the server. + +Additionally, there is the sample.calculator.app.composite file. This +describes the configuration of the SCA Calculator composite deployed to the +SCA runtime. + +See the README.html file for instructions to build and run this sample diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/README.html b/sca-cpp/trunk/contrib/samples/RestCalculator/README.html new file mode 100644 index 0000000000..80f7462c8a --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/README.html @@ -0,0 +1,231 @@ + + + + + + + + + + + + Tuscany SCA Native Samples - REST Calculator Sample + + + +
      +
      +
      +

      Tuscany SCA Native Samples - REST Calculator Sample

      + +

      This is a very simple sample to show how an SCA composite can wire + together two Ruby components to implement a Calculator service and expose + that service as a REST Service running under Apache HTTPD. +

      +

      The REST Calculator sample requires the following extensions: +

      + Please follow the documentation to ensure you have these extensions built and installed + on your system

      +

      There are three sub projects in this workspace:

      +
        +
      • sample.calculator
        + This contains the Ruby scripts and SCDL artifacts for the SCA Calculator + composite implementing the sample Calculator. +
      • +
      • sample.calculator.restclient
        + A sample client which does a local call to the Calculator service. +
      • +
      • httpserver
        + A minimal configuration for the Apache HTTP server used to host the + REST service as well as scripts to start and stop the server. +
      • +
      +

      Additionally, there is the sample.calculator.app.composite file. This + describes the configuration of the SCA Calculator composite deployed to the SCA + runtime. +

      +
      + + + + +
      +

      Building the REST Calculator sample on Linux and Mac OS X

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        +
      2. +
      3. As the REST Calculator sample is based on Ruby scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the Ruby samples only with the following command sequence: +
          +
        • cd <tuscany_sca_install_dir>/samples
        • +
        • ./configure --enable-ruby --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
        • +
        • make install
        • +
        + NOTE: If you don't provide the --prefix configure option, it will by default install into + /usr/local/tuscany/sca/samples/RestCalculator
      4. +
      +
      + +
      +

      Running the REST Calculator sample on Linux and Mac OS X

      +
        +
      1. The REST Calculator sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
      2. +
      3. Start the HTTPD server: +
          +
        1. The following environment variables are required: +
            +
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • +
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • +
          +
        2. +
        3. cd <tuscany_sca_install_dir>/samples/RestCalculator/deploy/httpserver
        4. +
        5. ./startserver.sh
          + NOTE: Depending on your installation of Apache HTTPD you may need to log in as root before following + these steps. If so, you may also need to uncomment the User and Group directives in the + <tuscany_sca_install_dir>/samples/RestCalculator/deploy/httpserver/conf/httpd.conf file + and set these to the appropriate username and group that the server should run as
        6. +
        +
      4. +
      5. Run the client: +
          +
        1. The following environment variables are required: +
            +
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • +
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • +
          +
        2. +
        3. cd <tuscany_sca_install_dir>/samples/RestCalculator/deploy/sample.calculator.restclient
        4. +
        5. ./runrestclient.sh
        6. +
        +
      6. +
      +
      + +
      +

      Building the REST Calculator sample on Windows

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
      2. + +
      3. As this sample is based on Ruby scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>\samples\RestCalculator
        • +
        • deploy.bat
        • +
        +
      4. +
      +
      + +
      +

      Running the REST Calculator sample on Windows

      +
        +
      1. The REST Calculator sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
      2. +
      3. Start the HTTPD server: +
          +
        1. The following environment variables are required: +
            +
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • +
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • +
          • HTTPD_HOME=<path to installed Apache HTTPD server>
          • +
          +
        2. +
        3. cd <tuscany_sca_install_dir>\samples\RestCalculator\deploy\httpserver
        4. +
        5. startserver.bat
        6. +
        +
      4. +
      5. Run the client: +
          +
        1. The following environment variables are required: +
            +
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • +
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • +
          • LIBCURL_HOME=<path to installed libcurl libraries>
          • +
          +
        2. +
        3. cd <tuscany_sca_install_dir>\samples\RestCalculator\deploy\sample.calculator.restclient
        4. +
        5. runrestclient.bat
        6. +
        +
      6. +
      +
      + + + +
      +

      Getting Help

      + +

      The first place to look is at the Tuscany SCA FAQ at + http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      + +

      Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      + +
      +
      +
      + + + + diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/Makefile.am b/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/Makefile.am new file mode 100644 index 0000000000..f9412183dc --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/Makefile.am @@ -0,0 +1,6 @@ +deploydir=$(prefix)/RestCalculator/deploy +serverdir=$(deploydir)/httpserver + +server_SCRIPTS = startserver.sh stopserver.sh +EXTRA_DIST = startserver.sh stopserver.sh conf htdocs +nobase_server_DATA = conf/httpd.conf conf/mime.types htdocs/index.html diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/conf/httpd.conf b/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/conf/httpd.conf new file mode 100644 index 0000000000..0303f787e9 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/conf/httpd.conf @@ -0,0 +1,34 @@ +# 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 is the main Apache HTTP server configuration file. It contains the +# configuration directives that give the server its instructions. +# See for detailed information. + +Listen 9090 + +# Generated by the startserver script +Include conf/base.conf +Include conf/tuscany_sca_mod_rest.conf + +# User and Group directives may be required if the server must be +# started from the root account. Uncomment the following lines and +# set the correct username and group +# +# User myusername +# Group mygroupname + diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/conf/mime.types b/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/conf/mime.types new file mode 100644 index 0000000000..4279f51bca --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/conf/mime.types @@ -0,0 +1,607 @@ +# 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 file controls what Internet media types are sent to the client for +# given file extension(s). Sending the correct media type to the client +# is important so they know how to handle the content of the file. +# Extra types can either be added here or by using an AddType directive +# in your config files. For more information about Internet media types, +# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type +# registry is at . + +# MIME type Extensions +application/activemessage +application/andrew-inset ez +application/applefile +application/atom+xml atom +application/atomicmail +application/batch-smtp +application/beep+xml +application/cals-1840 +application/cnrp+xml +application/commonground +application/cpl+xml +application/cybercash +application/dca-rft +application/dec-dx +application/dvcs +application/edi-consent +application/edifact +application/edi-x12 +application/eshop +application/font-tdpfr +application/http +application/hyperstudio +application/iges +application/index +application/index.cmd +application/index.obj +application/index.response +application/index.vnd +application/iotp +application/ipp +application/isup +application/mac-binhex40 hqx +application/mac-compactpro cpt +application/macwriteii +application/marc +application/mathematica +application/mathml+xml mathml +application/msword doc +application/news-message-id +application/news-transmission +application/ocsp-request +application/ocsp-response +application/octet-stream bin dms lha lzh exe class so dll dmg +application/oda oda +application/ogg ogg +application/parityfec +application/pdf pdf +application/pgp-encrypted +application/pgp-keys +application/pgp-signature +application/pkcs10 +application/pkcs7-mime +application/pkcs7-signature +application/pkix-cert +application/pkix-crl +application/pkixcmp +application/postscript ai eps ps +application/prs.alvestrand.titrax-sheet +application/prs.cww +application/prs.nprend +application/prs.plucker +application/qsig +application/rdf+xml rdf +application/reginfo+xml +application/remote-printing +application/riscos +application/rtf +application/sdp +application/set-payment +application/set-payment-initiation +application/set-registration +application/set-registration-initiation +application/sgml +application/sgml-open-catalog +application/sieve +application/slate +application/smil smi smil +application/srgs gram +application/srgs+xml grxml +application/timestamp-query +application/timestamp-reply +application/tve-trigger +application/vemmi +application/vnd.3gpp.pic-bw-large +application/vnd.3gpp.pic-bw-small +application/vnd.3gpp.pic-bw-var +application/vnd.3gpp.sms +application/vnd.3m.post-it-notes +application/vnd.accpac.simply.aso +application/vnd.accpac.simply.imp +application/vnd.acucobol +application/vnd.acucorp +application/vnd.adobe.xfdf +application/vnd.aether.imp +application/vnd.amiga.ami +application/vnd.anser-web-certificate-issue-initiation +application/vnd.anser-web-funds-transfer-initiation +application/vnd.audiograph +application/vnd.blueice.multipass +application/vnd.bmi +application/vnd.businessobjects +application/vnd.canon-cpdl +application/vnd.canon-lips +application/vnd.cinderella +application/vnd.claymore +application/vnd.commerce-battelle +application/vnd.commonspace +application/vnd.contact.cmsg +application/vnd.cosmocaller +application/vnd.criticaltools.wbs+xml +application/vnd.ctc-posml +application/vnd.cups-postscript +application/vnd.cups-raster +application/vnd.cups-raw +application/vnd.curl +application/vnd.cybank +application/vnd.data-vision.rdz +application/vnd.dna +application/vnd.dpgraph +application/vnd.dreamfactory +application/vnd.dxr +application/vnd.ecdis-update +application/vnd.ecowin.chart +application/vnd.ecowin.filerequest +application/vnd.ecowin.fileupdate +application/vnd.ecowin.series +application/vnd.ecowin.seriesrequest +application/vnd.ecowin.seriesupdate +application/vnd.enliven +application/vnd.epson.esf +application/vnd.epson.msf +application/vnd.epson.quickanime +application/vnd.epson.salt +application/vnd.epson.ssf +application/vnd.ericsson.quickcall +application/vnd.eudora.data +application/vnd.fdf +application/vnd.ffsns +application/vnd.fints +application/vnd.flographit +application/vnd.framemaker +application/vnd.fsc.weblaunch +application/vnd.fujitsu.oasys +application/vnd.fujitsu.oasys2 +application/vnd.fujitsu.oasys3 +application/vnd.fujitsu.oasysgp +application/vnd.fujitsu.oasysprs +application/vnd.fujixerox.ddd +application/vnd.fujixerox.docuworks +application/vnd.fujixerox.docuworks.binder +application/vnd.fut-misnet +application/vnd.grafeq +application/vnd.groove-account +application/vnd.groove-help +application/vnd.groove-identity-message +application/vnd.groove-injector +application/vnd.groove-tool-message +application/vnd.groove-tool-template +application/vnd.groove-vcard +application/vnd.hbci +application/vnd.hhe.lesson-player +application/vnd.hp-hpgl +application/vnd.hp-hpid +application/vnd.hp-hps +application/vnd.hp-pcl +application/vnd.hp-pclxl +application/vnd.httphone +application/vnd.hzn-3d-crossword +application/vnd.ibm.afplinedata +application/vnd.ibm.electronic-media +application/vnd.ibm.minipay +application/vnd.ibm.modcap +application/vnd.ibm.rights-management +application/vnd.ibm.secure-container +application/vnd.informix-visionary +application/vnd.intercon.formnet +application/vnd.intertrust.digibox +application/vnd.intertrust.nncp +application/vnd.intu.qbo +application/vnd.intu.qfx +application/vnd.irepository.package+xml +application/vnd.is-xpr +application/vnd.japannet-directory-service +application/vnd.japannet-jpnstore-wakeup +application/vnd.japannet-payment-wakeup +application/vnd.japannet-registration +application/vnd.japannet-registration-wakeup +application/vnd.japannet-setstore-wakeup +application/vnd.japannet-verification +application/vnd.japannet-verification-wakeup +application/vnd.jisp +application/vnd.kde.karbon +application/vnd.kde.kchart +application/vnd.kde.kformula +application/vnd.kde.kivio +application/vnd.kde.kontour +application/vnd.kde.kpresenter +application/vnd.kde.kspread +application/vnd.kde.kword +application/vnd.kenameaapp +application/vnd.koan +application/vnd.liberty-request+xml +application/vnd.llamagraphics.life-balance.desktop +application/vnd.llamagraphics.life-balance.exchange+xml +application/vnd.lotus-1-2-3 +application/vnd.lotus-approach +application/vnd.lotus-freelance +application/vnd.lotus-notes +application/vnd.lotus-organizer +application/vnd.lotus-screencam +application/vnd.lotus-wordpro +application/vnd.mcd +application/vnd.mediastation.cdkey +application/vnd.meridian-slingshot +application/vnd.micrografx.flo +application/vnd.micrografx.igx +application/vnd.mif mif +application/vnd.minisoft-hp3000-save +application/vnd.mitsubishi.misty-guard.trustweb +application/vnd.mobius.daf +application/vnd.mobius.dis +application/vnd.mobius.mbk +application/vnd.mobius.mqy +application/vnd.mobius.msl +application/vnd.mobius.plc +application/vnd.mobius.txf +application/vnd.mophun.application +application/vnd.mophun.certificate +application/vnd.motorola.flexsuite +application/vnd.motorola.flexsuite.adsi +application/vnd.motorola.flexsuite.fis +application/vnd.motorola.flexsuite.gotap +application/vnd.motorola.flexsuite.kmr +application/vnd.motorola.flexsuite.ttc +application/vnd.motorola.flexsuite.wem +application/vnd.mozilla.xul+xml xul +application/vnd.ms-artgalry +application/vnd.ms-asf +application/vnd.ms-excel xls +application/vnd.ms-lrm +application/vnd.ms-powerpoint ppt +application/vnd.ms-project +application/vnd.ms-tnef +application/vnd.ms-works +application/vnd.ms-wpl +application/vnd.mseq +application/vnd.msign +application/vnd.music-niff +application/vnd.musician +application/vnd.netfpx +application/vnd.noblenet-directory +application/vnd.noblenet-sealer +application/vnd.noblenet-web +application/vnd.novadigm.edm +application/vnd.novadigm.edx +application/vnd.novadigm.ext +application/vnd.obn +application/vnd.osa.netdeploy +application/vnd.palm +application/vnd.pg.format +application/vnd.pg.osasli +application/vnd.powerbuilder6 +application/vnd.powerbuilder6-s +application/vnd.powerbuilder7 +application/vnd.powerbuilder7-s +application/vnd.powerbuilder75 +application/vnd.powerbuilder75-s +application/vnd.previewsystems.box +application/vnd.publishare-delta-tree +application/vnd.pvi.ptid1 +application/vnd.pwg-multiplexed +application/vnd.pwg-xhtml-print+xml +application/vnd.quark.quarkxpress +application/vnd.rapid +application/vnd.s3sms +application/vnd.sealed.net +application/vnd.seemail +application/vnd.shana.informed.formdata +application/vnd.shana.informed.formtemplate +application/vnd.shana.informed.interchange +application/vnd.shana.informed.package +application/vnd.smaf +application/vnd.sss-cod +application/vnd.sss-dtf +application/vnd.sss-ntf +application/vnd.street-stream +application/vnd.svd +application/vnd.swiftview-ics +application/vnd.triscape.mxs +application/vnd.trueapp +application/vnd.truedoc +application/vnd.ufdl +application/vnd.uplanet.alert +application/vnd.uplanet.alert-wbxml +application/vnd.uplanet.bearer-choice +application/vnd.uplanet.bearer-choice-wbxml +application/vnd.uplanet.cacheop +application/vnd.uplanet.cacheop-wbxml +application/vnd.uplanet.channel +application/vnd.uplanet.channel-wbxml +application/vnd.uplanet.list +application/vnd.uplanet.list-wbxml +application/vnd.uplanet.listcmd +application/vnd.uplanet.listcmd-wbxml +application/vnd.uplanet.signal +application/vnd.vcx +application/vnd.vectorworks +application/vnd.vidsoft.vidconference +application/vnd.visio +application/vnd.visionary +application/vnd.vividence.scriptfile +application/vnd.vsf +application/vnd.wap.sic +application/vnd.wap.slc +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/vnd.webturbo +application/vnd.wrq-hp3000-labelled +application/vnd.wt.stf +application/vnd.wv.csp+wbxml +application/vnd.xara +application/vnd.xfdl +application/vnd.yamaha.hv-dic +application/vnd.yamaha.hv-script +application/vnd.yamaha.hv-voice +application/vnd.yellowriver-custom-menu +application/voicexml+xml vxml +application/watcherinfo+xml +application/whoispp-query +application/whoispp-response +application/wita +application/wordperfect5.1 +application/x-bcpio bcpio +application/x-cdlink vcd +application/x-chess-pgn pgn +application/x-compress +application/x-cpio cpio +application/x-csh csh +application/x-director dcr dir dxr +application/x-dvi dvi +application/x-futuresplash spl +application/x-gtar gtar +application/x-gzip +application/x-hdf hdf +application/x-javascript js +application/x-koan skp skd skt skm +application/x-latex latex +application/x-netcdf nc cdf +application/x-sh sh +application/x-shar shar +application/x-shockwave-flash swf +application/x-stuffit sit +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-tar tar +application/x-tcl tcl +application/x-tex tex +application/x-texinfo texinfo texi +application/x-troff t tr roff +application/x-troff-man man +application/x-troff-me me +application/x-troff-ms ms +application/x-ustar ustar +application/x-wais-source src +application/x400-bp +application/xhtml+xml xhtml xht +application/xslt+xml xslt +application/xml xml xsl +application/xml-dtd dtd +application/xml-external-parsed-entity +application/zip zip +audio/32kadpcm +audio/amr +audio/amr-wb +audio/basic au snd +audio/cn +audio/dat12 +audio/dsr-es201108 +audio/dvi4 +audio/evrc +audio/evrc0 +audio/g722 +audio/g.722.1 +audio/g723 +audio/g726-16 +audio/g726-24 +audio/g726-32 +audio/g726-40 +audio/g728 +audio/g729 +audio/g729D +audio/g729E +audio/gsm +audio/gsm-efr +audio/l8 +audio/l16 +audio/l20 +audio/l24 +audio/lpc +audio/midi mid midi kar +audio/mpa +audio/mpa-robust +audio/mp4a-latm +audio/mpeg mpga mp2 mp3 +audio/parityfec +audio/pcma +audio/pcmu +audio/prs.sid +audio/qcelp +audio/red +audio/smv +audio/smv0 +audio/telephone-event +audio/tone +audio/vdvi +audio/vnd.3gpp.iufp +audio/vnd.cisco.nse +audio/vnd.cns.anp1 +audio/vnd.cns.inf1 +audio/vnd.digital-winds +audio/vnd.everad.plj +audio/vnd.lucent.voice +audio/vnd.nortel.vbk +audio/vnd.nuera.ecelp4800 +audio/vnd.nuera.ecelp7470 +audio/vnd.nuera.ecelp9600 +audio/vnd.octel.sbc +audio/vnd.qcelp +audio/vnd.rhetorex.32kadpcm +audio/vnd.vmx.cvsd +audio/x-aiff aif aiff aifc +audio/x-alaw-basic +audio/x-mpegurl m3u +audio/x-pn-realaudio ram ra +audio/x-pn-realaudio-plugin +application/vnd.rn-realmedia rm +audio/x-wav wav +chemical/x-pdb pdb +chemical/x-xyz xyz +image/bmp bmp +image/cgm cgm +image/g3fax +image/gif gif +image/ief ief +image/jpeg jpeg jpg jpe +image/naplps +image/png png +image/prs.btif +image/prs.pti +image/svg+xml svg +image/t38 +image/tiff tiff tif +image/tiff-fx +image/vnd.cns.inf2 +image/vnd.djvu djvu djv +image/vnd.dwg +image/vnd.dxf +image/vnd.fastbidsheet +image/vnd.fpx +image/vnd.fst +image/vnd.fujixerox.edmics-mmr +image/vnd.fujixerox.edmics-rlc +image/vnd.globalgraphics.pgb +image/vnd.mix +image/vnd.ms-modi +image/vnd.net-fpx +image/vnd.svf +image/vnd.wap.wbmp wbmp +image/vnd.xiff +image/x-cmu-raster ras +image/x-icon ico +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-rgb rgb +image/x-xbitmap xbm +image/x-xpixmap xpm +image/x-xwindowdump xwd +message/delivery-status +message/disposition-notification +message/external-body +message/http +message/news +message/partial +message/rfc822 +message/s-http +message/sip +message/sipfrag +model/iges igs iges +model/mesh msh mesh silo +model/vnd.dwf +model/vnd.flatland.3dml +model/vnd.gdl +model/vnd.gs-gdl +model/vnd.gtw +model/vnd.mts +model/vnd.parasolid.transmit.binary +model/vnd.parasolid.transmit.text +model/vnd.vtu +model/vrml wrl vrml +multipart/alternative +multipart/appledouble +multipart/byteranges +multipart/digest +multipart/encrypted +multipart/form-data +multipart/header-set +multipart/mixed +multipart/parallel +multipart/related +multipart/report +multipart/signed +multipart/voice-message +text/calendar ics ifb +text/css css +text/directory +text/enriched +text/html html htm +text/parityfec +text/plain asc txt +text/prs.lines.tag +text/rfc822-headers +text/richtext rtx +text/rtf rtf +text/sgml sgml sgm +text/t140 +text/tab-separated-values tsv +text/uri-list +text/vnd.abc +text/vnd.curl +text/vnd.dmclientscript +text/vnd.fly +text/vnd.fmi.flexstor +text/vnd.in3d.3dml +text/vnd.in3d.spot +text/vnd.iptc.nitf +text/vnd.iptc.newsml +text/vnd.latex-z +text/vnd.motorola.reflex +text/vnd.ms-mediapackage +text/vnd.net2phone.commcenter.command +text/vnd.sun.j2me.app-descriptor +text/vnd.wap.si +text/vnd.wap.sl +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/x-setext etx +text/xml +text/xml-external-parsed-entity +video/bmpeg +video/bt656 +video/celb +video/dv +video/h261 +video/h263 +video/h263-1998 +video/h263-2000 +video/jpeg +video/mp1s +video/mp2p +video/mp2t +video/mp4v-es +video/mpv +video/mpeg mpeg mpg mpe +video/nv +video/parityfec +video/pointer +video/quicktime qt mov +video/smpte292m +video/vnd.fvt +video/vnd.motorola.video +video/vnd.motorola.videop +video/vnd.mpegurl mxu m4u +video/vnd.nokia.interleaved-multimedia +video/vnd.objectvideo +video/vnd.vivo +video/x-msvideo avi +video/x-sgi-movie movie +x-conference/x-cooltalk ice diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/htdocs/index.html b/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/htdocs/index.html new file mode 100644 index 0000000000..1bfb3e30c2 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/htdocs/index.html @@ -0,0 +1,21 @@ + + +

      It works!

      + diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/startserver.bat b/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/startserver.bat new file mode 100644 index 0000000000..2fc567a7e6 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/startserver.bat @@ -0,0 +1,72 @@ +@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 APFULLDIR=%~d0%~p0 +echo Running from %APFULLDIR% + +if "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) +echo Using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) +echo Using SDO installed at %TUSCANY_SDOCPP% + +if "%HTTPD_HOME%" == "" ( +echo "HTTPD_HOME not set" +goto end +) +echo Using HTTPD installed at %HTTPD_HOME% + +set PATH=%TUSCANY_SCACPP%\extensions\ruby\bin;%TUSCANY_SCACPP%\extensions\rest\interface\bin;%TUSCANY_SCACPP%\extensions\rest\service\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%HTTPD_HOME%\bin;%PATH% + +set TUSCANY_SCACPP_ROOT=%APFULLDIR%\..\ +set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +@REM Generate the tuscany_sca_mod_rest configuration +if not exist %APFULLDIR%\conf\tuscany_sca_mod_rest.conf ( + echo LoadModule sca_rest_module %TUSCANY_SCACPP%/extensions/rest\service/bin/tuscany_sca_mod_rest.dll > %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo TuscanyHome %TUSCANY_SCACPP% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo SetHandler sca_rest_module >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo TuscanyRoot %TUSCANY_SCACPP_ROOT% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf +) + +@REM Generate the base HTTPD configuration +if not exist %APFULLDIR%\conf\base.conf ( + echo LoadModule mime_module %HTTPD_HOME%\modules\mod_mime.so > %APFULLDIR%\conf\base.conf + echo LoadModule dir_module %HTTPD_HOME%\modules\mod_dir.so >> %APFULLDIR%\conf\base.conf + echo DocumentRoot %APFULLDIR%\htdocs >> %APFULLDIR%\conf\base.conf +) + +@REM Create logs directory +if not exist %APFULLDIR%\logs mkdir %APFULLDIR%\logs +set TUSCANY_SCACPP_LOG=%APFULLDIR%\logs\tuscany-server.log +set TUSCANY_SCACPP_LOGGING=9 + +@REM Start the HTTP server +echo Starting Apache httpd +httpd -d %APFULLDIR% diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/startserver.sh b/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/startserver.sh new file mode 100755 index 0000000000..e5d3d8f1ce --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/startserver.sh @@ -0,0 +1,66 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/ruby/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ +export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +libsuffix=.so +UNAME=`uname -s` +if [ "x$UNAME" = "xDarwin" ]; then + libsuffix=.dylib +fi +# Generate the mod_rest configuration +if [ ! -f conf/tuscany_sca_mod_rest.conf ]; then + echo "LoadModule sca_rest_module $TUSCANY_SCACPP/extensions/rest/service/lib/libtuscany_sca_mod_rest$libsuffix" >conf/tuscany_sca_mod_rest.conf + echo "TuscanyHome $TUSCANY_SCACPP" >>conf/tuscany_sca_mod_rest.conf + echo "" >>conf/tuscany_sca_mod_rest.conf + echo " SetHandler sca_rest_module" >>conf/tuscany_sca_mod_rest.conf + echo " TuscanyRoot $TUSCANY_SCACPP_ROOT" >>conf/tuscany_sca_mod_rest.conf + echo "" >>conf/tuscany_sca_mod_rest.conf +fi + +if [ ! -f conf/base.conf ]; then + echo "DocumentRoot $APFULLDIR/htdocs" >conf/base.conf +fi + +# Create logs directory +if [ ! -d logs ]; then + mkdir logs +fi + +# Start the HTTP server +echo "Starting Apache httpd" +apachectl -k start -d $APFULLDIR + diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/stopserver.sh b/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/stopserver.sh new file mode 100755 index 0000000000..c17f632a3e --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/httpserver/stopserver.sh @@ -0,0 +1,25 @@ +#!/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` + +# Stop the HTTP server +echo "Stopping Apache httpd" +apachectl -k stop -d $APFULLDIR + diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.app.composite b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.app.composite new file mode 100644 index 0000000000..b7c42f4731 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.app.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + sample.calculator.CalculatorComponent/CalculatorService + + + diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/CalculatorRestClient.rb b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/CalculatorRestClient.rb new file mode 100644 index 0000000000..4305c3e185 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/CalculatorRestClient.rb @@ -0,0 +1,25 @@ +# 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. +# +# + +require("tuscany_sca_ruby") + +calculator = SCA::locateService("CalculatorService") + +x = calculator.div(5, 2) +print "Retrieved result from RestCalculator service: ", x, "\n" diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/Makefile.am b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/Makefile.am new file mode 100644 index 0000000000..5eee4677b8 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/Makefile.am @@ -0,0 +1,23 @@ +# 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. + +deploydir=$(prefix)/RestCalculator/deploy +restclientdir=$(deploydir)/sample.calculator.restclient + +restclient_DATA = *.rb *.composite +restclient_SCRIPTS = runrestclient.sh +EXTRA_DIST = runrestclient.sh *.rb *.composite diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/runrestclient.bat b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/runrestclient.bat new file mode 100644 index 0000000000..fb97ed8b74 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/runrestclient.bat @@ -0,0 +1,50 @@ +@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 "%TUSCANY_SCACPP%" == "" ( +echo TUSCANY_SCACPP not set +goto end +) +echo using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo TUSCANY_SDOCPP not set +goto end +) +echo using SDO installed at %TUSCANY_SDOCPP% + +if "%LIBCURL_HOME%" == "" ( +echo LIBCURL_HOME not set +goto end +) +echo using Libcurl installed at %LIBCURL_HOME% + +set PATH=%HTTPD_HOME%\bin;%LIBCURL_HOME%\lib;%TUSCANY_SCACPP%\extensions\ruby\bin;%TUSCANY_SCACPP%\extensions\rest\interface\bin;%TUSCANY_SCACPP%\extensions\rest\reference\bin;%TUSCANY_SCACPP%\extensions\rest\service\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%PATH% + +set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ +set TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorRestClientComponent +set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +cd %TUSCANY_SCACPP_ROOT%\sample.calculator.restclient +ruby -I%TUSCANY_SCACPP%\extensions\ruby\bin CalculatorRestClient.rb + +:end +endlocal diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/runrestclient.sh b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/runrestclient.sh new file mode 100755 index 0000000000..0c6c6c182c --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/runrestclient.sh @@ -0,0 +1,41 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/ruby/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ +export TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorRestClientComponent +export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +cd $TUSCANY_SCACPP_ROOT/sample.calculator.restclient +ruby -I$TUSCANY_SCACPP/extensions/ruby/lib CalculatorRestClient.rb diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/sample.calculator.restclient.composite b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/sample.calculator.restclient.composite new file mode 100644 index 0000000000..fee8c6e14f --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator.restclient/sample.calculator.restclient.composite @@ -0,0 +1,28 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator/CalculatorImpl.rb b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator/CalculatorImpl.rb new file mode 100644 index 0000000000..36ed15ff9b --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator/CalculatorImpl.rb @@ -0,0 +1,48 @@ +# 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. +# +# + +class CalculatorImpl + + attr_writer :divideService + + def initialize() + print "Ruby - CalculatorImpl.initialize\n" + end + + def div(arg1, arg2) + print "Ruby - CalculatorImpl.div\n" + @divideService.divide(arg1.to_f, arg2.to_f) + end + + def add(arg1, arg2) + print "Ruby - CalculatorImpl.add\n" + arg1.to_f + arg2.to_f + end + + def sub(arg1, arg2) + print "Ruby - CalculatorImpl.sub\n" + arg1.to_f - arg2.to_f + end + + def mul(arg1, arg2) + print "Ruby - CalculatorImpl.mul\n" + arg1.to_f * arg2.to_f + end + +end \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator/DivideImpl.rb b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator/DivideImpl.rb new file mode 100644 index 0000000000..c6615bfcfa --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator/DivideImpl.rb @@ -0,0 +1,39 @@ +# 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. +# +# + +class DivideImpl + + attr_writer :round + + def initialize() + print "Ruby - DivideImpl.initialize\n" + end + + def divide(arg1, arg2) + print "Ruby - DivideImpl.divide ", arg1, " / ", arg2, "\n" + res = arg1.to_f / arg2.to_f + if @round then + res = res.round + print "DivideImpl.divide rounding\n" + end + print "DivideImpl.divide ", res, "\n" + res + end + +end \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator/Makefile.am b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator/Makefile.am new file mode 100644 index 0000000000..b715fe2424 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator/Makefile.am @@ -0,0 +1,22 @@ +# 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. + +deploydir=$(prefix)/RestCalculator/deploy +compositedir=$(deploydir)/sample.calculator + +composite_DATA = *.composite *.rb +EXTRA_DIST = *.composite *.rb diff --git a/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator/sample.calculator.composite b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator/sample.calculator.composite new file mode 100644 index 0000000000..49fbf17f54 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCalculator/sample.calculator/sample.calculator.composite @@ -0,0 +1,39 @@ + + + + + + + + CalculatorComponent + + + + + DivideComponent + + + + + true + + + diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/Makefile.am b/sca-cpp/trunk/contrib/samples/RestCustomer/Makefile.am new file mode 100644 index 0000000000..bf259580ce --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/Makefile.am @@ -0,0 +1,22 @@ +# 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. + +deploydir=$(prefix)/RestCustomer/deploy +SUBDIRS = sample.customer sample.customer.restclient httpserver + +EXTRA_DIST = *.composite README.html +deploy_DATA = *.composite diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/README b/sca-cpp/trunk/contrib/samples/RestCustomer/README new file mode 100644 index 0000000000..bf2a1c3eb6 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/README @@ -0,0 +1,25 @@ +Tuscany SCA for C++ Samples - REST Customer Sample +================================================== + +This is a very simple sample to show how to use the SCA REST binding to +implement a resource management service and make resources available +through HTTP. + +There are three sub projects in this workspace: + - sample.customer + This contains the source code and SCDL artifacts for the SCA component + implementing the Customer resource management service. + + - sample.customer.restclient + A sample REST client which shows how to create, update, retrieve, and + delete Customer resources. + + - httpserver + This contains a minimal configuration for the Apache HTTP server used + to host the REST service as well as scripts to start and stop the server. + +Additionally, there is the sample.customer.app.composite file. This +describes the configuration of the SCA Calculator composite deployed to the +SCA runtime. + +See the README.html file for instructions to build and run this sample diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/README.html b/sca-cpp/trunk/contrib/samples/RestCustomer/README.html new file mode 100644 index 0000000000..7d43177b9a --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/README.html @@ -0,0 +1,236 @@ + + + + + + + + + + + + Tuscany SCA Native Samples - REST Customer Sample + + + +
      +
      +
      +

      Tuscany SCA Native Samples - REST Customer Sample

      + +

      This is a very simple sample to show how to use the SCA REST binding to + implement a resource management service and make resources available + through HTTP. +

      +

      The REST Customer sample requires the following extensions: +

      + Please follow the documentation to ensure you have these extensions built and installed + on your system +

      +

      There are three sub-projects in this workspace:

      +
        +
      • sample.customer
        + This contains the source code and SCDL artifacts for the SCA component + implementing the Customer resource management service. +
      • +
      • sample.customer.restclient
        + A sample REST client which shows how to create, update, retrieve, and + delete Customer resources. +
      • +
      • httpserver
        + This contains a minimal configuration for the Apache HTTP server used + to host the REST service as well as scripts to start and stop the server. +
      • +
      +

      Additionally, there is the sample.customer.app.composite file. This + describes the configuration of the SCA Customer composite deployed to the SCA + runtime. +

      +
      + + + + +
      +

      Building the REST Customer sample on Linux and Mac OS X

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        +
      2. +
      3. As the REST Customer sample is based on Python scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the Python samples only with the following command sequence: +
          +
        • cd <tuscany_sca_install_dir>/samples
        • +
        • ./configure --enable-python --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
        • +
        • make install
        • +
        + NOTE: If you don't provide the --prefix configure option, it will by default install into + /usr/local/tuscany/sca/samples/RestCustomer
      4. +
      +
      + +
      +

      Running the REST Customer sample on Linux and Mac OS X

      +
        +
      1. The REST Customer sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
      2. +
      3. Start the Apache HTTPD server: +
          +
        1. The following environment variables are required: +
            +
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • +
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • +
          • PYTHON_LIB=<path to the Python library>
            + Note: If you are using a default installation of Python 2.5 this is usually /usr/lib
          • +
          +
        2. +
        3. cd <tuscany_sca_install_dir>/samples/RestCustomer/deploy/httpserver
        4. +
        5. ./startserver.sh
          + NOTE: Depending on your installation of Apache HTTPD you may need to log in as root before following + these steps. If so, you may also need to uncomment the User and Group directives in the + <tuscany_sca_install_dir>/samples/RestCustomer/deploy/httpserver/conf/httpd.conf file + and set these to the appropriate username and group that the server should run as
        6. +
        +
      4. +
      5. Run the client: +
          +
        1. The following environment variable is required: +
            +
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • +
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • +
          • PYTHON_LIB=<path to the Python library>
            + Note: If you are using a default installation of Python 2.5 this is usually /usr/lib
          • +
          +
        2. +
        3. cd <tuscany_sca_install_dir>/samples/RestCustomer/deploy/sample.customer.restclient
        4. +
        5. ./runrestclient.sh
        6. +
        +
      6. +
      +
      + +
      +

      Building the REST Customer sample on Windows

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
      2. + +
      3. As this sample is based on Ruby scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>\samples\RestCustomer
        • +
        • deploy.bat
        • +
        +
      4. +
      +
      + +
      +

      Running the REST Customer sample on Windows

      +
    • The REST Customer sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
    • +
    • Start the Apache HTTPD server: +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        • HTTPD_HOME=<path to installed Apache HTTPD server>
        • +
        +
      2. +
      3. cd <tuscany_sca_install_dir>\samples\RestCustomer\deploy\httpserver
      4. +
      5. startserver.bat
      6. +
      +
    • +
    • Run the client: +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        • LIBCURL_HOME=<path to installed libcurl libraries>
        • +
        +
      2. +
      3. cd <tuscany_sca_install_dir>\samples\RestCustomer\deploy\sample.customer.restclient
      4. +
      5. runrestclient.bat
      6. +
      +
    • + +
      + + + +
      +

      Getting Help

      + +

      The first place to look is at the Tuscany SCA FAQ at + http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      + +

      Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      + +
      +
      +
      + + + + diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/Makefile.am b/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/Makefile.am new file mode 100644 index 0000000000..af8c0bb550 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/Makefile.am @@ -0,0 +1,6 @@ +deploydir=$(prefix)/RestCustomer/deploy +serverdir=$(deploydir)/httpserver + +server_SCRIPTS = startserver.sh stopserver.sh +EXTRA_DIST = startserver.sh stopserver.sh conf htdocs +nobase_server_DATA = conf/httpd.conf conf/mime.types htdocs/index.html diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/conf/httpd.conf b/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/conf/httpd.conf new file mode 100644 index 0000000000..0303f787e9 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/conf/httpd.conf @@ -0,0 +1,34 @@ +# 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 is the main Apache HTTP server configuration file. It contains the +# configuration directives that give the server its instructions. +# See for detailed information. + +Listen 9090 + +# Generated by the startserver script +Include conf/base.conf +Include conf/tuscany_sca_mod_rest.conf + +# User and Group directives may be required if the server must be +# started from the root account. Uncomment the following lines and +# set the correct username and group +# +# User myusername +# Group mygroupname + diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/conf/mime.types b/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/conf/mime.types new file mode 100644 index 0000000000..4279f51bca --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/conf/mime.types @@ -0,0 +1,607 @@ +# 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 file controls what Internet media types are sent to the client for +# given file extension(s). Sending the correct media type to the client +# is important so they know how to handle the content of the file. +# Extra types can either be added here or by using an AddType directive +# in your config files. For more information about Internet media types, +# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type +# registry is at . + +# MIME type Extensions +application/activemessage +application/andrew-inset ez +application/applefile +application/atom+xml atom +application/atomicmail +application/batch-smtp +application/beep+xml +application/cals-1840 +application/cnrp+xml +application/commonground +application/cpl+xml +application/cybercash +application/dca-rft +application/dec-dx +application/dvcs +application/edi-consent +application/edifact +application/edi-x12 +application/eshop +application/font-tdpfr +application/http +application/hyperstudio +application/iges +application/index +application/index.cmd +application/index.obj +application/index.response +application/index.vnd +application/iotp +application/ipp +application/isup +application/mac-binhex40 hqx +application/mac-compactpro cpt +application/macwriteii +application/marc +application/mathematica +application/mathml+xml mathml +application/msword doc +application/news-message-id +application/news-transmission +application/ocsp-request +application/ocsp-response +application/octet-stream bin dms lha lzh exe class so dll dmg +application/oda oda +application/ogg ogg +application/parityfec +application/pdf pdf +application/pgp-encrypted +application/pgp-keys +application/pgp-signature +application/pkcs10 +application/pkcs7-mime +application/pkcs7-signature +application/pkix-cert +application/pkix-crl +application/pkixcmp +application/postscript ai eps ps +application/prs.alvestrand.titrax-sheet +application/prs.cww +application/prs.nprend +application/prs.plucker +application/qsig +application/rdf+xml rdf +application/reginfo+xml +application/remote-printing +application/riscos +application/rtf +application/sdp +application/set-payment +application/set-payment-initiation +application/set-registration +application/set-registration-initiation +application/sgml +application/sgml-open-catalog +application/sieve +application/slate +application/smil smi smil +application/srgs gram +application/srgs+xml grxml +application/timestamp-query +application/timestamp-reply +application/tve-trigger +application/vemmi +application/vnd.3gpp.pic-bw-large +application/vnd.3gpp.pic-bw-small +application/vnd.3gpp.pic-bw-var +application/vnd.3gpp.sms +application/vnd.3m.post-it-notes +application/vnd.accpac.simply.aso +application/vnd.accpac.simply.imp +application/vnd.acucobol +application/vnd.acucorp +application/vnd.adobe.xfdf +application/vnd.aether.imp +application/vnd.amiga.ami +application/vnd.anser-web-certificate-issue-initiation +application/vnd.anser-web-funds-transfer-initiation +application/vnd.audiograph +application/vnd.blueice.multipass +application/vnd.bmi +application/vnd.businessobjects +application/vnd.canon-cpdl +application/vnd.canon-lips +application/vnd.cinderella +application/vnd.claymore +application/vnd.commerce-battelle +application/vnd.commonspace +application/vnd.contact.cmsg +application/vnd.cosmocaller +application/vnd.criticaltools.wbs+xml +application/vnd.ctc-posml +application/vnd.cups-postscript +application/vnd.cups-raster +application/vnd.cups-raw +application/vnd.curl +application/vnd.cybank +application/vnd.data-vision.rdz +application/vnd.dna +application/vnd.dpgraph +application/vnd.dreamfactory +application/vnd.dxr +application/vnd.ecdis-update +application/vnd.ecowin.chart +application/vnd.ecowin.filerequest +application/vnd.ecowin.fileupdate +application/vnd.ecowin.series +application/vnd.ecowin.seriesrequest +application/vnd.ecowin.seriesupdate +application/vnd.enliven +application/vnd.epson.esf +application/vnd.epson.msf +application/vnd.epson.quickanime +application/vnd.epson.salt +application/vnd.epson.ssf +application/vnd.ericsson.quickcall +application/vnd.eudora.data +application/vnd.fdf +application/vnd.ffsns +application/vnd.fints +application/vnd.flographit +application/vnd.framemaker +application/vnd.fsc.weblaunch +application/vnd.fujitsu.oasys +application/vnd.fujitsu.oasys2 +application/vnd.fujitsu.oasys3 +application/vnd.fujitsu.oasysgp +application/vnd.fujitsu.oasysprs +application/vnd.fujixerox.ddd +application/vnd.fujixerox.docuworks +application/vnd.fujixerox.docuworks.binder +application/vnd.fut-misnet +application/vnd.grafeq +application/vnd.groove-account +application/vnd.groove-help +application/vnd.groove-identity-message +application/vnd.groove-injector +application/vnd.groove-tool-message +application/vnd.groove-tool-template +application/vnd.groove-vcard +application/vnd.hbci +application/vnd.hhe.lesson-player +application/vnd.hp-hpgl +application/vnd.hp-hpid +application/vnd.hp-hps +application/vnd.hp-pcl +application/vnd.hp-pclxl +application/vnd.httphone +application/vnd.hzn-3d-crossword +application/vnd.ibm.afplinedata +application/vnd.ibm.electronic-media +application/vnd.ibm.minipay +application/vnd.ibm.modcap +application/vnd.ibm.rights-management +application/vnd.ibm.secure-container +application/vnd.informix-visionary +application/vnd.intercon.formnet +application/vnd.intertrust.digibox +application/vnd.intertrust.nncp +application/vnd.intu.qbo +application/vnd.intu.qfx +application/vnd.irepository.package+xml +application/vnd.is-xpr +application/vnd.japannet-directory-service +application/vnd.japannet-jpnstore-wakeup +application/vnd.japannet-payment-wakeup +application/vnd.japannet-registration +application/vnd.japannet-registration-wakeup +application/vnd.japannet-setstore-wakeup +application/vnd.japannet-verification +application/vnd.japannet-verification-wakeup +application/vnd.jisp +application/vnd.kde.karbon +application/vnd.kde.kchart +application/vnd.kde.kformula +application/vnd.kde.kivio +application/vnd.kde.kontour +application/vnd.kde.kpresenter +application/vnd.kde.kspread +application/vnd.kde.kword +application/vnd.kenameaapp +application/vnd.koan +application/vnd.liberty-request+xml +application/vnd.llamagraphics.life-balance.desktop +application/vnd.llamagraphics.life-balance.exchange+xml +application/vnd.lotus-1-2-3 +application/vnd.lotus-approach +application/vnd.lotus-freelance +application/vnd.lotus-notes +application/vnd.lotus-organizer +application/vnd.lotus-screencam +application/vnd.lotus-wordpro +application/vnd.mcd +application/vnd.mediastation.cdkey +application/vnd.meridian-slingshot +application/vnd.micrografx.flo +application/vnd.micrografx.igx +application/vnd.mif mif +application/vnd.minisoft-hp3000-save +application/vnd.mitsubishi.misty-guard.trustweb +application/vnd.mobius.daf +application/vnd.mobius.dis +application/vnd.mobius.mbk +application/vnd.mobius.mqy +application/vnd.mobius.msl +application/vnd.mobius.plc +application/vnd.mobius.txf +application/vnd.mophun.application +application/vnd.mophun.certificate +application/vnd.motorola.flexsuite +application/vnd.motorola.flexsuite.adsi +application/vnd.motorola.flexsuite.fis +application/vnd.motorola.flexsuite.gotap +application/vnd.motorola.flexsuite.kmr +application/vnd.motorola.flexsuite.ttc +application/vnd.motorola.flexsuite.wem +application/vnd.mozilla.xul+xml xul +application/vnd.ms-artgalry +application/vnd.ms-asf +application/vnd.ms-excel xls +application/vnd.ms-lrm +application/vnd.ms-powerpoint ppt +application/vnd.ms-project +application/vnd.ms-tnef +application/vnd.ms-works +application/vnd.ms-wpl +application/vnd.mseq +application/vnd.msign +application/vnd.music-niff +application/vnd.musician +application/vnd.netfpx +application/vnd.noblenet-directory +application/vnd.noblenet-sealer +application/vnd.noblenet-web +application/vnd.novadigm.edm +application/vnd.novadigm.edx +application/vnd.novadigm.ext +application/vnd.obn +application/vnd.osa.netdeploy +application/vnd.palm +application/vnd.pg.format +application/vnd.pg.osasli +application/vnd.powerbuilder6 +application/vnd.powerbuilder6-s +application/vnd.powerbuilder7 +application/vnd.powerbuilder7-s +application/vnd.powerbuilder75 +application/vnd.powerbuilder75-s +application/vnd.previewsystems.box +application/vnd.publishare-delta-tree +application/vnd.pvi.ptid1 +application/vnd.pwg-multiplexed +application/vnd.pwg-xhtml-print+xml +application/vnd.quark.quarkxpress +application/vnd.rapid +application/vnd.s3sms +application/vnd.sealed.net +application/vnd.seemail +application/vnd.shana.informed.formdata +application/vnd.shana.informed.formtemplate +application/vnd.shana.informed.interchange +application/vnd.shana.informed.package +application/vnd.smaf +application/vnd.sss-cod +application/vnd.sss-dtf +application/vnd.sss-ntf +application/vnd.street-stream +application/vnd.svd +application/vnd.swiftview-ics +application/vnd.triscape.mxs +application/vnd.trueapp +application/vnd.truedoc +application/vnd.ufdl +application/vnd.uplanet.alert +application/vnd.uplanet.alert-wbxml +application/vnd.uplanet.bearer-choice +application/vnd.uplanet.bearer-choice-wbxml +application/vnd.uplanet.cacheop +application/vnd.uplanet.cacheop-wbxml +application/vnd.uplanet.channel +application/vnd.uplanet.channel-wbxml +application/vnd.uplanet.list +application/vnd.uplanet.list-wbxml +application/vnd.uplanet.listcmd +application/vnd.uplanet.listcmd-wbxml +application/vnd.uplanet.signal +application/vnd.vcx +application/vnd.vectorworks +application/vnd.vidsoft.vidconference +application/vnd.visio +application/vnd.visionary +application/vnd.vividence.scriptfile +application/vnd.vsf +application/vnd.wap.sic +application/vnd.wap.slc +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/vnd.webturbo +application/vnd.wrq-hp3000-labelled +application/vnd.wt.stf +application/vnd.wv.csp+wbxml +application/vnd.xara +application/vnd.xfdl +application/vnd.yamaha.hv-dic +application/vnd.yamaha.hv-script +application/vnd.yamaha.hv-voice +application/vnd.yellowriver-custom-menu +application/voicexml+xml vxml +application/watcherinfo+xml +application/whoispp-query +application/whoispp-response +application/wita +application/wordperfect5.1 +application/x-bcpio bcpio +application/x-cdlink vcd +application/x-chess-pgn pgn +application/x-compress +application/x-cpio cpio +application/x-csh csh +application/x-director dcr dir dxr +application/x-dvi dvi +application/x-futuresplash spl +application/x-gtar gtar +application/x-gzip +application/x-hdf hdf +application/x-javascript js +application/x-koan skp skd skt skm +application/x-latex latex +application/x-netcdf nc cdf +application/x-sh sh +application/x-shar shar +application/x-shockwave-flash swf +application/x-stuffit sit +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-tar tar +application/x-tcl tcl +application/x-tex tex +application/x-texinfo texinfo texi +application/x-troff t tr roff +application/x-troff-man man +application/x-troff-me me +application/x-troff-ms ms +application/x-ustar ustar +application/x-wais-source src +application/x400-bp +application/xhtml+xml xhtml xht +application/xslt+xml xslt +application/xml xml xsl +application/xml-dtd dtd +application/xml-external-parsed-entity +application/zip zip +audio/32kadpcm +audio/amr +audio/amr-wb +audio/basic au snd +audio/cn +audio/dat12 +audio/dsr-es201108 +audio/dvi4 +audio/evrc +audio/evrc0 +audio/g722 +audio/g.722.1 +audio/g723 +audio/g726-16 +audio/g726-24 +audio/g726-32 +audio/g726-40 +audio/g728 +audio/g729 +audio/g729D +audio/g729E +audio/gsm +audio/gsm-efr +audio/l8 +audio/l16 +audio/l20 +audio/l24 +audio/lpc +audio/midi mid midi kar +audio/mpa +audio/mpa-robust +audio/mp4a-latm +audio/mpeg mpga mp2 mp3 +audio/parityfec +audio/pcma +audio/pcmu +audio/prs.sid +audio/qcelp +audio/red +audio/smv +audio/smv0 +audio/telephone-event +audio/tone +audio/vdvi +audio/vnd.3gpp.iufp +audio/vnd.cisco.nse +audio/vnd.cns.anp1 +audio/vnd.cns.inf1 +audio/vnd.digital-winds +audio/vnd.everad.plj +audio/vnd.lucent.voice +audio/vnd.nortel.vbk +audio/vnd.nuera.ecelp4800 +audio/vnd.nuera.ecelp7470 +audio/vnd.nuera.ecelp9600 +audio/vnd.octel.sbc +audio/vnd.qcelp +audio/vnd.rhetorex.32kadpcm +audio/vnd.vmx.cvsd +audio/x-aiff aif aiff aifc +audio/x-alaw-basic +audio/x-mpegurl m3u +audio/x-pn-realaudio ram ra +audio/x-pn-realaudio-plugin +application/vnd.rn-realmedia rm +audio/x-wav wav +chemical/x-pdb pdb +chemical/x-xyz xyz +image/bmp bmp +image/cgm cgm +image/g3fax +image/gif gif +image/ief ief +image/jpeg jpeg jpg jpe +image/naplps +image/png png +image/prs.btif +image/prs.pti +image/svg+xml svg +image/t38 +image/tiff tiff tif +image/tiff-fx +image/vnd.cns.inf2 +image/vnd.djvu djvu djv +image/vnd.dwg +image/vnd.dxf +image/vnd.fastbidsheet +image/vnd.fpx +image/vnd.fst +image/vnd.fujixerox.edmics-mmr +image/vnd.fujixerox.edmics-rlc +image/vnd.globalgraphics.pgb +image/vnd.mix +image/vnd.ms-modi +image/vnd.net-fpx +image/vnd.svf +image/vnd.wap.wbmp wbmp +image/vnd.xiff +image/x-cmu-raster ras +image/x-icon ico +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-rgb rgb +image/x-xbitmap xbm +image/x-xpixmap xpm +image/x-xwindowdump xwd +message/delivery-status +message/disposition-notification +message/external-body +message/http +message/news +message/partial +message/rfc822 +message/s-http +message/sip +message/sipfrag +model/iges igs iges +model/mesh msh mesh silo +model/vnd.dwf +model/vnd.flatland.3dml +model/vnd.gdl +model/vnd.gs-gdl +model/vnd.gtw +model/vnd.mts +model/vnd.parasolid.transmit.binary +model/vnd.parasolid.transmit.text +model/vnd.vtu +model/vrml wrl vrml +multipart/alternative +multipart/appledouble +multipart/byteranges +multipart/digest +multipart/encrypted +multipart/form-data +multipart/header-set +multipart/mixed +multipart/parallel +multipart/related +multipart/report +multipart/signed +multipart/voice-message +text/calendar ics ifb +text/css css +text/directory +text/enriched +text/html html htm +text/parityfec +text/plain asc txt +text/prs.lines.tag +text/rfc822-headers +text/richtext rtx +text/rtf rtf +text/sgml sgml sgm +text/t140 +text/tab-separated-values tsv +text/uri-list +text/vnd.abc +text/vnd.curl +text/vnd.dmclientscript +text/vnd.fly +text/vnd.fmi.flexstor +text/vnd.in3d.3dml +text/vnd.in3d.spot +text/vnd.iptc.nitf +text/vnd.iptc.newsml +text/vnd.latex-z +text/vnd.motorola.reflex +text/vnd.ms-mediapackage +text/vnd.net2phone.commcenter.command +text/vnd.sun.j2me.app-descriptor +text/vnd.wap.si +text/vnd.wap.sl +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/x-setext etx +text/xml +text/xml-external-parsed-entity +video/bmpeg +video/bt656 +video/celb +video/dv +video/h261 +video/h263 +video/h263-1998 +video/h263-2000 +video/jpeg +video/mp1s +video/mp2p +video/mp2t +video/mp4v-es +video/mpv +video/mpeg mpeg mpg mpe +video/nv +video/parityfec +video/pointer +video/quicktime qt mov +video/smpte292m +video/vnd.fvt +video/vnd.motorola.video +video/vnd.motorola.videop +video/vnd.mpegurl mxu m4u +video/vnd.nokia.interleaved-multimedia +video/vnd.objectvideo +video/vnd.vivo +video/x-msvideo avi +video/x-sgi-movie movie +x-conference/x-cooltalk ice diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/htdocs/index.html b/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/htdocs/index.html new file mode 100644 index 0000000000..1bfb3e30c2 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/htdocs/index.html @@ -0,0 +1,21 @@ + + +

      It works!

      + diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/startserver.bat b/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/startserver.bat new file mode 100644 index 0000000000..a62f4bd510 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/startserver.bat @@ -0,0 +1,75 @@ +@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 APFULLDIR=%~d0%~p0 +echo Running from %APFULLDIR% + +if "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) +echo Using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) +echo Using SDO installed at %TUSCANY_SDOCPP% + +if "%HTTPD_HOME%" == "" ( +echo "HTTPD_HOME not set" +goto end +) +echo Using HTTPD installed at %HTTPD_HOME% + +set PATH=%TUSCANY_SCACPP%\extensions\python\bin;%TUSCANY_SCACPP%\extensions\rest\interface\bin;%TUSCANY_SCACPP%\extensions\rest\service\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%HTTPD_HOME%\bin;%PATH% +set PYTHONPATH=%TUSCANY_SCACPP%\extensions\python\bin + +set TUSCANY_SCACPP_ROOT=%APFULLDIR%\..\ +set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +set CUSTOMER_DIR=%TUSCANY_SCACPP_ROOT%\sample.customer + +@REM Generate the tuscany_sca_mod_rest configuration +if not exist %APFULLDIR%\conf\tuscany_sca_mod_rest.conf ( + echo LoadModule sca_rest_module %TUSCANY_SCACPP%/extensions/rest\service/bin/tuscany_sca_mod_rest.dll > %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo TuscanyHome %TUSCANY_SCACPP% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo SetHandler sca_rest_module >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo TuscanyRoot %TUSCANY_SCACPP_ROOT% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf + echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf +) + +@REM Generate the base HTTPD configuration +if not exist %APFULLDIR%\conf\base.conf ( + echo LoadModule mime_module %HTTPD_HOME%\modules\mod_mime.so > %APFULLDIR%\conf\base.conf + echo LoadModule dir_module %HTTPD_HOME%\modules\mod_dir.so >> %APFULLDIR%\conf\base.conf + echo DocumentRoot %APFULLDIR%\htdocs >> %APFULLDIR%\conf\base.conf +) + +@REM Create logs directory +if not exist %APFULLDIR%\logs mkdir %APFULLDIR%\logs +set TUSCANY_SCACPP_LOG=%APFULLDIR%\logs\tuscany-server.log +set TUSCANY_SCACPP_LOGGING=9 + +@REM Start the HTTP server +echo Starting Apache httpd +httpd -d %APFULLDIR% diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/startserver.sh b/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/startserver.sh new file mode 100755 index 0000000000..0d4561e3d3 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/startserver.sh @@ -0,0 +1,80 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$PYTHON_LIB != x ]; then +echo "Using Python library installed at $PYTHON_LIB" +export LD_LIBRARY_PATH=$PYTHON_LIB:$LD_LIBRARY_PATH +export PATH=$PYTHON_LIB/../bin:$PATH +fi + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SCACPP/extensions/python/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH +export PYTHONPATH=$TUSCANY_SCACPP/extensions/python/lib:$PYTHONPATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ +export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +export CUSTOMER_DIR=$TUSCANY_SCACPP_ROOT/sample.customer + +libsuffix=.so +UNAME=`uname -s` +if [ "x$UNAME" = "xDarwin" ]; then + libsuffix=.dylib +fi + +# Generate the mod_rest configuration +if [ ! -f conf/tuscany_sca_mod_rest.conf ]; then + echo "LoadModule sca_rest_module $TUSCANY_SCACPP/extensions/rest/service/lib/libtuscany_sca_mod_rest$libsuffix" >conf/tuscany_sca_mod_rest.conf + echo "TuscanyHome $TUSCANY_SCACPP" >>conf/tuscany_sca_mod_rest.conf + echo "" >>conf/tuscany_sca_mod_rest.conf + echo " SetHandler sca_rest_module" >>conf/tuscany_sca_mod_rest.conf + echo " TuscanyRoot $TUSCANY_SCACPP_ROOT" >>conf/tuscany_sca_mod_rest.conf + echo "" >>conf/tuscany_sca_mod_rest.conf +fi + +if [ ! -f conf/base.conf ]; then + echo "DocumentRoot $APFULLDIR/htdocs" >conf/base.conf +fi + +# Create logs directory +if [ ! -d logs ]; then + mkdir logs +fi + +# Start the HTTP server +echo "Starting Apache httpd" + +# Set LD_PRELOAD to use the expat included in Python to avoid incompatibilities +export LD_PRELOAD=$TUSCANY_SCACPP/extensions/python/lib/libtuscany_sca_python$libsuffix + +apachectl -k start -d $APFULLDIR + diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/stopserver.sh b/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/stopserver.sh new file mode 100755 index 0000000000..c17f632a3e --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/httpserver/stopserver.sh @@ -0,0 +1,25 @@ +#!/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` + +# Stop the HTTP server +echo "Stopping Apache httpd" +apachectl -k stop -d $APFULLDIR + diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.app.composite b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.app.composite new file mode 100644 index 0000000000..65565f1e3c --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.app.composite @@ -0,0 +1,34 @@ + + + + + + + + + + + + sample.customer.CustomerComponent/CustomerResource + sample.customer.CustomerComponent/CustomerCommand + + + diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/Customer.xsd b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/Customer.xsd new file mode 100644 index 0000000000..1cec1b0ae6 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/Customer.xsd @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/CustomerRestClient.py b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/CustomerRestClient.py new file mode 100644 index 0000000000..340da8700d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/CustomerRestClient.py @@ -0,0 +1,85 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# + +# +# This Python code is a simple sample that provides a Python +# client for the REST Customer sample + + +from xml.etree import ElementTree as et +import sca + +# Locate the customer resource service +customerResource = sca.locateservice("CustomerResource") + +# Show how to invoke CRUD operations on the customer resource +# The CRUD operations translate to HTTP POST, GET, PUT and DELETE +# according to the REST pattern + +customer = customerResource.retrieve("2345") +print "Rest - Retrieved customer " + et.tostring(customer) + +customer = et.fromstring("""1234JaneDoe""") +url = customerResource.create(customer) +print "Rest - Created customer " + url + +customer = customerResource.retrieve("1234") +print "Rest - Retrieved customer " + et.tostring(customer) + +customer = customerResource.retrieve(url) +print "Rest - Retrieved by url " + et.tostring(customer) + +customer.find("{http://sample.customer}lastName").text="Smith" +customerResource.update("1234", customer) +print "Rest - Updated customer 1234" + +customer = customerResource.retrieve("1234") +print "Rest - Retrieved customer " + et.tostring(customer) + +customerResource.delete("1234") +print "Rest - Deleted customer 1234" + +# Also show how to use REST binding to invoke remote commands +# using HTTP GET and XML over HTTP POST, the REST binding +# uses that command pattern when you don't declare a REST interface +# on your SCA reference + +# Locate the customer command service +customerCommand = sca.locateservice("CustomerCommand") + +# Invoke operations on the customer command service +customer = customerCommand.retrieve("2345") +print "Command - Retrieved customer " + et.tostring(customer) + +customer = et.fromstring("""1234JaneDoe""") +url = customerCommand.create(customer) +print "Command - Created customer " + url + +customer = customerCommand.retrieve("1234") +print "Command - Retrieved customer " + et.tostring(customer) + +customer.find("{http://sample.customer}lastName").text="Smith" +customerCommand.update("1234", customer) +print "Command - Updated customer 1234" + +customer = customerCommand.retrieve("1234") +print "Command - Retrieved customer " + et.tostring(customer) + +customerCommand.delete("1234") +print "Command - Deleted customer 1234" diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/Makefile.am b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/Makefile.am new file mode 100644 index 0000000000..13c14d07e9 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/Makefile.am @@ -0,0 +1,23 @@ +# 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. + +deploydir=$(prefix)/RestCustomer/deploy +restclientdir=$(deploydir)/sample.customer.restclient + +restclient_DATA = *.py *.composite *.xsd +restclient_SCRIPTS = runrestclient.sh +EXTRA_DIST = runrestclient.sh *.py *.composite *.xsd diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/runrestclient.bat b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/runrestclient.bat new file mode 100644 index 0000000000..982b9b5e83 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/runrestclient.bat @@ -0,0 +1,53 @@ +@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 "%TUSCANY_SCACPP%" == "" ( +echo TUSCANY_SCACPP not set +goto end +) +echo using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo TUSCANY_SDOCPP not set +goto end +) +echo using SDO installed at %TUSCANY_SDOCPP% + +if "%LIBCURL_HOME%" == "" ( +echo LIBCURL_HOME not set +goto end +) +echo using Libcurl installed at %LIBCURL_HOME% + +set PATH=%HTTPD_HOME%\bin;%LIBCURL_HOME%\lib;%TUSCANY_SCACPP%\extensions\rest\interface\bin;%TUSCANY_SCACPP%\extensions\rest\reference\bin;%TUSCANY_SCACPP%\extensions\python\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%PATH% +set PYTHONPATH=%TUSCANY_SCACPP%\extensions\python\bin + +set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ +set TUSCANY_SCACPP_COMPONENT=sample.customer.CustomerRestClientComponent +set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +set CUSTOMER_DIR=%TUSCANY_SCACPP_ROOT%\sample.customer + +cd %TUSCANY_SCACPP_ROOT%\sample.customer.restclient +python CustomerRestClient.py + +:end +endlocal diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/runrestclient.sh b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/runrestclient.sh new file mode 100755 index 0000000000..54c068f4e2 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/runrestclient.sh @@ -0,0 +1,50 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$PYTHON_LIB != x ]; then +echo "Using Python library installed at $PYTHON_LIB" +export LD_LIBRARY_PATH=$PYTHON_LIB:$LD_LIBRARY_PATH +export PATH=$PYTHON_LIB/../bin:$PATH +fi + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SCACPP/extensions/python/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH +export PYTHONPATH=$TUSCANY_SCACPP/extensions/python/lib:$PYTHONPATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ +export TUSCANY_SCACPP_COMPONENT=sample.customer.CustomerRestClientComponent +export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +export CUSTOMER_DIR=$TUSCANY_SCACPP_ROOT/sample.customer + +cd $TUSCANY_SCACPP_ROOT/sample.customer.restclient +python CustomerRestClient.py diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/sample.customer.restclient.composite b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/sample.customer.restclient.composite new file mode 100644 index 0000000000..15072f28f8 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer.restclient/sample.customer.restclient.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/2345.xml b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/2345.xml new file mode 100644 index 0000000000..48083380ea --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/2345.xml @@ -0,0 +1,20 @@ + + +2345JohnSmith \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/Customer.xsd b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/Customer.xsd new file mode 100644 index 0000000000..1cec1b0ae6 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/Customer.xsd @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/CustomerResourceImpl.py b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/CustomerResourceImpl.py new file mode 100644 index 0000000000..1d6796959e --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/CustomerResourceImpl.py @@ -0,0 +1,59 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# + +# +# This Python code implements a simple SCA component that +# manages Customer resources. +# + +import os +import shutil +from xml.etree import ElementTree as et + +qname = "{http://sample.customer}id" +dir = os.environ["CUSTOMER_DIR"] + +class CustomerResourceImpl: + "A class that manages Customer resources" + + def create(self, customer): + id = customer.findtext(qname) + print "Python - CustomerResourceImpl.create " + id + f = open(dir + "/" + id + ".xml", "w") + f.write(et.tostring(customer)) + f.close() + return id + + def retrieve(self, id): + print "Python - CustomerResourceImpl.retrieve " + id + f = open(dir + "/" + id + ".xml", "r") + customer = et.fromstring(f.read()) + f.close() + return customer + + def update(self, id, customer): + print "Python - CustomerResourceImpl.update " + id + f = open(dir + "/" + id + ".xml", "w") + f.write(et.tostring(customer)) + f.close() + + def delete(self, id): + print "Python - CustomerResourceImpl.delete " + id + shutil.copyfile(dir + "/" + id + ".xml", dir + "/" + id + "-bak.xml") + os.remove(dir + "/" + id + ".xml") diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/Makefile.am b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/Makefile.am new file mode 100644 index 0000000000..e48bb502c8 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/Makefile.am @@ -0,0 +1,22 @@ +# 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. + +deploydir=$(prefix)/RestCustomer/deploy +compositedir=$(deploydir)/sample.customer + +composite_DATA = *.composite *.py *.xsd *.xml +EXTRA_DIST = *.composite *.py *.xsd *.xml diff --git a/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/sample.customer.composite b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/sample.customer.composite new file mode 100644 index 0000000000..1ee3b2d6a2 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestCustomer/sample.customer/sample.customer.composite @@ -0,0 +1,39 @@ + + + + + + + + + CustomerComponent + + + + + CustomerComponent + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/RestYahoo/Makefile.am b/sca-cpp/trunk/contrib/samples/RestYahoo/Makefile.am new file mode 100644 index 0000000000..de28cf2d53 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestYahoo/Makefile.am @@ -0,0 +1,23 @@ +# 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. + +deploydir=$(prefix)/RestYahoo/deploy +SUBDIRS = sample.yahoo sample.yahoo.client + +EXTRA_DIST = *.composite README.html +deploy_DATA = *.composite + diff --git a/sca-cpp/trunk/contrib/samples/RestYahoo/README b/sca-cpp/trunk/contrib/samples/RestYahoo/README new file mode 100644 index 0000000000..79ee6c7813 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestYahoo/README @@ -0,0 +1,19 @@ +Tuscany SCA for C++ Samples - REST Yahoo Sample +=============================================== + +This is a very simple sample to show how to use the SCA REST binding to +invoke the Yahoo Web Search REST service. + +There are two sub-projects in this workspace: + - sample.yahoo + This contains the SCDL artifacts and source code for the WebSearch + Component which calls a Reference that is configured to call the + Yahoo service + - sample.yahoo.client + A Ruby client which calls the WebSearch component. + +Additionally, there is the sample.yahoo.app.composite file. This +describes the configuration of the SCA Yahoo Search composite deployed to +the SCA runtime. + +See the README.html file for instructions to build and run this sample diff --git a/sca-cpp/trunk/contrib/samples/RestYahoo/README.html b/sca-cpp/trunk/contrib/samples/RestYahoo/README.html new file mode 100644 index 0000000000..967f2c84b1 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestYahoo/README.html @@ -0,0 +1,202 @@ + + + + + + + + + + + + Tuscany SCA Native Samples - REST Yahoo Search Sample + + + +
      +
      +
      +

      Tuscany SCA Native Samples - REST Yahoo Search Sample

      + +

      This is a very simple sample to show how to use the SCA REST binding to + invoke the Yahoo Web Search REST service. +

      +

      The REST Yahoo Search sample requires the following extensions: +

      + Please follow the documentation to ensure you have these extensions built and installed + on your system +

      +

      There are two sub projects in this workspace:

      +
        +
      • sample.yahoo
        + This contains the SCDL artifacts and Python source code for the WebSearch + Component which calls a Reference that is configured to call the + Yahoo service +
      • +
      • sample.yahoo.client
        + A Ruby client which calls the WebSearch component +
      • +
      +

      Additionally, there is the sample.yahoo.app.composite file. This + describes the configuration of the SCA Yahoo Search composite deployed to + the SCA runtime. +

      +
      + + + + +
      +

      Building the Ruby & Python samples on Linux and Mac OS X

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
      2. + +
      3. As the REST Yahoo sample is based on Ruby and Python scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the Ruby and Python samples only with the following command sequence: +
          +
        • cd <tuscany_sca_install_dir>/samples
        • +
        • ./configure --enable-ruby --enable-python --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
        • +
        • make install
        • +
        + NOTE: If you don't provide the --prefix configure option, it will by default install into + /usr/local/tuscany/sca/samples/RestYahoo
      4. +
      +
      + +
      +

      Running the REST Yahoo Search sample on Linux and Mac OS X

      +
        +
      1. The REST Yahoo Search sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
      2. +
      3. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        +
      4. +
      5. Run the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>/samples/RestYahoo/deploy/sample.yahoo.client
        • +
        • ./runclient.sh
        • +
        +
      6. +
      +
      + +
      +

      Building the REST Yahoo Search sample on Windows

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
      2. + +
      3. As this sample is based on Ruby and Python scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>\samples\RestYahoo
        • +
        • deploy.bat
        • +
        +
      4. +
      +
      + +
      +

      Running the REST Yahoo Search sample on Windows

      +
        +
      1. The REST Yahoo Search sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
      2. +
      3. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        • LIBCURL_HOME=<path to libcurl>
        • +
        +
      4. +
      5. Run the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>\samples\RestYahoo\deploy\sample.yahoo.client
        • +
        • runclient.bat
        • +
        +
      6. +
      +
      + + + +
      +

      Getting Help

      + +

      The first place to look is at the Tuscany SCA FAQ at + http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      + +

      Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      + +
      +
      +
      + + + + diff --git a/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.app.composite b/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.app.composite new file mode 100644 index 0000000000..eb19962fe3 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.app.composite @@ -0,0 +1,28 @@ + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.client/Makefile.am b/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.client/Makefile.am new file mode 100644 index 0000000000..4fcbf00e16 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.client/Makefile.am @@ -0,0 +1,23 @@ +# 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. + +deploydir=$(prefix)/RestYahoo/deploy +clientdir=$(deploydir)/sample.yahoo.client + +client_DATA = *.rb +client_SCRIPTS = runclient.sh +EXTRA_DIST = runclient.sh *.rb diff --git a/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.client/YahooWebSearchClient.rb b/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.client/YahooWebSearchClient.rb new file mode 100644 index 0000000000..0a87ccd815 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.client/YahooWebSearchClient.rb @@ -0,0 +1,25 @@ +# 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. +# +# + +require("tuscany_sca_ruby") + +yahooWebSearch = SCA::locateService("WebSearchComponent") + +results = yahooWebSearch.search("Tuscany") +print results, "\n" diff --git a/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.client/runclient.bat b/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.client/runclient.bat new file mode 100644 index 0000000000..bf95f27738 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.client/runclient.bat @@ -0,0 +1,50 @@ +@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 "%TUSCANY_SCACPP%" == "" ( +echo TUSCANY_SCACPP not set +goto end +) +echo using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo TUSCANY_SDOCPP not set +goto end +) +echo using SDO installed at %TUSCANY_SDOCPP% + +if "%LIBCURL_HOME%" == "" ( +echo LIBCURL_HOME not set +goto end +) +echo using Libcurl installed at %LIBCURL_HOME% + +set PATH=%LIBCURL_HOME%\lib;%TUSCANY_SCACPP%\extensions\rest\interface\bin;%TUSCANY_SCACPP%\extensions\ruby\bin;%TUSCANY_SCACPP%\extensions\rest\reference\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%PATH% +set PYTHONPATH=%TUSCANY_SCACPP%\extensions\python\bin + +set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ +set TUSCANY_SCACPP_COMPONENT=sample.yahoo.app.WebSearchComponent + +cd %TUSCANY_SCACPP_ROOT%\sample.yahoo.client +ruby -I%TUSCANY_SCACPP%\extensions\ruby\bin YahooWebSearchClient.rb + +:end +endlocal diff --git a/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.client/runclient.sh b/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.client/runclient.sh new file mode 100755 index 0000000000..7dbae64748 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo.client/runclient.sh @@ -0,0 +1,51 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/ruby/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$TUSCANY_SCACPP/extensions/python/lib:$LD_LIBRARY_PATH +export PYTHONPATH=$TUSCANY_SCACPP/extensions/python/lib:$PYTHONPATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ +export TUSCANY_SCACPP_COMPONENT=sample.yahoo.app.WebSearchComponent + +cd $TUSCANY_SCACPP_ROOT/sample.yahoo.client + +libsuffix=.so +UNAME=`uname -s` +if [ "x$UNAME" = "xDarwin" ]; then + libsuffix=.dylib +fi +# Set LD_PRELOAD to use the expat included in Python to avoid incompatibilities +export LD_PRELOAD=$TUSCANY_SCACPP/extensions/python/lib/libtuscany_sca_python$libsuffix + +ruby -I$TUSCANY_SCACPP/extensions/ruby/lib YahooWebSearchClient.rb diff --git a/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo/Makefile.am b/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo/Makefile.am new file mode 100644 index 0000000000..7e330ca7b1 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo/Makefile.am @@ -0,0 +1,22 @@ +# 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. + +deploydir=$(prefix)/RestYahoo/deploy +compositedir=$(deploydir)/sample.yahoo + +composite_DATA = *.composite *.py *.xsd +EXTRA_DIST = *.composite *.py *.xsd diff --git a/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo/YahooWebSearchImpl.py b/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo/YahooWebSearchImpl.py new file mode 100644 index 0000000000..7ba6ab80ef --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo/YahooWebSearchImpl.py @@ -0,0 +1,60 @@ +# 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. +# +# + +try: + import xml.etree.ElementTree +except ImportError: + # Running under a pre-Python2.5 + try: + import elementtree.ElementTree + except ImportError: + print "The RestYahoo sample requires the ElementTree package" + + +def search(searchText): + + print "Python - YahooWebSearchImpl.py running Yahoo search for:", searchText, "with ID:", yahooAppID + + # Use the yahooWebSearchService reference to call the Yahoo REST service + # also use the yahooAppID property from the composite definition + xmlResult = yahooWebSearchService.webSearch(appid = yahooAppID, query = searchText, results = 5) + + print "Python - YahooWebSearchImpl.py formatting result from Yahoo:", xmlResult + + return formatResults(xmlResult, searchText) + + +def formatResults(results, searchText): + + formatted = "Failed to run Yahoo search service for \"" + str(searchText) + "\"" + + ns = "{urn:yahoo:srch}" + pathAndNS = "./" + ns + + formatted = "\n\nYahoo Web Search Results for \""+ str(searchText) +"\"\n" + formatted += results.attrib["totalResultsAvailable"]+ " results available. First "+ results.attrib["totalResultsReturned"]+ " below\n\n" + pos = 1 + + for node in results.findall(".//"+ns+"Result"): + formatted += str(pos) + ". "+ node.findtext(pathAndNS+"Title") +"\n\t" + formatted += node.findtext(pathAndNS+"Summary") +"\n\t" + formatted += node.findtext(pathAndNS+"Url") +"\n\n" + pos += 1 + + return formatted diff --git a/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo/YahooWebSearchResponse.xsd b/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo/YahooWebSearchResponse.xsd new file mode 100644 index 0000000000..210aabcf42 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo/YahooWebSearchResponse.xsd @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo/sample.yahoo.composite b/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo/sample.yahoo.composite new file mode 100644 index 0000000000..a37a9be7c4 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RestYahoo/sample.yahoo/sample.yahoo.composite @@ -0,0 +1,33 @@ + + + + + + + + YahooWebSearchReference + ApacheTuscanyC++SampleRestYahoo + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/Makefile.am b/sca-cpp/trunk/contrib/samples/RubyBigBank/Makefile.am new file mode 100644 index 0000000000..ae0b4958f1 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/Makefile.am @@ -0,0 +1,21 @@ +# 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. + +deploydir=$(prefix)/RubyBigBank/deploy +SUBDIRS = bigbank.account bigbank.client bigbank.wsclient +EXTRA_DIST = *.composite README.html +deploy_DATA = *.composite diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/README b/sca-cpp/trunk/contrib/samples/RubyBigBank/README new file mode 100644 index 0000000000..6b2dba4206 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/README @@ -0,0 +1,21 @@ +Tuscany SCA for C++ Samples - Ruby BigBank Sample +=============================================== + +This sample implements the "Simplified BigBank" scenario. A whitepaper +describing the scenario based on the SCA 0.9 Assembly specification can be +found here. This sample uses multiple Ruby components, calls out to an +external Web Service via a reference, exposes the service as a Web Service +and also provides a PHP based client. + +There are two sub projects in this workspace: + - bigbank.account + This contains the source code and SCDL artifacts for the SCA BigBank + composite implementing the account services. + + - bigbank.client + A sample client which does a local call to the BigBank service. + +Additionally, there is the bigbank.app.composite file. This describes the +configuration of the SCA BigBank composite deployed to the SCA runtime. + +See the README.html file for instructions to build and run this sample diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/README.html b/sca-cpp/trunk/contrib/samples/RubyBigBank/README.html new file mode 100644 index 0000000000..6eeb377d6f --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/README.html @@ -0,0 +1,312 @@ + + + + + + + + + + + + Tuscany SCA Native Samples - Ruby BigBank Sample + + + +
      +
      +
      +

      Tuscany SCA Native Samples - Ruby BigBank Sample

      + +

      This sample implements the "Simplified BigBank" scenario. A whitepaper describing + the scenario based on the SCA 0.9 Assembly specification can be found + here. + This sample uses multiple Ruby components, calls out to an external Web Service via a reference + and exposes the service as a Web Service. +

      +

      The Ruby BigBank sample requires the following extensions: +

      + Please follow the documentation to ensure you have these extensions built and installed + on your system +

      +

      There are three sub projects in this workspace:

      +
        +
      • bigbank.account
        + This contains the source code and SCDL artifacts for the SCA Ruby BigBank + composite implementing the account services. +
      • +
      • bigbank.client
        + A sample client which does a local call to the BigBank service. +
      • +
      • bigbank.wsclient
        + A sample client which uses an SCA Web Service reference to make a remote + call to the BigBank service. +
      • +
      +

      Additionally, there is the bigbank.app.composite file. This + describes the configuration of the SCA BigBank composite deployed to the SCA + runtime. +

      +
      + + + + +
      +

      Building the Ruby BigBank sample on Linux and Mac OS X

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
      2. + +
      3. As the Ruby BigBank sample is based on Ruby scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the Ruby samples only with the following command sequence: +
          +
        • cd <tuscany_sca_install_dir>/samples
        • +
        • ./configure --enable-ruby --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
        • +
        • make install
        • +
        + NOTE: If you don't provide the --prefix configure option, it will by default install into + /usr/local/tuscany/sca/samples/RubyBigBank +
      4. +
      +
      + +
      +

      Running the Ruby BigBank sample on Linux and Mac OS X

      +

      BigBank with basic client

      +
        +
      1. The Ruby BigBank sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
      2. +
      3. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        +
      4. +
      5. Run the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>/samples/RubyBigBank/deploy/bigbank.client
        • +
        • ./runclient.sh
        • +
        +
      6. +
      +

      BigBank with Web Service clients

      +
        +
      1. The Ruby BigBank sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
      2. +
      3. Ensure you have enabled Axis2/C to run Tuscany SCA services. Follow the instructions + found here. +
      4. +
      5. Start the Axis2/C simple http server: +
          +
        1. The following environment variables are required: +
            +
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • +
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • +
          • AXIS2C_HOME=<path to Axis2/C version 0.96>
          • +
          +
        2. +
        3. cd <tuscany_sca_install_dir>/samples/RubyBigBank/deploy/bigbank.account
        4. +
        5. ./runwsserver.sh
        6. +
        +
      6. +
      7. Now run the Web Service client: +
          +
        1. The following environment variables are required: +
            +
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • +
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • +
          • AXIS2C_HOME=<path to Axis2/C version 0.96>
          • +
          +
        2. +
        3. Run the sample with the following commands: +
            +
          • cd <tuscany_sca_install_dir>/samples/RubyBigBank/deploy/bigbank.wsclient
          • +
          • ./runwsclient.sh
          • +
          +
        4. +
        +
      8. +
      9. The PHP web client detailed in the + CppBigBank sample can also be used + with the Ruby BigBank service that is served by the Axis2/C http server started above. +
      10. +
      +
      + +
      +

      Building the Ruby BigBank sample on Windows

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> +
      2. + +
      3. As this sample is based on Ruby scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>\samples\RubyBigBank
        • +
        • deploy.bat
        • +
        +
      4. +
      +
      + +
      +

      Running the Ruby BigBank sample on Windows

      +

      BigBank with basic client

      +
        +
      1. The Ruby BigBank sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
      2. +
      3. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        +
      4. +
      5. Run the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>\samples\RubyBigBank\deploy\bigbank.client
        • +
        • runclient.bat
        • +
        +
      6. +
      +

      BigBank with Web Service clients

      +
        +
      1. The Ruby BigBank sample requires the following extensions: + + Please follow the documentation to ensure you have these extensions built and installed + on your system +
      2. +
      3. Ensure you have enabled Axis2/C to run Tuscany SCA services. Follow the instructions + found here. +
      4. +
      5. Start the Axis2/C simple http server: +
          +
        1. The following environment variables are required: +
            +
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • +
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • +
          • AXIS2C_HOME=<path to Axis2/C version 0.96>
          • +
          +
        2. +
        3. cd <tuscany_sca_install_dir>\samples\RubyBigBank\deploy\bigbank.account +
        4. +
        5. runwsserver.bat
        6. +
        +
      6. +
      7. Now run the Web Service client: +
          +
        1. The following environment variables are required: +
            +
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • +
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • +
          • AXIS2C_HOME=<path to Axis2/C version 0.96>
          • +
          +
        2. +
        3. Run the sample with the following commands: +
            +
          • cd <tuscany_sca_install_dir>/samples/RubyBigBank/deploy/bigbank.wsclient
          • +
          • ./runwsclient.bat
          • +
          +
        4. +
        +
      8. +
      9. The PHP web client detailed in the + CppBigBank sample can also be used + with the Ruby BigBank service that is served by the Axis2/C http server started above. +
      10. +
      +
      + + + +
      +

      Getting Help

      + +

      The first place to look is at the Tuscany SCA FAQ at + http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      + +

      Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      + +
      +
      +
      + + + + diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/AccountDataServiceImpl.rb b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/AccountDataServiceImpl.rb new file mode 100644 index 0000000000..8ae0e23bab --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/AccountDataServiceImpl.rb @@ -0,0 +1,72 @@ +# 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. +# + +require "rexml/document" +include REXML + +class AccountDataServiceImpl + + def initialize() + print "Ruby - AccountDataServiceImpl.initialize\n" + end + + def getCheckingAccount(id) + print "Ruby - AccountDataServiceImpl.getCheckingAccount ", id, "\n" + + result = Document.new <<-eof + + #{ id.to_s + "_CHA12345"} + 1500.0 + + eof + + return result + end + + def getSavingsAccount(id) + print "Ruby - AccountDataServiceImpl.getSavingsAccount ", id, "\n" + + result = Document.new <<-eof + + #{ id.to_s + "_SAA12345"} + 1500.0 + + eof + + return result + end + + def getStockAccount(id) + print "Ruby - AccountDataServiceImpl.getStockAccount ", id, "\n" + + result = Document.new <<-eof + + #{ id.to_s + "_STA12345"} + IBM + 100 + + + eof + + return result + end + +end diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/AccountService.wsdl b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/AccountService.wsdl new file mode 100644 index 0000000000..b83c453462 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/AccountService.wsdl @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/AccountServiceImpl.rb b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/AccountServiceImpl.rb new file mode 100644 index 0000000000..aab789ca13 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/AccountServiceImpl.rb @@ -0,0 +1,82 @@ +# 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. +# + +require "rexml/document" +include REXML + +class AccountServiceImpl + + attr_writer :accountDataService + attr_writer :stockQuoteService + attr_writer :currency + + def initialize() + print "Ruby - AccountServiceImpl.initialize\n" + end + + def getAccountReport(customerID) + + # Get the checking account info + checking = @accountDataService.getCheckingAccount(customerID) + + # Get the savings account info + savings = @accountDataService.getSavingsAccount(customerID) + + # Get the stocks account info + stock = @accountDataService.getStockAccount(customerID); + symbol = stock.root.elements["symbol"].text + quantity = stock.root.elements["quantity"].text + + # Get the stock price + price = @stockQuoteService.getQuote(symbol); + + # Convert to the configured currency + price = price.to_f * 0.80 if @currency == "EUR" + + # Calculate the balance + balance = price.to_f * quantity.to_f + + # Form the AccountReport document + report = Document.new <<-eof + + + + #{ checking.root.elements["accountNumber"].text } + #{ checking.root.elements["balance"].text } + + + + #{ savings.root.elements["accountNumber"].text } + #{ savings.root.elements["balance"].text } + + + + #{ stock.root.elements["accountNumber"].text } + #{ symbol } + #{ quantity } + #{ balance } + + + + eof + + return report + end + +end diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/Makefile.am b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/Makefile.am new file mode 100644 index 0000000000..6e5ec38414 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/Makefile.am @@ -0,0 +1,24 @@ +# 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. + +deploydir=$(prefix)/RubyBigBank/deploy +compositedir=$(deploydir)/bigbank.account + +composite_SCRIPTS = runwsserver.sh + +composite_DATA = *.composite *.wsdl *.xsd *.rb +EXTRA_DIST = *.composite *.wsdl *.xsd runwsserver.sh *.rb diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/StockQuoteServiceImpl.rb b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/StockQuoteServiceImpl.rb new file mode 100644 index 0000000000..7f8634072c --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/StockQuoteServiceImpl.rb @@ -0,0 +1,52 @@ +# 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. +# + +require "rexml/document" +include REXML + +class StockQuoteServiceImpl + + attr_writer :webService + + def initialize() + print "Ruby - StockQuoteServiceImpl.initialize\n" + end + + def getQuote(symbol) + print "Ruby - StockQuoteServiceImpl.getQuote ", symbol, "\n" + + price = 0 + catch (:RuntimeError) do + begin + + result = @webService.GetQuote(symbol) + doc = Document.new(result) + price = doc.root.elements["Stock"].elements["Last"].text; + + rescue + # offline or StockQuote web service is down + price = 95.0 + end + end + + print "Ruby - stock price = ", price, "\n" + + return price.to_f + end + +end \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/StockQuoteTypes.xsd b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/StockQuoteTypes.xsd new file mode 100644 index 0000000000..2f7012b5fb --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/StockQuoteTypes.xsd @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/StockQuoteWebService.wsdl b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/StockQuoteWebService.wsdl new file mode 100644 index 0000000000..c14f97c87b --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/StockQuoteWebService.wsdl @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get Stock quote for a company Symbol + + + + + + + + + + Get Stock quote for a company Symbol + + + + + + + + + + Get Stock quote for a company Symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/bigbank.account.composite b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/bigbank.account.composite new file mode 100644 index 0000000000..8fff8425a1 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/bigbank.account.composite @@ -0,0 +1,53 @@ + + + + + + + + + + + AccountServiceComponent + + + + + AccountDataServiceComponent + StockQuoteServiceComponent + USD + + + + + + + + + StockQuoteWebService + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/runwsserver.bat b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/runwsserver.bat new file mode 100644 index 0000000000..3ab4275436 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/runwsserver.bat @@ -0,0 +1,51 @@ +@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 "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) +echo Using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) +echo Using SDO installed at %TUSCANY_SDOCPP% + +if "%AXIS2C_HOME%" == "" ( +echo "AXIS2C_HOME not set" +goto end +) +echo Using Axis2C installed at %AXIS2C_HOME% + +set APFULLDIR=%~d0%~p0 +set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ +set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +rem Run the server +set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SCACPP%\extensions\cpp\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% + +cd %AXIS2C_HOME%\bin +.\axis2_http_server.exe + +:end +endlocal diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/runwsserver.sh b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/runwsserver.sh new file mode 100755 index 0000000000..e3bbca46c6 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.account/runwsserver.sh @@ -0,0 +1,46 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$AXIS2C_HOME = x ]; then +echo "AXIS2C_HOME not set" +exit; +fi +echo "Using Axis2C installed at $AXIS2C_HOME" + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/cpp/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ +export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +cd $AXIS2C_HOME/bin +./axis2_http_server diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.app.composite b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.app.composite new file mode 100644 index 0000000000..dd94e61e5b --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.app.composite @@ -0,0 +1,33 @@ + + + + + + + + + + + + bigbank.AccountManagementComponent/AccountService + + + diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.client/AccountClient.rb b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.client/AccountClient.rb new file mode 100644 index 0000000000..31c0acc909 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.client/AccountClient.rb @@ -0,0 +1,40 @@ +# 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. +# +# + +require("tuscany_sca_ruby") + +accountService = SCA::locateService("AccountServiceComponent") + +report = accountService.getAccountReport(1234) + +checking = report.root.elements["checking"] +savings = report.root.elements["savings"] +stocks = report.root.elements["stocks"] + +print "\n" +print "Checking account: ", checking.elements["accountNumber"].text.strip, "\n" +print "Balance: ", checking.elements["balance"].text.strip, "\n" + +print "Savings account: ", savings.elements["accountNumber"].text.strip, "\n" +print "Balance: ", savings.elements["balance"].text.strip, "\n" + +print "Stocks account:", stocks.elements["accountNumber"].text.strip, "\n" +print "Symbol: ", stocks.elements["symbol"].text.strip, "\n" +print "Quantity: ", stocks.elements["quantity"].text.strip, "\n" +print "Balance: ", stocks.elements["balance"].text.strip, "\n" diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.client/Makefile.am b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.client/Makefile.am new file mode 100644 index 0000000000..4e4936746a --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.client/Makefile.am @@ -0,0 +1,23 @@ +# 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. + +deploydir=$(prefix)/RubyBigBank/deploy +clientdir=$(deploydir)/bigbank.client + +client_DATA = *.rb +client_SCRIPTS = runclient.sh +EXTRA_DIST = runclient.sh *.rb diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.client/runclient.bat b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.client/runclient.bat new file mode 100644 index 0000000000..0495237f7f --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.client/runclient.bat @@ -0,0 +1,51 @@ +@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 "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) +echo Using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) +echo Using SDO installed at %TUSCANY_SDOCPP% + +if "%AXIS2C_HOME%" == "" ( +echo "AXIS2C_HOME not set" +goto end +) +echo Using Axis2C installed at %AXIS2C_HOME% + +rem Run the client +set PATH=%TUSCANY_SCACPP%\extensions\ruby\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% + +set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ +set TUSCANY_SCACPP_COMPONENT=bigbank.AccountManagementComponent +set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +cd %TUSCANY_SCACPP_ROOT%\bigbank.client +ruby -I%TUSCANY_SCACPP%\extensions\ruby\bin AccountClient.rb + +:end +endlocal diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.client/runclient.sh b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.client/runclient.sh new file mode 100755 index 0000000000..94d5cd6ff8 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.client/runclient.sh @@ -0,0 +1,48 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$AXIS2C_HOME = x ]; then +echo "AXIS2C_HOME not set" +exit; +fi +echo "Using Axis2C installed at $AXIS2C_HOME" + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/ruby/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ +export TUSCANY_SCACPP_COMPONENT=bigbank.AccountManagementComponent +export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +cd $TUSCANY_SCACPP_ROOT/bigbank.client +ruby -I$TUSCANY_SCACPP/extensions/ruby/lib AccountClient.rb diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/AccountService.wsdl b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/AccountService.wsdl new file mode 100644 index 0000000000..b83c453462 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/AccountService.wsdl @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/AccountWSClient.rb b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/AccountWSClient.rb new file mode 100644 index 0000000000..6775b80f7a --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/AccountWSClient.rb @@ -0,0 +1,40 @@ +# 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. +# +# + +require("tuscany_sca_ruby") + +accountService = SCA::locateService("AccountService") + +report = accountService.getAccountReport(1234) + +checking = report.root.elements["checking"] +savings = report.root.elements["savings"] +stocks = report.root.elements["stocks"] + +print "\n\n" +print "Checking account #: ", checking.elements["accountNumber"].text.strip, "\n" +print "Balance: ", checking.elements["balance"].text.strip, "\n" + +print "Savings account #: ", savings.elements["accountNumber"].text.strip, "\n" +print "Balance: ", savings.elements["balance"].text.strip, "\n" + +print "Stocks account #:", stocks.elements["accountNumber"].text.strip, "\n" +print "Symbol: ", stocks.elements["symbol"].text.strip, "\n" +print "Quantity: ", stocks.elements["quantity"].text.strip, "\n" +print "Balance: ", stocks.elements["balance"].text.strip, "\n" diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/Makefile.am b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/Makefile.am new file mode 100644 index 0000000000..23f8b55959 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/Makefile.am @@ -0,0 +1,23 @@ +# 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. + +deploydir=$(prefix)/RubyBigBank/deploy +clientdir=$(deploydir)/bigbank.wsclient + +client_DATA = *.rb *.composite *.wsdl +client_SCRIPTS = runwsclient.sh +EXTRA_DIST = runwsclient.sh *.rb *.composite *.wsdl diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/bigbank.wsclient.composite b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/bigbank.wsclient.composite new file mode 100644 index 0000000000..f484a2fc7c --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/bigbank.wsclient.composite @@ -0,0 +1,29 @@ + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/runwsclient.bat b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/runwsclient.bat new file mode 100644 index 0000000000..6e1bb27b4a --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/runwsclient.bat @@ -0,0 +1,51 @@ +@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 "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) +echo Using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) +echo Using SDO installed at %TUSCANY_SDOCPP% + +if "%AXIS2C_HOME%" == "" ( +echo "AXIS2C_HOME not set" +goto end +) +echo Using Axis2C installed at %AXIS2C_HOME% + +rem Run the client +set PATH=%TUSCANY_SCACPP%\extensions\ruby\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% + +set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ +set TUSCANY_SCACPP_COMPONENT=bigbank.AccountWSClientComponent +set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +cd %TUSCANY_SCACPP_ROOT%\bigbank.wsclient +ruby -I%TUSCANY_SCACPP%\extensions\ruby\bin AccountWSClient.rb + +:end +endlocal diff --git a/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/runwsclient.sh b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/runwsclient.sh new file mode 100755 index 0000000000..d50e6a4b0a --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyBigBank/bigbank.wsclient/runwsclient.sh @@ -0,0 +1,48 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$AXIS2C_HOME = x ]; then +echo "AXIS2C_HOME not set" +exit; +fi +echo "Using Axis2C installed at $AXIS2C_HOME" + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/ruby/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ +export TUSCANY_SCACPP_COMPONENT=bigbank.AccountWSClientComponent +export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +cd $TUSCANY_SCACPP_ROOT/bigbank.wsclient +ruby -I$TUSCANY_SCACPP/extensions/ruby/lib AccountWSClient.rb diff --git a/sca-cpp/trunk/contrib/samples/RubyCalculator/Makefile.am b/sca-cpp/trunk/contrib/samples/RubyCalculator/Makefile.am new file mode 100644 index 0000000000..246ea1852f --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyCalculator/Makefile.am @@ -0,0 +1,21 @@ +# 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. + +deploydir=$(prefix)/RubyCalculator/deploy +SUBDIRS = sample.calculator sample.calculator.client +EXTRA_DIST = *.composite README.html +deploy_DATA = *.composite diff --git a/sca-cpp/trunk/contrib/samples/RubyCalculator/README b/sca-cpp/trunk/contrib/samples/RubyCalculator/README new file mode 100644 index 0000000000..670f561dc1 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyCalculator/README @@ -0,0 +1,20 @@ +Tuscany SCA for C++ Samples - Calculator Sample +=============================================== + +This is a very simple sample to show how an SCA composite can wire together +two components to implement a Calculator service and expose that service as +a Web Service. + +There are two sub projects in this workspace: + - sample.calculator + This contains the source code and SCDL artifacts for the SCA Calculator. + composite implementing the sample Calculator. + + - sample.calculator.client + A sample client which does a local call to the Calculator service. + +Additionally, there is the sample.calculator.app.composite file. This +describes the configuration of the SCA Calculator composite deployed to the +SCA runtime. + +See the README.html file for instructions to build and run this sample diff --git a/sca-cpp/trunk/contrib/samples/RubyCalculator/README.html b/sca-cpp/trunk/contrib/samples/RubyCalculator/README.html new file mode 100644 index 0000000000..bb6fe7e0ea --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyCalculator/README.html @@ -0,0 +1,187 @@ + + + + + + + + + + + + Tuscany SCA Native Samples - Ruby Calculator Sample + + + +
      +
      +
      +

      Tuscany SCA Native Samples - Ruby Calculator Sample

      + +

      This is a very simple sample to show how an SCA composite can wire + together two Ruby components to implement a Calculator service and invoke + the service via a local client. +

      +

      There are two sub projects in this workspace:

      +
        +
      • sample.calculator
        + This contains the Ruby scripts and SCDL artifacts for the SCA Calculator + composite implementing the sample Calculator. +
      • +
      • sample.calculator.client
        + A sample client which does a local call to the Calculator service. +
      • +
      +

      Additionally, there is the sample.calculator.app.composite file. This + describes the configuration of the SCA Calculator composite deployed to the SCA + runtime. +

      +
      + + + + +
      +

      Building the Ruby samples on Linux and Mac OS X

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
      2. + +
      3. As the Ruby Calculator sample is based on Ruby scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the Ruby samples only with the following command sequence: +
          +
        • cd <tuscany_sca_install_dir>/samples
        • +
        • ./configure --enable-ruby --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
        • +
        • make install
        • +
        + NOTE: If you don't provide the --prefix configure option, it will by default install into + /usr/local/tuscany/sca/samples/RubyCalculator
      4. +
      +
      + +
      +

      Running the Ruby Calculator sample on Linux and Mac OS X

      +
        +
      1. The Ruby Calculator sample requires the following extension: + + Please follow the documentation to ensure you have this extension built and installed + on your system +
      2. + +
      3. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        +
      4. +
      5. Run the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>/samples/RubyCalculator/deploy/sample.calculator.client
        • +
        • ./runclient.sh
        • +
        +
      6. +
      +
      + +
      +

      Building the Ruby Calculator sample on Windows

      +

      If using the binary distribution the samples are built and installed in + <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      +
        +
      1. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        +
      2. +
      3. As this sample is based on Ruby scripts, a specific compilation step is not necessary - + only deployment is required. Deploy the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>\samples\RubyCalculator
        • +
        • deploy.bat
        • +
        +
      4. +
      +
      + +
      +

      Running the Ruby Calculator sample on Windows

      +
        +
      1. The Ruby Calculator sample requires the following extension: + + Please follow the documentation to ensure you have this extension built and installed + on your system +
      2. +
      3. The following environment variables are required: +
          +
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • +
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • +
        +
      4. +
      5. Run the sample with the following commands: +
          +
        • cd <tuscany_sca_install_dir>\samples\RubyCalculator\deploy\sample.calculator.client
        • +
        • runclient.bat
        • +
        +
      6. +
      +
      + +
      +

      Getting Help

      + +

      The first place to look is at the Tuscany SCA FAQ at + http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      + +

      Any problem with this release can be reported to the Tuscany + mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      + +
      +
      +
      + + + + diff --git a/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.app.composite b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.app.composite new file mode 100644 index 0000000000..ada4d89a1c --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.app.composite @@ -0,0 +1,28 @@ + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.client/CalculatorClient.rb b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.client/CalculatorClient.rb new file mode 100644 index 0000000000..253928df0c --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.client/CalculatorClient.rb @@ -0,0 +1,25 @@ +# 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. +# +# + +require("tuscany_sca_ruby") + +calculator = SCA::locateService("CalculatorComponent") + +x = calculator.div(5, 2) +print x, "\n" diff --git a/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.client/Makefile.am b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.client/Makefile.am new file mode 100644 index 0000000000..38f61539d3 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.client/Makefile.am @@ -0,0 +1,23 @@ +# 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. + +deploydir=$(prefix)/RubyCalculator/deploy +clientdir=$(deploydir)/sample.calculator.client + +client_DATA = *.rb +client_SCRIPTS = runclient.sh +EXTRA_DIST = runclient.sh *.rb diff --git a/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.client/runclient.bat b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.client/runclient.bat new file mode 100644 index 0000000000..4a1079986a --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.client/runclient.bat @@ -0,0 +1,44 @@ +@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 "%TUSCANY_SCACPP%" == "" ( +echo "TUSCANY_SCACPP not set" +goto end +) +echo using SCA installed at %TUSCANY_SCACPP% + +if "%TUSCANY_SDOCPP%" == "" ( +echo "TUSCANY_SDOCPP not set" +goto end +) +echo using SDO installed at %TUSCANY_SDOCPP% + +set PATH=%TUSCANY_SCACPP%\extensions\ruby\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%PATH% + +set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ +set TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent +set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +cd %TUSCANY_SCACPP_ROOT%\sample.calculator.client +ruby -I%TUSCANY_SCACPP%\extensions\ruby\bin CalculatorClient.rb + +:end +endlocal diff --git a/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.client/runclient.sh b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.client/runclient.sh new file mode 100755 index 0000000000..bc2d6c0904 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator.client/runclient.sh @@ -0,0 +1,42 @@ +#!/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$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/ruby/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ +export TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent +export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 + +cd $TUSCANY_SCACPP_ROOT/sample.calculator.client +ruby -I$TUSCANY_SCACPP/extensions/ruby/lib CalculatorClient.rb diff --git a/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/Calculator.wsdl b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/Calculator.wsdl new file mode 100644 index 0000000000..331b996ba2 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/Calculator.wsdl @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/CalculatorImpl.rb b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/CalculatorImpl.rb new file mode 100644 index 0000000000..36ed15ff9b --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/CalculatorImpl.rb @@ -0,0 +1,48 @@ +# 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. +# +# + +class CalculatorImpl + + attr_writer :divideService + + def initialize() + print "Ruby - CalculatorImpl.initialize\n" + end + + def div(arg1, arg2) + print "Ruby - CalculatorImpl.div\n" + @divideService.divide(arg1.to_f, arg2.to_f) + end + + def add(arg1, arg2) + print "Ruby - CalculatorImpl.add\n" + arg1.to_f + arg2.to_f + end + + def sub(arg1, arg2) + print "Ruby - CalculatorImpl.sub\n" + arg1.to_f - arg2.to_f + end + + def mul(arg1, arg2) + print "Ruby - CalculatorImpl.mul\n" + arg1.to_f * arg2.to_f + end + +end \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/DivideImpl.rb b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/DivideImpl.rb new file mode 100644 index 0000000000..c6615bfcfa --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/DivideImpl.rb @@ -0,0 +1,39 @@ +# 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. +# +# + +class DivideImpl + + attr_writer :round + + def initialize() + print "Ruby - DivideImpl.initialize\n" + end + + def divide(arg1, arg2) + print "Ruby - DivideImpl.divide ", arg1, " / ", arg2, "\n" + res = arg1.to_f / arg2.to_f + if @round then + res = res.round + print "DivideImpl.divide rounding\n" + end + print "DivideImpl.divide ", res, "\n" + res + end + +end \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/Makefile.am b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/Makefile.am new file mode 100644 index 0000000000..7de5b9fdd3 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/Makefile.am @@ -0,0 +1,22 @@ +# 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. + +deploydir=$(prefix)/RubyCalculator/deploy +compositedir=$(deploydir)/sample.calculator + +composite_DATA = *.composite *.wsdl *.rb +EXTRA_DIST = *.composite *.wsdl *.rb diff --git a/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/sample.calculator.composite b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/sample.calculator.composite new file mode 100644 index 0000000000..d77ba538fe --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/RubyCalculator/sample.calculator/sample.calculator.composite @@ -0,0 +1,34 @@ + + + + + + + + DivideComponent + + + + + true + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.demo.app.composite b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.demo.app.composite new file mode 100644 index 0000000000..3b8738a843 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.demo.app.composite @@ -0,0 +1,34 @@ + + + + + + + + supplychain.Retailer/RetailerService + supplychain.Logging/LoggingService + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.demo/DemoClientImpl.componentType b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.demo/DemoClientImpl.componentType new file mode 100644 index 0000000000..a63e4c37d3 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.demo/DemoClientImpl.componentType @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.demo/supplychain.demo.composite b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.demo/supplychain.demo.composite new file mode 100644 index 0000000000..20b0e49ec1 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.demo/supplychain.demo.composite @@ -0,0 +1,41 @@ + + + + + + + + retailer + logging + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.logging/LoggerImpl.componentType b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.logging/LoggerImpl.componentType new file mode 100644 index 0000000000..e78e602635 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.logging/LoggerImpl.componentType @@ -0,0 +1,28 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.logging/LoggingFacility.wsdl b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.logging/LoggingFacility.wsdl new file mode 100644 index 0000000000..c78357b1a8 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.logging/LoggingFacility.wsdl @@ -0,0 +1,37 @@ + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.logging/supplychain.logging.composite b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.logging/supplychain.logging.composite new file mode 100644 index 0000000000..2b28c8f9e2 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.logging/supplychain.logging.composite @@ -0,0 +1,34 @@ + + + + + + + + + Logger/Logging + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturer/Manufacturer.wsdl b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturer/Manufacturer.wsdl new file mode 100644 index 0000000000..fb0c8a5676 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturer/Manufacturer.wsdl @@ -0,0 +1,39 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturer/ManufacturerImpl.componentType b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturer/ManufacturerImpl.componentType new file mode 100644 index 0000000000..63530bc0ee --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturer/ManufacturerImpl.componentType @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturer/WarehouseCallback.wsdl b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturer/WarehouseCallback.wsdl new file mode 100644 index 0000000000..256671f64f --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturer/WarehouseCallback.wsdl @@ -0,0 +1,38 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturer/supplychain.manufacturer.composite b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturer/supplychain.manufacturer.composite new file mode 100644 index 0000000000..c61657c0a7 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturer/supplychain.manufacturer.composite @@ -0,0 +1,50 @@ + + + + + + + + + ManufacturerProcess/ManufacturerService + + + + + + + callback + logging + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturerA.app.composite b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturerA.app.composite new file mode 100644 index 0000000000..1963304b83 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturerA.app.composite @@ -0,0 +1,30 @@ + + + + + + + + supplychain.Logging/LoggingService + manufacturerA + + + diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturerB.app.composite b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturerB.app.composite new file mode 100644 index 0000000000..a2f9141f00 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturerB.app.composite @@ -0,0 +1,30 @@ + + + + + + + + supplychain.Logging/LoggingService + manufacturerB + + + diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturerC.app.composite b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturerC.app.composite new file mode 100644 index 0000000000..a48258b6ca --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.manufacturerC.app.composite @@ -0,0 +1,30 @@ + + + + + + + + supplychain.Logging/LoggingService + manufacturerC + + + diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.retailer.app.composite b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.retailer.app.composite new file mode 100644 index 0000000000..734849de05 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.retailer.app.composite @@ -0,0 +1,66 @@ + + + + + + + + supplychain.WarehouseA/WarehouseService + supplychain.WarehouseB/WarehouseService + supplychain.WarehouseC/WarehouseService + supplychain.Logging/LoggingService + + + + + supplychain.manufacturerA/ManufacturerService + supplychain.Logging/LoggingService + warehouseA + + + + + supplychain.manufacturerB/ManufacturerService + supplychain.Logging/LoggingService + warehouseB + + + + + supplychain.manufacturerA/ManufacturerService + supplychain.Logging/LoggingService + warehouseC + + + + supplychain.manufacturerA/callback + supplychain.WarehouseA/WarehouseCallbackService + + + supplychain.manufacturerB/callback + supplychain.WarehouseB/WarehouseCallbackService + + + supplychain.manufacturerC/callback + supplychain.WarehouseC/WarehouseCallbackService + + + diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.retailer/Retailer.wsdl b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.retailer/Retailer.wsdl new file mode 100644 index 0000000000..39bd1963f2 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.retailer/Retailer.wsdl @@ -0,0 +1,39 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.retailer/RetailerImpl.componentType b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.retailer/RetailerImpl.componentType new file mode 100644 index 0000000000..fb381ec9a6 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.retailer/RetailerImpl.componentType @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.retailer/supplychain.retailer.composite b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.retailer/supplychain.retailer.composite new file mode 100644 index 0000000000..51a2b96b1b --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.retailer/supplychain.retailer.composite @@ -0,0 +1,46 @@ + + + + + + + + + RetailerProcess/RetailerService + + + + + warehouses + logging + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.warehouse/Warehouse.wsdl b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.warehouse/Warehouse.wsdl new file mode 100644 index 0000000000..a007f9957b --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.warehouse/Warehouse.wsdl @@ -0,0 +1,38 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.warehouse/WarehouseCallbackImpl.componentType b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.warehouse/WarehouseCallbackImpl.componentType new file mode 100644 index 0000000000..fbc1edb462 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.warehouse/WarehouseCallbackImpl.componentType @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.warehouse/WarehouseImpl.componentType b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.warehouse/WarehouseImpl.componentType new file mode 100644 index 0000000000..7f63d3b571 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.warehouse/WarehouseImpl.componentType @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.warehouse/supplychain.warehouse.composite b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.warehouse/supplychain.warehouse.composite new file mode 100644 index 0000000000..e44b964eb4 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/SupplyChain/supplychain.warehouse/supplychain.warehouse.composite @@ -0,0 +1,62 @@ + + + + + + + + + WarehouseProcess/WarehouseService + + + + + + WarehouseCallbackProcess/WarehouseCallbackService + + + + + + + manufacturer + logging + + + + + + logging + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/autogen.sh b/sca-cpp/trunk/contrib/samples/autogen.sh new file mode 100755 index 0000000000..18277601c8 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/autogen.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# 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. + +for i in "libtoolize --force" aclocal autoconf autoheader +do + echo -n "Running $i..." + $i || exit 1 + echo 'done.' +done + +echo -n 'Running automake...' +automake --add-missing +echo 'done.' +exit 0 + diff --git a/sca-cpp/trunk/contrib/samples/build.sh b/sca-cpp/trunk/contrib/samples/build.sh new file mode 100755 index 0000000000..c306d2a20d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/build.sh @@ -0,0 +1,22 @@ +#!/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. + +./configure.sh +make install + diff --git a/sca-cpp/trunk/contrib/samples/configure.ac b/sca-cpp/trunk/contrib/samples/configure.ac new file mode 100644 index 0000000000..41cd6f4dbe --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/configure.ac @@ -0,0 +1,206 @@ +# 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. + +dnl run autogen.sh to generate the configure script. + +AC_PREREQ(2.59) +AC_INIT(tuscany-sca-samples, 1.0-M3) +AC_CANONICAL_SYSTEM +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) +AC_PREFIX_DEFAULT(/usr/local/tuscany/sca/samples) + +# Checks for programs. +AC_PROG_CXX +AC_PROG_CC +AC_PROG_CPP +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PROG_LIBTOOL + +# Check for running on Darwin +AC_MSG_CHECKING([Checking if running on Darwin]) +UNAME=`uname -s` +if test "x$UNAME" = "xDarwin"; then + AC_DEFINE([IS_DARWIN], [1], [Set to 1 when running on Darwin - Mac OSX]) + AC_MSG_RESULT(yes) + AC_SUBST([libsuffix],[".dylib"]) + is_darwin=true +else + AC_MSG_RESULT(no) + AC_SUBST([libsuffix],[".so"]) + is_darwin=false +fi +AM_CONDITIONAL([DARWIN], [test x$is_darmin = xtrue]) + +# Checks for libraries. + +# Checks for header files. +AC_HEADER_DIRENT +AC_HEADER_STDC +AC_CHECK_HEADERS([inttypes.h stdlib.h string.h sys/time.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_HEADER_STDBOOL +AC_C_CONST +AC_C_INLINE + +# Checks for library functions. +AC_FUNC_CLOSEDIR_VOID +AC_FUNC_STAT +AC_FUNC_VPRINTF +AC_CHECK_FUNCS([getcwd putenv strdup]) + +# Configure TUSCANY_SCACPP and TUSCANY_SDOCPP +TUSCANY_SCACPP=`echo "$TUSCANY_SCACPP"` +if test "x$TUSCANY_SCACPP" = "x"; then + SCAPWD=`pwd` + AC_SUBST([TUSCANY_SCACPP], ["$SCAPWD/.."]) +fi + +TUSCANY_SDOCPP=`echo "$TUSCANY_SDOCPP"` +if test "x$TUSCANY_SDOCPP" = "x"; then + SCAPWD=`pwd` + AC_SUBST([TUSCANY_SDOCPP], ["$SCAPWD/../../sdo/deploy"]) +fi + +# Configure LIBXML2_INCLUDE and LIBXML2_LIB +LIBXML2_INCLUDE=`echo "$LIBXML2_INCLUDE"` +if test "x$LIBXML2_INCLUDE" = "x"; then + AC_SUBST([LIBXML2_INCLUDE], ["/usr/include/libxml2"]) +fi + +LIBXML2_LIB=`echo "$LIBXML2_LIB"` +if test "x$LIBXML2_LIB" = "x"; then + AC_SUBST([LIBXML2_LIB], ["/usr/lib"]) +fi + +# Configure GCC C++ compile options +AC_SUBST([CXXFLAGS], ["$(CXXFLAGS) -D_DEBUG -O0 -g3 -Wall -std=c++0x -fmessage-length=0"]) + +AC_MSG_CHECKING(whether to build all samples) +AC_ARG_ENABLE(all-samples, [AS_HELP_STRING([--enable-all-samples],[build all samples [default=no]])], +[ case "${enableval}" in + no) + AC_MSG_RESULT(no) + want_all_samples=false + ;; + *) + AC_MSG_RESULT(yes) + want_all_samples=true + ;; + esac ], +[ AC_MSG_RESULT(no) + want_all_samples=false ] +) +AM_CONDITIONAL([WANT_ALL_SAMPLES], [test x$want_all_samples = xtrue]) + +AC_MSG_CHECKING(whether to build C++ samples) +AC_ARG_ENABLE(cpp, [AS_HELP_STRING([--enable-cpp],[build C++ samples [default=yes]])], +[ case "${enableval}" in + no) + AC_MSG_RESULT(no) + want_cpp_samples=false + ;; + *) + AC_MSG_RESULT(yes) + want_cpp_samples=true + ;; + esac ], +[ AC_MSG_RESULT(yes) + want_cpp_samples=true ] +) +AM_CONDITIONAL([WANT_CPP_SAMPLES], [test x$want_cpp_samples = xtrue]) + +AC_MSG_CHECKING(whether to build Python samples) +AC_ARG_ENABLE(python, [AS_HELP_STRING([--enable-python],[build Python samples [default=no]])], +[ case "${enableval}" in + no) + AC_MSG_RESULT(no) + want_python_samples=false + ;; + *) + AC_MSG_RESULT(yes) + want_python_samples=true + ;; + esac ], +[ AC_MSG_RESULT(no) + want_python_samples=false ] +) +AM_CONDITIONAL([WANT_PYTHON_SAMPLES], [test x$want_python_samples = xtrue]) + +AC_MSG_CHECKING(whether to build Ruby samples) +AC_ARG_ENABLE(ruby, [AS_HELP_STRING([--enable-ruby],[build Ruby samples [default=no]])], +[ case "${enableval}" in + no) + AC_MSG_RESULT(no) + want_ruby_samples=false + ;; + *) + AC_MSG_RESULT(yes) + want_ruby_samples=true + ;; + esac ], +[ AC_MSG_RESULT(no) + want_ruby_samples=false ] +) +AM_CONDITIONAL([WANT_RUBY_SAMPLES], [test x$want_ruby_samples = xtrue]) + +AC_CONFIG_FILES([Makefile + AlertAggregator/Makefile + AlertAggregator/sample.alerter/Makefile + AlertAggregator/sample.display/Makefile + AlertAggregator/httpserver/Makefile + CppCalculator/Makefile + CppCalculator/sample.calculator/Makefile + CppCalculator/sample.calculator.client/Makefile + RubyCalculator/Makefile + RubyCalculator/sample.calculator/Makefile + RubyCalculator/sample.calculator.client/Makefile + PythonCalculator/Makefile + PythonCalculator/sample.calculator/Makefile + PythonCalculator/sample.calculator.client/Makefile + PythonWeatherForecast/Makefile + PythonWeatherForecast/sample.weather/Makefile + PythonWeatherForecast/sample.weather.client/Makefile + RestCalculator/Makefile + RestCalculator/sample.calculator/Makefile + RestCalculator/sample.calculator.restclient/Makefile + RestCalculator/httpserver/Makefile + RestCustomer/Makefile + RestCustomer/sample.customer/Makefile + RestCustomer/sample.customer.restclient/Makefile + RestCustomer/httpserver/Makefile + RestYahoo/Makefile + RestYahoo/sample.yahoo/Makefile + RestYahoo/sample.yahoo.client/Makefile + CppBigBank/Makefile + CppBigBank/bigbank.account/Makefile + CppBigBank/bigbank.client/Makefile + CppBigBank/bigbank.phpwsclient/Makefile + RubyBigBank/Makefile + RubyBigBank/bigbank.account/Makefile + RubyBigBank/bigbank.client/Makefile + RubyBigBank/bigbank.wsclient/Makefile + HttpdBigBank/Makefile + HttpdBigBank/bigbank.account/Makefile + HttpdBigBank/bigbank.accountdata/Makefile + HttpdBigBank/bigbank.wsclient/Makefile + HttpdBigBank/httpserver/Makefile + ]) +AC_OUTPUT diff --git a/sca-cpp/trunk/contrib/samples/runtest.sh b/sca-cpp/trunk/contrib/samples/runtest.sh new file mode 100755 index 0000000000..1c016a5287 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/runtest.sh @@ -0,0 +1,159 @@ +#!/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. + + +echo "Running CppCalculator client" +cd $TUSCANY_SCACPP/samples/CppCalculator/deploy/sample.calculator.client +r=`./runclient.sh | grep "div(5,2) = 2.5"` +if [ "x$r" == "x" ] +then + echo "CppCalculator client failed" +fi + +echo "Running CppCalculator wsclient" +cd $TUSCANY_SCACPP/samples/CppCalculator/deploy/sample.calculator +(./runwsserver.sh >/dev/null)& +cd $TUSCANY_SCACPP/samples/CppCalculator/deploy/sample.calculator.wsclient +r=`./runwsclient.sh | grep "Result = 2.500e+00"` +killall -q axis2_http_server >/dev/null +if [ "x$r" == "x" ] +then + echo "CppCalculator wsclient failed" +fi + +echo "Running CppBigBank client" +cd $TUSCANY_SCACPP/samples/CppBigBank/deploy/bigbank.client +r=`./runclient.sh | grep "Balance"` +if [ "x$r" == "x" ] +then + echo "CppBigBank client failed" +fi + +echo "Running CppBigBank wsclient" +cd $TUSCANY_SCACPP/samples/CppBigBank/deploy/bigbank.account +(./runwsserver.sh >/dev/null)& +cd $TUSCANY_SCACPP/samples/CppBigBank/deploy/bigbank.wsclient +r=`./runwsclient.sh | grep ""` +killall -q axis2_http_server >/dev/null +if [ "x$r" == "x" ] +then + echo "CppBigBank wsclient failed" +fi + +echo "Running RubyCalculator client" +cd $TUSCANY_SCACPP/samples/RubyCalculator/deploy/sample.calculator.client +r=`./runclient.sh | grep "^3"` +if [ "x$r" == "x" ] +then + echo "RubyCalculator client failed" +fi + +echo "Running RubyCalculator wsclient" +cd $TUSCANY_SCACPP/samples/RubyCalculator/deploy/sample.calculator +(./runwsserver.sh >/dev/null)& +cd $TUSCANY_SCACPP/samples/RubyCalculator/deploy/sample.calculator.wsclient +r=`./runwsclient.sh | grep "^3.0"` +killall -q axis2_http_server >/dev/null +if [ "x$r" == "x" ] +then + echo "RubyCalculator wsclient failed" +fi + +echo "Running RubyBigBank client" +cd $TUSCANY_SCACPP/samples/RubyBigBank/deploy/bigbank.client +r=`./runclient.sh | grep "Balance:"` +if [ "x$r" == "x" ] +then + echo "RubyBigBank client failed" +fi + +echo "Running RubyBigBank wsclient" +cd $TUSCANY_SCACPP/samples/RubyBigBank/deploy/bigbank.account +(./runwsserver.sh >/dev/null)& +cd $TUSCANY_SCACPP/samples/RubyBigBank/deploy/bigbank.wsclient +r=`./runwsclient.sh | grep "Balance:"` +killall -q axis2_http_server >/dev/null +if [ "x$r" == "x" ] +then + echo "RubyBigBank wsclient failed" +fi + +echo "Running PythonCalculator client" +cd $TUSCANY_SCACPP/samples/PythonCalculator/deploy/sample.calculator.client +r=`./runclient.sh | grep "div ( 5 , 2 ) = 3.0"` +if [ "x$r" == "x" ] +then + echo "PythonCalculator client failed" +fi + +echo "Running PythonCalculator wsclient" +cd $TUSCANY_SCACPP/samples/PythonCalculator/deploy/sample.calculator +(./runwsserver.sh >/dev/null)& +cd $TUSCANY_SCACPP/samples/PythonCalculator/deploy/sample.calculator.wsclient +r=`./runwsclient.sh | grep "div ( 5 , 2 ) = 3.0"` +killall -q axis2_http_server >/dev/null +if [ "x$r" == "x" ] +then + echo "PythonCalculator wsclient failed" +fi + +echo "Running PythonWeatherForecast client" +cd $TUSCANY_SCACPP/samples/PythonWeatherForecast/deploy/sample.weather.client +r=`./runclient.sh | grep "Latitude: 34.090107"` +if [ "x$r" == "x" ] +then + echo "PythonWeatherForecast client failed" +fi + +echo "Running HttpdBigBank wsclient" +cd $TUSCANY_SCACPP/samples/HttpdBigBank/deploy/httpserver +./startserver.sh >/dev/null +cd $TUSCANY_SCACPP/samples/HttpdBigBank/deploy/bigbank.wsclient +r=`./runwsclient.sh | grep "Balance:"` +cd $TUSCANY_SCACPP/samples/HttpdBigBank/deploy/httpserver +./stopserver.sh >/dev/null +if [ "x$r" == "x" ] +then + echo "HttpdBigBank wsclient failed" +fi + +echo "Running RestCalculator restclient" +cd $TUSCANY_SCACPP/samples/RestCalculator/deploy/httpserver +./startserver.sh >/dev/null +cd $TUSCANY_SCACPP/samples/RestCalculator/deploy/sample.calculator.restclient +r=`./runrestclient.sh | grep "^3"` +cd $TUSCANY_SCACPP/samples/RestCalculator/deploy/httpserver +./stopserver.sh >/dev/null +if [ "x$r" == "x" ] +then + echo "RestCalculator restclient failed" +fi + +echo "Running RestCustomer restclient" +cd $TUSCANY_SCACPP/samples/RestCustomer/deploy/httpserver +./startserver.sh >/dev/null +cd $TUSCANY_SCACPP/samples/RestCustomer/deploy/sample.customer.restclient +r=`./runrestclient.sh | grep "Command - Deleted customer 1234"` +cd $TUSCANY_SCACPP/samples/RestCustomer/deploy/httpserver +./stopserver.sh >/dev/null +if [ "x$r" == "x" ] +then + echo "RestCustomer restclient failed" +fi + diff --git a/sca-cpp/trunk/contrib/samples/scagen.bat b/sca-cpp/trunk/contrib/samples/scagen.bat new file mode 100644 index 0000000000..169855a0a9 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/scagen.bat @@ -0,0 +1,37 @@ +@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 copy the correct files from the source tree for packaging and +rem deployment of the SCA Calculator sample. + +setlocal + +if . == .%1 ( +echo source path not specified +goto usage +) +set srcdir=%1 + +%TUSCANY_SCACPP%\extensions\cpp\bin\scagen.bat -dir %srcdir% -output %srcdir% -verbose + +goto end +:usage +echo Usage: scagen +:end + +endlocal diff --git a/sca-cpp/trunk/doc/Axis2CWSExtension.html b/sca-cpp/trunk/doc/Axis2CWSExtension.html deleted file mode 100644 index 17b9676650..0000000000 --- a/sca-cpp/trunk/doc/Axis2CWSExtension.html +++ /dev/null @@ -1,498 +0,0 @@ - - - - - - - - - - - - Tuscany SCA Native - Axis2/C Web Services Extension - - - -
      -
      -
      -

      Tuscany SCA Native - Axis2/C Web Services Extension

      - -

      This document describes the installation, deployment and use of the Axis2/C Web Service - support in the Apache Tuscany SCA Native runtime. -

      -

      The WS service code is based on Apache - Axis2/C version 0.96 and allows SCA components to be invoked via Web - Service calls. -

      -

      WS service currently supports Document/literal Wrapped style Web Services - only. There are also restrictions about the parameter and return types of the - operations in SCA components that can be exposed as Web Services, see below - for more details. -

      -

      See the SCA - Web Service binding specification for more details about SCA Web - Service support. -

      -

      Also, see the samples for various - demonstrations of the use of the binding.ws service support. -

      -
      - - - -
      -

      System Requirements

      - -

      In order to install and use the Tuscany SCA Axis2/C Web Services Extension there are some - extra requirements in addition to the Tuscany - SCA requirements:

      - - - - - - - - - - - - - -
      SoftwareDownload Link
      Axis2/C version 0.96 - http://ws.apache.org/axis2/c/download.cgi
      - Please download and follow the installation instructions. Ensure you can run - the Axis2/C samples. -
      -
      - -
      -

      Installing the Tuscany SCA Axis2/C Extension

      -

      Getting the Tuscany SCA Axis2/C Extension working with the binary release on Linux and Mac OS X

      -
        -
      1. Ensure the AXIS2C_HOME environment variable is set to the Axis2/C installation
      2. -
      3. Deploy the Axis2/C Web Services extension by following the deployment steps
      4. -
      -

      Getting the Tuscany SCA Axis2/C Extension working with the source release on Linux and Mac OS X

      -
        -
      1. You will need the Tuscany SCA and SDO libraries - follow the instructions - here to build the SCA libraries and default extensions
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to built Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        • AXIS2C_HOME=<path to Axis2/C installation>
        • -
      4. -
      5. Build the Axis2/C source only with the following command sequence: -
          -
        • cd <tuscany_sca_install_dir>
        • -
        • ./configure --prefix=$TUSCANY_SCACPP --enable-wsbinding --enable-cpp=no
        • -
        • make
        • -
        • make install
        • -
        - NOTE: If you don't provide a --prefix configure option, it will by default install into - /usr/local/tuscany/sca
      6. -
      - -

      Getting the Tuscany SCA Axis2/C Extension working with the binary release on Windows

      -
        -
      1. Ensure the AXIS2C_HOME environment variable is set to the Axis2/C installation
      2. -
      3. Deploy the Axis2/C Web Services extension by following the deployment steps
      4. -
      -

      Getting the Tuscany SCA Axis2/C Extension working with the source release on Windows

      -
        -
      1. Unzip the supplied source zip file
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to built Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        • AXIS2C_HOME=<path to Axis2/C installation>
        • -
      4. -
      5. You must have set up the environment for Microsoft Visual C++ tools. The build command - will call vcvars32 to set the environment. Ensure the directory containing this is on your path. - This will be where you installed the compiler.
      6. -
      7. Build the source: -
          -
        • cd <to where you unzipped the source>
        • -
        • build
        • -
        - This will build all the projects and put the required output into the 'deploy' directory

        - Alternatively, open the workspace at <tuscany_sca_install_dir>/projects/tuscany_sca/tuscany_sca.dsw - in Visual Studio 6 or at at <tuscany_sca_install_dir>/projectsvc7/tuscany_sca/tuscany_sca.sln - in Visual Studio 7.1 - you can build projects individually - or build the samples to rebuild all the projects
      8. -
      -
      - - -
      -

      Deploying the Tuscany Web Service support to Axis2/C

      -

      Deploying via scripts

      -

      Tuscany provides simple shell scripts to deploy the Web Service support to Axis2/C. - However, the script will overwrite your Axis2/C axis.xml file, so if you - have altered your axis2.xml from the default provided by the Axis2/C distribution, it is - recommended that you follow the manual deployment steps - outlined below. -

      -

      To automatically deploy Tuscany Web Service support to Axis2/C on Linux and Mac OS X: -

        -
      1. The AXIS2C_HOME environment variable is required: -
          -
        • set AXIS2C_HOME=<path to axis2c version 0.96>
        • -
      2. -
      3. Use the following command sequence to run the deploy script: -
          -
        • cd <tuscany_sca_install_dir>/extensions/ws/service
        • -
        • ./deploy.sh
        • -
        -
      4. -
      -

      -

      To automatically deploy Tuscany Web Service support to Axis2/C on Windows: -

        -
      1. The AXIS2C_HOME environment variable is required: -
          -
        • export AXIS2C_HOME=<path to axis2c version 0.96>
        • -
      2. -
      3. Use the following command sequence to run the deploy script: -
          -
        • cd <tuscany_sca_install_dir>\extensions\ws\service
        • -
        • deploy.bat
        • -
        -
      4. -
      -

      - - -

      Deploying manually

      -

      To deploy Tuscany Web Service support to Axis2/C manually, use the following steps: -

      -
        -
      1. - Linux and Mac OS X: -
          -
        1. cd <axis2c version 0.96>/services
        2. -
        3. ln -sf <tuscany_sca_install_dir>/extensions/ws/service/services/tuscany
        4. -
        5. cd <axis2c version 0.96>/modules
        6. -
        7. ln -sf <tuscany_sca_install_dir>/extensions/ws/service/modules/tuscany
        8. -
        - Windows: -
          -
        1. Create a <axis2c version 0.96>\services\tuscany directory -
        2. -
        3. Copy all the files in <tuscany_sca_install_dir>\extensions\ws\service\services\tuscany - to the directory created above -
        4. -
        5. Create a <axis2c version 0.96>\modules\tuscany directory -
        6. -
        7. Copy all the files in <tuscany_sca_install_dir>\extensions\ws\service\modules\tuscany - to the directory created above -
        8. -
        -
      2. -
      3. Edit the <axis2c version 0.96>/axis2.xml file to add a <ref module="tuscany"> - element. This will register the above module. E.g.: -
        ...
        -    <!-- ================================================= -->
        -    <!-- Global Modules  -->
        -    <!-- ================================================= -->
        -    <!-- Comment this to disable Addressing -->
        -    <module ref="addressing"/>
        -
        -    <module ref="tuscany"/>
        -
        -...              
        -
      4. - -
      -
      - -
      -

      Deploying Axis2/C to the Apache HTTPD server

      -

      Follow the Axis2/C documentation - to deploy Axis2/C to Apache HTTPD. Also see the HTTPDBigBank - sample, which demonstrates running Axis2/C under Apache HTTPD.

      -
      - - -
      -

      Defining an SCA Composite with a WS service

      - -

      In this section we will use the Calculator sample as a worked example. - The Calculator code and files can be found at - <tuscany_sca_install_dir>samples/CppCalculator. -

      -

      Pre-requisites: -

        -
      • At least one working component within a composite and solution - composite. The component(s) can be implemented in C++, Ruby or Python. - If this includes C++ components, the SCAGEN generated Proxy and Wrapper - classes and the component class files must have been compiled into a - .dll or .so library. The *.composite and *.componentType files must - also be available and working. -
      • -
      -

      -
        -
      1. Optionally, create the WSDL that defines the interface of your SCA component. See the - table XML Schema Type to C++ Type Mapping and - Notes on creating WSDL below - for mapping the parameters and return types of the component operations to XML - schema types in the WSDL. This file will need to be accessible from the component, - so place it in the same directory as the component or in a subdirectory. -
        - See the <tuscany_sca_install_dir>/samples/CppCalculator/sample.calculator/Calculator.wsdl - file as an example. -
        - If you do not provide a WSDL file describing the service interface then the service will - accept any incoming document/literal wrapped XML request that matches an operation on the - target service (the wrapper element name and types of the sub-elements must match the operation - name and its parameter types). Additionally, if the target component is a Python or Ruby - scripting component, it will accept any parameter type so you can pretty much pass whatever - data you want, as long at the incoming XML request matches to an operation name with the - correct number of parameters on the target service. -
      2. -
      3. Add a service definition to the component .composite file. If you have created a WSDL - definition, set the interface.wsdl interface attribute to the namespace and port name - specified in the WSDL, in the form: "<namespace>#wsdl.interface(<port-name>)". - Link a reference from this service definition to your - component, give the service a name and set the multiplicity if required. -
        - E.g. for the Calculator component, based on the Calculator.wsdl file: -
        <service name="CalculatorService">
        -    <interface.wsdl interface="http://sample/calculator#wsdl.interface(Calculator)"/>
        -    <binding.ws/>
        -    <reference>CalculatorComponent/CalculatorService</reference>
        -</service>
        - If the Calculator.wsdl file were not included, the service definition would simply - be as follows: -
        <service name="CalculatorService">
        -    <binding.ws/>
        -    <reference>CalculatorComponent/CalculatorService</reference>
        -</service>
        -
      4. -
      5. You are now ready to start the Axis2/C HTTP server. Remember you will need to have the - TUSCANY_SCACPP, TUSCANY_SDOCPP and AXIS2C_HOME environment variables set, - as well as the SCA and SDO bin directories and the Axis2/C lib directory on - your PATH on Windows or the SCA, SDO and Axis2/C lib directories on - your LD_LIBRARY_PATH on Linux and your DYLD_LIBRARY_PATH on Mac OS X. - You will also need to set the TUSCANY_SCACPP_SYSTEM_ROOT - and TUSCANY_SCACPP_DEFAULT_COMPONENT environment variables to the - path to your SCA component directory structure and the default component respectively. - E.g. on Windows run the following commands: -
          -
        • set TUSCANY_SCACPP=C:/tuscany_sca
        • -
        • set TUSCANY_SDOCPP=C:/tuscany_sdo
        • -
        • set AXIS2C_HOME=C:/axis2c-bin-0.96-win32
        • -
        • set PATH=%PATH%;C:/tuscany_sca/bin;C:/tuscany_sdo/bin;C:/axis2c-bin-0.96-win32/lib
        • -
        • set TUSCANY_SCACPP_SYSTEM_ROOT=C:/tuscany_sca/samples/CppCalculator/deploy
        • -
        • set TUSCANY_SCACPP_DEFAULT_COMPONENT=sample.calculator.CalculatorComponent
        • -
        • cd %AXIS2C_HOME%/bin/
        • -
        • ./axis2_http_server.exe
        • -
        -
      6. -
      7. Optionally, enable Tuscany logging by setting the TUSCANY_SCACPP_LOGGING - environment variable with the level you wish to log at (0 for minimal - logging, up to 9 for more detailed logging) and the TUSCANY_SCACPP_LOG - environment variable to define the file to log to (if this is not set, - logging will go to the console). E.g. on Windows run the following - commands: -
          -
        • set TUSCANY_SCACPP_LOGGING=5
        • -
        • set TUSCANY_SCACPP_LOG=C:/tuscany/mylogfile.txt
        • -
        -
      8. -
      -

      Your component should now be exposed as an Axis2/C Web Service, via the WS - service you created. See the Axis2/C documentation for writing clients to - invoke the Web Service, or you can use any other Web Service client platform - (e.g. Axis2 for Java), or you can - invoke your service from another SCA application by using Tuscany's WS - reference support. -

      - -
      - -
      -

      XML Schema Type to C++ Type Mapping

      -

      To help define the WSDL that describes the interface of your component, the - table below lists how incoming XML data in Web Service messages is mapped to - C++ types used in the parameters and return types of your component operations. -

      -

      This lists the only C++ types that can currently be used on the operations of a - component exposed as a Web Service. For other types, use an SDO DataObject to - wrap the data, and define that wrapping as a complexType in the WSDL. See the - SDO - specifications for the C++ types that SDO supports. -

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      XML Schema TypeC++ Type
      stringstd::string
      intlong
      integerlong
      shortshort
      floatfloat
      doublelong double
      booleanbool
      hexBinarychar*
      base64Binarychar*
      bytechar
      complexTypecommonj::sdo::DataObjectPtr
      anycommonj::sdo::DataObjectPtr with OpenDataObjectType
      -
      - -
      -

      Notes on creating WSDL

      -

      Currently only Document/literal Wrapped style Web Services are supported by - WS EntryPoint, support for RPC style Web Services is planned for future - releases. -

      -

      See this article - for an explanation of Document/literal Wrapped style WSDL and Web Services -

      -

      Document/literal Wrapped services require that the operation name is used as - the name of the incoming element that wraps the operation parameters. Additionally, - operation parameter and return messages that are defined in the WSDL must be - XML Schema elements containing a complexType. -

      -

      For example, a component operation defined in C++ as: -

      long myOperation(std::string arg1, short arg2, DataObjectPtr arg3);
      - will need to be described in WSDL with messages like: -
      <wsdl:message name="myOperationRequestMsg">                                               
      -  <wsdl:part element="tns:myOperation" name="myOperationRequestPart"/>                    
      -</wsdl:message>                                                                           
      -<wsdl:message name="myOperationResponseMsg">                                              
      -  <wsdl:part element="tns:myOperationResponse" name="myOperationResponsePart"/>           
      -</wsdl:message>
      - and will need an XML schema to define the types like: -
      <xsd:element name="myOperation">                                                          
      - <xsd:complexType>                                                                       
      -   <xsd:sequence>                                                                        
      -     <xsd:element name="arg1" type="xsd:string" minOccurs="1"/>                          
      -     <xsd:element name="arg2" type="xsd:short" minOccurs="1"/>                           
      -     <xsd:element name="arg3" minOccurs="1">                                             
      -       <xsd:complexType>                                                                 
      -         <xsd:sequence>                                                                  
      -           <xsd:element name="dataObjectFloatData" type="xsd:float"/>                    
      -           <xsd:element name="dataObjectStringData" type="xsd:string"/>                  
      -           <xsd:element name="dataObjectIntData" type="xsd:int"/>                        
      -         </xsd:sequence>                                                                 
      -       </xsd:complexType>                                                                
      -     </xsd:element>                                                                      
      -   </xsd:sequence>                                                                       
      - </xsd:complexType>                                                                      
      -</xsd:element>                                                                            
      -                                                                                         
      -<xsd:element name="myOperationResponse">                                                  
      - <xsd:complexType>                                                                       
      -   <xsd:sequence>                                                                        
      -     <xsd:element name="result" type="xsd:int" minOccurs="1"/>                           
      -   </xsd:sequence>                                                                       
      - </xsd:complexType>                                                                      
      -</xsd:element>
      -
      - -
      -

      Getting Help

      - -

      First place to look is at the Tuscany FAQ at - http://incubator.apache.org/tuscany/faq.html

      - -

      Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      -
      -
      -
      - - - - diff --git a/sca-cpp/trunk/doc/CPPGeneratorTool.txt b/sca-cpp/trunk/doc/CPPGeneratorTool.txt deleted file mode 100644 index c004799791..0000000000 --- a/sca-cpp/trunk/doc/CPPGeneratorTool.txt +++ /dev/null @@ -1,362 +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. - - - -Tuscany SCA For C++ - scagen C++ generator tool -=============================================== - - -See cpp/build.txt in the parent directory or the cpp/sca/INSTALL file -for build instructions. - -Building the tools ------------------- - -NOTE: this is built and installed by the build step above. - -Currently, there is only one tool: "scagen". It can be built using the -ant build script at \tuscany\cpp\sca\tools\scagen\build.xml. -The default target "all" will build the java jars, documentation, -scripts and a zip file of the whole thing. This is all the ant -build tasks apart from "test" which runs all the junit tests. - -The ant build script can be altered to add the junit tests to the -default target. Replace the line - - - -The "test" task was not included in "all" as it requires a -junit jar file to run. This jar is available here: -http://www.junit.org/index.htm testing has been done with -Junit version 3.8.1. - -Running the scagen tool ------------------------ - -The scagen tool user interface is quite basic in this initial release. -It can be run from the scagen.jar file using "java -jar scagen.jar" -or from small scripts - scagen.bat for Windows and scagen.sh for Unix. -The parameters are: - -dir - -output - -e.g. - scagen -dir c:\mycomposites\composite1 -output c:\mycomposites\bld\composite1 - -What scagen does ----------------- - -The input directory passed to the scagen tools as -the -dir parameter method is taken to be the SCA -composite root directory. All the sca.composite and .fragment -files in that directory are inspected to resolve all -the elements within them. - -Each element found is inspected -to see if it has a element within it. - -Each element should have a -header attribute that represents a C++ header file -that contains function prototypes for the C++ -implementation of the service. An optional class -attribute can be used to select one class if more than -one that is present in the header file. The default -class is the one with the same name as the header file. -The tool will verify that the implementation header -contains an appropriate class prototype. - -The directory that contains the implementation header -should also contain a matching .componentType file for -the equivalent SCA component. So for example, a -MyServiceImpl.h file would have a corresponding -MyServiceImpl.componentType file in the same directory. - -Each componentType file is inspected for -and elements. For each element -that is found that contains a element -within it, - -the header attribute of the is taken -as the filename of the C++ interface header for the -SCA service. This C++ header file is opened and used -as a means for specifying the SCA service resulting -in an appropriate wrapper and proxy being generated -for this service interface. Both method bodies and h -eaders are generated in the given output directory. -The processing of a element is the same -except that only a proxy header and implementation -re generated. - - -Getting started with the code ------------------------------ - -The following is a list of tasks that are performed by the scagen tool -for each task we will describe technically how it is accomplished and -the location of the code that can be inspected/changed to alter the -behaviour. - -Here are the tasks listed, below is a paragraph for each one: - - o (Overall structure of the code) - o Walking the input directory - o Scanning the .composite and .fragment files - o finding the C++ implementation headers - o finding/checking the classname in the C++ implementation headers - o find the matching .componentTemplate files - o going into the componentTemplate files to extract the interface header filenames - o going into the interface header files and parsing them to extract the method signatures - into a network of objects we can inspect. - o taking all the meta data stored as objects and building a DOM for XSLT processing - o using XSLT to produce a proxy header - o using XSLT to produce a proxy implementation - o using XSLT to produce a wrapper header - o using XSLT to produce a wrapper implementation - - -Overall structure of the code ------------------------------ - -There are two packages org.apache.tuscany.sca.cpp.tools.common and -org.apache.tuscany.sca.cpp.tools.services. The ...common package is -taken from some existing code that was also contributed to axis that -was used to parse C++ code and do various tasks like insert trace. -This code was repackaged and shipped as a tuscany package but there -has been a desire not to change it significantly from the equivalent -org.apache.axis.tools.common package to leave the door open for -future convergence. - -Where the ...common package has been amended (for example to cope with -namespaces better or the provision of an Options.reset method to reset a static -variable and enable the tuscany junit tests to run independently) these -have been flagged with a "Tuscany" comment. The ...common package basically -provides two functions - 1) the ability to go into a directory (see DirectoryTree.java) -and process files that fit a particular filter (e.g. "*.hpp") by passing them to -implementer of the FileActor Interface (see the classes "Headers" for the -actor that processes C++ headers and "XMLFileActor" for the file actor that -processes the .componentType and sca.composite/fragment files.) - -The ...services package contains the majority of code written afresh for the -scagen tool including the subclasses of XMLFileActor (see ComponentTypeFileHandler.java -and CompositeOrFragmentFileHandler.java) that are the classes that tie this -package to the ...common package and which are called by the -DirectoryTree walker. - -Walking the composite root input directory ---------------------------------------- - -The main method of the scagen class creates an instance of -"DirectoryScanner" and registers with it a file handler of -type "CompositeOrFragmentFileHandler" for all files that end -in ".composite" or ".fragment". On calling the "walkTree" method -on the scanner it will in turn call the actOnFile method on the -CompositeOrFragmentFileHandler for appropriate files. - -Scanning the .composite and .fragment files ----------------------------------------- - -The scanning of these files by the respective "CompositeOrFragmentFileHandler" -and "ComponentTypeFileHandler" is mostly handled by the superclass -"XMLFileActor". This class will recursively goes through the whole -XML file and considers the name of the XML element it finds. -"XMLFileActor" contains a map of element names to element handlers -that will "flatten out" the structure of the XML file "above" the -level of node we are interested in. - -So for example the ComponentTypeFile handler sets up the handlers -map as follows: - - GenericDomNodeHandler gdnh = new GenericDomNodeHandler(); - handlers.put("componentType", gdnh); - handlers.put("interface.cpp", gdnh); - ServiceDomNodeHandler sdnh = new ServiceDomNodeHandler(); - handlers.put("service", sdnh); - - ReferenceDomNodeHandler rdnh = new ReferenceDomNodeHandler(); - handlers.put("reference", rdnh); - -The majority of processing done by these DomNOdeHandlers is to -place the attributes and values discovered into another map that -maps an (static version of) the XPath of a value to the value itself. -So for example "/componentType/service/interface.cpp/@header" might contain -the current ("root to here") value of the header attribute of the current -interface. - -Particular handlers for the "leaves" of this tree -such as ServiceDomNodeHandler and ReferenceDomNodeHandler -can then consume these values from the map without having -to be concerned with the actual names of things, -like the service name, appearing in the key. It should be -understood though that there are multiple values placed in the map -for one "key" as the processing works its way through the -XML tree. For example the processing of a second component will -overlay its data over the same keys as the first component. -(After "wiping" the appropriate subtree.) - -Finding the C++ implementation headers --------------------------------------- - -The "/composite/component/implementation.cpp/@header" and -is used to key into the name of the implementation header -and this is opened directly and passed to the -actOnFileMethod of a Headers object from the ...common package -bypassing the DirectoryScanner code. The path is relative to -the given (-dir option) composite root directory. - -Finding/checking the classname in the C++ implementation headers ------------------------------------------------------------------ - -This implementation header is not used to define the -methods of the SCA service but rather is opened to check - any given implementation.cpp/@class attribute -(or find out the name of the implementation class -in the header if this is not specified in the XML. This -is done using the same method that later parses the interface -C++ headers into java objects - we just them inspect the -class attribute of the "Signature" objects that represent the methods -we find in the header. - -Find the matching .componentType files ------------------------------------------- - -By SCA convention we go to the same directory as the implementation -files and look for the XXX.componentType files with the same name. -A instance of the ComponentDOMNodeHandler handles the data in the -Component Element and pre-creates a ComponentTypeFileHandler that -will eventually be called to process the .componentType file. This -object receives a number of "setParameter" calls to poke into it -matadata that is available prior/outside the the actual .componentType -file it will read. - -Go into the componentType files to extract the interface header filenames ------------------------------------------------------------------------------ - -We open up the .componentTemplateFiles with exactly the same -mechanism as we read the sca.composite/fragment file (by creating -a DOM and descending through it this time using a ComponentTypeFileHandler that it -has had various data values ( e.g. the implementation class and namespace used later) -poked into it. The ComponentTypeFileHandler itself has individual -handlers for the service and reference XML/DOM element/nodes -that is comes across (ServiceDomNodeHandler and ReferenceDomNodeHandler -respectively). Each these handlers will pull out the name of -a C++ interface header and use it to resolve the interface of the -SCA Service. - -Parsing the interface header files for signatures -------------------------------------------------- - -The Service/Reference DOM Node hander both call the - ServicesGenerator.handleInterfaceHeader(parameters, true); -method, the second parameter is used to differentiate -the call source as we don't need wrapper files for -SCA references (just proxies). - -The ServicesGenerator uses the Headers file actor from -the ...common package to create a List of Signature -objects that describe the interface methods in the C++ -header. - -Take all the meta data stored as objects and build a DOM --------------------------------------------------------- -We now have a List of Signature objects and a map that -represents the flattened information that we have pulled -from the XML files in the ServiceGenerator class. -We call a "createDOMofMethods" method -to consolidate all this information into one DOM -(this task should be split into more than one method as the -signature/parameter list of the method is too large). - -Use XSLT to produce the output files (Proxy/Wrapper headers and Implementations) --------------------------------------------------------------------------------- - -The ServicesGenerator.handleInterfaceHeader(parameters, forReference); -method closes of with the code: - - createProxyCPPFromDom(outputDir, dom); - createProxyHeaderFromDom(outputDir, dom); - - if (!forReference) { - createWrapperCPPFromDom(outputDir, dom); - createWrapperHeaderFromDom(outputDir, dom); - } - - -Each of the create methods sets up the output -file name and a different XSLT transform and calls -"createOutputFromDom" to transform/filter the data in the -"model" that is held in our DOM of the data to a particular -"view" as expressed in the C++ output file. - -The four XSLT style sheets are in rough order of the output -file and this corresponds very roughly to a depth first descent -of the DOM tree so, for example, we could have in a stylesheet: - -... - void* - ::newImplementation() - { - return new (target); - } - -which would be output as: - - void* MyClassImpl_MyClass_Proxy::newImplementation() - { - return new MyClassImpl(target) - } - -given appropriate valies for $class and "../@implClass" and -$class might be defined to be: -xsl:variable name="clazz"> - - _ - - _Proxy - - -giving "MyClassImpl_MyClass_Proxy" - -The stylesheets can be found in the xsl subdirectory of the -org.apache.tuscany.sca.cpp.tools.services package. - -Unit Testing Scagen Code Changes --------------------------------- - -The junit unit test - /tuscany/cpp/sca/tools/scagen/ - junit/org/apache/tuscany/sca/cpp/tools/junit/TestAllCompositesTest.java - -will dynamically look for all the subdirectores of the directory -path given by TuscanyTestCase.junit_composites and run the scagen -tool on them as if they were composites roots. - -By convention an "expected_output" directory is located -(see the CVS tree or the test program) and the actual -and expected results compared. This testcase is thus a -good first/basic regression test for any changes. - -New test cases can thus be added without having to write -any new junit java code by by creating new SCA composites and -the associated expected Scagen output - perhaps by using the tool -initially and checking the output is satisfactory before copying -it to the expected output directory at: - -/tuscany/cpp/sca/tools/scagen/junit/testoutput//expected_output -where input data is taken from -/tuscany/cpp/sca/tools/scagen/junit/testinput/composites/ diff --git a/sca-cpp/trunk/doc/CppExtension.html b/sca-cpp/trunk/doc/CppExtension.html deleted file mode 100644 index 6e7420a9d4..0000000000 --- a/sca-cpp/trunk/doc/CppExtension.html +++ /dev/null @@ -1,430 +0,0 @@ - - - - - - - - - - - - Tuscany SCA Native - Creating C++ SCA Components - - - -
      -
      -
      -

      Tuscany SCA Native - C++ Extension

      -

      The Tuscany C++ extension allows C++ classes to be used as components in - SCA composites and as clients that can invoke SCA services. -

      -

      This document describes how to build and install the C++ extension and create and run SCA - components in Tuscany SCA Native milestone release 3. -

      -

      See the SCA - C++ Client and Implementation specification for more details about the SCA C++ - programming model. -

      -

      See CppCalculator or - CppBigBank for samples that - demonstrate the use of C++ components -

      -
      - - -
      -

      System Requirements

      - -

      In order to install and use the Tuscany SCA C++ Extension there are some - extra requirements in addition to the Tuscany - SCA requirements:

      - - - - - - - - - - - - - - - - -
      SoftwareDownload Link
      Java SDK 1.4 or laterhttp://java.sun.com/javase/downloads
      - For building and running the SCAGEN code generation tool, which is used when developing - Tuscany SCA C++ components. Please download and follow the installation instructions
      Apache Ant 1.6 or laterhttp://ant.apache.org
      - For building the SCAGEN code generation tool. This is only required when building - the C++ extension from a source distribution of Tuscany SCA Native. - Please download and follow the installation instructions
      -
      - -
      -

      Installing the Tuscany SCA C++ Extension

      -

      Getting the Tuscany SCA C++ Extension working with the binary release on Linux and Mac OS X

      -
        -
      1. Add the <tuscany_sca_install_dir>/extensions/cpp/lib directory to the PATH environment variable
      2. -
      -

      Getting the Tuscany SCA C++ Extension working with the source release on Linux and Mac OS X

      -
        -
      1. You will need the Tuscany SCA kernel and SDO libraries - follow the instructions - here to build the SCA libraries and default extensions
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to built Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
      4. -
      5. Build the C++ source only with the following command sequence: -
          -
        • cd <tuscany_sca_install_dir>
        • -
        • ./configure --prefix=$TUSCANY_SCACPP --enable-cpp --enable-wsbinding=no
        • -
        • make
        • -
        • make install
        • -
        - NOTE: If you don't provide a --prefix configure option, it will by default install into - /usr/local/tuscany/sca
      6. -
      - -

      Getting the Tuscany SCA C++ Extension working with the binary release on Windows

      -
        -
      1. Add the <tuscany_sca_install_dir>/extensions/cpp/lib directory to the PATH environment variable
      2. -
      -

      Getting the Tuscany SCA C++ Extension working with the source release on Windows

      -
        -
      1. Unzip the supplied source zip file
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to built Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
      4. -
      5. You must have set up the environment for Microsoft Visual C++ tools. The build command - will call vcvars32 to set the environment. Ensure the directory containing this is on your path. - This will be where you installed the compiler.
      6. -
      7. Build the source: -
          -
        • cd <to where you unzipped the source>
        • -
        • build
        • -
        - This will build all the projects and put the required output into the 'deploy' directory

        - Alternatively, open the workspace at <tuscany_sca_install_dir>/projects/tuscany_sca/tuscany_sca.dsw - in Visual Studio 6 or at at <tuscany_sca_install_dir>/projectsvc7/tuscany_sca/tuscany_sca.sln - in Visual Studio 7.1 - you can build projects individually -
      8. Set the TUSCANY_SCACPP environment variable to point to the 'deploy' directory that was just created
      9. -
      -
      - -
      -

      Creating and deploying an SCA C++ Component

      -

      Each SCA C++ component needs: -

      -
        -
      • A service header file that defines the operations that can be invoked on the - component -
      • -
      • An implementation header file that defines the implementation and extends - the service header file -
      • -
      • A C++ implementation of the service that implements the operations defined - in the service header file -
      • -
      • Proxy and wrapper header and implementation files generated by the Tuscany - C++ SCAGEN tool -
      • -
      • A service definition in a .componentType file -
      • -
      • An SCDL component definition within an SCDL composite file. Usually this - composite file will contain multiple components configured and assembled together. -
      • -
      -

      Once these items are in place for each component in your composite, you will need to - deploy this composite to your SCA system. In this release we are - using the SCA recursive composition model to do this. You simply create another - SCDL component definition in a separate composite file that will represent the composite - you created above in the SCA system. Follow the steps below to see each of these items - being created and used. -

      -

      In this section we will use the Calculator sample as a worked example. - The Calculator code and files can be found at samples/CppCalculator and has been - developed further than the details specified below. In the interests of - readability, the example used below takes the simplest path. -

      -
        -
      1. Create the service header file that defines the operations your component - will implement. E.g. Calculator.h contains the following:
        -
        #ifndef CALCULATOR_H
        -#define CALCULATOR_H
        -class Calculator  
        -{
        -public:
        -    virtual float add(float arg1, float arg2) = 0;
        -    virtual float sub(float arg1, float arg2) = 0;
        -    virtual float mul(float arg1, float arg2) = 0;
        -    virtual float div(float arg1, float arg2) = 0;
        -};
        -
        -#endif
        -
      2. -
      3. Create the implementation header file that extends the service header file. - E.g. CalculatorImpl.h contains the following:
        -
        #ifndef CALCULATORIMPL_H
        -#define CALCULATORIMPL_H
        -
        -#include "Calculator.h"
        -
        -class CalculatorImpl : public Calculator
        -{
        -public:
        -    CalculatorImpl();
        -    virtual ~CalculatorImpl();
        -
        -    // Calculator interface
        -    virtual float add(float arg1, float arg2);
        -    virtual float sub(float arg1, float arg2);
        -    virtual float mul(float arg1, float arg2);
        -    virtual float div(float arg1, float arg2);
        -};
        -
        -#endif
        -
      4. -
      5. Create the implementation for the component based on the implementation - header file. E.g. CalculatorImpl.cpp contains the following code:
        -
        #include "CalculatorImpl.h"
        -#include 
        -
        -CalculatorImpl::CalculatorImpl()
        -{
        -}
        -    
        -CalculatorImpl::~CalculatorImpl()
        -{
        -}
        -
        -// Calculator interface
        -float CalculatorImpl::add(float arg1, float arg2)
        -{
        -    float result = arg1 + arg2;
        -
        -    printf("CalculatorImpl::add %f + %f = %f\n", arg1, arg2, result);
        -    return result;
        -}
        -
        -float CalculatorImpl::sub(float arg1, float arg2)
        -{
        -    float result = arg1 - arg2;
        -    printf("CalculatorImpl::sub %f - %f = %f\n", arg1, arg2, result);
        -    return result;
        -}
        -
        -float CalculatorImpl::div(float arg1, float arg2)
        -{
        -    float result = arg1 / arg2;
        -    printf("CalculatorImpl::div %f / %f = %f\n", arg1, arg2, result);
        -    return result;
        -}
        -	
        -float CalculatorImpl::mul(float arg1, float arg2)
        -{
        -    float result = arg1 * arg2;
        -    printf("CalculatorImpl::mul %f * %f = %f\n", arg1, arg2, result);
        -    return result;
        -}
        -
      6. -
      7. Create the componentType file for your component to define the service that - your component provides. The file must be named after your implementation - class and specifies the name of the service and the service header file - (which describes the service operations). E.g. CalculatorImpl.componentType - contains the following XML:
        -
        <componentType xmlns="http://www.osoa.org/xmlns/sca/1.0">
        -
        -	<service name="CalculatorService">
        -		<interface.cpp header="Calculator.h"/>
        -	</service>
        -
        -</componentType>
        -
      8. -
      9. Create a sample.calculator.composite file for your composite and define your - component within it. The component definition specifies the implementation - library to use (a .dll file on Windows, a .so file on Linux and a .dylib file on Mac OS X) and the - implementation header file (which describes the implementation class). Component - properties and references to other services can also be specified here. E.g. the - Calculator sample.calculator.composite file contains the following XML:
        -
        <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" 
        -	name="sample.calculator">
        -
        -	<component name="CalculatorComponent">
        -		<implementation.cpp library="Calculator" header="CalculatorImpl.h"/>
        -	</component>
        -
        -</composite>
        -
      10. -
      11. Generate the proxy and wrapper classes and header files using the SCAGEN - tool. These classes are used by the Tuscany SCA C++ runtime to enable - service implementations to be invoked from a client or another component. - Run the SCAGEN tool, specifying the directory where your header files, - sca.composite and componentType file are and the directory where you - want the generated files to be placed. E.g. on Windows, the - following command is run from the directory where Tuscany SCA is deployed:
        -
        ./extensions/cpp/bin/scagen.bat -dir ./samples/CppCalculator/sample.calculator -output ./samples/CppCalculator/sample.calculator
        - which produces the following files: -
          -
        • CalculatorImpl_CalculatorService_Proxy.h
        • -
        • CalculatorImpl_CalculatorService_Proxy.cpp
        • -
        • CalculatorImpl_CalculatorService_Wrapper.h
        • -
        • CalculatorImpl_CalculatorService_Wrapper.cpp
        • -
        -
      12. -
      13. Compile and link the code that has been written and generated. This will - produce a .dll or .so library file. The name should match the library name - specified in the sample.calculator.composite file. -
      14. -
      15. Create the sample.calculator.solution.composite file and define the Calculator composite - as a component within it. This is used to include the Calculator composite in the SCA system - and should specify the composite name used in the sample.calculator.composite file. - E.g. the Calculator sample.calculator.solution.composite - file contains the following XML:
        -
        <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
        -	name="sample.calculator.solution">
        -	
        -        <component name="sample.calculator.CalculatorComponent">
        -        	<implementation.composite name="sample.calculator" />
        -       	</component>
        -
        -</composite>
        -
      16. -
      17. Deploy the various files into the SCA directory structure, as follows: -
          -
        • <deploy_root>/CompositeName/CompositeName.composite
        • -
        • <deploy_root>/CompositeName/Implementation.componentType
        • -
        • <deploy_root>/CompositeName/Implementation.dll (or .so on Linux and .dylib on Mac OS X)
        • -
        • <deploy_root>/SolutionName.composite
        • -
        - E.g. for the Calculator sample the structure is: -
          -
        • samples/CppCalculator/deploy/sample.calculator/Calculator.h
        • -
        • samples/CppCalculator/deploy/sample.calculator/CalculatorImpl.h
        • -
        • samples/CppCalculator/deploy/sample.calculator/sample.calculator.composite
        • -
        • samples/CppCalculator/deploy/sample.calculator/CalculatorImpl.componentType
        • -
        • samples/CppCalculator/deploy/sample.calculator/Calculator.dll
        • -
        • samples/CppCalculator/deploy/sample.calculator.solution.composite
        • -
        -
      18. -
      19. Your component, composite and subsystem are now ready to be invoked. Create a - client that will call the service. E.g. the Calculator client (in the - CalculatorClient.cpp file) contains code similar to the following:
        -
        try
        -{
        -    // Locate the service
        -    CompositeContext myContext = CompositeContext::getCurrent();
        -    Calculator *calcService = (Calculator*) myContext.locateService("CalculatorComponent/CalculatorService");
        -    if (calcService == 0)
        -    {
        -        cout << "calculator_client: Unable to find Calculator service" << endl;
        -    }
        -    else
        -    {
        -        float result = calcService->add(arg1, arg2);
        -        cout << "calculator_client add(" << arg1 << "," << arg2 << ") = " << result << endl; 
        -    }
        -}
        -catch (ServiceRuntimeException& ex)
        -{
        -    cout << "calculator_client: Error whilst invoking Tuscany: " << 
        -            ex.getMessageText() << endl; 
        -}
        -
        -
      20. -
      21. Compile, link and run the client that has been created. You should - (hopefully!) see your component invoked. Remember you will need to have the - TUSCANY_SCACPP and TUSCANY_SDOCPP environment variables set, - as well as the SCA and SDO bin directories on - your PATH on Windows or the SCA and SDO lib directories on your LD_LIBRARY_PATH on Linux - and your DYLD_LIBRARY_PATH on Mac OS X. You will also need to set the TUSCANY_SCACPP_SYSTEM_ROOT - and TUSCANY_SCACPP_DEFAULT_COMPONENT environment variables to the - path to your SCA component directory structure and the default component respectively. - TUSCANY_SCACPP_SYSTEM_ROOT is the directory where the SCA runtime will look for any - .composite files and TUSCANY_SCACPP_DEFAULT_COMPONENT is the name of the base component - to be used by SCA clients or containers when finding services - this component must be - an instance of a composite (i.e. contain an <implementation.composite> element). -
        - E.g. on Windows run the following commands: -
          -
        • set TUSCANY_SCACPP=C:/tuscany_sca
        • -
        • set TUSCANY_SDOCPP=C:/tuscany_sdo
        • -
        • set PATH=%PATH%;C:/tuscany_sca/bin;C:/tuscany_sdo/bin
        • -
        • set TUSCANY_SCACPP_SYSTEM_ROOT=C:/tuscany_sca/samples/CppCalculator/deploy
        • -
        • set TUSCANY_SCACPP_DEFAULT_COMPONENT=sample.calculator.CalculatorComponent
        • -
        • ./calculator_client.exe
        • -
        -
      22. -
      23. Optionally, enable Tuscany logging by setting the TUSCANY_SCACPP_LOGGING - environment variable with the level you wish to log at (0 for minimal - logging, up to 9 for more detailed logging) and the TUSCANY_SCACPP_LOG - environment variable to define the file to log to (if this is not set, - logging will go to the console). E.g. on Windows run the following - commands: -
          -
        • set TUSCANY_SCACPP_LOGGING=5
        • -
        • set TUSCANY_SCACPP_LOG=C:/tuscany/mylogfile.txt
        • -
        -
      24. -
      -
      -
      -

      Getting Help

      - -

      First place to look is at the Tuscany FAQ at - http://incubator.apache.org/tuscany/faq.html

      - -

      Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      -
      -
      -
      - - - - diff --git a/sca-cpp/trunk/doc/Doxyfile.in b/sca-cpp/trunk/doc/Doxyfile.in index 8127448fd6..ba02d58a2a 100644 --- a/sca-cpp/trunk/doc/Doxyfile.in +++ b/sca-cpp/trunk/doc/Doxyfile.in @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -# Doxyfile 1.4.6 +# Doxyfile 1.6.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project @@ -31,535 +31,673 @@ # Project related configuration options #--------------------------------------------------------------------------- -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. -PROJECT_NAME = @PACKAGE_NAME@ +PROJECT_NAME = tuscany-sca -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = @PACKAGE_VERSION@ +PROJECT_NUMBER = 1.0-M3 -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = +OUTPUT_DIRECTORY = -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, -# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, -# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, -# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, -# Swedish, and Ukrainian. +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English -# This tag can be used to specify the encoding used in the generated output. -# The encoding is not always determined by the language that is chosen, -# but also whether or not the output is meant for Windows or non-Windows users. -# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES -# forces the Windows encoding (this is the default for the Windows binary), -# whereas setting the tag to NO uses a Unix-style encoding (the default for -# all platforms other than Windows). - -USE_WINDOWS_ENCODING = NO - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" -ABBREVIATE_BRIEF = +ABBREVIATE_BRIEF = -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the # path to strip. -STRIP_FROM_PATH = +STRIP_FROM_PATH = -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) -MULTILINE_CPP_IS_BRIEF = NO +QT_AUTOBRIEF = NO -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. -DETAILS_AT_TOP = NO +MULTILINE_CPP_IS_BRIEF = NO -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO -# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. -ALIASES = +ALIASES = -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to -# include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it parses. +# With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this tag. +# The format is ext=language, where ext is a file extension, and language is one of +# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, +# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat +# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = YES -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will rougly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = YES -# If the EXTRACT_STATIC tag is set to YES all static members of a file +# If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = NO -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = YES -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = YES -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = YES -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the +# Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES -# The ENABLED_SECTIONS tag can be used to enable conditional +# The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. -ENABLED_SECTIONS = +ENABLED_SECTIONS = -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from the -# version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by +# doxygen. The layout file controls the global structure of the generated output files +# in an output format independent way. The create the layout file that represents +# doxygen's defaults, run doxygen with the -l option. You can optionally specify a +# file name after the option, if omitted DoxygenLayout.xml will be used as the name +# of the layout file. + +LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- -# The QUIET tag can be used to turn on/off the messages that are generated +# The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = YES -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written # to stderr. -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = @top_builddir@/runtime - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: - - -#FILE_PATTERNS = *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py -FILE_PATTERNS = *.c *.cc *.cxx *.cpp *.c++ *.h *.hh *.hxx *.hpp *.h++ - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. +INPUT = ../kernel \ + ../modules + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. -EXCLUDE = +EXCLUDE = -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see # the \include command). -EXAMPLE_PATH = +EXAMPLE_PATH = -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left # blank all files are included. -EXAMPLE_PATTERNS = +EXAMPLE_PATTERNS = -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see # the \image command). -IMAGE_PATH = +IMAGE_PATH = -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be # ignored. -INPUT_FILTER = +INPUT_FILTER = -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. -FILTER_PATTERNS = +FILTER_PATTERNS = -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO @@ -568,46 +706,54 @@ FILTER_SOURCE_FILES = NO # configuration options related to source browsing #--------------------------------------------------------------------------- -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = YES -# Setting the INLINE_SOURCES tag to YES will include the body +# Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = YES -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES @@ -616,279 +762,393 @@ VERBATIM_HEADERS = YES # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = doxygen -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a # standard header. -HTML_HEADER = +HTML_HEADER = -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a # standard footer. -HTML_FOOTER = +HTML_FOOTER = -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! -HTML_STYLESHEET = +HTML_STYLESHEET = -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be # written to the html output directory. -CHM_FILE = +CHM_FILE = -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. -HHC_LOCATION = +HHC_LOCATION = -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO -# The TOC_EXPAND flag can be set to YES to add extra items for group members +# The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER +# are set, an additional index file will be generated that can be used as input for +# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated +# HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. +# For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's +# filter section matches. +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO -# This tag can be used to set the number of enum values (range [1..20]) +# This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. GENERATE_TREEVIEW = NO -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# When the SEARCHENGINE tag is enable doxygen will generate a search box for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP) +# there is already a search function so this one should typically +# be disabled. + +SEARCHENGINE = NO + #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. -EXTRA_PACKAGES = +EXTRA_PACKAGES = -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! -LATEX_HEADER = +LATEX_HEADER = -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO +# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = -# Set optional variables used in the generation of an rtf document. +# Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man -# The MAN_EXTENSION tag determines the extension that is added to +# The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO @@ -897,33 +1157,33 @@ MAN_LINKS = NO # configuration options related to the XML output #--------------------------------------------------------------------------- -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the # syntax of the XML files. -XML_SCHEMA = +XML_SCHEMA = -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the # syntax of the XML files. -XML_DTD = +XML_DTD = -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES @@ -932,10 +1192,10 @@ XML_PROGRAMLISTING = YES # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO @@ -944,311 +1204,338 @@ GENERATE_AUTOGEN_DEF = NO # configuration options related to the Perl module output #--------------------------------------------------------------------------- -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- -# Configuration options related to the preprocessor +# Configuration options related to the preprocessor #--------------------------------------------------------------------------- -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by # the preprocessor. -INCLUDE_PATH = +INCLUDE_PATH = -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator # instead of the = operator. -PREDEFINED = +PREDEFINED = -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- -# Configuration::additions related to external references +# Configuration::additions related to external references #--------------------------------------------------------------------------- -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen +# If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. -TAGFILES = +TAGFILES = -# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. -GENERATE_TAGFILE = +GENERATE_TAGFILE = -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES -# The PERL_PATH should be the absolute path and name of the perl script +# The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- -# Configuration options related to the dot tool +# Configuration options related to the dot tool #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = YES -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO -# If set to YES, the inheritance and collaboration graphs will show the +# If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. CALL_GRAPH = NO -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png -# The tag DOT_PATH can be used to specify the path where the dot tool can be +# The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. -DOT_PATH = +DOT_PATH = -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the # \dotfile command). -DOTFILE_DIRS = - -# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_WIDTH = 1024 +DOTFILE_DIRS = -# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. -MAX_DOT_GRAPH_HEIGHT = 1024 +DOT_GRAPH_MAX_NODES = 50 -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that a graph may be further truncated if the graph's -# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH -# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), -# the graph is not depth-constrained. +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, which results in a white background. -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO diff --git a/sca-cpp/trunk/doc/Doxyfile.w32 b/sca-cpp/trunk/doc/Doxyfile.w32 deleted file mode 100644 index e97d3602db..0000000000 --- a/sca-cpp/trunk/doc/Doxyfile.w32 +++ /dev/null @@ -1,1253 +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. - -# Doxyfile 1.4.6 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = tuscany_sca_cpp - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = 1.0-incubator-M2 - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, -# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, -# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, -# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, -# Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# This tag can be used to specify the encoding used in the generated output. -# The encoding is not always determined by the language that is chosen, -# but also whether or not the output is meant for Windows or non-Windows users. -# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES -# forces the Windows encoding (this is the default for the Windows binary), -# whereas setting the tag to NO uses a Unix-style encoding (the default for -# all platforms other than Windows). - -USE_WINDOWS_ENCODING = NO - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. - -JAVADOC_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to -# include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = NO - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = YES - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = YES - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = YES - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from the -# version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = YES - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = ../runtime - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: - - -FILE_PATTERNS = *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = YES - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = doxygen - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_WIDTH = 1024 - -# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_HEIGHT = 1024 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that a graph may be further truncated if the graph's -# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH -# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), -# the graph is not depth-constrained. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, which results in a white background. -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO diff --git a/sca-cpp/trunk/doc/Makefile.am b/sca-cpp/trunk/doc/Makefile.am index fdf2de8c58..c5f29b0d6b 100644 --- a/sca-cpp/trunk/doc/Makefile.am +++ b/sca-cpp/trunk/doc/Makefile.am @@ -26,10 +26,5 @@ endif datadir=$(prefix)/doc -data_DATA = *.html -nobase_data_DATA = css/*.* - -EXTRA_DIST = css *.html - clean: rm -rf doxygen diff --git a/sca-cpp/trunk/doc/PythonExtension.html b/sca-cpp/trunk/doc/PythonExtension.html deleted file mode 100644 index f51af0d6c9..0000000000 --- a/sca-cpp/trunk/doc/PythonExtension.html +++ /dev/null @@ -1,281 +0,0 @@ - - - - - - - - - - - - Tuscany SCA Native - Python Extension - - - -
      -
      -
      -

      Tuscany SCA Native - Python Extension

      - -

      The Tuscany Python extension allows Python scripts to be used as components in - SCA composites and as clients that can invoke SCA services. -

      -

      The following samples demonstrate use of the Python extension:

      - - -
      - -
      -

      System Requirements

      - -

      In order to install and use the Tuscany SCA Python Extension there are some - extra requirements in addition to the Tuscany - SCA requirements:

      - - - - - - - - - - - - - -
      SoftwareDownload Link
      Python version 2.5 - http://www.python.org/download/
      - Please download and follow the installation instructions. -
      -
      - -
      -

      Installing the Tuscany SCA Python Extension

      -

      Getting the Tuscany SCA Python Extension working with the binary release on Linux and Mac OS X

      -
        -
      1. Ensure the Python libraries are available on the PATH environment variable
      2. -
      3. Add the <tuscany_sca_install_dir>/extensions/python/lib directory to the PYTHONPATH environment variable
      4. -
      -

      Getting the Tuscany SCA Python Extension working with the source release on Linux and Mac OS X

      -
        -
      1. You will need the Tuscany SCA and SDO libraries - follow the instructions - here to build the SCA libraries and default extensions
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to built Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
        • PYTHON_LIB=<path to Python libraries>
        • -
        • PYTHON_INCLUDE=<path to Python includes>
        • -
        • PYTHON_VERSION=<name of the Python version>
          - Note: If you are using a default installation of Python 2.5 these are usually:
          - PYTHON_LIB=/usr/lib
          - PYTHON_INCLUDE=/usr/include/python2.5
          - PYTHON_VERSION=python2.5
        • -
      4. -
      5. Build the Python source only with the following command sequence: -
          -
        • cd <tuscany_sca_install_dir>
        • -
        • ./configure --prefix=$TUSCANY_SCACPP --enable-python --enable-cpp=no --enable-wsbinding=no
        • -
        • make
        • -
        • make install
        • -
        - NOTE: If you don't provide a --prefix configure option, it will by default install into - /usr/local/tuscany/sca
      6. -
      - -

      Getting the Tuscany SCA Python Extension working with the binary release on Windows

      -
        -
      1. Ensure the Python libraries are available on the PATH environment variable
      2. -
      3. Add the <tuscany_sca_install_dir>\extensions\python\bin directory to the PYTHONPATH environment variable
      4. -
      -

      Getting the Tuscany SCA Python Extension working with the source release on Windows

      -
        -
      1. Unzip the supplied source zip file
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to built Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
        • PYTHON_HOME=<path to installed Python> -
      4. -
      5. You must have set up the environment for Microsoft Visual C++ tools. The build command - will call vcvars32 to set the environment. Ensure the directory containing this is on your path. - This will be where you installed the compiler.
      6. -
      7. Build the source: -
          -
        • cd <to where you unzipped the source>
        • -
        • build
        • -
        - This will build all the projects and put the required output into the 'deploy' directory

        - Alternatively, open the workspace at <tuscany_sca_install_dir>/projects/tuscany_sca/tuscany_sca.dsw - in Visual Studio 6 or at at <tuscany_sca_install_dir>/projectsvc7/tuscany_sca/tuscany_sca.sln - in Visual Studio 7.1 - you can build projects individually -
      8. Set the TUSCANY_SCACPP environment variable to point to the 'deploy' directory that was just created
      9. -
      -
      - - -
      -

      The Tuscany Python Programming Model

      -

      This section will explain - the Tuscany Python programming model to help you to write your own Python - components and clients. -

      -

      The Tuscany Python component and client support comes from a Python extension - package that is built in the <tuscany_sca_install_dir>/extensions/python/bin - directory on Windows and <tuscany_sca_install_dir>/extensions/python/lib on - Linux and Mac OS X. This package must be made available to your Python environment by - adding this directory to your PYTHONPATH environment variable. This makes the sca - module available for use by clients and allows references and properties to be - used in your Python components -

      -

      Clients

      -

      Using the sca module, a Python client can search for an SCA service with: -

      -
      import sca
      -
      -calculator = sca.locateservice("CalculatorComponent/CalculatorService")
      -
      -

      This finds the component and service as defined in the composite and componentType - side files and returns a proxy object that can call the SCA service. You can then - simply call a business method on "calculator", like this: -

      -
      result = calculator.add(12.3, 45.6)
      -

      -

      Components

      -

      Python component implementations are standard Python scripts, where class-level - functions or module-level functions can be invoked by the Tuscany runtime. To - use a Python component implementation, use the implementation.python element in - your .composite file. For example, the following snippet will use the Python script - at path/to/module/PythonModuleName.py, where the path is relative to the location of - the composite file: -

      -
      <implementation.python module="PythonModuleName" path="path/to/module"/>
      -
      -

      To instantiate a class instance and use a class-level function, the Python class must - have a default constructor (an __init__ method that takes no arguments besides - 'self') and the class attribute must be defined in the implementation.python element - in your composite, like so: -

      -
      <implementation.python module="PythonModuleName" path="path/to/module" class="PythonClassName"/>
      -
      -

      Tuscany currently supports passing simple types (strings, ints, floats, etc) as well - as Service Data Objects into and out of Ruby components. Service Data Objects are represented - in Python as xml.etree.ElementTree Element objects (see the - PythonWeatherForecast sample for a demonstration). -

      -

      You can write a componentType file for your Python component, but you don't have to - the Python - extension automatically exposes a service and adds references and properties to your Python component - implementation classes based on the information in the composite file. -

      - -

      References

      -

      References are automatically added to your Python component implementation when - the runtime loads the implementation script, so they can be used like so: -

      -
      # The module-level div function
      -def div(val1, val2):
      -    # Use the divideService reference
      -    result = divideService.divide(val1, val2)
      -    return result
      -
      -

      and in your composite file: -

      -
      <component name="CalculatorComponent">
      -    <implementation.python module="CalculatorImpl"/>
      -    <reference name="divideService">DivideComponent/DivideService</reference>
      -</component>
      -
      -

      Properties

      -

      A composite with a property defined for a component like so: -

      -
      <component name="DivideComponent">
      -    <implementation.python module="DivideImpl"/>
      -    <property name="doRounding">true</property>
      -</component>
      -
      -

      means the property is automatically instantiated and assigned the - property value in the Python component implementation, so it can be - used like so: -

      -
      def divide(val1, val2):
      -    result = float(val1) / float(val2)
      -    print "Python - DivideImpl.divide " + str(val1) + " / " + str(val2) + " = " + str(result)
      -
      -    # Use the doRounding property
      -    if doRounding:
      -        result = round(result)
      -        print "Python - DivideImpl.divide is rounding the result to " + str(result)
      -
      -    return result
      -
      -

      -
      - -
      -

      Getting Help

      - -

      First place to look is at the Tuscany FAQ at - http://incubator.apache.org/tuscany/faq.html

      - -

      Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      -
      -
      -
      - - - - diff --git a/sca-cpp/trunk/doc/RESTExtension.html b/sca-cpp/trunk/doc/RESTExtension.html deleted file mode 100644 index 71482d43ec..0000000000 --- a/sca-cpp/trunk/doc/RESTExtension.html +++ /dev/null @@ -1,291 +0,0 @@ - - - - - - - - - - - - Tuscany SCA Native - REST Extension - - - -
      -
      -
      -

      Tuscany SCA Native - REST Extension

      - -

      This document describes the deployment and use of the REST - binding support in the Apache Tuscany SCA Native runtime. -

      -

      The Tuscany REST extension allows SCA services and references to be invoked - via HTTP REST calls -

      -

      The following samples demonstrate use of the REST extension:

      - -
      - -
      -

      System Requirements

      - -

      In order to install and use the Tuscany SCA REST Extension there are some - extra requirements in addition to the Tuscany - SCA requirements:

      - - - - - - - - - - - - - - - - -
      SoftwareDownload Link
      Apache HTTPD version 2.2 - http://httpd.apache.org
      - Please download and follow the installation instructions. This is required - for building the REST Service extension and for hosting and running REST services. -
      libcurl version 7.15 or higher - http://curl.haxx.se/download.html
      - Please download and follow the installation instructions. This is required - for building the REST Reference extension and for calling REST references.
      - On Windows, the extension was developed and tested against the "Win32 - MSVC 7.15.1 devel" - library provided by Chris Drake. On Linux the libcurl libraries were built from - the 7.16.1 source. On Mac OS X the library was downloaded, built and installed via the - standard "port" command. -
      -
      - -
      -

      Installing the Tuscany SCA REST Extension

      -

      Getting the Tuscany SCA REST Extension working with the binary release on Linux and Mac OS X

      -
        -
      1. Follow the deployment steps below to ensure the HTTPD server - invokes Tuscany when it receives an appropriate HTTP request
      2. -
      3. Ensure the libcurl and HTTPD libraries are available on the LD_LIBRARY_PATH environment variable on Linux and - the DYLD_LIBRARY_PATH environment variable on Mac OS X
      4. -
      -

      Getting the Tuscany SCA REST Extension working with the source release on Linux and Mac OS X

      -
        -
      1. You will need the Tuscany SCA and SDO libraries - follow the instructions - here to build the SCA libraries and default extensions
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to built Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
        • APR_INCLUDE=<path to APR includes>
        • -
        • HTTPD_INCLUDE=<path to HTTPD includes>
          - Note: If you are using a default installation of HTTPD these are usually:
          - APR_INCLUDE=/usr/include/apr-1
          - HTTPD_INCLUDE=/usr/include/httpd
        • -
        • CURL_INCLUDE=<path to libcurl includes>
        • -
        • CURL_LIB<path to libcurl libraries>
          - Note: If you are using a default installation of libcurl these are usually:
          - CURL_INCLUDE=/usr/include/curl
          - CURL_LIB=/usr/lib
        • -
      4. -
      5. Build the REST source only with the following command sequence: -
          -
        • cd <tuscany_sca_install_dir>
        • -
        • ./configure --prefix=$TUSCANY_SCACPP --enable-restbinding --enable-cpp=no --enable-wsbinding=no
        • -
        • make
        • -
        • make install
        • -
        - NOTE: If you don't provide a --prefix configure option, it will by default install into - /usr/local/tuscany/sca
      6. -
      - -

      Getting the Tuscany SCA REST Extension working with the binary release on Windows

      -
        -
      1. Follow the deployment steps below to ensure the HTTPD server - invokes Tuscany when it receives an appropriate HTTP request
      2. -
      3. Ensure the libcurl and HTTPD libraries are available on the PATH environment variable
      4. -
      -

      Getting the Tuscany SCA REST Extension working with the source release on Windows

      -
        -
      1. Unzip the supplied source zip file
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to built Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
        • HTTPD_HOME=<path to installed HTTPD server> -
        • LIBCURL_HOME=<path to installed libcurl libraries> -
      4. -
      5. You must have set up the environment for Microsoft Visual C++ tools. The build command - will call vcvars32 to set the environment. Ensure the directory containing this is on your path. - This will be where you installed the compiler.
      6. -
      7. Build the source: -
          -
        • cd <to where you unzipped the source>
        • -
        • build
        • -
        - This will build all the projects and put the required output into the 'deploy' directory

        - Alternatively, open the workspace at <tuscany_sca_install_dir>/projects/tuscany_sca/tuscany_sca.dsw - in Visual Studio 6 or at at <tuscany_sca_install_dir>/projectsvc7/tuscany_sca/tuscany_sca.sln - in Visual Studio 7.1 - you can build projects individually - or build the samples to rebuild all the projects
      8. -
      -
      - - -
      -

      Deploying the Tuscany REST Service extension to the HTTPD server

      -

      The following samples demonstrate use of the REST extension:

      - -

      Each of these samples generate a set of configuration files for the HTTPD server. Use the startserver - script that comes with each sample to generate the files and start the server with the REST Service - extension enabled. The instructions below detail the information that is provided in these configuration - files.

      -
        -
      1. On Windows, load the sca_rest_module into HTTPD by adding the following line to the conf/httpd.conf file: -
        LoadModule sca_rest_module <path to installed Tuscany SCA>/extensions/rest/service/bin/tuscany_sca_mod_rest.dll
        - On Linux, use the following line: -
        LoadModule sca_rest_module <path to installed Tuscany SCA>/extensions/rest/service/lib/libtuscany_sca_mod_rest.so
        - On Mac OS X, use the following line: -
        LoadModule sca_rest_module <path to installed Tuscany SCA>/extensions/rest/service/lib/libtuscany_sca_mod_rest.dylib
        -
      2. -
      3. Set a TuscanyHome directive to the installation of Tuscany SCA Native: -
        TuscanyHome <path to installed Tuscany SCA>
        -
      4. -
      5. Create a Location directive for the URL to be used and set the sca_rest_module as the handler to - be invoked when requests for the location are received. Also set the TuscanyRoot directive for - this Location, set to the location of the SCA application to be invoked: -
        -<Location /rest>
        -       SetHandler sca_rest_module 
        -       TuscanyRoot <path to installed Tuscany SCA>/samples/RestCalculator/deploy/
        -</Location>
        -
        - The above example will mean that calls to http://myserver/rest will be handled by Tuscany SCA Native - and configured to invoke the RestCalculator sample application. -
      6. -
      -
      - -
      -

      Tuscany REST Extension Resource Pattern

      -

      If the SCA service or reference uses an <interface.rest> interface, CRUD - (Create, Retrieve, Update, Delete) methods are mapped to HTTP verbs to access resource - representations as follows:

      -
        -
      • uri = create(resource)
        - HTTP POST <binding-uri> + an XML element representing the resource to create
        - Returns Location header containing the uri of the created resource
      • -
      • resource = retrieve()
        - HTTP GET <binding-uri>
        - Returns an XML element representing the REST resource
      • -
      • resource = retrieve(uri, parm-value-1, parm-value-n)
        - HTTP GET uri/parm-value-1/parm-value-n
        - or if uri ends with a '?':
        - HTTP GET uri?parm-name-1=parm-value1&parm-name-n=parm-value-n
        - Returns an XML element representing the REST resource
      • -
      • update(resource)
        - HTTP PUT <binding-uri> + an XML element representing the updated resource
      • -
      • update(uri, parm-1, parm-n, resource)
        - HTTP PUT uri/parm-value-1/parm-value-n + an XML element representing the updated resource
        - or if uri ends with a '?':
        - HTTP PUT uri?parm-name-1=parm-value1&parm-name-n=parm-value-n + an XML element representing the updated resource
      • -
      • delete()
        - HTTP DELETE <binding-uri>
      • -
      • delete(uri, parm-1, parm-n)
        - HTTP DELETE uri/parm-value-1/parm-value-n
        - or if uri ends with a '?':
        - HTTP DELETE uri?parm-name-1=parm-value1&parm-name-n=parm-value-n
      • -
      -

      In this mode, HTTP return codes are used almost as described in the Atom spec. Also - GET returns etags with the retrieved resource representations to help caching by clients.

      -
      - -
      -

      Tuscany REST Extension RPC Pattern

      -

      If the SCA service/reference does not use an <interface.rest> interface, then this is - not a real REST pattern, we simply flow method calls over XML / HTTP as follows:

      -
      • result = method-abc(parm-1, parm-n) -
          -
        • if single input parameter of complex type:
          - HTTP POST <binding-uri>/method-abc + XML element representing the complex parameter
        • -
        • or if multiple parameters including parameters of complex types:
          - HTTP POST <binding-uri>/method-abc + Mime multipart/form-data body containing one parameter per part
        • -
        • or if multiple parameters all of simple types:
          - HTTP GET <binding-uri>/method-abc?parm-1-name=parm-1-value&parm-n-name=parm-n-value
        • -
        - Returns an XML element representing the result
      • -
      -
      - -
      -

      Getting Help

      - -

      First place to look is at the Tuscany FAQ at - http://incubator.apache.org/tuscany/faq.html

      - -

      Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      -
      -
      -
      - - - - diff --git a/sca-cpp/trunk/doc/RubyExtension.html b/sca-cpp/trunk/doc/RubyExtension.html deleted file mode 100644 index 96a4ad2b82..0000000000 --- a/sca-cpp/trunk/doc/RubyExtension.html +++ /dev/null @@ -1,292 +0,0 @@ - - - - - - - - - - - - Tuscany SCA Native - Ruby Extension - - - -
      -
      -
      -

      Tuscany SCA Native - Ruby Extension

      - -

      The Tuscany Ruby extension allows Ruby scripts to be used as components in - SCA composites and as clients that can invoke SCA services. -

      -

      The following samples demonstrate use of the Ruby extension:

      - -
      - -
      -

      System Requirements

      - -

      In order to install and use the Tuscany SCA Ruby Extension there are some - extra requirements in addition to the Tuscany - SCA requirements:

      - - - - - - - - - - - - - -
      SoftwareDownload Link
      Ruby version 1.8.x - http://www.ruby-lang.org
      - Please download and follow the installation instructions. You should - be able to build the Tuscany SCA Ruby Extension with other versions of Ruby. - The extension has been tested with the - Ruby 1.8.5 One-Click Installer - on Windows and the 1.8.5 source code - (compiled locally) on Linux. -
      -
      - -
      -

      Installing the Tuscany SCA Ruby Extension

      -

      Getting the Tuscany SCA Ruby Extension working with the binary release on Linux and Mac OS X

      -
        -
      1. Ensure the Ruby libraries are available on the PATH environment variable
      2. -
      -

      Getting the Tuscany SCA Ruby Extension working with the source release on Linux and Mac OS X

      -
        -
      1. You will need the Tuscany SCA and SDO libraries - follow the instructions - here to build the SCA libraries and default extensions
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to built Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
        • RUBY_LIB=<path to Ruby libraries>
        • -
        • RUBY_INCLUDE=<path to Ruby includes>
          - Note: If you are using a default installation of Ruby these are usually:
          - RUBY_LIB=/usr/lib
          - RUBY_INCLUDE=/usr/lib/ruby/1.8/i386-linux
        • -
      4. -
      5. Build the Ruby source only with the following command sequence: -
          -
        • cd <tuscany_sca_install_dir>
        • -
        • ./configure --prefix=$TUSCANY_SCACPP --enable-ruby --enable-cpp=no --enable-wsbinding=no
        • -
        • make
        • -
        • make install
        • -
        - NOTE: If you don't provide a --prefix configure option, it will by default install into - /usr/local/tuscany/sca
      6. -
      - -

      Getting the Tuscany SCA Ruby Extension working with the binary release on Windows

      -
        -
      1. Ensure the Ruby libraries are available on the PATH environment variable
      2. -
      -

      Getting the Tuscany SCA Ruby Extension working with the source release on Windows

      -
        -
      1. Unzip the supplied source zip file
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to built Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
        • RUBY_HOME=<path to installed Ruby> -
      4. -
      5. You must have set up the environment for Microsoft Visual C++ tools. The build command - will call vcvars32 to set the environment. Ensure the directory containing this is on your path. - This will be where you installed the compiler.
      6. -
      7. Build the source: -
          -
        • cd <to where you unzipped the source>
        • -
        • build
        • -
        - This will build all the projects and put the required output into the 'deploy' directory

        - Alternatively, open the workspace at <tuscany_sca_install_dir>/projects/tuscany_sca/tuscany_sca.dsw - in Visual Studio 6 or at at <tuscany_sca_install_dir>/projectsvc7/tuscany_sca/tuscany_sca.sln - in Visual Studio 7.1 - you can build projects individually - or build the samples to rebuild all the projects
      8. -
      -
      - - -
      -

      The Tuscany Ruby Programming Model

      -

      This section will explain the Tuscany Ruby programming model to help you to - write your own Ruby components and clients. -

      -

      The Tuscany Ruby component and client support comes from a Ruby extension - library that is built in the <tuscany_sca_install_dir>/extensions/ruby/bin - directory on Windows and <tuscany_sca_install_dir>/extensions/ruby/lib on - Linux and Mac OS X. -

      -

      Clients

      -

      Using the Ruby SCA extension library, a Ruby client can search for an SCA service with: -

      -
      require("libtuscany_sca_ruby")
      -
      -calculator = SCA::locateService("CalculatorComponent/CalculatorService")
      -
      -

      This finds the component and service as defined in the composite and componentType - side files and returns a proxy object that can call the SCA service. You can then - simply call a business method on "calculator", like this: -

      -
      result = calculator.add(12.3, 45.6)
      -

      -

      Components

      -

      Ruby component implementations are standard Ruby scripts, where class-level - functions or module-level functions can be invoked by the Tuscany runtime. To - use a Ruby component implementation, use the implementation.ruby element in - your .composite file. For example: -

      -
      <implementation.ruby script="CalculatorImpl.rb"/>
      -
      -

      To instantiate a class instance and use a class-level function, the Ruby class must - have a default constructor (an initialize() method that takes no arguments) and the - class attribute must be definde in the implementation.ruby element - in your composite, like so: -

      -
      <implementation.ruby script="CalculatorImpl.rb" class="CalculatorImpl"/>
      -
      -

      Tuscany currently supports passing simple types (strings, ints, floats, etc) as well - as Service Data Objects into and out of Ruby components. Service Data Objects are represented - in Ruby as REXML Document objects (see the - Ruby BigBank sample for a demonstration). -

      -

      You can write a componentType file for your Ruby component, but you don't have to - the Ruby - extension introspects Ruby component implementation classes for you and binds public - attributes to references and properties. -

      -

      References

      -

      References can be invoked from Ruby component implementations by the use of public - attributes in the component implementation classes, like this: -

      -
      class CalculatorImpl
      -
      -  # Define the public attribute that corresponds to the divideService reference
      -  attr_writer :divideService
      -
      -...	
      -
      -  def div(arg1, arg2)
      -    print "Ruby - CalculatorImpl.div\n"
      -    # Invoke the divideService reference
      -    @divideService.divide(arg1.to_f, arg2.to_f)
      -  end
      -
      -...
      -end
      -
      -

      and in your composite file: -

      -
      <component name="CalculatorComponent">
      -    <implementation.ruby script="CalculatorImpl.rb"/>
      -    <reference name="divideService">DivideComponent/DivideService</reference>
      -</component>
      -
      -

      Properties

      -

      A composite with a property defined for a component like so: -

      -
      <component name="DivideComponent">
      -    <implementation.ruby script="DivideImpl.rb" class="DivideImpl"/>
      -    <property name="round">true</property>
      -</component>
      -
      -

      allows a public attribute of a Ruby component implementation class to be - assigned the property value, so it can be used like so: -

      -
      class DivideImpl
      -
      -  # Define the public attribute that corresponds to the round property
      -  attr_writer :round           
      -
      -...	
      -
      -  def divide(arg1, arg2)
      -    print "Ruby - DivideImpl.divide ", arg1, " / ", arg2, "\n"
      -    res = arg1.to_f / arg2.to_f
      -    # Use the round property
      -    if @round then
      -      res = res.round
      -      print "DivideImpl.divide rounding\n"
      -    end
      -    print "DivideImpl.divide ", res, "\n"
      -    res
      -  end
      -end
      -
      -

      -
      - -
      -

      Getting Help

      - -

      First place to look is at the Tuscany FAQ at - http://incubator.apache.org/tuscany/faq.html

      - -

      Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      -
      -
      -
      - - - - diff --git a/sca-cpp/trunk/doc/SCAExtension.html b/sca-cpp/trunk/doc/SCAExtension.html deleted file mode 100644 index 63157dc9bf..0000000000 --- a/sca-cpp/trunk/doc/SCAExtension.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - - - - Tuscany SCA Native - SCA Binding Extension - - - -
      -
      -
      -

      Tuscany SCA Native - SCA Binding Extension

      - -

      This document describes the deployment and use of the SCA - binding support in the Apache Tuscany SCA Native runtime. -

      -

      The SCA binding allows components to be invoked via an - implementation specific protocol. Currently, in the Tuscany SCA binding - extension, the Axis2/C Web Service binding extension - is used to provide the implementaion, so calls use the SOAP protocol -

      -

      The HTTPDBigBank sample demonstrates the - use of the SCA binding extension. -

      -
      - -
      -

      System Requirements

      - -

      In order to install and use the Tuscany SCA Binding Extension there are some - extra requirements in addition to the Tuscany - SCA requirements:

      - - - - - - - - - - - - - -
      SoftwareDetails
      Tuscany Axis2/C Web Service binding extension - Please follow the installation instructions. The Axis2/C Web Service extension requires - Axis2/C version 0.96. -
      -
      - -
      -

      Installing the Tuscany SCA Binding Extension

      -

      Getting the Tuscany SCA Binding Extension working with the binary release on Linux and Mac OS X

      -
        -
      1. Ensure the AXIS2C_HOME environment variable is set to the Axis2/C installation
      2. -
      3. Deploy the Axis2/C Web Services extension by following the deployment steps
      4. -
      5. Ensure the Axis2/C Web Service extension and SCA Binding extension libraries are available - on the LD_LIBRARY_PATH environment variable on Linux and the DYLD_LIBRARY_PATH environment variable on Mac OS X
      6. -
      -

      Getting the Tuscany SCA Binding Extension working with the source release on Linux and Mac OS X

      -
        -
      1. You will need the Tuscany SCA and SDO libraries - follow the instructions - here to build the SCA libraries and default extensions
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to built Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
      4. -
      5. Build the SCA Binding source only with the following command sequence: -
          -
        • cd <tuscany_sca_install_dir>
        • -
        • ./configure --prefix=$TUSCANY_SCACPP --enable-scabinding --enable-cpp=no --enable-wsbinding=no
        • -
        • make
        • -
        • make install
        • -
        - NOTE: If you don't provide a --prefix configure option, it will by default install into - /usr/local/tuscany/sca
      6. -
      - -

      Getting the Tuscany SCA Binding Extension working with the binary release on Windows

      -
        -
      1. Ensure the AXIS2C_HOME environment variable is set to the Axis2/C installation
      2. -
      3. Deploy the Axis2/C Web Services extension by following the deployment steps
      4. -
      5. Ensure the Axis2/C Web Services extension and SCA Binding extension libraries are available - on the PATH environment variable
      6. -
      -

      Getting the Tuscany SCA Binding Extension working with the source release on Windows

      -
        -
      1. Unzip the supplied source zip file
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to built Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
      4. -
      5. You must have set up the environment for Microsoft Visual C++ tools. The build command - will call vcvars32 to set the environment. Ensure the directory containing this is on your path. - This will be where you installed the compiler.
      6. -
      7. Build the source: -
          -
        • cd <to where you unzipped the source>
        • -
        • build
        • -
        - This will build all the projects and put the required output into the 'deploy' directory

        - Alternatively, open the workspace at <tuscany_sca_install_dir>/projects/tuscany_sca/tuscany_sca.dsw - in Visual Studio 6 or at at <tuscany_sca_install_dir>/projectsvc7/tuscany_sca/tuscany_sca.sln - in Visual Studio 7.1 - you can build projects individually - or build the samples to rebuild all the projects
      8. -
      -
      - -
      -
      - -
      -

      Getting Help

      - -

      First place to look is at the Tuscany FAQ at - http://incubator.apache.org/tuscany/faq.html

      - -

      Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      -
      -
      -
      - - - - diff --git a/sca-cpp/trunk/doc/css/maven-base.css b/sca-cpp/trunk/doc/css/maven-base.css deleted file mode 100644 index e23caf04e5..0000000000 --- a/sca-cpp/trunk/doc/css/maven-base.css +++ /dev/null @@ -1,168 +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$ */ - -body { - margin: 0px; - padding: 0px; -} -img { - border:none; -} -table { - padding:0px; - width: 100%; - margin-left: -2px; - margin-right: -2px; -} -acronym { - cursor: help; - border-bottom: 1px dotted #feb; -} -table.bodyTable th, table.bodyTable td { - padding: 2px 4px 2px 4px; - vertical-align: top; -} -div.clear{ - clear:both; - visibility: hidden; -} -div.clear hr{ - display: none; -} -#bannerLeft, #bannerRight { - font-size: xx-large; - font-weight: bold; -} -#bannerLeft img, #bannerRight img { - margin: 0px; -} -.xleft, #bannerLeft img { - float:left; - text-shadow: #7CFC00; -} -.xright, #bannerRight img { - float:right; - text-shadow: #7CFC00; -} -#banner { - padding: 0px; -} -#banner img { - border: none; -} -#breadcrumbs { - padding: 3px 10px 3px 10px; -} -#leftColumn { - width: 150px; - float:left; -} -#bodyColumn { - margin-right: 1.5em; - margin-left: 30px; -} -#legend { - padding: 8px 0 8px 0; -} -#navcolumn { - padding: 8px 4px 0 8px; -} -#navcolumn h5 { - margin: 0; - padding: 0; - font-size: small; -} -#navcolumn ul { - margin: 0; - padding: 0; - font-size: small; -} -#navcolumn li { - list-style-type: none; - background-image: none; - background-repeat: no-repeat; - background-position: 0 0.4em; - padding-left: 16px; - list-style-position: ouside; - line-height: 1.2em; - font-size: smaller; -} -#navcolumn li.expanded { - background-image: url(../images/expanded.gif); -} -#navcolumn li.collapsed { - background-image: url(../images/collapsed.gif); -} -#poweredBy { - text-align: center; -} -#navcolumn img { - margin-top: 10px; - margin-bottom: 3px; -} -#poweredBy img { - display:block; - margin: 20px 0 20px 17px; - border: 1px solid black; - width: 90px; - height: 30px; -} -#search img { - margin: 0px; - display: block; -} -#search #q, #search #btnG { - border: 1px solid #999; - margin-bottom:10px; -} -#search form { - margin: 0px; -} -#lastPublished { - font-size: x-small; -} -.navSection { - margin-bottom: 2px; - padding: 8px; -} -.navSectionHead { - font-weight: bold; - font-size: x-small; -} -.section { - padding: 4px; -} -#footer { - padding: 3px 10px 3px 10px; - font-size: x-small; -} -#breadcrumbs { - font-size: x-small; - margin: 0pt; -} -.source { - padding: 12px; - margin: 1em 7px 1em 7px; -} -.source pre { - margin: 0px; - padding: 0px; -} diff --git a/sca-cpp/trunk/doc/css/maven-theme.css b/sca-cpp/trunk/doc/css/maven-theme.css deleted file mode 100644 index 91cf29cda2..0000000000 --- a/sca-cpp/trunk/doc/css/maven-theme.css +++ /dev/null @@ -1,173 +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$ */ - -body { - padding: 0px 0px 10px 0px; -} -body, td, select, input, li{ - font-family: Verdana, Helvetica, Arial, sans-serif; - #font-size: 13px; - padding: 4px 4px 4px 4px; - line-height: 1.5em; - font-size: small; -} -code{ - font-family: Courier, monospace; - font-size: 13px; -} -a { - text-decoration: none; -} -a:link { - color:#36a; -} -a:visited { - color:#47a; -} -a:active, a:hover { - color:#69c; -} -#legend li.externalLink { - background: url(../images/external.png) left top no-repeat; - padding-left: 18px; -} -a.externalLink, a.externalLink:link, a.externalLink:visited, a.externalLink:active, a.externalLink:hover { - background: url(../images/external.png) right center no-repeat; - padding-right: 18px; -} -#legend li.newWindow { - background: url(../images/newwindow.png) left top no-repeat; - padding-left: 18px; -} -a.newWindow, a.newWindow:link, a.newWindow:visited, a.newWindow:active, a.newWindow:hover { - background: url(../images/newwindow.png) right center no-repeat; - padding-right: 18px; -} -h1 { - font-size: x-large; - line-height: 1em; -} - - -h2 { - padding: 4px 4px 4px 6px; - border: 1px solid #999; - color: #900; - background-color: #ddd; - - font-size: large; -} -h3 { - padding: 4px 4px 4px 6px; - border: 1px solid #aaa; - color: #900; - background-color: #eee; - font-weight: normal; - font-size: large; -} -h4 { - padding: 4px 4px 4px 6px; - border: 1px solid #bbb; - color: #900; - background-color: #fff; - font-weight: normal; - font-size: large; -} -h5 { - padding: 4px 4px 4px 6px; - color: #900; - font-size: normal; -} -p { - line-height: 1.5em; - font-size: small; -} -#breadcrumbs { - border-top: 1px solid #aaa; - border-bottom: 1px solid #aaa; - background-color: #ccc; -} -#leftColumn { - margin: 10px 0 0 5px; - border: 1px solid #999; - background-color: #eee; -} -#navcolumn h5 { - font-size: smaller; - border-bottom: 1px solid #aaaaaa; - padding-top: 2px; - color: #000; -} - -table.bodyTable th { - color: white; - background-color: #bbb; - text-align: left; - font-weight: bold; -} - -table.bodyTable th, table.bodyTable td { - font-size: small; -} - -table.bodyTable tr.a { - background-color: #ddd; -} - -table.bodyTable tr.b { - background-color: #eee; -} - -.source { - border: 1px solid #999; -} -dl { - padding: 4px 4px 4px 6px; - border: 1px solid #aaa; - background-color: #ffc; -} -dt { - color: #900; -} -#organizationLogo img, #projectLogo img, #projectLogo span{ - margin: 8px; -} -#banner { - border-bottom: 1px solid #fff; -} -.sourcecode { - border: 1px solid #999; - font-family: Courier, monospace; - font-size: 13px; - white-space: pre; - padding: 4px 4px 4px 6px; - margin: 4px 4px 4px 6px; -} -pre { - border: 1px solid #999; - font-family: Courier, monospace; - font-size: 13px; - white-space: pre; - padding: 4px 4px 4px 6px; - margin: 4px 4px 4px 6px; -} - - diff --git a/sca-cpp/trunk/etc/git-exclude b/sca-cpp/trunk/etc/git-exclude index d9198b48ce..b9baef8244 100644 --- a/sca-cpp/trunk/etc/git-exclude +++ b/sca-cpp/trunk/etc/git-exclude @@ -30,6 +30,7 @@ surefire*.properties Makefile .deps/ .libs/ +m4/ *.m4 config.guess config.sub @@ -56,6 +57,7 @@ Doxyfile gmon.out *~ tags +doxygen # Specific ignores sca/runtime/extensions/cpp/tools/scagen/docs/ @@ -67,8 +69,9 @@ atom-test eval-test eval-shell json-test -diskcache-test -memcache-test +cache-test +client-test +mcache-test curl-test scdl-test store-function-test diff --git a/sca-cpp/trunk/makebindist.sh b/sca-cpp/trunk/makebindist.sh deleted file mode 100755 index 50141f6c59..0000000000 --- a/sca-cpp/trunk/makebindist.sh +++ /dev/null @@ -1,37 +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. - -TUSCANY_SCACPP_HOME=`pwd` - -if [ x$TUSCANY_SDOCPP = x ]; then - export TUSCANY_SDOCPP="$TUSCANY_SCACPP_HOME/../../sdo/deploy" -fi -./configure.sh - -make install - -cd ${TUSCANY_SCACPP_HOME}/samples -make install - -cd ${TUSCANY_SCACPP_HOME}/deploy -for i in `find . -name "*.la"` -do - rm $i -done - diff --git a/sca-cpp/trunk/modules/Makefile.am b/sca-cpp/trunk/modules/Makefile.am index 89256ae1a0..44ddf85de4 100644 --- a/sca-cpp/trunk/modules/Makefile.am +++ b/sca-cpp/trunk/modules/Makefile.am @@ -15,5 +15,8 @@ # specific language governing permissions and limitations # under the License. -SUBDIRS = atom cache eval http json scdl +SUBDIRS = atom eval http json scdl server + +includedir = $(prefix)/include/modules +nobase_include_HEADERS = */*.hpp diff --git a/sca-cpp/trunk/modules/atom/Makefile.am b/sca-cpp/trunk/modules/atom/Makefile.am index 61998ece8b..2e4eb4b89f 100644 --- a/sca-cpp/trunk/modules/atom/Makefile.am +++ b/sca-cpp/trunk/modules/atom/Makefile.am @@ -17,8 +17,6 @@ noinst_PROGRAMS = atom-test -nobase_include_HEADERS = *.hpp - INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${APR_INCLUDE} atom_test_SOURCES = atom-test.cpp diff --git a/sca-cpp/trunk/modules/eval/Makefile.am b/sca-cpp/trunk/modules/eval/Makefile.am index 68e01d42e2..b6b85c6965 100644 --- a/sca-cpp/trunk/modules/eval/Makefile.am +++ b/sca-cpp/trunk/modules/eval/Makefile.am @@ -20,8 +20,6 @@ noinst_PROGRAMS = eval-test eval-shell datadir=$(prefix)/modules/eval nobase_data_DATA = *.xsd -nobase_include_HEADERS = *.hpp - INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${APR_INCLUDE} eval_test_SOURCES = eval-test.cpp diff --git a/sca-cpp/trunk/modules/http/Makefile.am b/sca-cpp/trunk/modules/http/Makefile.am index ba5eadbab4..ffc7b58599 100644 --- a/sca-cpp/trunk/modules/http/Makefile.am +++ b/sca-cpp/trunk/modules/http/Makefile.am @@ -17,21 +17,9 @@ noinst_PROGRAMS = curl-test -libdir=$(prefix)/lib -lib_LTLIBRARIES = libmod_tuscany_eval.la libmod_tuscany_wiring.la - -nobase_include_HEADERS = *.hpp - -INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${HTTPD_INCLUDE} -I${APR_INCLUDE} -I${LIBMOZJS_INCLUDE} -I${CURL_INCLUDE} - -libmod_tuscany_eval_la_SOURCES = mod-eval.cpp -libmod_tuscany_eval_la_LIBADD = -lpthread -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1 -L${CURL_LIB} -lcurl -L${LIBMOZJS_LIB} -lmozjs - -libmod_tuscany_wiring_la_SOURCES = mod-wiring.cpp -libmod_tuscany_wiring_la_LIBADD = -lpthread -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1 -L${CURL_LIB} -lcurl -L${LIBMOZJS_LIB} -lmozjs +INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${HTTPD_INCLUDE} -I${APR_INCLUDE} -I${JS_INCLUDE} -I${CURL_INCLUDE} curl_test_SOURCES = curl-test.cpp -curl_test_LDADD = -lpthread -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1 -L${CURL_LIB} -lcurl -L${LIBMOZJS_LIB} -lmozjs - -TESTS = httpd-test http-test wiring-test +curl_test_LDADD = -lpthread -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1 -L${CURL_LIB} -lcurl -L${JS_LIB} -lmozjs +TESTS = httpd-test http-test diff --git a/sca-cpp/trunk/modules/json/Makefile.am b/sca-cpp/trunk/modules/json/Makefile.am index ab85d910ad..57f8b76602 100644 --- a/sca-cpp/trunk/modules/json/Makefile.am +++ b/sca-cpp/trunk/modules/json/Makefile.am @@ -17,12 +17,10 @@ noinst_PROGRAMS = json-test -nobase_include_HEADERS = *.hpp - -INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${APR_INCLUDE} -I${LIBMOZJS_INCLUDE} +INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${APR_INCLUDE} -I${JS_INCLUDE} json_test_SOURCES = json-test.cpp -json_test_LDADD = -lpthread -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1 -L${LIBMOZJS_LIB} -lmozjs +json_test_LDADD = -lpthread -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1 -L${JS_LIB} -lmozjs TESTS = json-test diff --git a/sca-cpp/trunk/modules/scdl/Makefile.am b/sca-cpp/trunk/modules/scdl/Makefile.am index 55a190579c..e4b16a8822 100644 --- a/sca-cpp/trunk/modules/scdl/Makefile.am +++ b/sca-cpp/trunk/modules/scdl/Makefile.am @@ -17,8 +17,6 @@ noinst_PROGRAMS = scdl-test -nobase_include_HEADERS = *.hpp - INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${APR_INCLUDE} scdl_test_SOURCES = scdl-test.cpp diff --git a/sca-cpp/trunk/runtime/Makefile.am b/sca-cpp/trunk/runtime/Makefile.am deleted file mode 100644 index a03650cd83..0000000000 --- a/sca-cpp/trunk/runtime/Makefile.am +++ /dev/null @@ -1,19 +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 = core extensions - diff --git a/sca-cpp/trunk/runtime/core/Makefile.am b/sca-cpp/trunk/runtime/core/Makefile.am deleted file mode 100644 index f833a2cb08..0000000000 --- a/sca-cpp/trunk/runtime/core/Makefile.am +++ /dev/null @@ -1,22 +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 test -nobase_data_DATA = xsd/*.* - -EXTRA_DIST = xsd - diff --git a/sca-cpp/trunk/runtime/core/src/Makefile.am b/sca-cpp/trunk/runtime/core/src/Makefile.am deleted file mode 100644 index ebba243583..0000000000 --- a/sca-cpp/trunk/runtime/core/src/Makefile.am +++ /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. - -lib_LTLIBRARIES = libtuscany_sca.la - -nobase_include_HEADERS = \ -tuscany/sca/*.h \ -tuscany/sca/core/*.h \ -tuscany/sca/model/*.h \ -tuscany/sca/util/*.h \ -tuscany/sca/extension/*.h - -## To list the source files execute the following: -## ls -1 tuscany/sca/util/*.cpp tuscany/sca/extension/*.cpp tuscany/sca/model/*.cpp tuscany/sca/core/*.cpp tuscany/sca/cpp/*.cpp tuscany/sca/ws/*.cpp | awk '{ print $1 " \\" }' -## and copy/paste the output below -libtuscany_sca_la_SOURCES = \ -tuscany/sca/core/Exceptions.cpp \ -tuscany/sca/core/Operation.cpp \ -tuscany/sca/core/SCARuntime.cpp \ -tuscany/sca/core/ServiceProxy.cpp \ -tuscany/sca/core/ServiceWrapper.cpp \ -tuscany/sca/extension/ImplementationExtension.cpp \ -tuscany/sca/extension/InterfaceExtension.cpp \ -tuscany/sca/extension/ReferenceBindingExtension.cpp \ -tuscany/sca/extension/ServiceBindingExtension.cpp \ -tuscany/sca/model/Binding.cpp \ -tuscany/sca/model/Component.cpp \ -tuscany/sca/model/ComponentType.cpp \ -tuscany/sca/model/Composite.cpp \ -tuscany/sca/model/CompositeReference.cpp \ -tuscany/sca/model/CompositeReferenceBinding.cpp \ -tuscany/sca/model/CompositeService.cpp \ -tuscany/sca/model/Contract.cpp \ -tuscany/sca/model/Interface.cpp \ -tuscany/sca/model/ModelLoader.cpp \ -tuscany/sca/model/ReferenceBinding.cpp \ -tuscany/sca/model/Reference.cpp \ -tuscany/sca/model/ReferenceType.cpp \ -tuscany/sca/model/ServiceBinding.cpp \ -tuscany/sca/model/Service.cpp \ -tuscany/sca/model/ServiceType.cpp \ -tuscany/sca/model/Wire.cpp \ -tuscany/sca/model/WSDLDefinition.cpp \ -tuscany/sca/model/WSDLInterface.cpp \ -tuscany/sca/model/WSDLMessagePart.cpp \ -tuscany/sca/model/WSDLOperation.cpp \ -tuscany/sca/util/DefaultLogWriter.cpp \ -tuscany/sca/util/File.cpp \ -tuscany/sca/util/FileLogWriter.cpp \ -tuscany/sca/util/Library.cpp \ -tuscany/sca/util/Logger.cpp \ -tuscany/sca/util/LogWriter.cpp \ -tuscany/sca/util/Mutex.cpp \ -tuscany/sca/util/Queue.cpp \ -tuscany/sca/util/SDOUtils.cpp \ -tuscany/sca/util/Thread.cpp \ -tuscany/sca/util/ThreadLocal.cpp \ -tuscany/sca/util/Utils.cpp - -libtuscany_sca_la_LIBADD = -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo -lpthread - -INCLUDES = -I$(top_builddir)/runtime/core/src \ - -I${TUSCANY_SDOCPP}/include - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/Exceptions.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/Exceptions.cpp deleted file mode 100644 index 7fa9c5e6b9..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/Exceptions.cpp +++ /dev/null @@ -1,285 +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 -#if defined(WIN32) || defined (_WINDOWS) || defined (IS_DARWIN) -#else -#include -#endif - -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/util/Logging.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - - // ======================================================================== - // Constructor - // ======================================================================== - TuscanyRuntimeException :: TuscanyRuntimeException(const char* name, - severity_level sev, - const char* msg_text) - { - severity = sev; - location_set = 0; - class_name = new char[strlen(name) + 1]; - strcpy(class_name,name); - message_text = new char[strlen(msg_text)+1]; - strcpy(message_text,msg_text); - -#if defined(WIN32) || defined (_WINDOWS) || defined (IS_DARWIN) -#else - void* array[25]; - stacktrace_size = backtrace(array, 25); - stacktrace_symbols = backtrace_symbols(array, stacktrace_size); -#endif - - logwarning("%s raised: %s", class_name, message_text); - - } // end TuscanyRuntimeException constuctor - - // ======================================================================== - // Constructor - // ======================================================================== - TuscanyRuntimeException :: TuscanyRuntimeException(const TuscanyRuntimeException& c) - { - severity = c.getSeverity(); - location_set = c.location_set; - class_name = new char[strlen(c.getEClassName()) + 1]; - strcpy(class_name, c.getEClassName()); - message_text = new char[strlen(c.getMessageText())+1]; - strcpy(message_text,c.getMessageText()); - - for (int i=0; i < location_set; i++) - { - locations[i].file = new char[strlen(c.locations[i].file) + 1]; - strcpy(locations[i].file,c.locations[i].file); - locations[i].line = c.locations[i].line; - locations[i].function = new char[strlen(c.locations[i].function) + 1]; - strcpy(locations[i].function, c.locations[i].function); - } - -#if defined(WIN32) || defined (_WINDOWS) || defined (IS_DARWIN) -#else - void* array[25]; - stacktrace_size = backtrace(array, 25); - stacktrace_symbols = backtrace_symbols(array, stacktrace_size); -#endif - - logwarning("%s raised: %s", class_name, message_text); - } - - // ======================================================================== - // Constructor - // ======================================================================== - TuscanyRuntimeException :: TuscanyRuntimeException(const commonj::sdo::SDORuntimeException& c) - { - class_name = new char[strlen(c.getEClassName()) + 1]; - strcpy(class_name, c.getEClassName()); - message_text = new char[strlen(c.getMessageText())+1]; - strcpy(message_text,c.getMessageText()); - severity = Warning; - const char* file = c.getFileName(); - unsigned long line = c.getLineNumber(); - const char* function = c.getFunctionName(); - location_set = 0; - if (file) - { - setLocation(file, line, function); - } - -#if defined(WIN32) || defined (_WINDOWS) || defined (IS_DARWIN) -#else - void* array[25]; - stacktrace_size = backtrace(array, 25); - stacktrace_symbols = backtrace_symbols(array, stacktrace_size); -#endif - - logwarning("%s raised: %s", class_name, message_text); - } - - // ======================================================================== - // Destructor - // ======================================================================== - TuscanyRuntimeException :: ~TuscanyRuntimeException() - { - if (class_name) delete class_name; - if (message_text) delete message_text; - for (int i=0;i1) - { - os << " Path:" << endl; - int i=1; - while (i < location_set) - { - os << " File: " << locations[i].file << endl; - os << " Line: " << locations[i].line << endl; - os << " Function: " << locations[i].function << endl; - i++; - } - } - } -#if defined(WIN32) || defined (_WINDOWS) || defined (IS_DARWIN) -#else - if (stacktrace_size != 0) - { - os << " Backtrace:" << endl; - for (int j = 0; j < stacktrace_size; j++) - { - os << " " << stacktrace_symbols[j] << endl; - } - } -#endif - return os; - } // end ostream operator << - - - // ======================================================================== - // ostream operator << - // ======================================================================== - SCA_API ostream& operator<< (ostream &os, const TuscanyRuntimeException &except) - { - return except.PrintSelf(os); - } // end ostream operator << - - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/Exceptions.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/Exceptions.h deleted file mode 100644 index 50cf91f7d4..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/Exceptions.h +++ /dev/null @@ -1,346 +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_core_exceptions_h -#define tuscany_sca_core_exceptions_h - -#include - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/export.h" - - -namespace tuscany -{ - namespace sca - { - /** - * Top level exception to represent all the exceptions that may be - * thrown by an SCA runtime implementation. - */ - class SCA_API TuscanyRuntimeException - { - public: - /** - * Represents the possible severity levels for an exception. - */ - enum severity_level - { - Normal, - Warning, - Error, - Severe - }; - - /** - * Constructor. - * @param name Class name of the exception. - * @param sev Severity level. - * @param msg_text Detailed description of the exception. - */ - TuscanyRuntimeException( - const char *name = "TuscanyRuntimeException", - severity_level sev = Severe, - const char* msg_text = ""); - - TuscanyRuntimeException(const TuscanyRuntimeException& c); - TuscanyRuntimeException(const commonj::sdo::SDORuntimeException& c); - - // Destructor - virtual ~TuscanyRuntimeException(); - - /** - * Return class name of this exception. - */ - const char* getEClassName() const; - - /** - * Return severity. - */ - severity_level getSeverity() const; - - /** - * Return message text associated with exception. - */ - const char* getMessageText() const; - - /* - * Return file name where the exception was raised. - */ - const char* getFileName() const; - - /** - * Return line number where the exception was raised. - */ - unsigned long getLineNumber() const; - - /** - * Return function name where the exception was raised. - */ - const char* getFunctionName() const; - - /** - * Set the exception severity. - */ - void setSeverity(severity_level sev); - - /** - * Set the message text associated with exception. - */ - void setMessageText(const char* msg_text); - - /** - * Set the location where the exception was raised. - * @param file Name of the file. - * @param line Line number in the file. - * @param function Name of the function. - */ - void setLocation(const char* file, - unsigned long line, - const char* function=""); - - /** - * Append exception details to ostream. - */ - virtual std::ostream& PrintSelf(std::ostream &os) const; - - /** - * Operator to send exceptions details to a stream. - */ - SCA_API friend std::ostream& operator<< (std::ostream &os, const TuscanyRuntimeException &except); - - protected: - - private: - /** - * Class name of the exception. - */ - char* class_name; - - /** - * Severity level of the exception. - */ - severity_level severity; - - /** - * Description of the exception. - */ - char* message_text; // Description of exception - - /** - * Location where the exception was thrown or handled and thrown. - */ - class location - { - public: - char* file; // File name (from __FILE__) - unsigned long line; // Line number (from __LINE__) - char* function; // Function name - }; - - - enum {num_locations=5}; - /** - * Array of locations where the exception has been handled and thrown. - */ - location locations[num_locations]; - - /** - * The current location (index into TuscanyRuntimeException#location). - */ - int location_set; - - /** - * A snapshot of the stack when the exception was constructed - */ -#if defined(WIN32) || defined (_WINDOWS) -#else - int stacktrace_size; - char** stacktrace_symbols; -#endif - - }; // End TuscanyRuntimeException class definition - - - /** - * Indicates a problem in the consistency of the SCA model provided to the - * Tuscany runtime. - */ - class SCA_API SystemConfigurationException: public TuscanyRuntimeException - { - public: - SystemConfigurationException(const char* msg) - : TuscanyRuntimeException("SystemConfigurationException", Severe, - msg) - { - } - - SystemConfigurationException( - const char *name, - severity_level sev, - const char* msg_text) - : TuscanyRuntimeException(name, sev, msg_text) - { - } - - SystemConfigurationException(const commonj::sdo::SDORuntimeException& c) - : TuscanyRuntimeException(c) - { - } - private: - }; - - /** - * Indicates a problem while invoking a service. - */ - class SCA_API ServiceInvocationException: public TuscanyRuntimeException - { - public: - ServiceInvocationException(const char* msg) - : TuscanyRuntimeException("ServiceInvocationException", Severe, msg) - { - } - - ServiceInvocationException( - const char *name, - severity_level sev, - const char* msg_text) - : TuscanyRuntimeException(name, sev, msg_text) - { - } - - ServiceInvocationException(const commonj::sdo::SDORuntimeException& c) - : TuscanyRuntimeException(c) - { - } - - private: - }; - - /** - * Indicates a problem while working with service data. - */ - class SCA_API ServiceDataException: public TuscanyRuntimeException - { - public: - ServiceDataException(const char* msg) - : TuscanyRuntimeException("ServiceDataException", Severe, - msg) - { - } - - ServiceDataException( - const char *name, - severity_level sev, - const char* msg_text) - : TuscanyRuntimeException(name, sev, msg_text) - { - } - - ServiceDataException(const commonj::sdo::SDORuntimeException& c) - : TuscanyRuntimeException(c) - { - } - private: - }; - - } // End namespace sca -} // End namespace tuscany - - -/** - * ========================================================================= - * Macro - throwException - * - * adds the current file name, line number and function name to the exception. - * then throws the exception. - * The parameter 'function_name' should be the name of the function throwing - * this exception. - * The parameter 'type' is the class of exception to throw and must be a - * SDORuntimeException or a class derived from SDORuntimeException. - * The parameter 'parameter' is the construction parameter for the exception - * ========================================================================= -*/ - -#if defined(WIN32) || defined (_WINDOWS) -#define throwException(type, parameter) \ -{\ - type __TuscanyThrownException__(parameter); \ - __TuscanyThrownException__.setLocation(__FILE__,__LINE__,__FUNCTION__); \ - throw __TuscanyThrownException__;\ -} -#else -#define throwException(type, parameter) \ -{\ - type __TuscanyThrownException__(parameter); \ - __TuscanyThrownException__.setLocation(__FILE__,__LINE__,__PRETTY_FUNCTION__); \ - throw __TuscanyThrownException__;\ -} -#endif - -/** - ========================================================================= - * Macro - rethrowException - * - * adds the current file name, line number and function name to the exception. - * then re-throws the exception. - * The parameter 'function_name' should be the name of the function throwing - * this exception. - * ========================================================================= -*/ -#if defined(WIN32) || defined (_WINDOWS) -#define rethrowException(exception) \ -{\ - (exception).setLocation(__FILE__,__LINE__,__FUNCTION__); \ - throw (exception);\ -} -#else -#define rethrowException(exception) \ -{\ - (exception).setLocation(__FILE__,__LINE__,__PRETTY_FUNCTION__); \ - throw (exception);\ -} -#endif - -/** - * ========================================================================= - * Macro - handleException - * - * adds the current file name, line number and function name to the exception. - * Writes an exception trace entry then continues. - * The parameter 'function_name' should be the name of the function handling - * this exception. - * ========================================================================= -*/ -#if defined(WIN32) || defined (_WINDOWS) -#define handleException(__PRETTY_FUNCTION__, exception) \ -{\ - (exception).setLocation(__FILE__,__LINE__,__FUNCTION__); \ -} -#else -#define handleException(__PRETTY_FUNCTION__, exception) \ -{\ - (exception).setLocation(__FILE__,__LINE__,__PRETTY_FUNCTION__); \ -} -#endif - -#endif // tuscany_sca_core_exceptions_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/Operation.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/Operation.cpp deleted file mode 100644 index 335ed5d369..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/Operation.cpp +++ /dev/null @@ -1,578 +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 - -#include "tuscany/sca/core/Operation.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/core/SCARuntime.h" - -using namespace std; -using namespace commonj::sdo; - - -namespace tuscany -{ - namespace sca - { - // =========== - // Constructor - // =========== - Operation::Operation(const char* operationName) - { - logentry(); - if (operationName != 0) - { - name = operationName; - } - } - - // ========== - // Destructor - // ========== - Operation::~Operation() - { - logentry(); - clean(); - } - - // ========== - // Copy Constructor - // ========== - Operation::Operation(const Operation& op) - { - logentry(); - copy(op); - } - - // ========== - // operator= - // ========== - Operation& Operation::operator=(const Operation& op) - { - logentry(); - if (&op != this) - { - copy(op); - } - return *this; - } - - // ========== - // Clean - // ========== - void Operation::clean() - { - logentry(); - for (unsigned int i = 0; i < getNParms(); i++) - { - const Parameter& parm = getParameter(i); - if (parm.getType() == DATAOBJECT) - { - delete (DataObjectPtr*)parm.getValue(); - } - } - - parameters.empty(); - - if (getReturnType() == DATAOBJECT) - { - delete (DataObjectPtr*)getReturnValue(); - } - } - - // ========== - // Copy - // ========== - void Operation::copy(const Operation& op) - { - logentry(); - clean(); - for (unsigned int i = 0; i < op.getNParms(); i++) - { - const Parameter& parm = op.getParameter(i); - if (parm.getType() == DATAOBJECT) - { - addParameter((const DataObject*)parm.getValue()); - } - else - { - parameters.insert(parameters.end(), parm); - } - } - - if (getReturnType() == DATAOBJECT) - { - setReturnValue((const DataObjectPtr*)op.getReturnValue()); - } - else - { - returnValue = op.returnValue; - } - } - - // ============================================== - // getParameter: return parameter at position pos - // ============================================== - void* Operation::getParameterValue(unsigned int pos) const - { - logentry(); - if (pos < parameters.size()) - { - return parameters[pos].getValue(); - } - - return 0; - } - - // ================================================== - // getParameter: return parameter value based on name - // ================================================== - void* Operation::getParameterValue(const string& name) const - { - logentry(); - try - { - return getParameter(name).getValue(); - } - catch(ServiceInvocationException) - {} - - return 0; - } - - // ====================================================== - // getParameter: return parameter based on index position - // ====================================================== - const Operation::Parameter& Operation::getParameter(unsigned int pos) const - { - logentry(); - if (pos < parameters.size()) - { - return parameters[pos]; - } - - throwException(ServiceInvocationException, "Index out of range"); - } - - // =============================================== - // getParameter: return of parameter based on name - // =============================================== - const Operation::Parameter& Operation::getParameter(const string& name) const - { - logentry(); - for(unsigned int pos=0; pos < parameters.size(); pos++) - { - if(parameters[pos].getName() == name) - { - return parameters[pos]; - } - } - - throwException(ServiceInvocationException, "Parameter name not found"); - } - - - // ============================================================ - // getParameterType: return type of parameter based on position - // ============================================================ - Operation::ParameterType Operation::getParameterType(unsigned int pos) const - { - logentry(); - if (pos < parameters.size()) - { - return parameters[pos].getType(); - } - - return VOID_TYPE; - } - - // ======================================================== - // getParameterType: return type of parameter based on name - // ======================================================== - Operation::ParameterType Operation::getParameterType(const string& name) const - { - logentry(); - try - { - return getParameter(name).getType(); - } - catch(ServiceInvocationException) - {} - - return VOID_TYPE; - } - - const string emptyString = string(); - - // ============================================== - // getParameterName: return name of parameter - // ============================================== - const string& Operation::getParameterName(unsigned int pos) const - { - logentry(); - if (pos < parameters.size()) - { - return parameters[pos].getName(); - } - - return emptyString; - } - - // =========================================== - // addParameter: set parameter at position pos - // =========================================== - void Operation::addParameter(const void *parm) - { - logentry(); - loginfo("Adding operation parameter, type: void, value: %p", parm); - parameters.insert(parameters.end(), Parameter((void*)parm, VOID_TYPE)); - } - - void Operation::addParameter(const bool *parm) - { - logentry(); - loginfo("Adding operation parameter, type: bool, value: %d", (int)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, BOOL)); - } - - void Operation::addParameter(const short *parm) - { - logentry(); - loginfo("Adding operation parameter, type: short, value: %hd", (short)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, SHORT)); - } - - void Operation::addParameter(const int *parm) - { - logentry(); - loginfo("Adding operation parameter, type: int, value: %d", (int)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, INT)); - } - - void Operation::addParameter(const long *parm) - { - logentry(); - loginfo("Adding operation parameter, type: long, value: %ld", (long)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, LONG)); - } - - void Operation::addParameter(const unsigned short *parm) - { - logentry(); - loginfo("Adding operation parameter, type: unsigned short, value: %hu", (unsigned short)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, USHORT)); - } - - void Operation::addParameter(const unsigned int *parm) - { - logentry(); - loginfo("Adding operation parameter, type: unsigned int, value: %u", (unsigned int)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, UINT)); - } - - void Operation::addParameter(const unsigned long *parm) - { - logentry(); - loginfo("Adding operation parameter, type: unsigned long, value: %lu", (unsigned long)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, ULONG)); - } - - void Operation::addParameter(const float *parm) - { - logentry(); - loginfo("Adding operation parameter, type: float, value: %f", (float)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, FLOAT)); - } - - void Operation::addParameter(const double *parm) - { - logentry(); - loginfo("Adding operation parameter, type: double, value: %lf", (double)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, DOUBLE)); - } - - void Operation::addParameter(const long double *parm) - { - logentry(); - loginfo("Adding operation parameter, type: long double, value: %Lf", (long double)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, LONGDOUBLE)); - } - - void Operation::addParameter(const char* *parm) - { - logentry(); - loginfo("Adding operation parameter, type: char*, value: %s", (const char*)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, CHARS)); - } - - void Operation::addParameter(const char *parm) - { - logentry(); - loginfo("Adding operation parameter, type: char, value: %d", (int)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, CHAR)); - } - - void Operation::addParameter(const string *parm) - { - logentry(); - loginfo("Adding operation parameter, type: string, value: %s", (const char*)(*parm).c_str()); - parameters.insert(parameters.end(), Parameter((void*)parm, STRING)); - } - - void Operation::addParameter(const DataObjectPtr *parm) - { - logentry(); - ostringstream os; - os << *parm; - loginfo("Adding operation parameter, type: DataObject, value: %s", os.str().c_str()); - parameters.insert(parameters.end(), Parameter((void*)new DataObjectPtr(*parm), DATAOBJECT)); - } - - // ======================================================= - // addParameter: set parameter at position pos with a name - // ======================================================= - void Operation::addParameter(const string& name, const void *parm) - { - logentry(); - loginfo("Adding operation parameter, name: %s, type: void, value: %p", name.c_str(), parm); - parameters.insert(parameters.end(), Parameter((void*)parm, VOID_TYPE, (string&) name)); - } - - void Operation::addParameter(const string& name, const bool *parm) - { - logentry(); - loginfo("Adding operation parameter, name: %s, type: bool, value: %d", name.c_str(), (int)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, BOOL, (string&) name)); - } - - void Operation::addParameter(const string& name, const short *parm) - { - logentry(); - loginfo("Adding operation parameter, name: %s, type: short, value: %hd", name.c_str(), (short)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, SHORT, (string&) name)); - } - - void Operation::addParameter(const string& name, const int *parm) - { - logentry(); - loginfo("Adding operation parameter, name: %s, type: int, value: %d", name.c_str(), (int)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, INT, (string&) name)); - } - - void Operation::addParameter(const string& name, const long *parm) - { - logentry(); - loginfo("Adding operation parameter, name: %s, type: long, value: %ld", name.c_str(), (long)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, LONG, (string&) name)); - } - - void Operation::addParameter(const string& name, const unsigned short *parm) - { - logentry(); - loginfo("Adding operation parameter, name: %s, type: unsigned short, value: %hu", (unsigned short)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, USHORT, (string&) name)); - } - - void Operation::addParameter(const string& name, const unsigned int *parm) - { - logentry(); - loginfo("Adding operation parameter, name: %s, type: unsigned int, value: %u", name.c_str(), (unsigned int)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, UINT, (string&) name)); - } - - void Operation::addParameter(const string& name, const unsigned long *parm) - { - logentry(); - loginfo("Adding operation parameter, name: %s, type: unsigned long, value: %lu", name.c_str(), (unsigned long)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, ULONG, (string&) name)); - } - - void Operation::addParameter(const string& name, const float *parm) - { - logentry(); - loginfo("Adding operation parameter, name: %s, type: float, value: %f", name.c_str(), (float)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, FLOAT, (string&) name)); - } - - void Operation::addParameter(const string& name, const double *parm) - { - logentry(); - loginfo("Adding operation parameter, name: %s, type: double, value: %lf", name.c_str(), (double)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, DOUBLE, (string&) name)); - } - - void Operation::addParameter(const string& name, const long double *parm) - { - logentry(); - loginfo("Adding operation parameter, name: %s, type: long double, value: %Lf", name.c_str(), (long double)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, LONGDOUBLE, (string&) name)); - } - - void Operation::addParameter(const string& name, const char* *parm) - { - logentry(); - loginfo("Adding operation parameter, name: %s, type: char*, value: %s", name.c_str(), (const char*)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, CHARS, (string&) name)); - } - - void Operation::addParameter(const string& name, const char *parm) - { - logentry(); - loginfo("Adding operation parameter, name: %s, type: char, value: %d", name.c_str(), (int)*parm); - parameters.insert(parameters.end(), Parameter((void*)parm, CHAR, (string&) name)); - } - - void Operation::addParameter(const string& name, const string *parm) - { - logentry(); - loginfo("Adding operation parameter, name: %s, type: string, value: %s", name.c_str(), (const char*)(*parm).c_str()); - parameters.insert(parameters.end(), Parameter((void*)parm, STRING, (string&) name)); - } - - void Operation::addParameter(const string& name, const DataObjectPtr *parm) - { - logentry(); - ostringstream os; - os << *parm; - loginfo("Adding operation parameter, name: %s, type: DataObject, value: %s", name.c_str(), os.str().c_str()); - parameters.insert(parameters.end(), Parameter((void*)new DataObjectPtr(*parm), DATAOBJECT, (string&) name)); - } - - Operation::Parameter::Parameter(void* val, Operation::ParameterType typ, const string& nam) - : value(val), type(typ), name(nam) - { - } - - // =========================================== - // setReturnValue - // =========================================== - void Operation::setReturnValue(const void *parm) - { - logentry(); - loginfo("Setting operation return value, type: void, value: %p", parm); - returnValue = Parameter((void*)parm, VOID_TYPE); - } - - void Operation::setReturnValue(const bool *parm) - { - logentry(); - loginfo("Setting operation return value, type: bool, value: %d", (bool)*parm); - returnValue = Parameter((void*)parm, BOOL); - } - - void Operation::setReturnValue(const short *parm) - { - logentry(); - loginfo("Setting operation return value, type: short, value: %h", (short)*parm); - returnValue = Parameter((void*)parm, SHORT); - } - - void Operation::setReturnValue(const int *parm) - { - logentry(); - loginfo("Setting operation return value, type: int, value: %d", (int)*parm); - returnValue = Parameter((void*)parm, INT); - } - - void Operation::setReturnValue(const long *parm) - { - logentry(); - loginfo("Setting operation return value, type: long, value: %l", (long)*parm); - returnValue = Parameter((void*)parm, LONG); - } - - void Operation::setReturnValue(const unsigned short *parm) - { - logentry(); - loginfo("Setting operation return value, type: unsigned short, value: %hu", (unsigned short)*parm); - returnValue = Parameter((void*)parm, USHORT); - } - - void Operation::setReturnValue(const unsigned int *parm) - { - logentry(); - loginfo("Setting operation return value, type: unsigned short, value: %u", (unsigned int)*parm); - returnValue = Parameter((void*)parm, UINT); - } - - void Operation::setReturnValue(const unsigned long *parm) - { - logentry(); - loginfo("Setting operation return value, type: unsigned long, value: %lu", (unsigned long)*parm); - returnValue = Parameter((void*)parm, ULONG); - } - - void Operation::setReturnValue(const float *parm) - { - logentry(); - loginfo("Setting operation return value, type: float, value: %f", (float)*parm); - returnValue = Parameter((void*)parm, FLOAT); - } - - void Operation::setReturnValue(const double *parm) - { - logentry(); - loginfo("Setting operation return value, type: double, value: %lf", (double)*parm); - returnValue = Parameter((void*)parm, DOUBLE); - } - - void Operation::setReturnValue(const long double *parm) - { - logentry(); - loginfo("Setting operation return value, type: long double, value: %Lf", (long double)*parm); - returnValue = Parameter((void*)parm, LONGDOUBLE); - } - - void Operation::setReturnValue(const char *parm) - { - logentry(); - loginfo("Setting operation return value, type: char, value: %d", (char)*parm); - returnValue = Parameter((void*)parm, CHAR); - } - - void Operation::setReturnValue(const char* *parm) - { - logentry(); - loginfo("Setting operation return value, type: char*, value: %s", (char*)*parm); - returnValue = Parameter((void*)parm, CHARS); - } - - void Operation::setReturnValue(const string *parm) - { - logentry(); - loginfo("Setting operation return value, type: string, value: %s", (*parm).c_str()); - returnValue = Parameter((void*)parm, STRING); - } - - void Operation::setReturnValue(const DataObjectPtr *parm) - { - logentry(); - ostringstream os; - os << *parm; - loginfo("Setting operation return value, type: DataObject, value: %s", os.str().c_str()); - returnValue = Parameter((void*)new DataObjectPtr(*parm), DATAOBJECT); - } - - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/Operation.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/Operation.h deleted file mode 100644 index 89cf0b63b7..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/Operation.h +++ /dev/null @@ -1,251 +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_core_operation_h -#define tuscany_sca_core_operation_h - -#include -#include - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/export.h" - - -namespace tuscany -{ - namespace sca - { - /** - * Holds the details of a single invocation of a business method. - * This class is used to pass the parameters and operation name from the - * client to a service. It will also hold the return value on the - * return from the business method. - */ - class Operation - { - public: - /** - * Create a new operation. - * @param operationName The method name of the business method to be invoked. - * @param numParameters The number of parameters to be passed. - */ - SCA_API Operation(const char* operationName = 0); - - /** - * Destructor. - */ - SCA_API virtual ~Operation(); - - /** - * Copy constructor. - */ - SCA_API Operation(const Operation& op); - - /** - * Assignment operator. - */ - SCA_API Operation& operator=(const Operation& op); - - /** - * Return the operation name. - * @return The name of the operation. - */ - SCA_API const std::string& getName() const {return name;} - - - enum ParameterType - { - UNSET = 0, - VOID_TYPE, - BOOL, - SHORT, - INT, - LONG, - USHORT, - UINT, - ULONG, - FLOAT, - DOUBLE, - LONGDOUBLE, - CHARS, - CHAR, - STRING, - DATAOBJECT - }; - - class Parameter - { - public: - SCA_API Parameter(void* value = NULL, ParameterType type = VOID_TYPE, const std::string& name = ""); - SCA_API void* getValue() const {return value;} - SCA_API ParameterType getType() const {return type;} - SCA_API const std::string& getName() const {return name;} - SCA_API bool hasName() const {return (name.length() > 0);} - - private: - std::string name; - void* value; - ParameterType type; - }; - - /** - * Set a return value for the operation. - * @param retVal Pointer to the return value. - */ - SCA_API void setReturnValue(const void *retVal); - SCA_API void setReturnValue(const bool *retVal); - SCA_API void setReturnValue(const short *retVal); - SCA_API void setReturnValue(const int *retVal); - SCA_API void setReturnValue(const long *retVal); - SCA_API void setReturnValue(const unsigned short *retVal); - SCA_API void setReturnValue(const unsigned int *retVal); - SCA_API void setReturnValue(const unsigned long *retVal); - SCA_API void setReturnValue(const float *retVal); - SCA_API void setReturnValue(const double *retVal); - SCA_API void setReturnValue(const long double *retVal); - SCA_API void setReturnValue(const char *retVal); - SCA_API void setReturnValue(const char* *retVal); - SCA_API void setReturnValue(const std::string *retVal); - SCA_API void setReturnValue(const commonj::sdo::DataObjectPtr *retVal); - - /** - * Set a parameter on the operation. - * @param parm Pointer to the parameter to be passed. - */ - SCA_API void addParameter(const void *parm); - SCA_API void addParameter(const bool *parm); - SCA_API void addParameter(const short *parm); - SCA_API void addParameter(const int *parm); - SCA_API void addParameter(const long *parm); - SCA_API void addParameter(const unsigned short *parm); - SCA_API void addParameter(const unsigned int *parm); - SCA_API void addParameter(const unsigned long *parm); - SCA_API void addParameter(const float *parm); - SCA_API void addParameter(const double *parm); - SCA_API void addParameter(const long double *parm); - SCA_API void addParameter(const char *parm); - SCA_API void addParameter(const char* *parm); - SCA_API void addParameter(const std::string *parm); - SCA_API void addParameter(const commonj::sdo::DataObjectPtr *parm); - - /** - * Set a parameter on the operation. - * @param name The name of the parameter in the parameter list. - * @param parm Pointer to the parameter to be passed. - */ - SCA_API void addParameter(const std::string& name, const void *parm); - SCA_API void addParameter(const std::string& name, const bool *parm); - SCA_API void addParameter(const std::string& name, const short *parm); - SCA_API void addParameter(const std::string& name, const int *parm); - SCA_API void addParameter(const std::string& name, const long *parm); - SCA_API void addParameter(const std::string& name, const unsigned short *parm); - SCA_API void addParameter(const std::string& name, const unsigned int *parm); - SCA_API void addParameter(const std::string& name, const unsigned long *parm); - SCA_API void addParameter(const std::string& name, const float *parm); - SCA_API void addParameter(const std::string& name, const double *parm); - SCA_API void addParameter(const std::string& name, const long double *parm); - SCA_API void addParameter(const std::string& name, const char *parm); - SCA_API void addParameter(const std::string& name, const char* *parm); - SCA_API void addParameter(const std::string& name, const std::string *parm); - SCA_API void addParameter(const std::string& name, const commonj::sdo::DataObjectPtr *parm); - - SCA_API unsigned int getNParms() const {return parameters.size();} - - /** - * Get a parameter from the operation. - * @param pos The position of the parameter in the parameter list. - * @return Pointer to the paramter at the given postion. Should be - * cast to the appropriate type. - */ - SCA_API const Parameter& getParameter(unsigned int pos) const; - - /** - * Get a parameter from the operation. - * @param name The name of the parameter in the parameter list. - * @return Pointer to the paramter with the given name. Should be - * cast to the appropriate type. - */ - SCA_API const Parameter& getParameter(const std::string& name) const; - - /** - * Get a parameter type from the operation. - * @param pos The position of the parameter in the parameter list. - * @return Type of the parameter at the given position. - */ - SCA_API ParameterType getParameterType(unsigned int pos) const; - - /** - * Get a parameter type from the operation. - * @param name The name of the parameter in the parameter list. - * @return Type of the parameter with the given name. - */ - SCA_API ParameterType getParameterType(const std::string& name) const; - - /** - * Get a parameter name from the operation. - * @param pos The position of the parameter in the parameter list. - * @return Name of the parameter at the given position. - */ - SCA_API const std::string& getParameterName(unsigned int pos) const; - - /** - * Get the parameter value from the operation. - * @param pos The position of the parameter in the parameter list. - * @return Pointer to the value of the parameter at the given postion. Should be - * cast to the appropriate type. - */ - SCA_API void* getParameterValue(unsigned int pos) const; - - /** - * Get the parameter value from the operation. - * @param name The name of the parameter in the parameter list. - * @return Pointer to the value of the parameter with the given name. Should be - * cast to the appropriate type. - */ - SCA_API void* getParameterValue(const std::string& name) const; - - SCA_API ParameterType getReturnType() const {return returnValue.getType();} - SCA_API void* getReturnValue() const {return returnValue.getValue();} - - private: - /** - * Operation name (method name). - */ - std::string name; - - /** - * Array of parameters. - */ - typedef std::vector PARAMETER_VECTOR; - - PARAMETER_VECTOR parameters; - - Parameter returnValue; - - void clean(); - void copy(const Operation& op); - - }; - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_core_operation_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/SCARuntime.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/SCARuntime.cpp deleted file mode 100644 index d605f37f95..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/SCARuntime.cpp +++ /dev/null @@ -1,616 +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/core/SCARuntime.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/model/ModelLoader.h" -#include "tuscany/sca/util/File.h" -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Component.h" - -using namespace std; -using namespace tuscany::sca::model; -using namespace tuscany::sca::util; - -namespace tuscany -{ - namespace sca - { - /** - * Environment variable names - */ - static const char* TUSCANY_SCACPP = "TUSCANY_SCACPP"; - static const char* TUSCANY_SCACPP_SYSTEM_ROOT = "TUSCANY_SCACPP_SYSTEM_ROOT"; - static const char* TUSCANY_SCACPP_DEFAULT_COMPONENT = "TUSCANY_SCACPP_DEFAULT_COMPONENT"; - - static const char* TUSCANY_SCACPP_ROOT = "TUSCANY_SCACPP_ROOT"; - static const char* TUSCANY_SCACPP_COMPONENT = "TUSCANY_SCACPP_COMPONENT"; - static const char* TUSCANY_SCACPP_PATH = "TUSCANY_SCACPP_PATH"; - static const char* TUSCANY_SCACPP_BASE_URI = "TUSCANY_SCACPP_BASE_URI"; - - // Initialize statics - SCARuntime* SCARuntime::sharedRuntime = NULL; - Mutex SCARuntime::sharedRuntimeLock; - ThreadLocal SCARuntime::current; - - - // =================================================================== - // Constructor for the SCARuntime class. This will - // hold all the information about the current runtime. - // =================================================================== - SCARuntime::SCARuntime(const string& insRoot, - const string& sysRoot, const string& sysPath, - const string& base, const string& defName) - : system(0), - installRoot(insRoot), systemRoot(sysRoot), systemPath(sysPath), - defaultBaseURI(base), defaultComponentName(defName) - { - logentry(); - - if (installRoot == "") - { - // Get install dir from environment variable TUSCANY_SCACPP - const char* root = getenv(TUSCANY_SCACPP); - if (root != NULL) - { - installRoot = root; - } - else - { - string msg = TUSCANY_SCACPP; - msg += " environment variable not set"; - throwException(SystemConfigurationException, msg.c_str()); - } - } - loginfo("SCA runtime install root: %s", installRoot.c_str()); - - if (systemRoot == "") - { - // Get root from environment variable TUSCANY_SCACPP_ROOT - char* systemRootEnv = getenv(TUSCANY_SCACPP_ROOT); - if (systemRootEnv == 0) - { - // Get root from environment variable TUSCANY_SCACPP_SYSTEM_ROOT - systemRootEnv = getenv(TUSCANY_SCACPP_SYSTEM_ROOT); - } - if (systemRootEnv == 0) - { - string msg = TUSCANY_SCACPP_ROOT; - msg += " environment variable not set"; - throwException(SystemConfigurationException, msg.c_str()); - } - - systemRoot = systemRootEnv; - } - else - { - loginfo("System root: %s", systemRoot.c_str()); - } - - if (systemPath == "") - { - - // Get system path from environment variable TUSCANY_SCACPP_PATH - char* systemPathEnv = getenv(TUSCANY_SCACPP_PATH); - if (systemPathEnv != 0) - { - systemPath = systemPathEnv; - } - } - else - { - loginfo("System path: %s", systemPath.c_str()); - } - - if (defaultBaseURI == "") - { - - // Get default base URI from environment variable TUSCANY_SCACPP_BASE_URI - char* baseURI = getenv(TUSCANY_SCACPP_BASE_URI); - if (baseURI != 0) - { - defaultBaseURI = baseURI; - } - } - else - { - loginfo("Default base URI: %s", defaultBaseURI.c_str()); - } - - if (defaultComponentName == "") - { - const char* defComp = getenv(TUSCANY_SCACPP_COMPONENT); - if (!defComp) - { - defComp = getenv(TUSCANY_SCACPP_DEFAULT_COMPONENT); - } - if (defComp) - { - defaultComponentName = defComp; - } - } - loginfo("Default component: %s", defaultComponentName.c_str()); - - SCARuntime* currentRuntime = (SCARuntime*)current.getValue(); - current.setValue(this); - try - { - - // Load the runtime extensions - loadExtensions(); - - // Load the system composite - loadSystem(); - } - catch (...) - { - current.setValue(currentRuntime); - throw; - } - current.setValue(currentRuntime); - - // Find the default component - if (defaultComponentName != "") - { - Component* comp = system->findComponent(defaultComponentName); - if (!comp) - { - string message = "Component \'" + defaultComponentName + "\' not found"; - throwException(SystemConfigurationException, message.c_str()); - } - defaultComponent.setValue(comp); - } - - } - - // =================================================================== - // Destructor for the SCARuntime class. - // =================================================================== - SCARuntime::~SCARuntime() - { - logentry(); - - if (system) - { - delete system; - } - } - - // ========================================================== - // Returns the system configuration root - // ========================================================== - const string& SCARuntime::getSystemRoot() - { - return systemRoot; - } - - // ========================================================== - // Returns the system path - // ========================================================== - const string& SCARuntime::getSystemPath() - { - return systemPath; - } - - // ========================================================== - // Returns the default component name - // ========================================================== - const string& SCARuntime::getDefaultComponentName() - { - return defaultComponentName ; - } - - // ========================================================== - // Returns the default base URI - // ========================================================== - const string& SCARuntime::getDefaultBaseURI() - { - return defaultBaseURI; - } - - // ========================================================== - // Returns the install root - // ========================================================== - const string& SCARuntime::getInstallRoot() - { - return installRoot; - } - - // ============================================================= - // Get the runtime associated with the current thread. - // ============================================================= - SCARuntime* SCARuntime::getCurrentRuntime() - { - logentry(); - - SCARuntime* runtime = (SCARuntime*)current.getValue(); - if (runtime == NULL) - { - runtime = getSharedRuntime(); - if (runtime != NULL) - { - setCurrentRuntime(runtime); - } - else - { - runtime = new SCARuntime(); - setCurrentRuntime(runtime); - } - } - loginfo("Runtime: %p", runtime); - return runtime; - } - - // ============================================================= - // Set the runtime associated with the current thread. - // ============================================================= - void SCARuntime::setCurrentRuntime(SCARuntime* runtime) - { - logentry(); - - loginfo("Runtime: %p", runtime); - current.setValue(runtime); - } - - // ============================================================= - // Get the runtime associated with the current process. - // ============================================================= - SCARuntime* SCARuntime::getSharedRuntime() - { - logentry(); - - sharedRuntimeLock.lock(); - SCARuntime* runtime = sharedRuntime; - sharedRuntimeLock.unlock(); - - return runtime; - } - - // ============================================================= - // Initialize the runtime associated with the current process. - // ============================================================= - SCARuntime* SCARuntime::initializeSharedRuntime(const string& installRoot, const string& systemRoot, - const string& systemPath, const string& baseURI, const string& defaultComponentName) - { - logentry(); - - SCARuntime* runtime; - - sharedRuntimeLock.lock(); - try - { - if (sharedRuntime == NULL) - { - sharedRuntime = new SCARuntime(installRoot, systemRoot, systemPath, baseURI, defaultComponentName); - } - else - { - if (installRoot.size() != 0 && sharedRuntime->getInstallRoot() != installRoot) - { - string msg = "Cannot reconfigure runtime installation directory: " + string(installRoot); - throwException(SystemConfigurationException, msg.c_str()); - } - if (systemRoot.size() != 0 && sharedRuntime->getSystemRoot() != systemRoot) - { - string msg = "Cannot reconfigure SCA system root: " + string(systemRoot); - throwException(SystemConfigurationException, msg.c_str()); - } - if (systemPath.size() != 0 && sharedRuntime->getSystemPath() != systemPath) - { - string msg = "Cannot reconfigure SCA system path: " + string(systemPath); - throwException(SystemConfigurationException, msg.c_str()); - } - if (baseURI.size() != 0 && sharedRuntime->getDefaultBaseURI() != baseURI) - { - string msg = "Cannot reconfigure SCA system URI: " + string(baseURI); - throwException(SystemConfigurationException, msg.c_str()); - } - if (defaultComponentName.size() != 0 && sharedRuntime->getDefaultComponentName() != defaultComponentName) - { - string msg = "Cannot reconfigure main SCA component: " + string(baseURI); - throwException(SystemConfigurationException, msg.c_str()); - } - } - - runtime = sharedRuntime; - } - catch (...) - { - sharedRuntimeLock.unlock(); - throw; - } - sharedRuntimeLock.unlock(); - - return runtime; - } - - // ====================================== - // Load the system composite - // ====================================== - void SCARuntime::loadSystem() - { - logentry(); - - system = new Composite("tuscany/sca/system", ""); - ModelLoader loader(this, system); - loader.load(systemRoot, systemPath); - } - - // ====================================== - // Load up extensions to the runtime - // ====================================== - void SCARuntime::loadExtensions() - { - logentry(); - - string extensionsRoot = installRoot + "/extensions"; - -#if defined(WIN32) || defined (_WINDOWS) - string libraryExtension = ".dll"; -#else -#if defined(IS_DARWIN) - string libraryExtension = ".dylib"; -#else - string libraryExtension = ".so"; -#endif -#endif - string pattern = "*" + libraryExtension; - - // Get list of all directories named "module" - Files extensionModules(extensionsRoot, "module", true, true); - loginfo("Found %i extension modules", extensionModules.size() ); - for (unsigned int emI=0; emI < extensionModules.size(); emI++) - { - string extensionRoot = extensionModules[emI].getDirectory().c_str(); - extensionRoot += "/module"; - loginfo("Loading extension module: %s", extensionRoot.c_str() ); - - Files files(extensionRoot, pattern, true); - loginfo("Found %i extension libraries", files.size() ); - for (unsigned int i=0; i < files.size(); i++) - { - try - { - string filename = files[i].getFileName(); - loginfo("Loading extension library: %s", filename ); - Library lib = Library( files[i].getDirectory() + "/" + filename); - - // Determine the name of the initialize method - // 1) strip the .dll/.so/.dylib suffix - // 2) for non-Windows strip any lib prefix - string initializeMethod; - #if defined(WIN32) || defined (_WINDOWS) - #else - if (filename.substr(0,3) == "lib") - { - initializeMethod = filename.substr(3, filename.size()-libraryExtension.size() - 3); - } - else - #endif - { - initializeMethod = filename.substr(0, filename.size()-libraryExtension.size()); - } - initializeMethod += "_initialize"; - TUSCANY_IMPLEMENTATION_EXTENSION_INITIALIZE extension = - (TUSCANY_IMPLEMENTATION_EXTENSION_INITIALIZE)lib.getSymbol(initializeMethod); - if (extension) - { - extension(); - extensionsList.push_back(lib); - } - } - catch (TuscanyRuntimeException& ex) - { - logwarning("Failed to load extension library: %s: %s: %s", - files[i].getFileName().c_str(), ex.getEClassName(), ex.getMessageText()); - } - } - } - } - - - // ====================================== - // register an interfaceExtension - // ====================================== - void SCARuntime::registerInterfaceExtension(InterfaceExtension* extension) - { - logentry(); - if (extension) - { - loginfo("Registering interface: %s", extension->getExtensionTypeQName().c_str()); - interfaceExtensions[extension->getExtensionTypeQName()] = extension; - } - } - - // ====================================== - // find an InterfaceExtension - // ====================================== - InterfaceExtension* SCARuntime::getInterfaceExtension(const string& extensionTypeQName) - { - return interfaceExtensions[extensionTypeQName]; - } - - // ====================================== - // register an implementationExtension - // ====================================== - void SCARuntime::registerImplementationExtension(ImplementationExtension* extension) - { - logentry(); - if (extension) - { - loginfo("Registering implementation: %s", extension->getExtensionTypeQName().c_str()); - implementationExtensions[extension->getExtensionTypeQName()] = extension; - } - } - - // ====================================== - // find an implementationExtension - // ====================================== - ImplementationExtension* SCARuntime::getImplementationExtension(const string& extensionTypeQName) - { - return implementationExtensions[extensionTypeQName]; - } - - // ====================================== - // register a referenceBindingExtension - // ====================================== - void SCARuntime::registerReferenceBindingExtension(ReferenceBindingExtension* extension) - { - logentry(); - if (extension) - { - loginfo("Registering reference binding: %s", extension->getExtensionTypeQName().c_str()); - referenceBindingExtensions[extension->getExtensionTypeQName()] = extension; - } - } - - // ====================================== - // find a referenceBindingExtension - // ====================================== - ReferenceBindingExtension* SCARuntime::getReferenceBindingExtension(const string& extensionTypeQName) - { - return referenceBindingExtensions[extensionTypeQName]; - } - - // ====================================== - // register a serviceBindingExtension - // ====================================== - void SCARuntime::registerServiceBindingExtension(ServiceBindingExtension* extension) - { - logentry(); - if (extension) - { - loginfo("Registering service binding: %s", extension->getExtensionTypeQName().c_str()); - serviceBindingExtensions[extension->getExtensionTypeQName()] = extension; - } - } - - // ====================================== - // find a serviceBindingExtension - // ====================================== - ServiceBindingExtension* SCARuntime::getServiceBindingExtension(const string& extensionTypeQName) - { - return serviceBindingExtensions[extensionTypeQName]; - } - - - // =================================== - // Return the top of the runtime model - // =================================== - Composite* SCARuntime::getSystem() - { - logentry(); - - return system; - } - - - // =================================================== - // setCurrentComponent: push component for this thread - // =================================================== - void SCARuntime::setCurrentComponent(Component* component) - { - logentry(); - - COMPONENT_STACK* compStack = (COMPONENT_STACK*)componentStack.getValue(); - if (compStack == NULL) - { - compStack = new COMPONENT_STACK(); - componentStack.setValue(compStack); - } - compStack->push(component); - } - - // ==================================================== - // unsetCurrentComponent: pop component for this thread - // ==================================================== - Component* SCARuntime::unsetCurrentComponent() - { - logentry(); - - COMPONENT_STACK* compStack = (COMPONENT_STACK*)componentStack.getValue(); - if (compStack != NULL) - { - if (compStack->size() > 0) - { - Component* component = compStack->top(); - compStack->pop(); - return component; - } - } - - return NULL; - } - - // ============================================================= - // getCurrentComponent: return current component for this thread - // ============================================================= - Component* SCARuntime::getCurrentComponent() - { - logentry(); - - COMPONENT_STACK* compStack = (COMPONENT_STACK*)componentStack.getValue(); - if (compStack != NULL) - { - if (compStack->size() > 0) - { - return compStack->top(); - } - } - - return NULL; - } - - // =========================================== - // getDefaultComponent: return the default composite component - // =========================================== - Component* SCARuntime::getDefaultComponent() - { - logentry(); - - Component* comp = (Component*)defaultComponent.getValue(); - if (comp == NULL && defaultComponentName != "") - { - comp = system->findComponent(defaultComponentName); - if (!comp) - { - string message = "Component \'" + defaultComponentName + "\' not found"; - throwException(SystemConfigurationException, message.c_str()); - } - defaultComponent.setValue(comp); - } - return comp; - } - - // =========================================== - // Set the default composite component - // =========================================== - void SCARuntime::setDefaultComponent(Component* component) - { - logentry(); - - return defaultComponent.setValue(component); - } - - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/SCARuntime.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/SCARuntime.h deleted file mode 100644 index ff93bd5005..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/SCARuntime.h +++ /dev/null @@ -1,295 +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_core_scaruntime_h -#define tuscany_sca_core_scaruntime_h - -#if defined(WIN32) || defined (_WINDOWS) -#include -#else -#include -#endif - -#include -#include -#include -#include - -#include "tuscany/sca/export.h" -#include "tuscany/sca/extension/InterfaceExtension.h" -#include "tuscany/sca/extension/ImplementationExtension.h" -#include "tuscany/sca/extension/ReferenceBindingExtension.h" -#include "tuscany/sca/extension/ServiceBindingExtension.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/util/Library.h" -#include "tuscany/sca/util/ThreadLocal.h" -#include "tuscany/sca/util/Mutex.h" - - -namespace tuscany -{ - namespace sca - { - - /** - * Represents an executing SCA runtime. - */ - class SCARuntime { - public: - - /** - * Constructor - */ - SCA_API SCARuntime(const std::string& installRoot = "", - const std::string& systemRoot = "", const std::string& systemPath = "", - const std::string& baseURI = "", const std::string& defaultComponentName = ""); - - /** - * Destructor - */ - SCA_API virtual ~SCARuntime(); - - /** - * Get the runtime associated with the current thread. - * @return The runtime associated with the current thread. - */ - SCA_API static SCARuntime* getCurrentRuntime(); - - /** - * Get the runtime associated with the current thread. - * @return The runtime associated with the current thread. - */ - SCA_API static void setCurrentRuntime(SCARuntime* runtime); - - /** - * Get the runtime associated with the current process. - * @return The runtime associated with the current process. - */ - SCA_API static SCARuntime* getSharedRuntime(); - - /** - * Initialize the runtime associated with the current process. - * @return The runtime associated with the current process. - */ - SCA_API static SCARuntime* initializeSharedRuntime(const std::string& installRoot = "", - const std::string& systemRoot = "", const std::string& systemPath = "", - const std::string& baseURI = "", const std::string& defaultComponentName = ""); - - /** - * Returns the directory in which the Tuscany runtime has been installed. - */ - SCA_API const std::string& getInstallRoot(); - - /** - * Returns the system root - */ - SCA_API const std::string& getSystemRoot(); - - /** - * Returns the search path for composites. - */ - SCA_API const std::string& getSystemPath(); - - /** - * Returns the default component name. - */ - SCA_API const std::string& getDefaultComponentName(); - - /** - * Returns the default base URI for the system - */ - SCA_API const std::string& getDefaultBaseURI(); - - /** - * Set the current component for the current thread. - * @param component The current component. - */ - SCA_API void setCurrentComponent(tuscany::sca::model::Component* component); - - /** - * Remove the current component from this thread, and return - * to the previous component (if there was one). - * @return The previous component. - */ - SCA_API tuscany::sca::model::Component* unsetCurrentComponent(); - - /** - * Get a pointer to the configured SCA system which this - * SCA runtime represents. - * The rest of the SCA configuration can be navigated from - * the System. - * @return The configured SCA system. - */ - SCA_API tuscany::sca::model::Composite* getSystem(); - - /** - * Return the current component for this thread. - * @return The current component for this thread. - */ - SCA_API tuscany::sca::model::Component* getCurrentComponent(); - - /** - * Get the default component set for the current thread. - * @return The default composite. - */ - SCA_API tuscany::sca::model::Component* getDefaultComponent(); - - /** - * Set the default component for the current thread. - * @return The default component. - */ - SCA_API void setDefaultComponent(tuscany::sca::model::Component* component); - - /** - * Register an implementation extension - */ - SCA_API void registerImplementationExtension(ImplementationExtension* extension); - - /** - * Returns the implementation extension associated with - * the specified qname - */ - SCA_API ImplementationExtension* getImplementationExtension(const std::string& typeQname); - - /** - * Register a reference binding extension - */ - SCA_API void registerReferenceBindingExtension(ReferenceBindingExtension* extension); - - /** - * Returns the reference binding extension associated with - * the specified qname - */ - SCA_API ReferenceBindingExtension* getReferenceBindingExtension(const std::string& typeQname); - - /** - * Register a service binding extension - */ - SCA_API void registerServiceBindingExtension(ServiceBindingExtension* extension); - - /** - * Returns the service binding extension associated with - * the specified qname - */ - SCA_API ServiceBindingExtension* getServiceBindingExtension(const std::string& typeQname); - - /** - * Register an interface extension - */ - SCA_API void registerInterfaceExtension(InterfaceExtension* extension); - - /** - * Returns the interface extension associated with - * the specified qname - */ - SCA_API InterfaceExtension* getInterfaceExtension(const std::string& typeQname); - - private: - - /** - * The runtime associated with the current thread. - */ - static tuscany::sca::util::ThreadLocal current; - - /** - * The runtime shared by all threads of the current process. - */ - static tuscany::sca::util::Mutex sharedRuntimeLock; - static SCARuntime* sharedRuntime; - - /** - * Pointer to the top of the runtime model. - */ - tuscany::sca::model::Composite* system; - - /** - * The installed path of the Tuscany runtime. - */ - std::string installRoot; - - /** - * The path to the system configuration - */ - std::string systemRoot; - - /** - * The search path for composites. - */ - std::string systemPath; - - /** - * The default base URI. - */ - std::string defaultBaseURI; - - /** - * The default CompositeComponent name. - */ - std::string defaultComponentName; - - /** - * Load the SCA configuration from the scdl files (sca.composite, - * *.fragment, etc). - * This will create the runtime model from which the SCA runtime - * will operate. - */ - void loadSystem(); - - /** - * Component stack for the current thread. - */ - typedef std::stack COMPONENT_STACK; - tuscany::sca::util::ThreadLocal componentStack; - - /** - * The default component for the current thread. - */ - tuscany::sca::util::ThreadLocal defaultComponent; - - /** - * Runtime Extensions - */ - typedef std::map IMPLEMENTATION_EXTENSIONS_MAP; - IMPLEMENTATION_EXTENSIONS_MAP implementationExtensions; - - typedef std::map REFERENCE_BINDING_EXTENSIONS_MAP; - REFERENCE_BINDING_EXTENSIONS_MAP referenceBindingExtensions; - - typedef std::map SERVICE_BINDING_EXTENSIONS_MAP; - SERVICE_BINDING_EXTENSIONS_MAP serviceBindingExtensions; - - typedef std::map INTERFACE_EXTENSIONS_MAP; - INTERFACE_EXTENSIONS_MAP interfaceExtensions; - - void loadExtensions(); - - typedef std::list EXTENSIONS_LIST; - EXTENSIONS_LIST extensionsList; - - }; - - } // End namespace sca -} // End namespace tuscany - -typedef void (* TUSCANY_IMPLEMENTATION_EXTENSION_INITIALIZE) (); - -#endif // tuscany_sca_core_scaruntime_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp deleted file mode 100644 index c54d7648e3..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp +++ /dev/null @@ -1,50 +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/core/ServiceProxy.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/Exceptions.h" - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - // ============================ - // Constructor: Create a proxy - // ============================ - ServiceProxy::ServiceProxy(Reference* reference) - : reference(reference) - { - logentry(); - } - - // ========== - // Destructor - // ========== - ServiceProxy::~ServiceProxy() - { - logentry(); - } - - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/ServiceProxy.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/ServiceProxy.h deleted file mode 100644 index f1a0309be1..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/ServiceProxy.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_core_serviceproxy_h -#define tuscany_sca_core_serviceproxy_h - -#include "tuscany/sca/export.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Reference.h" - - -namespace tuscany -{ - namespace sca - { - - /** - * Holds a proxy for a given component and reference. - * The proxy which is held inside a ServiceProxy will be specific to the component - * and reference and will have been code generated and be contained in a dll - * created by a developer of an SCA application. - */ - class SCA_API 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. - */ - ServiceProxy(tuscany::sca::model::Reference* reference); - - /** - * Destructor. - */ - virtual ~ServiceProxy(); - - /** - * Returns the reference represented by this proxy. - * @return The Reference represented by this proxy. - */ - tuscany::sca::model::Reference* getReference() const { return reference; }; - - private: - - /** - * The reference represented by this proxy. - */ - tuscany::sca::model::Reference* reference; - - }; - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_core_serviceproxy_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/ServiceWrapper.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/ServiceWrapper.cpp deleted file mode 100644 index 17666a5bb7..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/ServiceWrapper.cpp +++ /dev/null @@ -1,50 +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/core/ServiceWrapper.h" -#include "tuscany/sca/util/Logging.h" - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - - // =========== - // Constructor - // =========== - ServiceWrapper::ServiceWrapper(Service* service) - : service(service) - { - logentry(); - } - - // ========== - // Destructor - // ========== - ServiceWrapper::~ServiceWrapper() - { - logentry(); - } - - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/ServiceWrapper.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/ServiceWrapper.h deleted file mode 100644 index 6a44c57675..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/core/ServiceWrapper.h +++ /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$ */ - -#ifndef tuscany_sca_core_servicewrapper_h -#define tuscany_sca_core_servicewrapper_h - -#include "tuscany/sca/export.h" -#include "tuscany/sca/core/Operation.h" -#include "tuscany/sca/model/Service.h" - - -namespace tuscany -{ - namespace sca - { - - /** - * An abstract class that wraps a component implementation or an external - * service. - */ - class SCA_API ServiceWrapper - { - public: - /** - * Constructor. - * @param target The service wrapper wraps the target of a wire. - */ - ServiceWrapper(tuscany::sca::model::Service* service); - - /** - * Destructor. - */ - virtual ~ServiceWrapper(); - - /** - * Get the service represented by this wrapper. - * @return The service represented by this wrapper. - */ - tuscany::sca::model::Service* getService() const { return service; } - - /** - * All business method calls on the target service are performed through - * this invoke method. - * @param operation The details of the method, paramaters and return value for the - * business method to be called on the target service. - */ - virtual void invoke(Operation& operation) = 0; - - private: - /** - * The target represented by this wrapper. - */ - tuscany::sca::model::Service* service; - - }; - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_core_servicewrapper_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/export.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/export.h deleted file mode 100644 index 79b02fe4cf..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/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_export_h -#define tuscany_sca_export_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) - -#ifdef SCA_EXPORTS -#define SCA_API __declspec(dllexport) -#else -#define SCA_API __declspec(dllimport) -#endif - -#else -#include -#include -#include -#define SCA_API -#endif - -#endif // tuscany_sca_export_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ImplementationExtension.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ImplementationExtension.cpp deleted file mode 100644 index a20cf1f6da..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ImplementationExtension.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/extension/ImplementationExtension.h" -#include "tuscany/sca/util/Logging.h" - -namespace tuscany -{ - namespace sca - { - // =================================================================== - // Constructor for the ImplementationExtension class. - // =================================================================== - ImplementationExtension::ImplementationExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the ImplementationExtension class. - // =================================================================== - ImplementationExtension::~ImplementationExtension() - { - logentry(); - } - - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ImplementationExtension.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ImplementationExtension.h deleted file mode 100644 index 524af2df77..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ImplementationExtension.h +++ /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$ */ - -#ifndef tuscany_sca_extension_implementationextension_h -#define tuscany_sca_extension_implementationextension_h - -#include - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/export.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/model/Composite.h" - -namespace tuscany -{ - namespace sca - { - class SCA_API ImplementationExtension - { - public: - /** - * Default constructor - */ - ImplementationExtension(); - - /** - * Destructor - */ - virtual ~ImplementationExtension(); - - /** - * return the name of the extension (e.g. "cpp" "php") - */ - virtual const std::string& getExtensionName() = 0; - - /** - * return the QName of schema elemant for this implementation extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#implementation.cpp") - */ - virtual const std::string& getExtensionTypeQName() = 0; - - /** - * Get an implementation from a DataObject representing - * an SCDL implementation element - */ - virtual tuscany::sca::model::ComponentType* getImplementation( - tuscany::sca::model::Composite* composite, - commonj::sdo::DataObjectPtr scdlImplementation) = 0; - - }; - - - } // End namespace sca -} // End namespace tuscany - - -#endif // tuscany_sca_extension_implementationextension_h - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/InterfaceExtension.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/InterfaceExtension.cpp deleted file mode 100644 index 584945344b..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/InterfaceExtension.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/extension/InterfaceExtension.h" -#include "tuscany/sca/util/Logging.h" - -namespace tuscany -{ - namespace sca - { - // =================================================================== - // Constructor for the InterfaceExtension class. - // =================================================================== - InterfaceExtension::InterfaceExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the InterfaceExtension class. - // =================================================================== - InterfaceExtension::~InterfaceExtension() - { - logentry(); - } - - - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/InterfaceExtension.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/InterfaceExtension.h deleted file mode 100644 index 5329104c77..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/InterfaceExtension.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_extension_interfaceextension_h -#define tuscany_sca_extension_interfaceextension_h - -#include - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/export.h" -#include "tuscany/sca/model/Interface.h" -#include "tuscany/sca/model/Composite.h" - - -namespace tuscany -{ - namespace sca - { - class SCA_API InterfaceExtension - { - public: - /** - * Default constructor - */ - InterfaceExtension(); - - /** - * Destructor - */ - virtual ~InterfaceExtension(); - - /** - * return the name of the extension (e.g. "cpp" "php") - */ - virtual const std::string& getExtensionName() = 0; - - /** - * return the QName of schema elemant for this interface extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#interface.cpp") - */ - virtual const std::string& getExtensionTypeQName() = 0; - - /** - * Get an interface from a DataObject representing an - * SCDL interface - */ - virtual tuscany::sca::model::Interface* getInterface( - tuscany::sca::model::Composite *composite, - commonj::sdo::DataObjectPtr scdlInterface) = 0; - - }; - - - } // End namespace sca -} // End namespace tuscany - - -#endif // tuscany_sca_extension_interfaceextension_h - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.cpp deleted file mode 100644 index a7f60dcbec..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.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/extension/ReferenceBindingExtension.h" -#include "tuscany/sca/util/Logging.h" - -namespace tuscany -{ - namespace sca - { - // =================================================================== - // Constructor for the ReferenceBindingExtension class. - // =================================================================== - ReferenceBindingExtension::ReferenceBindingExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the ReferenceBindingExtension class. - // =================================================================== - ReferenceBindingExtension::~ReferenceBindingExtension() - { - logentry(); - } - - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.h deleted file mode 100644 index c3d1e97c9e..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ReferenceBindingExtension.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_extension_referencebindingextension_h -#define tuscany_sca_extension_referencebindingextension_h - -#include - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/export.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/ReferenceBinding.h" - - -namespace tuscany -{ - namespace sca - { - class SCA_API ReferenceBindingExtension - { - public: - /** - * Default constructor - */ - ReferenceBindingExtension(); - - /** - * Destructor - */ - virtual ~ReferenceBindingExtension(); - - /** - * return the name of the extension (e.g. "cpp" "php") - */ - virtual const std::string& getExtensionName() = 0; - - /** - * return the QName of schema elemant for this binding extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.ws") - */ - virtual const std::string& getExtensionTypeQName() = 0; - - /** - * Get a reference binding from a DataObject representing - * an SCDL binding element - */ - virtual tuscany::sca::model::ReferenceBinding* getReferenceBinding( - tuscany::sca::model::Composite* composite, - tuscany::sca::model::Reference* reference, - commonj::sdo::DataObjectPtr scdlBinding) = 0; - - }; - - - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_referencebindingextension_h - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.cpp deleted file mode 100644 index f5fe361d36..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.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/extension/ServiceBindingExtension.h" -#include "tuscany/sca/util/Logging.h" - -namespace tuscany -{ - namespace sca - { - // =================================================================== - // Constructor for the ServiceBindingExtension class. - // =================================================================== - ServiceBindingExtension::ServiceBindingExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the ServiceBindingExtension class. - // =================================================================== - ServiceBindingExtension::~ServiceBindingExtension() - { - logentry(); - } - - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.h deleted file mode 100644 index d2f7e72ed0..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/extension/ServiceBindingExtension.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_extension_servicebindingextension_h -#define tuscany_sca_extension_servicebindingextension_h - -#include - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/export.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/ServiceBinding.h" - - -namespace tuscany -{ - namespace sca - { - class SCA_API ServiceBindingExtension - { - public: - /** - * Default constructor - */ - ServiceBindingExtension(); - - /** - * Destructor - */ - virtual ~ServiceBindingExtension(); - - /** - * return the name of the extension (e.g. "cpp" "php") - */ - virtual const std::string& getExtensionName() = 0; - - /** - * return the QName of schema elemant for this binding extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.ws") - */ - virtual const std::string& getExtensionTypeQName() = 0; - - /** - * Get a reference binding from a DataObject representing - * an SCDL binding element - */ - virtual tuscany::sca::model::ServiceBinding* getServiceBinding( - tuscany::sca::model::Composite* composite, - tuscany::sca::model::Service* service, - commonj::sdo::DataObjectPtr scdlBinding) = 0; - - }; - - - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_servicebindingextension_h - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Binding.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Binding.cpp deleted file mode 100644 index a654b9f0f7..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Binding.cpp +++ /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. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/model/Binding.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - - namespace model - { - - // Constructor - Binding::Binding(const string& uri) : uri(uri) - { - logentry(); - } - - // Destructor - Binding::~Binding() - { - logentry(); - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Binding.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Binding.h deleted file mode 100644 index 66dc66e853..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Binding.h +++ /dev/null @@ -1,83 +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_model_binding_h -#define tuscany_sca_model_binding_h - -#include - -namespace tuscany -{ - namespace sca - { - namespace model - { - /** - * Represents a binding. - * Bindings are used by services and references. References use bindings - * to describe the access mechanism used to call an external service (which can - * be a service provided by another SCA composite). Services use bindings to describe - * the access mechanism that clients (which can be a client from another SCA composite) - * have to use to call the service. - * This interface will typically be extended by binding implementations to allow - * specification of binding/transport specific information. - */ - class Binding - { - - public: - - /** - * Constructor to create a new binding. - * @param uri The binding URI. - */ - SCA_API Binding(const std::string& uri); - - /** - * Destructor. - */ - SCA_API virtual ~Binding(); - - /** - * Returns the binding type - * @return The binding type. - */ - SCA_API virtual std::string getType() = 0; - - /** - * Returns the binding URI. - * @return The binding URI. - */ - SCA_API virtual const std::string& getURI() const { return uri; }; - - private: - - /** - * The binding URI. - */ - std::string uri; - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_binding_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Component.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Component.cpp deleted file mode 100644 index 37bf381811..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Component.cpp +++ /dev/null @@ -1,148 +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/util/Logging.h" -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/model/ComponentType.h" - -using namespace std; -using namespace commonj::sdo; - -namespace tuscany -{ - namespace sca - { - namespace model - { - // Constructor - Component::Component(Composite* composite, const std::string& componentName, ComponentType *componentType) - : name(componentName), composite(composite), type(componentType) - { - logentry(); - loginfo("Component name: %s", name.c_str()); - - // Initialize the component from its component type - componentType->initializeComponent(this); - - } - - Component::~Component() - { - logentry(); - } - - void Component::addService(Service* service) - { - logentry(); - services[service->getType()->getName()] = service; - } - - Service* Component::findService(const string& serviceName) - { - logentry(); - - // If serviceName is empty then return the ONLY service - if (serviceName == "" - && services.size() == 1) - { - return services.begin()->second; - } - else - { - Service* service = services[serviceName]; - if (service == NULL) - { - // A service with an empty name will match any service name - service = services[""]; - } - return service; - } - } - - void Component::addReference(Reference* reference) - { - logentry(); - references[reference->getType()->getName()] = reference; - } - - Reference* Component::findReference(const std::string& referenceName) - { - logentry(); - return references[referenceName]; - } - - DataObjectPtr Component::getProperties() - { - logentry(); - - if (!properties) - { - properties = type->getPropertyDataFactory()->create("org/osoa/sca", "Properties"); - } - return properties; - } - - void Component::setProperty(const string& name, DataObjectPtr value) - { - logentry(); - - DataObjectPtr props = getProperties(); - - // Get the property's type - PropertyPtr propProperty = props->getInstanceProperty(name); - if (!propProperty) { - std::string msg("Property not found: "); - msg += name; - throwException(SystemConfigurationException, msg.c_str()); - } - const Type& propType = propProperty->getType(); - if (propType.isDataType()) - { - if (propProperty->isMany()) - { - DataObjectList& dol = props->getList(*propProperty); - dol.append(value->getCString("")); - } - else - { - props->setCString(*propProperty, value->getCString("")); - } - } - else - { - // Create a new instance of the DO - // iterate over properties setting each one - // for now: - props->setDataObject(*propProperty, value); - } - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Component.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Component.h deleted file mode 100644 index 882d79a94c..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Component.h +++ /dev/null @@ -1,183 +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_model_component_h -#define tuscany_sca_model_component_h - -#include -#include - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/export.h" - - -namespace tuscany -{ - namespace sca - { - namespace model - { - - class Composite; - class ComponentType; - class Reference; - class ReferenceType; - class Service; - class ServiceType; - - /** - * A component is a configured instance of an implementation. Components provide - * and consume services. More than one component can use and configure the same - * implementation, where each component configures the implementation differently. - * For example each component may configure a reference of the same implementation - * to consume a different service. - */ - class Component - { - public: - - /** - * Constructor - * @param composite The composite containing the component. - * @param name The name of the component. - */ - SCA_API Component(Composite *composite, const std::string& name, ComponentType *type); - - /** - * Destructor. - */ - SCA_API virtual ~Component(); - - /** - * Returns the name of this component. - * @return the name of this component - */ - SCA_API const std::string& getName() const { return name; } - - /** - * Returns the composite containing this component. - * @return The composite containing this component. - */ - SCA_API Composite* getComposite() const { return composite; } - - /** - * Returns the type of this component. - * @return The type of this component. - */ - SCA_API ComponentType* getType() const { return type; } - - /** - * Add a new service to this component. - * @param service The service to add. - */ - SCA_API void addService(Service* service); - - /** - * Find an existing service on this component. - * @param serviceName The name of the service to find. - * If the serviceName is the zero length string then if there is - * only one service it will be returned. - * @return The found service, or 0 if not found. - */ - SCA_API Service* findService(const std::string& serviceName); - - /** - * Add a new reference to this component. - * @param reference The reference to add. - */ - SCA_API void addReference(Reference* reference); - - /** - * Find an existing reference on this component. - * @param referenceName The name of the reference to find. - * @return The found reference, or 0 if not found. - */ - SCA_API Reference* findReference(const std::string& referenceName); - - /** - * Returns all the services defined on this component. - * @return All the services defined on this component. - */ - typedef std::map SERVICE_MAP; - SCA_API const SERVICE_MAP& getServices() const { return services; }; - - /** - * Returns all the references defined on this component. - * @return All the references defined on this component. - */ - typedef std::map REFERENCE_MAP; - SCA_API const REFERENCE_MAP& getReferences() const { return references; }; - - /** - * Set the value of a property defined on this component. The values - * will usually come from a component declaration in a composite file. - * @param name The name of the property. - * @param value The value of the property. - */ - SCA_API void setProperty(const std::string& name, commonj::sdo::DataObjectPtr value); - - /** - * Returns a data object from which all the properties of the component - * and their values can be accessed. - * @return A data object holding the property values. - */ - SCA_API commonj::sdo::DataObjectPtr getProperties(); - - private: - - /** - * Name of the component. - */ - std::string name; - - /** - * Composite containing the component. - */ - Composite* composite; - - /** - * Type of the component. - */ - ComponentType* type; - - /** - * Map of all the services defined on this component. - */ - SERVICE_MAP services; - - /** - * Map of all the references defined on this component. - */ - REFERENCE_MAP references; - - /** - * The properties and their values for this component. - */ - commonj::sdo::DataObjectPtr properties; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_component_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ComponentType.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ComponentType.cpp deleted file mode 100644 index 20e70ede20..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ComponentType.cpp +++ /dev/null @@ -1,294 +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/util/Logging.h" -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/model/ComponentType.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/ReferenceType.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" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::util; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - // Constructor - ComponentType::ComponentType(Composite* composite, const string& name) - : composite(composite), name(name) - { - logentry(); - } - - // Destructor - ComponentType::~ComponentType() - { - logentry(); - } - - void ComponentType::addServiceType(ServiceType* serviceType) - { - logentry(); - serviceTypes[serviceType->getName()] = serviceType; - } - - ServiceType* ComponentType::findServiceType(const string& serviceName) - { - logentry(); - - // If serviceName is empty then return the ONLY service - if (serviceName == "" - && serviceTypes.size() == 1) - { - return serviceTypes.begin()->second; - } - else - { - return serviceTypes[serviceName]; - } - } - - void ComponentType::addReferenceType(ReferenceType* referenceType) - { - logentry(); - - referenceTypes[referenceType->getName()] = referenceType; - } - - ReferenceType* ComponentType::findReferenceType(const string& referenceName) - { - logentry(); - - return referenceTypes[referenceName]; - } - - void ComponentType::addPropertyType(const string& name, - const string& type, - bool many, - DataObjectPtr* defaultValue) - { - logentry(); - - // Create a Type in the Properties dataFactory - DataFactoryPtr factory = getPropertyDataFactory(); - - string typeUri, typeName; - Utils::tokeniseQName(type, typeUri, typeName); - - if (typeUri == "http://www.w3.org/2001/XMLSchema") - { - typeUri = "commonj.sdo"; - if (typeName == "string") - { - typeName = "String"; - } - else if (typeName == "anyType") - { - typeName = "DataObject"; - } - else if (typeName == "int") - { - typeName = "Int"; - } - else if (typeName == "integer") - { - typeName = "Integer"; - } - else if (typeName == "negativeInteger") - { - typeName = "Integer"; - } - else if (typeName == "nonNegativeInteger") - { - typeName = "Integer"; - } - else if (typeName == "positiveInteger") - { - typeName = "Integer"; - } - else if (typeName == "nonPositiveInteger") - { - typeName = "Integer"; - } - else if (typeName == "unsignedLong") - { - typeName = "Integer"; - } - else if (typeName == "unsignedShort") - { - typeName = "Integer"; - } - else if (typeName == "unsignedInt") - { - typeName = "Long"; - } - else if (typeName == "long") - { - typeName = "Long"; - } - else if (typeName == "double") - { - typeName = "Double"; - } - else if (typeName == "short") - { - typeName = "Short"; - } - else if (typeName == "unsignedByte") - { - typeName = "Short"; - } - else if (typeName == "float") - { - typeName = "Float"; - } - else if (typeName == "boolean") - { - typeName = "Boolean"; - } - else if (typeName == "byte") - { - typeName = "Byte"; - } - else if (typeName == "base64Binary") - { - typeName = "Bytes"; - } - else if (typeName == "hexBinary") - { - typeName = "Bytes"; - } - else if (typeName == "anyURI") - { - typeName = "URI"; - } - else if (typeName == "QName") - { - typeName = "URI"; - } - else - { - // Default unknown xs: types to string?? - typeName = "String"; - } - } - else - { - // It's not an XML type - } - - factory->addPropertyToType( - "org/osoa/sca", - "Properties", - name.c_str(), - typeUri.c_str(), - typeName.c_str(), - many, - false, - true); - - // Set the default for a dataType - if (defaultValue!=NULL) - { - try - { - const Type& propType = factory->getType(typeUri.c_str(), typeName.c_str()); - if (propType.isDataType()) - { - factory->setDefault("org/osoa/sca", "Properties", - name.c_str(), - (char*)(*defaultValue)->getCString("")); - } - } - catch (SDOTypeNotFoundException&) - { - } - } - } - - const Property* ComponentType::findPropertyType(const string& propertyName) - { - logentry(); - const Property* property = NULL; - - DataFactoryPtr dataFactory = getPropertyDataFactory(); - const Type& propertiesType = dataFactory->getType("org/osoa/sca", "Properties"); - - try - { - const Property& prop = propertiesType.getProperty(propertyName); - property = ∝ - } - catch(SDOPropertyNotFoundException) - { - loginfo("Property named %s not found, returning null", propertyName.c_str()); - } - return property; - } - - DataFactoryPtr ComponentType::getPropertyDataFactory() - { - logentry(); - - if (!propertyFactory) - { - propertyFactory = DataFactory::getDataFactory(); - // Add the root type - propertyFactory->addType("org/osoa/sca", "Properties", false, false, false, false); - } - return propertyFactory; - } - - void ComponentType::initializeComponent(Component* component) - { - logentry(); - - for (SERVICETYPE_MAP::iterator iter = serviceTypes.begin(); - iter != serviceTypes.end(); - iter++) - { - Service* service = new Service(component, iter->second); - component->addService(service); - } - for (REFERENCETYPE_MAP::iterator refiter = referenceTypes.begin(); - refiter != referenceTypes.end(); - refiter++) - { - Reference* reference = new Reference(component, refiter->second); - component->addReference(reference); - } - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ComponentType.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ComponentType.h deleted file mode 100644 index 86f17890e9..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ComponentType.h +++ /dev/null @@ -1,186 +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_model_componenttype_h -#define tuscany_sca_model_componenttype_h - -#include -#include - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/model/ReferenceType.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - class ServiceType; - class ReferenceType; - class Interface; - class Component; - class Composite; - - /** - * Component type represents the configurable aspects of an implementation. - * A component type consists of services that are offered, references to other services - * that can be wired and properties that can be set. The settable properties and the settable - * references to services are configured by a component which uses the implementation. - * The component type can be thought of as the contract which is honoured by an implementation. - */ - class ComponentType - { - public: - - /** - * Constructor - */ - SCA_API ComponentType(Composite* composite, const std::string& name); - - /** - * Destructor. - */ - SCA_API virtual ~ComponentType(); - - /** - * Returns the name of the component type - */ - SCA_API const std::string& getName() const { return name; }; - - /** - * Returns the composite containing this component type - */ - SCA_API Composite* getComposite() const { return composite; }; - - /** - * Add a new service type to this component type. - * @param serviceType The service type to add. - */ - SCA_API virtual void addServiceType(ServiceType* serviceType); - - /** - * Find an existing service type on this component type. - * @param serviceName The name of the service type to find. - * If the serviceName is the zero length string then if there is - * only one service type it will be returned. - * @return The found service, or 0 if not found. - */ - SCA_API virtual ServiceType* findServiceType(const std::string& serviceName); - - /** - * Add a new reference type to this component type. - * @param referenceType The reference type to add. - */ - SCA_API virtual void addReferenceType(ReferenceType* referenceType); - - /** - * Find an existing reference type on this component type. - * @param referenceName The name of the reference type to find. - * @return The found reference type, or 0 if not found. - */ - SCA_API virtual ReferenceType* findReferenceType(const std::string& referenceName); - - /** - * Returns the service types defined on this component. - * @return The service types defined on this component. - */ - typedef std::map SERVICETYPE_MAP; - SERVICETYPE_MAP getServiceTypes() const { return serviceTypes; }; - - /** - * Returns the reference types defined on this component. - * @return The reference types defined on this component. - */ - typedef std::map REFERENCETYPE_MAP; - REFERENCETYPE_MAP getReferenceTypes() const { return referenceTypes; }; - - /** - * Add a new property type to this component type. Property types are added - * one at a time. The property definitions usually come from a component type file. - * @param name The name of the property type. - * @param type The full name of the property data type (including uri and local name). - * @param many True if this is a many valued property. - * @param defaultValue The default value if the property does not have a - * value set. - */ - SCA_API virtual void addPropertyType(const std::string& name, - const std::string& type, - bool many, - commonj::sdo::DataObjectPtr* defaultValue); - - /** - * Find an existing property type on this component type. - * @param propertyName The name of the property type to find. - * @return The found property, or 0 if not found. - */ - SCA_API virtual const commonj::sdo::Property* findPropertyType(const std::string& propertyName); - - /** - * Return the SDO data factory which has the types of the properties defined - * in this component type. - * @return The data factory. - */ - SCA_API virtual commonj::sdo::DataFactoryPtr getPropertyDataFactory(); - - /** - * Initialize a component of this type. - * @param component The component to initialize. - */ - SCA_API virtual void initializeComponent(Component* component); - - private: - - /** - * The name of the component type - */ - std::string name; - - /** - * The composite containing this component type - */ - Composite* composite; - - /** - * Map of all the service types defined on this component. - */ - SERVICETYPE_MAP serviceTypes; - - /** - * Map of all the reference types defined on this component. - */ - REFERENCETYPE_MAP referenceTypes; - - /** - * SDO data factory which has all the types of the properties defined in - * this component type - */ - commonj::sdo::DataFactoryPtr propertyFactory; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_componenttype_h - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Composite.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Composite.cpp deleted file mode 100644 index 6456b0cede..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Composite.cpp +++ /dev/null @@ -1,427 +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/model/Composite.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/CompositeReference.h" -#include "tuscany/sca/model/CompositeReferenceBinding.h" -#include "tuscany/sca/model/CompositeService.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/model/Wire.h" -#include "tuscany/sca/model/WSDLDefinition.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/ServiceBinding.h" -#include "tuscany/sca/model/ReferenceBinding.h" - -using namespace std; -using namespace tuscany::sca::util; - -namespace tuscany -{ - namespace sca - { - - namespace model - { - - // Constructor - Composite::Composite(const string& name, const string& root) - : ComponentType(0, name), root(root) - { - logentry(); - } - -#if defined(COPY_COMPOSITES_ON_INSTANCIATION) - // Constructor - Composite::Composite(Composite* templateComposite, Composite* containerComposite) - : ComponentType(containerComposite, templateComposite->getName()), root(templateComposite->root) - { - logentry(); - components = templateComposite->components; - includes = templateComposite->includes; - wires = templateComposite->wires; - wsdlDefinitions = templateComposite->wsdlDefinitions; - // Copy all services from the cloned template - SERVICETYPE_MAP serviceTypeMap = templateComposite->getServiceTypes(); - for (SERVICETYPE_MAP::iterator serviter = serviceTypeMap.begin(); - serviter != serviceTypeMap.end(); - ++serviter) - { - addServiceType(serviter->second); - } - // Copy all references from the cloned template - REFERENCETYPE_MAP referenceTypeMap = templateComposite->getReferenceTypes(); - for (REFERENCETYPE_MAP::iterator refiter = referenceTypeMap.begin(); - refiter != referenceTypeMap.end(); - refiter++) - { - addReferenceType(refiter->second); - } - // Copy the dataFactory from the cloned template - commonj::sdo::DataFactoryPtr propertyFactory = getPropertyDataFactory(); - commonj::sdo::DataFactoryPtr dataFactory = templateComposite->getPropertyDataFactory(); - commonj::sdo::TypeList typeList = dataFactory->getTypes(); - for (int typeiter1=0; - typeiter1 < typeList.size(); - ++typeiter1) - { - const commonj::sdo::Type& type = typeList[typeiter1]; - propertyFactory->addType( - type.getURI(), - type.getName(), - type.isSequencedType(), - type.isOpenType(), - type.isAbstractType(), - type.isDataType()); - } - for (int typeiter2=0; - typeiter2 < typeList.size(); - ++typeiter2) - { - const commonj::sdo::Type& type = typeList[typeiter2]; - commonj::sdo::PropertyList propertyList = type.getProperties(); - for (int propertyiter=0; - propertyiter < propertyList.size(); - ++propertyiter) - { - const commonj::sdo::Property& property = propertyList[propertyiter]; - propertyFactory->addPropertyToType( - type.getURI(), - type.getName(), - property.getName(), - property.getType().getURI(), - property.getType().getName(), - property.isMany(), - property.isReadOnly(), - property.isContainment()); - } - for (int propertyiter=0; - propertyiter < propertyList.size(); - ++propertyiter) - { - const commonj::sdo::Property& property = propertyList[propertyiter]; - for (int aliasiter = 0; - aliasiter < property.getAliasCount(); - ++aliasiter) - { - propertyFactory->setAlias( - type.getURI(), - type.getName(), - property.getName(), - property.getAlias(aliasiter)); - } - } - for (int aliasiter = 0; - aliasiter < type.getAliasCount(); - ++aliasiter) - { - propertyFactory->setAlias( - type.getURI(), - type.getName(), - type.getAlias(aliasiter)); - } - if ( type.getBaseType() ) - { - propertyFactory->setBaseType( - type.getURI(), - type.getName(), - type.getBaseType()->getURI(), - type.getBaseType()->getName(), - false); //TODO: Where do we know if the cloned Type is a restriction ??? - } - } - - } -#endif - - // Destructor - Composite::~Composite() - { - logentry(); - } - - void Composite::addComponent(Component* component) - { - logentry(); - components[component->getName()] = component; - } - - void Composite::addCompositeReference(CompositeReference* compositeReference) - { - logentry(); - components[compositeReference->getName()] = compositeReference; - - // Create a reference type describing the composite reference - ServiceType* serviceType = compositeReference->getType()->findServiceType(""); - ReferenceType* referenceType = new ReferenceType( - this, compositeReference->getName(), - serviceType->getInterface(), - serviceType->getCallbackInterface(), - compositeReference->getMultiplicity()); - addReferenceType(referenceType); - } - - void Composite::addCompositeService(CompositeService* compositeService) - { - logentry(); - components[compositeService->getName()] = compositeService; - - // Create a service type describing the composite service - ReferenceType* referenceType = compositeService->getType()->findReferenceType(""); - ServiceType* serviceType = new ServiceType( - this, compositeService->getName(), - referenceType->getInterface(), - referenceType->getCallbackInterface()); - addServiceType(serviceType); - } - - void Composite::initializeComponent(Component* component) - { - ComponentType::initializeComponent(component); - - // Create 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; - //CompositeServiceBinding* binding = new CompositeServiceBinding(service); - //service->setBinding(binding); - iter++; - } - - // Create bindings for all the references - const Component::REFERENCE_MAP& references = component->getReferences(); - Component::REFERENCE_MAP::const_iterator refiter = references.begin(); - for (unsigned int ri=0; ri< references.size(); ri++) - { - Reference *reference = refiter->second; - CompositeReferenceBinding* binding = new CompositeReferenceBinding(reference); - reference->setBinding(binding); - refiter++; - } - } - - Component* Composite::findComponent(const std::string& name) - { - logentry(); - Component* component = components[name]; - return component; - } - - std::list Composite::getComponents() const - { - logentry(); - - std::list componentList; - COMPONENT_MAP::const_iterator iter = components.begin(); - COMPONENT_MAP::const_iterator iterEnd = components.end(); - - for( ; iter != iterEnd; ++iter ) - { - componentList.push_back( iter->first ); - } - - return componentList; - } - - Service* Composite::findComponentService(const std::string& name) - { - logentry(); - - Service* service = 0; - - string componentName; - string serviceName; - Utils::tokeniseUri(name, componentName, serviceName); - - // Locate the component - Component* component = findComponent(componentName); - if (component) - { - // Locate the service - service = component->findService(serviceName); - } - return service; - } - - void Composite::addWire(const std::string& source, const std::string& target) - { - logentry(); - Wire* wire=new Wire(source, target); - wires.push_back(wire); - } - - void Composite::addInclude(Composite* composite) - { - logentry(); - includes[composite->getName()] = composite; - - for (COMPONENT_MAP::iterator iter = composite->components.begin(); - iter != composite->components.end(); - iter++) - { - components[iter->first] = iter->second; - } - } - - void Composite::resolveWires() - { - logentry(); - - for (WIRES::iterator iter = wires.begin(); - iter != wires.end(); - iter++) - { - Wire* wire = *iter; - - // Find the source component and reference - Component* component = findComponent(wire->getSourceComponent()); - Reference* reference; - if (component) - { - reference = component->findReference(wire->getSourceReference()); - if (!reference) - { - logerror("Wire source reference %s not found", wire->getSourceReference().c_str()); - } - } - else - { - reference = NULL; - logerror("Wire source %s not found", wire->getSourceComponent().c_str()); - } - - // Configure the reference binding with the wire target URI - if (reference) - { - reference->getBinding()->configure(wire->getTarget()); - } - } - } - - void Composite::addWSDLDefinition(commonj::sdo::DataObjectPtr wsdlModel) - { - logentry(); - WSDLDefinition* wsdlDefinition = new WSDLDefinition(wsdlModel); - - WSDLDefinition* existingDefinition = wsdlDefinitions[wsdlDefinition->getNamespace()]; - if (existingDefinition == NULL) - { - wsdlDefinitions[wsdlDefinition->getNamespace()] = wsdlDefinition; - } - else{ - existingDefinition->addWSDLModel(wsdlModel); - } - } - - WSDLDefinition* Composite::findWSDLDefinition(const std::string& wsdlNamespace ) - { - logentry(); - // remember the map operator[] inserts a blank object if key not found - WSDL_MAP::iterator iter = wsdlDefinitions.find( wsdlNamespace ); - if( iter == wsdlDefinitions.end() ) - { - return NULL; - } - - return iter->second; - } - - std::list Composite::getWSDLNamespaces() const - { - logentry(); - std::list namespaceList; - WSDL_MAP::const_iterator iter = wsdlDefinitions.begin(); - WSDL_MAP::const_iterator iterEnd = wsdlDefinitions.end(); - - for( ; iter != iterEnd; ++iter ) - { - namespaceList.push_back( iter->first ); - } - - return namespaceList; - } - - Composite* Composite::findIncludedComposite(const std::string& compositeName) - { - logentry(); - - // remember the map operator[] inserts a blank object if key not found - INCLUDES::iterator iter = includes.find( compositeName ); - if( iter == includes.end() ) - { - return NULL; - } - - return iter->second; - } - - std::list Composite::getIncludedComposites() const - { - logentry(); - std::list compositeList; - INCLUDES::const_iterator iter = includes.begin(); - INCLUDES::const_iterator iterEnd = includes.end(); - - for( ; iter != iterEnd; ++iter ) - { - compositeList.push_back( iter->first ); - } - - return compositeList; - } - - commonj::sdo::XSDHelperPtr Composite::getXSDHelper() - { - logentry(); - if (xsdHelper == 0) - { - xsdHelper = commonj::sdo::HelperProvider::getXSDHelper(); - } - - return xsdHelper; - } - - commonj::sdo::XMLHelperPtr Composite::getXMLHelper() - { - logentry(); - if (xmlHelper == 0) - { - xmlHelper = commonj::sdo::HelperProvider::getXMLHelper(getXSDHelper()->getDataFactory()); - } - - return xmlHelper; - } - - commonj::sdo::DataFactoryPtr Composite::getDataFactory() - { - logentry(); - return getXSDHelper()->getDataFactory(); - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Composite.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Composite.h deleted file mode 100644 index 40626feb14..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Composite.h +++ /dev/null @@ -1,250 +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_model_composite_h -#define tuscany_sca_model_composite_h - -#include -#include -#include - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/export.h" -#include "tuscany/sca/model/ComponentType.h" - -#define COPY_COMPOSITES_ON_INSTANCIATION - -namespace tuscany -{ - namespace sca - { - - namespace model - { - class Component; - class ComponentType; - class CompositeReference; - class CompositeService; - class Service; - class WSDLDefinition; - class Wire; - - /** - * Represents a composite. - * A composite is used to assemble SCA elements in logical groupings. - * It is the basic unit of composition within an SCA System. An SCA composite contains a - * set of components, services, references and the wires that interconnect them, plus a set - * of properties which can be used to configure components. - */ - class Composite : public ComponentType - { - public: - - /** - * Constructor. - * @param name the name of the composite. - * @param root the root of the composite in the file system. - */ - SCA_API Composite(const std::string& name, const std::string& root); - -#if defined(COPY_COMPOSITES_ON_INSTANCIATION) - /** - * Constructor to create a composite representing an instance by copying a template. - * @param templateComposite the template copmosite that will be copied. - * @param containerComposite the container of the instance. - */ - SCA_API Composite(Composite* templateComposite, Composite* containerComposite); -#endif - - /** - * Destructor. - */ - SCA_API virtual ~Composite(); - - /** - * Returns the root directory of the composite. - * @return The root of the composite in the file system. - */ - SCA_API const std::string& getRoot() const { return root; } - - /** - * Add a new component to the composite. - * @param component The component to add. - */ - SCA_API void addComponent(Component* component); - - /** - * Add a new composite reference to the composite. - * @param compositeReference The composite reference to add. - */ - SCA_API void addCompositeReference(CompositeReference* compositeReference); - - /** - * Add a new composite service to the composite. - * @param compositeService The composite service to add. - */ - SCA_API void addCompositeService(CompositeService* compositeService); - - /** - * Add/include a composite in this composite. - * @param composite The composite included in this composite. - */ - SCA_API void addInclude(Composite* composite); - - /** - * Add a wire to the model. - * @param source The source location. Either the source component and - * reference (optional), or an entry point. - * @param target The target location. Either the target component and - * service (optional), or an external service. - */ - SCA_API void addWire(const std::string& source, const std::string& target); - - /** - * Find a component by name. - * @param componentName The name of the component to be found. - * @return The component that was found, or 0 if not found. - */ - SCA_API Component* findComponent(const std::string& componentName); - - /** - * Get all included components - * @return A list of Component name strings - */ - SCA_API std::list getComponents() const; - - /** - * Find a component and service by name. - * @param componentServiceName A string of the form - * "componentName"/"serviceName" where the service name is optional - * if there is only one service on the component. - * @return The Service that was found, or 0 if not found. - */ - SCA_API Service* findComponentService(const std::string& componentServiceName); - - /** - * Add a WSDL definition to the composite. - * @param wsdlModel A data object holding all the information about - * the WSDL definition from a WSDL file. - */ - SCA_API void addWSDLDefinition(commonj::sdo::DataObjectPtr wsdlModel); - - /** - * Find a WSDL definition by target namespace. - * @param wsdlNamespace The namespace of the WSDL definitions to find. - */ - SCA_API WSDLDefinition* findWSDLDefinition(const std::string& wsdlNamespace); - - /** - * Get all loaded WSDL namespaces - * @return A list of strings, each of which is a different project namespace - */ - SCA_API std::list getWSDLNamespaces() const; - - /** - * Find an Included Composite by its name - * @param compositeName The name of the included composite to find. - */ - SCA_API Composite* findIncludedComposite(const std::string& compositeName); - - /** - * Get all included composites - * @return A list of Composite name strings - */ - SCA_API std::list getIncludedComposites() const; - - /** - * Initialize a component of this type. - * @param component The component to initialize. - */ - virtual void initializeComponent(Component* component); - - /** - * Return a cached SDO XSDHelper. - */ - SCA_API commonj::sdo::XSDHelperPtr getXSDHelper(void); - - /** - * Return a cached SDO XMLHelper. - */ - SCA_API commonj::sdo::XMLHelperPtr getXMLHelper(void); - - /** - * Return a data factory which has all the types defined in XSDs and - * WSDL files configured for this composite. - * @return The data factory for this composite. - */ - SCA_API commonj::sdo::DataFactoryPtr getDataFactory(void); - - /** - * Work through the list of wires and connect the source and target uris. - */ - SCA_API void resolveWires(); - - private: - - /** - * Directory of the root of the composite. - */ - std::string root; - - /** - * Cached XSDHelper. - */ - commonj::sdo::XSDHelperPtr xsdHelper; - - /** - * Cached XMLHelper. - */ - commonj::sdo::XMLHelperPtr xmlHelper; - - /** - * Map (by name) of all the components in this composite. - */ - typedef std::map COMPONENT_MAP; - COMPONENT_MAP components; - - /** - * Map of all the composites included by this composite. - * Map the Composite name to the Composite - */ - typedef std::map INCLUDES; - INCLUDES includes; - - /** - * Vector of all the wires in this composite. - */ - typedef std::vector WIRES; - WIRES wires; - - /** - * Map by namespace of all the wsdl definitions in this composite. - */ - typedef std::map WSDL_MAP; - WSDL_MAP wsdlDefinitions; - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_composite_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeReference.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeReference.cpp deleted file mode 100644 index be0bf71a17..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeReference.cpp +++ /dev/null @@ -1,68 +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/model/CompositeReference.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/ComponentType.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/Service.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - - namespace model - { - - // Constructor - CompositeReference::CompositeReference(Composite* composite, const string& name, - Interface* intface, Interface* callbackInterface, bool conversational, ReferenceType::Multiplicity multiplicity) : - Component(composite, name, new ComponentType(composite, name)) - { - logentry(); - loginfo("Composite reference name: %s", name.c_str()); - - // Initialize the component type, service type and service - ComponentType* componentType = getType(); - ServiceType* serviceType = new ServiceType( - componentType, "", intface, callbackInterface); - componentType->addServiceType(serviceType); - - service = new Service(this, serviceType); - addService(service); - } - - // Destructor - CompositeReference::~CompositeReference() - { - logentry(); - } - - } // End namespace model - - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeReference.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeReference.h deleted file mode 100644 index f5e2166e06..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeReference.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_model_compositereferencetype_h -#define tuscany_sca_model_compositereferencetype_h - -#include - -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/ReferenceType.h" - -namespace tuscany -{ - namespace sca - { - - namespace model - { - class ComponentType; - class Composite; - class Interface; - class Service; - - /** - * Represents a reference in a composite. - * Composite references represent dependencies that the composite has on services provided elsewhere, - * outside the composite. - */ - class CompositeReference : public Component - { - public: - - /** - * Constructor. - * @param name The name of the reference. - */ - SCA_API CompositeReference(Composite* composite, const std::string& name, - Interface* intface, Interface* callbackInterface, bool conversational, ReferenceType::Multiplicity multiplicity); - - /** - * Destructor. - */ - SCA_API virtual ~CompositeReference(); - - /** - * Returns the service exposed by this composite reference. - * @return The service exposed by this composite reference. - */ - SCA_API Service* getService() const { return service; }; - - /** - * Returns the multiplicity of this composite reference - * @return The multiplicity of the composite reference - */ - SCA_API ReferenceType::Multiplicity getMultiplicity() { return multiplicity; } - - private: - - /** - * The service exposed by this composite reference. - */ - Service* service; - - /** - * The multiplicity of this reference - */ - ReferenceType::Multiplicity multiplicity; - - }; - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_compositereferencetype_h - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.cpp deleted file mode 100644 index 24191285c5..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.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/model/CompositeReferenceBinding.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - // Constructor - CompositeReferenceBinding::CompositeReferenceBinding(Reference* reference) - : ReferenceBinding(reference, ""), uri("") - { - } - - // Destructor - CompositeReferenceBinding::~CompositeReferenceBinding() - { - } - - void CompositeReferenceBinding::configure(ServiceBinding *binding) - { - setTargetServiceBinding(binding); - } - - ServiceProxy* CompositeReferenceBinding::getServiceProxy() - { - return serviceProxy; - } - - void CompositeReferenceBinding::configure(const string& uri) - { - this->uri = uri; - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.h deleted file mode 100644 index 5c64c3b657..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.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_model_compositereferencebinding_h -#define tuscany_sca_model_compositereferencebinding_h - -#include - -#include "tuscany/sca/model/ReferenceBinding.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - /** - * A default composite reference binding - */ - class CompositeReferenceBinding : public ReferenceBinding - { - public: - - /** - * Constructor. - * @param uri The uri of the binding. - */ - SCA_API CompositeReferenceBinding(Reference* reference); - - /** - * Destructor. - */ - SCA_API virtual ~CompositeReferenceBinding(); - - /** - * Returns the type of binding. - */ - virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#CompositeServiceBinding"; }; - - /** - * Configure this binding from a service binding. - */ - SCA_API virtual void configure(ServiceBinding* serviceBinding); - - /** - * Configure this binding from a URI. - */ - SCA_API virtual void configure(const std::string& uri); - - /** - * Create a proxy representing the reference to the - * client component. - */ - SCA_API virtual ServiceProxy* getServiceProxy(); - - /** - * Returns the binding URI. - * @return The binding URI. - */ - SCA_API virtual const std::string& getURI() const { return uri; }; - - private: - - /** - * The proxy representing the reference to the client - * component. - */ - ServiceProxy* serviceProxy; - - /** - * The binding URI - */ - std::string uri; - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_compositereferencebinding_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeService.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeService.cpp deleted file mode 100644 index e06dc548c1..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeService.cpp +++ /dev/null @@ -1,70 +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/model/CompositeService.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/ComponentType.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/model/ServiceType.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - - namespace model - { - - // Constructor - CompositeService::CompositeService(Composite* composite, const string& name, - Interface* intface, Interface* callbackInterface, bool conversational, - ReferenceType::Multiplicity multiplicity) : - Component(composite, name, new ComponentType(composite, name)) - { - logentry(); - loginfo("Composite service name: %s", name.c_str()); - - // Initialize the component type, reference type and reference - ComponentType* componentType = getType(); - ReferenceType* referenceType = new ReferenceType( - componentType, "", intface, callbackInterface, multiplicity); - componentType->addReferenceType(referenceType); - - reference = new Reference(this, referenceType); - addReference(reference); - } - - // Destructor - CompositeService::~CompositeService() - { - logentry(); - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeService.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeService.h deleted file mode 100644 index 8c626ccac3..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/CompositeService.h +++ /dev/null @@ -1,83 +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_model_compositeservicetype_h -#define tuscany_sca_model_compositeservicetype_h - -#include - -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/ReferenceType.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - class Composite; - class Component; - class Interface; - class Reference; - - /** - * Represents a service in a composite. - * Composite services define the public services provided by the composite, which can be - * accessed from outside the composite. - */ - class CompositeService : public Component - { - - public: - - /** - * Constructor. - * @param componentType The component type on which this service is defined. - * @param name The name of the service. - */ - SCA_API CompositeService(Composite* composite, const std::string& name, - Interface* intface, Interface* callbackInterface, bool conversational, ReferenceType::Multiplicity multiplicity); - - /** - * Destructor. - */ - SCA_API virtual ~CompositeService(); - - /** - * Returns the reference used by this composite service. - * @return The reference used by this composite service. - */ - SCA_API Reference* getReference() const { return reference; }; - - private: - - /** - * The reference used by this composite service. - */ - Reference* reference; - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_compositeservicetype_h - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Contract.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Contract.cpp deleted file mode 100644 index 99a1d04dc2..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Contract.cpp +++ /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. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/model/Contract.h" - - -namespace tuscany -{ - namespace sca - { - - namespace model - { - - // Constructor - Contract::Contract(Interface *intface, Interface* callbackInterface) : - iface(intface), callbackInterface(callbackInterface) - { - logentry(); - } - - // Destructor - Contract::~Contract() - { - logentry(); - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Contract.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Contract.h deleted file mode 100644 index e1d526f842..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Contract.h +++ /dev/null @@ -1,85 +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_model_contract_h -#define tuscany_sca_model_contract_h - -#include "tuscany/sca/model/Interface.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - /** - * Interface contracts define one or more business functions. These business functions are - * provided by services and are used by references. Services are defined by the interface which - * they implement. - * This interface will typically be extended to support concrete interface type systems, such as - * CPP classes, Java interfaces, WSDL 1.1 portTypes and WSDL 2.0 interfaces. - */ - class Contract - { - public: - - /** - * Constructor. - */ - SCA_API Contract(Interface* intface, Interface* callbackInterface); - - /** - * Destructor. - */ - SCA_API virtual ~Contract(); - - /** - * Returns the interface for invocations from the requestor to the provider. - * @return The interface for invocations from the requestor to the provider. - */ - SCA_API Interface* getInterface() const { return iface; } - - /** - * Returns the interface for invocations from the provider back to the requestor. - * @return The interface for invocations from the provider back to the requestor. - */ - SCA_API Interface* getCallbackInterface() const { return callbackInterface; } - - private: - - /** - * The interface for invocations from the requestor to the provider. - */ - Interface* iface; - - /** - * The interface for invocations from the provider back to the requestor. - */ - Interface* callbackInterface; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_contract_h - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Interface.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Interface.cpp deleted file mode 100644 index f8dd02a74a..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Interface.cpp +++ /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. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/model/Interface.h" - - -namespace tuscany -{ - namespace sca - { - - namespace model - { - - // Constructor - Interface::Interface(bool remotable, bool conversational) - : remotable(remotable), conversational(conversational) - { - logentry(); - } - - Interface::~Interface() - { - logentry(); - } - - } // End namespace model - - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Interface.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Interface.h deleted file mode 100644 index 5ac7736d43..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Interface.h +++ /dev/null @@ -1,90 +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_model_interface_h -#define tuscany_sca_model_interface_h - -#include - -namespace tuscany -{ - namespace sca - { - namespace model - { - - /** - * Information about an interface. Subtypes will hold information - * specific to a type of interface. - */ - class Interface - { - - public: - - /** - * Constructor - */ - SCA_API Interface(bool remotable, bool conversational); - - /** - * Destructor - */ - SCA_API virtual ~Interface(); - - /** - * Returns true if the interface is remotable. - * @return True if the interface is remotable. - */ - SCA_API bool isRemotable() const { return remotable; }; - - /** - * Returns true if the interface is conversational. - * @return True if the interface is conversational. - */ - SCA_API bool isConversational() const { return conversational; }; - - /** - * return the QName of schema type for this interface type - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#WSDLInterface") - */ - SCA_API virtual const std::string& getInterfaceTypeQName() = 0; - - private: - - /** - * True if the interface is remotable - */ - bool remotable; - - /** - * True if the interface is conversational - */ - bool conversational; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_interface_h - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ModelLoader.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ModelLoader.cpp deleted file mode 100644 index 549ffcfc7e..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ModelLoader.cpp +++ /dev/null @@ -1,939 +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/export.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/model/ModelLoader.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/CompositeService.h" -#include "tuscany/sca/model/CompositeReference.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/model/WSDLInterface.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/util/File.h" - - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::util; - - -#if defined(WIN32) || defined (_WINDOWS) -#define PATH_SEPARATOR ";" -#else -#define PATH_SEPARATOR ":" -#endif - -namespace tuscany -{ - namespace sca - { - - namespace model - { - // =========== - // Constructor - // =========== - ModelLoader::ModelLoader(SCARuntime* runtime, Composite* system) - : system(system), runtime(runtime) - { - logentry(); - } - - // ========== - // Destructor - // ========== - ModelLoader::~ModelLoader() - { - logentry(); - } - - // ========================================================= - // load: Load the runtime model from the deployed xml files - // This class has the responsibility for translating from - // the SCDL files to the SCA runtime's in memory model. - // ========================================================= - void ModelLoader::load(const string& systemRoot, const string& systemPath) - { - logentry(); - loginfo("System root: %s", systemRoot.c_str()); - loginfo("System path: %s", systemPath.c_str()); - - // Load composite implementations - // Composite implementations can occur anywhere on the given search path - if (systemPath != "") - { - loadComposites(systemRoot + PATH_SEPARATOR + systemPath); - } - else - { - loadComposites(systemRoot); - } - - // Load system composites - // Composites on the the system root path get included - // in the System composite - loadSystem(systemRoot); - - // Resolve the wires in the system composite - system->resolveWires(); - } - - // ======================================================================== - // loadSystem: - // Load all the composite files on the system root path - // Translate the composite information to composite model objects - // ======================================================================== - void ModelLoader::loadSystem(const string& systemRoot) - { - logentry(); - - // Get all the composite files on the system root path - // These composites are included in the system composite - for (string path = systemRoot; path != ""; ) - { - string dir; - Utils::tokeniseString(PATH_SEPARATOR, path, dir, path); - if (dir != "") - { - loginfo("System root directory: %s", dir.c_str()); - Files files(dir, "*.composite", false); - for (unsigned int i=0; i < files.size(); i++) - { - string fileName = files[i].getDirectory() + "/" + files[i].getFileName(); - Composite* composite = compositeFiles[fileName]; - if (composite) - { - // Include the composite in the system composite - system->addInclude(composite); - } - else - { - // We already got an error or warning indicating why the file - // didn't turn into a composite - } - } - } - } - } - - // ===================================================================== - // loadComposites: - // Load all the composites from any directory under the composite search path - // Translate the composite information to composite model objects - // ===================================================================== - void ModelLoader::loadComposites(const string& searchPath) - { - logentry(); - - // Get all the composite files on the composite search path - for (string path = searchPath; path != ""; ) - { - string dir; - Utils::tokeniseString(PATH_SEPARATOR, path, dir, path); - if (dir != "") - { - loginfo("Composite path directory: %s", dir.c_str()); - Files files(dir, "*.composite", true); - for (unsigned int i=0; i < files.size(); i++) - { - loadCompositeFile(files[i]); - } - } - } - - // Complete the mapping of the composites - for (COMPOSITE_DATAOBJECTS::iterator iter = compositeDataObjects.begin(); - iter != compositeDataObjects.end(); - iter++) - { - mapCompositePass2(iter->first, iter->second); - } - } - - // ==================================================================== - // loadCompositeFile: - // This method is called for each .composite file found under the composite search - // path. The location of this composite file will indicate the root of a composite. - // ==================================================================== - Composite* ModelLoader::loadCompositeFile(const File& file) - { - logentry(); - - loginfo("Composite file name: %s", file.getFileName().c_str()); - - Composite* composite = NULL; - try - { - string fileName = file.getDirectory() + "/" + file.getFileName(); - if (compositeFiles[fileName] == NULL) - { - XMLDocumentPtr compositeFile = getXMLHelper()->loadFile(fileName.c_str()); - if (compositeFile->getRootDataObject() == NULL) - { - logerror("Unable to load file: %s", fileName.c_str()); - } - else - { - // Map the SCDL - composite = mapCompositePass1(file, compositeFile->getRootDataObject()); - - // Load the xsd types and wsdl files in the composite - loadTypeMetadata(file.getDirectory(), composite); - } - } - - } catch (SDORuntimeException& ex) - { - logerror("Unable to load composite: %s", ex.getMessageText()); - } - return composite; - } - - // =========== - // mapCompositePass1 - // =========== - Composite* ModelLoader::mapCompositePass1(const File& file, DataObjectPtr root) - { - logentry(); - - const string& compositeRootDir = file.getDirectory(); - const string compositeName = root->getCString("name"); - loginfo("Composite: %s, root directory: %s", compositeName.c_str(), compositeRootDir.c_str()); - - Composite* composite = new Composite(compositeName, compositeRootDir); - compositeModels[compositeName] = composite; - compositeDataObjects[compositeName] = root; - compositeFiles[file.getDirectory() + "/" + file.getFileName()] = composite; - - // ------------ - // Composite services - // ------------ - DataObjectList& compositeServiceList = root->getList("service"); - for (unsigned int i = 0; i < compositeServiceList.size(); i++) - { - addCompositeService(composite, compositeServiceList[i]); - } - - // ----------------- - // Composite references - // ----------------- - DataObjectList& compositeReferenceList = root->getList("reference"); - for (unsigned int cri = 0; cri < compositeReferenceList.size(); cri++) - { - addCompositeReference(composite, compositeReferenceList[cri]); - } - - // ----- - // Wires - // ----- - DataObjectList& wireList = root->getList("wire"); - for (unsigned int l = 0; l < wireList.size(); l++) - { - string source = wireList[l]->getCString("source"); - string target = wireList[l]->getCString("target"); - composite->addWire(source, target); - } - - return composite; - } - - // =========== - // mapCompositePass2 - // =========== - Composite* ModelLoader::mapCompositePass2(const string& compositeName, DataObjectPtr root) - { - logentry(); - loginfo("Composite: %s", compositeName.c_str()); - - Composite* composite = compositeModels[compositeName]; - - // ---------------------------- - // Add components to the composite - // ---------------------------- - DataObjectList& componentList = root->getList("component"); - unsigned int i; - for (i=0; i < componentList.size(); i++) - { - addComponent(composite, componentList[i]); - } - - // Resolve all the wires inside the composite - composite->resolveWires(); - - return composite; - } - - // ================================= - // addComponent: - // ================================= - void ModelLoader::addComponent(Composite* composite, DataObjectPtr componentDO) - { - logentry(); - - // ------------------- - // Get the component implementation - // ------------------- - DataObjectPtr impl = componentDO->getDataObject("implementation"); - if (!impl) - { - string message = "No implementation for component: "; - message = message + componentDO->getCString("name"); - throwException(SystemConfigurationException, message.c_str()); - } - - // Create the component type - ComponentType* componentType; - string componentTypeName; - string componentTypePath; - - string implTypeQname = impl->getType().getURI(); - implTypeQname += "#"; - implTypeQname += impl->getType().getName(); - - if (implTypeQname == "http://www.osoa.org/xmlns/sca/1.0#SCAImplementation") - { - // Handle a composite implementation - Composite* compositeComponentType = compositeModels[impl->getCString("name")]; - if (!compositeComponentType) - { - string message = "Composite not found: "; - message = message + impl->getCString("name"); - throwException(SystemConfigurationException, message.c_str()); - } -#if defined(COPY_COMPOSITES_ON_INSTANCIATION) - componentType = new Composite(compositeComponentType, composite); -#else - componentType = compositeComponentType; -#endif - } - else - { - - // Locate extension that handles this implementation type - ImplementationExtension* implExtension = runtime->getImplementationExtension(implTypeQname); - if (implExtension) - { - componentType = implExtension->getImplementation(composite, impl); - - // ----------------------- - // Load the .componentType - // ----------------------- - string typeFileName = composite->getRoot() + "/" + componentType->getName() + ".componentType"; - - // Check that the component type file exists - //TODO We need a better and portable way to do this - string dirName; - string fileName; - Utils::rTokeniseString("/", typeFileName, dirName, fileName); - Files files(dirName, fileName, false); - if (files.size() !=0) - { - try - { - XMLDocumentPtr componentTypeFile = getXMLHelper()->loadFile(typeFileName.c_str()); - if (!componentTypeFile || componentTypeFile->getRootDataObject() == 0) - { - // Component type files are optional - logerror("Unable to load file: %s", typeFileName.c_str()); - } - else - { - //Utils::printDO(componentTypeFile->getRootDataObject()); - //commonj::sdo::SDOUtils::printDataObject(componentTypeFile->getRootDataObject()); - addServiceTypes(composite, componentType, componentTypeFile->getRootDataObject()); - addReferenceTypes(composite, componentType, componentTypeFile->getRootDataObject()); - addPropertyTypes(componentType, componentTypeFile->getRootDataObject()); - } - } catch (SDORuntimeException& ex) - { - logerror("Unable to load file:%s", typeFileName.c_str()); - throwException(SystemConfigurationException, ex); - } - } - } - else - { - logerror("Unsupported implementation type: %s", implTypeQname.c_str()); - - string message = "Implementation type not supported: "; - message = message + implTypeQname; - throwException(SystemConfigurationException, message.c_str()); - } - } - - // First check that references and properties exist, some component types - // will create all used references & properties automatically - DataObjectList& refs = componentDO->getList("reference"); - for (unsigned int i=0; igetCString("name"); - if (!componentType->findReferenceType(refName)) - { - // Configuration error: reference is not defined - string message = "Undefined reference: " + refName; - throwException(SystemConfigurationException, message.c_str()); - } - } - - DataObjectList& props = componentDO->getList("property"); - for (unsigned int pi=0; pigetCString("name"); - if (!componentType->findPropertyType(propName)) - { - // Configuration error: property is not defined - string message = "Undefined property: " + propName; - throwException(SystemConfigurationException, message.c_str()); - } - } - - - // Create the component - Component* component = new Component(composite, componentDO->getCString("name"), componentType); - composite->addComponent(component); - - // ---------- - // Properties - // ---------- - for (unsigned int pi=0; pigetCString("name"); - DataObjectPtr propValue = props[pi]->getDataObject("value"); - - component->setProperty(propName, propValue); - } - - // ---------- - // References - // ---------- - for (unsigned int ri=0; rigetCString("name"); - if (!component->findReference(refName)) - { - // Configuration error: reference is not defined - string message = "Undefined reference: " + refName; - throwException(SystemConfigurationException, message.c_str()); - } - - string src = component->getName() + "/" + refName; - - // Get the reference value - string refValue = refs[ri]->getCString("value"); - - composite->addWire(src, refValue); - } - } - - // ===================================================================== - // addServiceTypes: add the services to the component type - // ===================================================================== - void ModelLoader::addServiceTypes(Composite* composite, ComponentType* componentType, DataObjectPtr componentTypeDO) - { - logentry(); - - DataObjectList& serviceTypes = componentTypeDO->getList("service"); - for (unsigned int i=0; igetCString("name"), iface, NULL); - componentType->addServiceType(serviceType); - } - } - - // =================================================== - // addReferenceTypes: add the references to the component type - // =================================================== - void ModelLoader::addReferenceTypes(Composite* composite, ComponentType* componentType, DataObjectPtr componentTypeDO) - { - logentry(); - - DataObjectList& refs = componentTypeDO->getList("reference"); - for (unsigned int i=0; iisSet("multiplicity")) - { - string s = refs[i]->getCString("multiplicity"); - multiplicity = ReferenceType::getMultiplicityFromString(s); - } - else - { - multiplicity = ReferenceType::ONE_ONE; - } - - Interface* iface = getInterface(composite, refs[i]); - - ReferenceType* referenceType = new ReferenceType( - componentType, refs[i]->getCString("name"), iface, NULL, multiplicity); - componentType->addReferenceType(referenceType); - - } - } - - - // ============== - // getInterface - // ============== - Interface* ModelLoader::getInterface(Composite* composite, DataObjectPtr obj) - { - logentry(); - - // ----------------- - // get the interface - // ----------------- - DataObjectPtr iface = obj->getDataObject("interface"); - if (!iface) - { - string message = "No interface for: "; - message = message + obj->getCString("name"); - throwException(SystemConfigurationException, message.c_str()); - } - - string typeQname = iface->getType().getURI(); - typeQname += "#"; - typeQname += iface->getType().getName(); - - if (typeQname == WSDLInterface::typeQName) - { - // Load a WSDL interface - string qname = iface->getCString("interface"); - - return new WSDLInterface(qname, true, false); - } - else - { - // Locate extension that handles this interface type - InterfaceExtension* ifaceExtension = runtime->getInterfaceExtension(typeQname); - if (ifaceExtension) - { - return ifaceExtension->getInterface(composite, iface); - } - else - { - // log this for now. - logerror("Unsupported interface type: %s", typeQname.c_str()); - return 0; - } - } - - } - - // ============================================== - // addProperties: add properties to the component type - // ============================================== - void ModelLoader::addPropertyTypes(ComponentType* componentType, DataObjectPtr componentTypeDO) - { - logentry(); - - DataObjectList& props = componentTypeDO->getList("property"); - for (unsigned int i=0; igetCString("name"); - string type = props[i]->getCString("type"); - bool many=false; - if (props[i]->isSet("many")) - { - many = props[i]->getBoolean("many"); - } - - //TODO need to add support for complex properties, need the SDO - // folks to help understand how to do this... - DataObjectPtr defaultValue = props[i]->getDataObject("value"); - - componentType->addPropertyType(name, type, many, &defaultValue); - } - } - - // =============================================== - // addCompositeService: add an CompositeService to the composite - // =============================================== - void ModelLoader::addCompositeService(Composite* composite, DataObjectPtr compositeServiceDO) - { - logentry(); - - string compositeServiceName = compositeServiceDO->getCString("name"); - - Interface* iface; - if (compositeServiceDO->getDataObject("interface")) - { - iface = getInterface(composite, compositeServiceDO); - } - else - { - iface = NULL; - } - - ReferenceType::Multiplicity multiplicity; - if (compositeServiceDO->isSet("multiplicity")) - { - string s = compositeServiceDO->getCString("multiplicity"); - multiplicity = ReferenceType::getMultiplicityFromString(s); - } - else - { - multiplicity = ReferenceType::ONE_ONE; - } - - CompositeService* compositeService = new CompositeService( - composite, compositeServiceName, iface, NULL, false, multiplicity); - - composite->addCompositeService(compositeService); - - DataObjectList& refs = compositeServiceDO->getList("reference"); - for (unsigned int i=0; iaddWire(compositeServiceName, targ); - } - - // Get binding, it will be the first and only binding - DataObjectList& bindings = compositeServiceDO->getList("binding"); - if (bindings.size()==0) - { - string message = "No binding for compositeService: "; - message = message + compositeServiceDO->getCString("name"); - throwException(SystemConfigurationException, message.c_str()); - } - DataObjectPtr binding = bindings[0]; - - // Determine the binding type - string bindingType = binding->getType().getName(); - string bindingTypeQname = binding->getType().getURI(); - bindingTypeQname += "#"; - bindingTypeQname += binding->getType().getName(); - - // Locate the extension that handles this binding type - ReferenceBindingExtension* bindingExtension = runtime->getReferenceBindingExtension(bindingTypeQname); - if (bindingExtension) - { - Reference* reference = compositeService->getReference(); - ReferenceBinding* referenceBinding = bindingExtension->getReferenceBinding(composite, reference, binding); - reference->setBinding(referenceBinding); - } - else - { - logerror("Unsupported binding type: %s", bindingTypeQname.c_str()); - - string message = "Binding type not supported: "; - message = message + bindingTypeQname; - throwException(SystemConfigurationException, message.c_str()); - } - } - - - // ========================================================= - // addCompositeReference: add a CompositeReference to the composite - // ========================================================= - void ModelLoader::addCompositeReference(Composite* composite, DataObjectPtr compositeReferenceDO) - { - logentry(); - - string compositeReferenceName = compositeReferenceDO->getCString("name"); - - Interface* iface; - if (compositeReferenceDO->getDataObject("interface")) - { - iface = getInterface(composite, compositeReferenceDO); - } - else - { - iface = NULL; - } - - CompositeReference* compositeReference = new CompositeReference( - composite, compositeReferenceName, iface, NULL, false, ReferenceType::ONE_ONE); - - composite->addCompositeReference(compositeReference); - - // Get binding, it will be the first and only binding - DataObjectList& bindings = compositeReferenceDO->getList("binding"); - if (bindings.size()==0) - { - string message = "No binding for compositeReference: "; - message = message + compositeReferenceDO->getCString("name"); - throwException(SystemConfigurationException, message.c_str()); - } - DataObjectPtr binding = bindings[0]; - - // Determine the binding type - string bindingType = binding->getType().getName(); - string bindingTypeQname = binding->getType().getURI(); - bindingTypeQname += "#"; - bindingTypeQname += binding->getType().getName(); - - // Locate the extension that handles this binding type - ServiceBindingExtension* bindingExtension = runtime->getServiceBindingExtension(bindingTypeQname); - if (bindingExtension) - { - Service *service = compositeReference->getService(); - ServiceBinding* serviceBinding = bindingExtension->getServiceBinding(composite, service, binding); - service->setBinding(serviceBinding); - } - else - { - logerror("Unsupported binding type: %s", bindingTypeQname.c_str()); - - string message = "Binding type not supported: "; - message = message + bindingTypeQname; - throwException(SystemConfigurationException, message.c_str()); - } - } - - - /// - /// Use the Tuscany.config file in the composite root directory to - /// determine which xsds and wsdls to load into a dataFactory. - /// - void ModelLoader::loadTypeMetadata(const string &compositeRootDir, Composite* composite) - { - logentry(); - - // Load the "Tuscany.config" file, if it exists - Files files(compositeRootDir, "Tuscany.config", false); - if (files.size() !=0) - { - for (unsigned int i=0; i < files.size(); i++) - { - string filename = compositeRootDir + "/" + files[i].getFileName(); - XMLDocumentPtr compositeConfigFile = getXMLHelper()->loadFile(filename.c_str()); - if (compositeConfigFile->getRootDataObject() == 0) - { - logerror("Unable to load file: %s", filename.c_str()); - } - else - { - loginfo("Composite config for: %s, root directory: %s", composite->getName().c_str(), compositeRootDir.c_str()); - - if(compositeConfigFile->getRootDataObject()->isSet("xsd")) - { - DataObjectList& xsds = compositeConfigFile->getRootDataObject()->getList("xsd/file"); - - for (unsigned int i=0; iisSet("name")) - { - // Load a xsd file -> set the types in the compositeComponents data factory file - string xsdName = compositeRootDir + "/" +xsds[i]->getCString("name"); - loadXMLSchema(composite, xsdName.c_str()); - } - } - } - - - if( compositeConfigFile->getRootDataObject()->isSet("wsdl")) - { - DataObjectList& wsdls = compositeConfigFile->getRootDataObject()->getList("wsdl/file"); - for (unsigned int j=0; jisSet("name")) - { - string wsdlName = compositeRootDir + "/" +wsdls[j]->getCString("name"); - // Load a wsdl file -> get the types, then the contents of the wsdl - loadXMLSchema(composite, wsdlName.c_str()); - - // Load the contents of the wsdl files - loadWSDLDefinition(composite, wsdlName.c_str()); - } - } - } - } - } - } - else - { - // The default scheme is to have no Tuscany.config file, then we simply load all - // WSDLs and XSDs that we find under the composite root - - Files xsdFiles(compositeRootDir, "*.xsd", true); - for (unsigned int i=0; i < xsdFiles.size(); i++) - { - // Load a xsd file -> set the types in the compositeComponents data factory file - string xsdName = xsdFiles[i].getDirectory() + "/" + xsdFiles[i].getFileName(); - loadXMLSchema(composite, xsdName.c_str()); - - } - - Files wsdlFiles(compositeRootDir, "*.wsdl", true); - for (unsigned int wi=0; wi < wsdlFiles.size(); wi++) - { - // Load a wsdl file -> get the types, then the contents of the wsdl - string wsdlName = wsdlFiles[wi].getDirectory() + "/" + wsdlFiles[wi].getFileName(); - loadXMLSchema(composite, wsdlName.c_str()); - - // Load the contents of the wsdl files - loadWSDLDefinition(composite, wsdlName.c_str()); - } - } - } - - - /// - /// Use the types from an xsd or wsdl file - /// - void ModelLoader::loadXMLSchema(Composite* composite, const char *fileName) - { - logentry(); - loginfo("Loading XML schema %s", fileName); - // Load a xsd file -> set the types in the data factory associated with - // the composite - try { - composite->getXSDHelper()->defineFile(fileName); - //Utils::printTypes(composite->getXSDHelper()->getDataFactory()); - - } catch (SDORuntimeException& ex) - { - logerror("Unable to load schema: %s", fileName); - throwException(SystemConfigurationException, ex); - } - } - - /// - /// Load the web services definition from a wsdl - /// - void ModelLoader::loadWSDLDefinition(Composite* composite, const char *fileName) - { - logentry(); - - try { - // Load the wsdl file - XMLDocumentPtr doc = getXMLHelper()->loadFile(fileName); - - if (doc!=0 && doc->getRootDataObject()!=0) - { - //Utils::printDO(doc->getRootDataObject()); - - // Add the root WSDL object to the composite - composite->addWSDLDefinition(doc->getRootDataObject()); - - } - else - { - logerror("Unable to load or parse WSDL: %s", fileName); - } - - } catch (SDORuntimeException& ex) - { - logerror("Unable to load or parse WSDL: %s", fileName); - throwException(SystemConfigurationException, ex); - } - } - - ////////////////////////////////////////////////////////////////////////////// - // Methods used to load the model into memory - ////////////////////////////////////////////////////////////////////////////// - - /// - /// Get an XSDHelper that has the appropriate XSDs already loaded - /// - const XSDHelperPtr ModelLoader::getXSDHelper() - { - logentry(); - - if (myXSDHelper == 0) - { - - // Create an xsd helper - myXSDHelper = HelperProvider::getXSDHelper(); - - try { - - // Load the Assembly model schema - string root = runtime->getInstallRoot(); - string filename = root + "/xsd/sca.xsd"; - - myXSDHelper->defineFile(filename.c_str()); - - // Tuscany specific xsd for config files - filename = root + "/xsd/tuscany.xsd"; - myXSDHelper->defineFile(filename.c_str()); - - filename = root + "/xsd/wsdl_11.xsd"; - myXSDHelper->defineFile(filename.c_str()); - - filename = root + "/xsd/wsdl_11_http.xsd"; - myXSDHelper->defineFile(filename.c_str()); - - filename = root + "/xsd/wsdl_11_mime.xsd"; - myXSDHelper->defineFile(filename.c_str()); - - filename = root + "/xsd/wsdl_11_soap.xsd"; - myXSDHelper->defineFile(filename.c_str()); - - filename = root + "/xsd/wsdl_11_soap12.xsd"; - myXSDHelper->defineFile(filename.c_str()); - - // Load any schema from the extensions directory - string extensionsRoot = root + "/extensions"; - - Files files(extensionsRoot, "*.xsd", true); - for (unsigned int i=0; i < files.size(); i++) - { - string extensionSchema = files[i].getDirectory() + "/" + files[i].getFileName(); - myXSDHelper->defineFile(extensionSchema.c_str()); - } - - - } catch (SDORuntimeException& ex) - { - throwException(SystemConfigurationException, ex); - } - } - - return myXSDHelper; - } - - /// - /// Get an XMLHelper to load files - /// - const XMLHelperPtr ModelLoader::getXMLHelper() - { - logentry(); - - if (myXMLHelper == 0) { - - // Create an xml helper - myXMLHelper = HelperProvider::getXMLHelper(getXSDHelper()->getDataFactory()); - - } - - return myXMLHelper; - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ModelLoader.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ModelLoader.h deleted file mode 100644 index b3b3ec2df6..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ModelLoader.h +++ /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$ */ - -#ifndef tuscany_sca_model_modelloader_h -#define tuscany_sca_model_modelloader_h - -#include - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/export.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/model/Interface.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/ComponentType.h" -#include "tuscany/sca/util/File.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - - /** - * Provides methods to load the runtime model from the SCDL file. - */ - class ModelLoader { - - public: - /** - * Constructor. - * @param system The SCA system to load. - */ - ModelLoader(tuscany::sca::SCARuntime* runtime, Composite* system); - - /** - * Destructor. - */ - virtual ~ModelLoader(); - - /** - * Load the model from the configuration information. - * @param systemRoot The location of the system configuration - * @param systemPath The search path for composites - */ - void load(const std::string& systemRoot, const std::string& systemPath); - - private: - void loadSystem(const std::string& systemRoot); - - void loadComposites(const std::string& searchPath); - Composite* loadCompositeFile(const tuscany::sca::util::File& file); - Composite* mapCompositePass1(const tuscany::sca::util::File& file, commonj::sdo::DataObjectPtr rootDO); - Composite* mapCompositePass2(const std::string& compositeName, commonj::sdo::DataObjectPtr rootDO); - - void addComponent(Composite* composite, commonj::sdo::DataObjectPtr componentDO); - void addCompositeService(Composite* composite, commonj::sdo::DataObjectPtr compositeServiceDO); - void addCompositeReference(Composite* composite, commonj::sdo::DataObjectPtr referenceServiceDO); - - void addServiceTypes(Composite* composite, ComponentType* componentType, commonj::sdo::DataObjectPtr componentTypeDO); - void addReferenceTypes(Composite* composite, ComponentType* componentType, commonj::sdo::DataObjectPtr componentTypeDO); - void addPropertyTypes(ComponentType* componentType, commonj::sdo::DataObjectPtr componentTypeDO); - - void loadTypeMetadata(const std::string &compositeRootDir, Composite* composite); - - void loadXMLSchema(Composite* composite, const char *fileName); - void loadWSDLDefinition(Composite* composite, const char *fileName); - - Interface* getInterface(Composite* composite, commonj::sdo::DataObjectPtr obj); - - SCARuntime* runtime; - - commonj::sdo::XMLHelperPtr myXMLHelper; // Used to load scdl files - commonj::sdo::XSDHelperPtr myXSDHelper; // Used to load xsds - - const commonj::sdo::XSDHelperPtr getXSDHelper(void); - const commonj::sdo::XMLHelperPtr getXMLHelper(void); - - /** - * The composite describing the composition of the system - */ - Composite* system; - - /** - * Maps of all the composites installed on the system. - */ - typedef std::map COMPOSITE_MODELS; - COMPOSITE_MODELS compositeModels; - - typedef std::map COMPOSITE_DATAOBJECTS; - COMPOSITE_DATAOBJECTS compositeDataObjects; - - typedef std::map COMPOSITE_FILES; - COMPOSITE_FILES compositeFiles; - - }; - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_modelloader_h - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Reference.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Reference.cpp deleted file mode 100644 index 8820379c4e..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Reference.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/Exceptions.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/ReferenceType.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - // Constructor - Reference::Reference(Component* component, ReferenceType* referenceType) - : component(component), type(referenceType), binding(0) - { - logentry(); - } - - // Destructor - Reference::~Reference() - { - logentry(); - } - - void Reference::setBinding(ReferenceBinding* binding) - { - this->binding = binding; - } - - ReferenceBinding* Reference::getBinding() const - { - return binding; - } - - void Reference::addTarget(Service* target) - { - logentry(); - - if (type->getMultiplicity() == ReferenceType::ONE_ONE || type->getMultiplicity() == ReferenceType::ZERO_ONE) - { - if (targets.size() > 0) - { - string message = "Duplicate wire for reference: " + type->getName(); - throwException(SystemConfigurationException, message.c_str()); - } - } - - targets.push_back(target); - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Reference.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Reference.h deleted file mode 100644 index 33413b488f..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Reference.h +++ /dev/null @@ -1,126 +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_model_reference_h -#define tuscany_sca_model_reference_h - -#include - -namespace tuscany -{ - namespace sca - { - namespace model - { - class Component; - class ReferenceType; - class ReferenceBinding; - class Service; - - /** - * An addressable instance of a reference type associated with a particular component. - * Each reference represents a configured version of a logical - * reference type defined in the component type. If the logical reference - * has a multiplicity greater than 1 (0..n or 1..n) then the configured - * reference many have multiple targets. - */ - class Reference - { - public: - /** - * Constructor. - * @param component The component on which the reference is defined. - * @param referenceType The reference type defining the characteristics of the reference. - */ - SCA_API Reference(Component* component, ReferenceType* referenceType); - - /** - * Destructor. - */ - SCA_API virtual ~Reference(); - - /** - * Returns the component on which this reference is defined. - * @return The component on which this reference is defined. - */ - SCA_API Component* getComponent() const { return component; } - - /** - * Returns the reference type defining the characteristics of the reference. - * @return The reference type defining the characteristics of the reference. - */ - SCA_API ReferenceType* getType() const { return type; } - - /** - * Returns the binding supported by the reference. - * @return The binding supported by the reference. - */ - SCA_API ReferenceBinding* getBinding() const; - - /** - * Sets the binding supported by the reference. - * @param binding The binding supported by the reference. - */ - SCA_API void setBinding(ReferenceBinding* binding); - - /** - * Add a target for this reference. There may be more than - * one if the multiplicity is 0..n or 1..n. - * @param target The target of the reference. - */ - SCA_API void addTarget(Service* target); - - typedef std::vector TARGETS; - - /** - * Get a vector of all the targets from this reference. - * @return The targets of this reference. - */ - SCA_API const TARGETS& getTargets() const { return targets; } - - private: - - /** - * The component on which this reference is defined. - */ - Component* component; - - /** - * The reference type defining the characteristics of the reference. - */ - ReferenceType* type; - - /** - * The binding supported by this reference - */ - ReferenceBinding* binding; - - /** - * Vector of all the targets wired from this reference. - */ - TARGETS targets; - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_reference_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ReferenceBinding.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ReferenceBinding.cpp deleted file mode 100644 index c4e9d875b6..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ReferenceBinding.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/util/Logging.h" -#include "tuscany/sca/model/ReferenceBinding.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Service.h" - - -using namespace std; - -namespace tuscany -{ - namespace sca - { - - namespace model - { - - // Constructor - ReferenceBinding::ReferenceBinding(Reference *reference, const string& uri) : - Binding(uri), reference(reference), targetServiceBinding(0) - { - logentry(); - } - - // Destructor - ReferenceBinding::~ReferenceBinding() - { - logentry(); - } - - void ReferenceBinding::configure(const string& uri) - { - logentry(); - - // Find the target service - Component* component = reference->getComponent(); - Composite* composite = component->getComposite(); - Service* service; - service = composite->findComponentService(uri); - if (!service) - { - logerror("Wire target %s not found", uri.c_str()); - } - else - { - // Configure this binding from the target service binding - configure(service->getBinding()); - } - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ReferenceBinding.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ReferenceBinding.h deleted file mode 100644 index 197d40aabf..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ReferenceBinding.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_model_referencebinding_h -#define tuscany_sca_model_referencebinding_h - -#include - -#include "tuscany/sca/model/Binding.h" - -namespace tuscany -{ - namespace sca - { - class ServiceProxy; - - - namespace model - { - class Reference; - class ServiceBinding; - - /** - * Represents a reference binding. - * Bindings are used by services and references. References use bindings - * to describe the access mechanism used to call an external service (which can - * be a service provided by another SCA composite). Services use bindings to describe - * the access mechanism that clients (which can be a client from another SCA composite) - * have to use to call the service. - * This interface will typically be extended by binding implementations to allow - * specification of binding/transport specific information. - */ - class ReferenceBinding : public Binding - { - public: - - /** - * Constructor to create a new binding. - */ - SCA_API ReferenceBinding(Reference* reference, const std::string& uri); - - /** - * Destructor. - */ - SCA_API virtual ~ReferenceBinding(); - - /** - * Create a proxy representing the reference to the - * client component. - */ - SCA_API virtual ServiceProxy* getServiceProxy() = 0; - - /** - * Configure this binding from a service binding. - */ - SCA_API virtual void configure(ServiceBinding* serviceBinding) = 0; - - /** - * Configure this binding from a URI. - */ - SCA_API virtual void configure(const std::string& uri); - - /** - * Returns the reference. - * @return The reference. - */ - SCA_API Reference* getReference() const { return reference; }; - - /** - * Returns the target service binding. - */ - SCA_API ServiceBinding* getTargetServiceBinding() const { return targetServiceBinding; }; - - protected: - - /** - * Sets the target service binding. - */ - SCA_API void setTargetServiceBinding(ServiceBinding* binding) { targetServiceBinding = binding; }; - - private: - - /** - * The reference configured with the binding. - */ - Reference* reference; - - /** - * The service binding of the target - */ - ServiceBinding* targetServiceBinding; - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_referencebinding_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ReferenceType.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ReferenceType.cpp deleted file mode 100644 index 732a14cace..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ReferenceType.cpp +++ /dev/null @@ -1,88 +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/Exceptions.h" -#include "tuscany/sca/model/ReferenceType.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - - // Constructor - ReferenceType::ReferenceType(ComponentType* componentType, const string& name, - Interface* intface, Interface* callbackInterface, Multiplicity multiplicity) - : Contract(intface, callbackInterface), - componentType(componentType), name(name), multiplicity(multiplicity) - { - logentry(); - } - - ReferenceType::~ReferenceType() - { - logentry(); - } - - ReferenceType::Multiplicity ReferenceType::getMultiplicityFromString(const string& multip) - { - logentry(); - - if (multip == "0..1") - { - return ReferenceType::ZERO_ONE; - } - else if (multip == "1..1") - { - return ReferenceType::ONE_ONE; - } - else if (multip == "0..n") - { - return ReferenceType::ZERO_MANY; - } - else if (multip == "1..n") - { - return ReferenceType::ONE_MANY; - } - else - { - return ReferenceType::UNKNOWN; - } - } - - void ReferenceType::setBinding(Binding* binding) - { - this->binding = binding; - } - - Binding* ReferenceType::getBinding() const - { - return binding; - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ReferenceType.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ReferenceType.h deleted file mode 100644 index 87d38ab330..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ReferenceType.h +++ /dev/null @@ -1,138 +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_model_referencetype_h -#define tuscany_sca_model_referencetype_h - -#include - -#include "tuscany/sca/model/Contract.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - class ComponentType; - class Interface; - class Binding; - - /** - * Represents an SCA reference. SCA references within an implementation represent - * links to services that the implementation uses that must be provided by other components - * in the SCA system. - */ - class ReferenceType : public Contract - { - public: - - /** - * Multiplicity (how many wires can be connected to this - * reference) - */ - enum Multiplicity - { - ZERO_ONE = 1, - ONE_ONE = 2, - ZERO_MANY = 3, - ONE_MANY = 4, - UNKNOWN = 0, - }; - - /** - * Constructor. - * @param name The name of the reference. - */ - SCA_API ReferenceType(ComponentType* componentType, const std::string& name, - Interface* intface, Interface* callbackInterface, Multiplicity multiplicity); - - /** - * Destructor. - */; - SCA_API virtual ~ReferenceType(); - - /** - * Returns the component type on which this reference is defined. - * @return The component type on which this reference is defined. - */ - SCA_API ComponentType* getComponentType() const { return componentType; } - - /** - * Returns the name of the reference. - * @return The name of the reference. - */ - SCA_API const std::string& getName() const { return name; } - - /** - * Returns the multiplicity allowed for wires connected to this reference. - * @return The multiplicity allowed for wires connected to this reference - */ - SCA_API Multiplicity getMultiplicity() const { return multiplicity; } - - /** - * Returns the binding supported by the reference. - * @return The binding supported by the reference. - */ - SCA_API Binding* getBinding() const; - - /** - * Sets the binding supported by the reference. - * @param binding The binding supported by the reference. - */ - SCA_API void setBinding(Binding* binding); - - /** - * Get the multiplicity corresponding to the given - * string. - */ - static Multiplicity getMultiplicityFromString(const std::string& multip); - - private: - - /** - * The component type on which this reference is defined. - */ - ComponentType *componentType; - - /** - * The name of the reference type. - */ - std::string name; - - /** - * The multiplicity allowed for wires connected to this reference. - */ - Multiplicity multiplicity; - - /** - * The binding supported by this reference type. - */ - Binding* binding; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_referencetype_h - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Service.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Service.cpp deleted file mode 100644 index 4df1d1efc6..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Service.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/core/Exceptions.h" -#include "tuscany/sca/model/Service.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - - // Constructor - Service::Service(Component* component, ServiceType* serviceType) - : component(component), type(serviceType), binding(0) - { - logentry(); - } - - // Destructor - Service::~Service() - { - logentry(); - } - - void Service::setBinding(ServiceBinding* binding) - { - this->binding = binding; - } - - ServiceBinding* Service::getBinding() const - { - return binding; - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Service.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Service.h deleted file mode 100644 index a1f2c5d672..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Service.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 tuscany_sca_model_service_h -#define tuscany_sca_model_service_h - - -namespace tuscany -{ - namespace sca - { - namespace model - { - class Component; - class ServiceType; - class ServiceBinding; - - /** - * An addressable instance of a service type associated with a particular component. - */ - class Service - { - public: - /** - * Constructor. - * @param component The component on which the service is defined. - * @param serviceType The service type defining the characteristics of the service. - */ - SCA_API Service(Component* component, ServiceType* serviceType); - - /** - * Destructor. - */ - SCA_API virtual ~Service(); - - /** - * Returns the component on which this service is defined. - * @return The component on which this service is defined. - */ - SCA_API Component* getComponent() const { return component; } - - /** - * Returns the service type defining the characteristics of the service. - * @return The service type defining the characteristics of the service. - */ - SCA_API ServiceType* getType() const { return type; } - - /** - * Returns the binding supported by the service. - * @return The binding supported by the service. - */ - SCA_API ServiceBinding* getBinding() const; - - /** - * Sets the binding supported by the service. - * @param binding The binding supported by the service. - */ - SCA_API void setBinding(ServiceBinding* binding); - - private: - - /** - * The component on which this service is defined. - */ - Component* component; - - /** - * The service type defining the characteristics of the service. - */ - ServiceType* type; - - /** - * The binding supported by this service - */ - ServiceBinding* binding; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_service_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ServiceBinding.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ServiceBinding.cpp deleted file mode 100644 index ddc5e6a711..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ServiceBinding.cpp +++ /dev/null @@ -1,51 +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/model/ServiceBinding.h" - -using namespace std; - - -namespace tuscany -{ - namespace sca - { - - namespace model - { - - // Constructor - ServiceBinding::ServiceBinding(Service* service, const string& uri) : - Binding(uri), service(service) - { - logentry(); - } - - // Destructor - ServiceBinding::~ServiceBinding() - { - logentry(); - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ServiceBinding.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ServiceBinding.h deleted file mode 100644 index 4e68f492a3..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ServiceBinding.h +++ /dev/null @@ -1,89 +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_model_servicebinding_h -#define tuscany_sca_model_servicebinding_h - -#include - -#include "tuscany/sca/model/Binding.h" - - -namespace tuscany -{ - namespace sca - { - class ServiceWrapper; - - namespace model - { - class Service; - - /** - * Represents a service binding. - * Bindings are used by services and references. References use bindings - * to describe the access mechanism used to call an external service (which can - * be a service provided by another SCA composite). Services use bindings to describe - * the access mechanism that clients (which can be a client from another SCA composite) - * have to use to call the service. - * This interface will typically be extended by binding implementations to allow - * specification of binding/transport specific information. - */ - class ServiceBinding : public Binding - { - public: - - /** - * Constructor to create a new binding. - */ - SCA_API ServiceBinding(Service* service, const std::string& uri); - - /** - * Destructor. - */ - SCA_API virtual ~ServiceBinding(); - - /** - * Create a service wrapper handling the interaction - * with the service configured with this binding. - */ - SCA_API virtual ServiceWrapper* getServiceWrapper() = 0; - - /** - * Returns the service - * @return The service. - */ - SCA_API Service* getService() const { return service; }; - - private: - - /** - * The service configured with the binding. - */ - Service* service; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_servicebinding_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ServiceType.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ServiceType.cpp deleted file mode 100644 index 819a832443..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ServiceType.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/model/ServiceType.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - - // Constructor - ServiceType::ServiceType(ComponentType* componentType, const string& name, - Interface* intface, Interface* callbackInterface) - : Contract(intface, callbackInterface), - componentType(componentType), name(name) - { - logentry(); - } - - // Destructor - ServiceType::~ServiceType() - { - logentry(); - } - - void ServiceType::setBinding(Binding* binding) - { - this->binding = binding; - } - - Binding* ServiceType::getBinding() const - { - return binding; - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ServiceType.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ServiceType.h deleted file mode 100644 index 08a76e3b3f..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/ServiceType.h +++ /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$ */ - -#ifndef tuscany_sca_model_servicetype_h -#define tuscany_sca_model_servicetype_h - -#include - -#include "tuscany/sca/model/Contract.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - class ComponentType; - class Binding; - class Interface; - - /** - * Represents a service type. Services are used to publish services provided by - * implementations, so that they are addressable by other components. - */ - class ServiceType : public Contract - { - public: - - /** - * Constructor. - * @param componentType The component type on which this service is defined. - * @param name The name of the service. - */ - SCA_API ServiceType(ComponentType* componentType, const std::string& name, - Interface* intface, Interface* callbackInterface); - - /** - * Destructor. - */ - SCA_API virtual ~ServiceType(); - - /** - * Returns the component type on which this service is defined. - * @return The component type on which this service is defined. - */ - SCA_API ComponentType* getComponentType() const { return componentType; } - - /** - * Returns the name of the service type. - * @return The name of the service type - */ - SCA_API const std::string& getName() const { return name; } - - /** - * Returns the binding supported by this service type. - * @return The binding supported by this service type - */ - SCA_API Binding* getBinding() const; - - /** - * Sets the binding supported by this service type. - * @param binding the binding supported by this service type - */ - SCA_API void setBinding(Binding* binding); - - private: - - /** - * The component type on which this service is defined. - */ - ComponentType* componentType; - - /** - * The name of the service type. - */ - std::string name; - - /** - * The binding supported by this service - */ - Binding* binding; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_servicetype_h - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp deleted file mode 100644 index 53971b5a17..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp +++ /dev/null @@ -1,633 +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 - -#include "tuscany/sca/model/WSDLDefinition.h" -#include "tuscany/sca/model/WSDLOperation.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/core/Exceptions.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::util; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - // Constructor - WSDLDefinition::WSDLDefinition(DataObjectPtr wsdlModel) - { - logentry(); - - wsdlModels.insert(wsdlModels.end(), wsdlModel); - mapOperations( wsdlModel ); - } - - WSDLDefinition::~WSDLDefinition() - { - logentry(); - } - - /// - /// The namespace of the service and other definitions defined in this wsdl definition - string WSDLDefinition::getNamespace() - { - logentry(); - return wsdlModels[0]->getCString("targetNamespace"); - } - - void WSDLDefinition::addWSDLModel(DataObjectPtr wsdlModel) - { - logentry(); - wsdlModels.insert(wsdlModels.end(), wsdlModel); - mapOperations( wsdlModel ); - } - - /// - /// Find the operation defined in this wsdl - /// - const WSDLOperation& WSDLDefinition::findOperation(const string& serviceName, - const string& portName, - const string& operationName) - { - logentry(); - - string operationKey = serviceName+"#"+portName; - STR_OPERATION_MAP::const_iterator spIter = servicePortMap.find(operationKey); - if( spIter == servicePortMap.end() ) - { - stringstream errMessage; - errMessage - << "Unable to find Service and Port: \"" - << serviceName << "," << portName - << "\" in the WSDL definition"; - throwException(SystemConfigurationException, errMessage.str().c_str()); - } - - OPERATION_MAP::const_iterator opIter = spIter->second.find(operationName); - - if (opIter != spIter->second.end()) - { - return opIter->second; - } - else - { - stringstream errMessage; - errMessage - << "Unable to find operation \"" - << serviceName << ":" << portName << ":" << operationName - << "\" in the WSDL definition"; - - throwException(SystemConfigurationException, errMessage.str().c_str()); - } - } - - /// - /// Find the operation defined in this wsdl - /// - const WSDLOperation& WSDLDefinition::findOperation(const string& portTypeName, - const string& operationName) - { - logentry(); - - STR_OPERATION_MAP::const_iterator ptIter = portTypeMap.find(portTypeName); - if( ptIter == portTypeMap.end() ) - { - stringstream errMessage; - errMessage - << "Unable to find PortType: \"" - << portTypeName - << "\" in the WSDL definition"; - throwException(SystemConfigurationException, errMessage.str().c_str()); - } - - OPERATION_MAP::const_iterator opIter = ptIter->second.find(operationName); - - if (opIter != ptIter->second.end()) - { - return opIter->second; - } - else - { - stringstream errMessage; - errMessage - << "Unable to find Operation \"" - << portTypeName << ":" << operationName - << "\" in the WSDL definition"; - throwException(SystemConfigurationException, errMessage.str().c_str()); - } - } - - std::list WSDLDefinition::getPortTypes() - { - logentry(); - - std::list ptList; - STR_OPERATION_MAP::const_iterator ptIter = portTypeMap.begin(); - STR_OPERATION_MAP::const_iterator ptIterEnd = portTypeMap.end(); - - for( ; ptIter != ptIterEnd; ++ptIter ) - { - ptList.push_back( ptIter->first ); - } - - return ptList; - } - - std::list WSDLDefinition::getOperations( const std::string &portTypeName ) - { - logentry(); - - std::list ptOpList; - STR_OPERATION_MAP::const_iterator ptIter = portTypeMap.find( portTypeName ); - - if( ptIter == portTypeMap.end() ) - { - stringstream errMessage; - errMessage - << "Unable to find PortType: \"" - << portTypeName - << "\" in the WSDL definition"; - throwException(SystemConfigurationException, errMessage.str().c_str()); - } - - OPERATION_MAP::const_iterator opIter = ptIter->second.begin(); - OPERATION_MAP::const_iterator opIterEnd = ptIter->second.end(); - - for( ; opIter != opIterEnd; ++opIter ) - { - ptOpList.push_back( opIter->first ); - } - - return ptOpList; - } - - /// - /// Find a service - /// - DataObjectPtr WSDLDefinition::findService(const string& serviceName) - { - logentry(); - - DataObjectPtr service = 0; - - // Find the binding - for (unsigned int m = 0; m < wsdlModels.size(); m++) - { - DataObjectList& serviceList = wsdlModels[m]->getList("service"); - for (unsigned int i=0; igetCString("name")); - - if (name.compare(serviceName) == 0) - { - return serviceList[i]; - } - } - } - - return service; - } - - - /// - /// Find a named binding - /// - DataObjectPtr WSDLDefinition::findBinding(const string& bindingName) - { - logentry(); - - DataObjectPtr binding = 0; - string uri; - string name; - - Utils::rTokeniseString("#", bindingName, uri, name); - - // Find the binding - for (unsigned int m = 0; m < wsdlModels.size(); m++) - { - DataObjectList& bindingList = wsdlModels[m]->getList("binding"); - for (unsigned int i=0; igetCString("name")); - - if (nameBinding.compare(name) == 0) - { - return bindingList[i]; - } - } - } - - return binding; - } - - /// - /// Find a named portType - /// - DataObjectPtr WSDLDefinition::findPortType(const string& portTypeName) - { - logentry(); - - DataObjectPtr portType = 0; - string uri; - string name; - - Utils::rTokeniseString("#", portTypeName, uri, name); - - // Find the binding - for (unsigned int m = 0; m < wsdlModels.size(); m++) - { - DataObjectList& portTypeList = wsdlModels[m]->getList("portType"); - for (unsigned int i=0; igetCString("name")); - - if (namePortType.compare(name) == 0) - { - return portTypeList[i]; - } - } - } - - return portType; - } - - /// - /// Find a named message - /// - DataObjectPtr WSDLDefinition::findMessage(const string& messageName) - { - logentry(); - - DataObjectPtr message = 0; - string uri; - string name; - - Utils::rTokeniseString("#", messageName, uri, name); - - // Find the binding - for (unsigned int m = 0; m < wsdlModels.size(); m++) - { - DataObjectList& messageList = wsdlModels[m]->getList("message"); - for (unsigned int i=0; igetCString("name")); - - if (nameMessage.compare(name) == 0) - { - return messageList[i]; - } - } - } - - return message; - } - - /// - /// Traverse the WSDL SDO and insert operations into the operationMap - /// - void WSDLDefinition::mapOperations( DataObjectPtr wsdlModel ) - { - logentry(); - - // check for duplicate message/binding/PortType/Service - // with equal name attributes. This cant be enforced by - // the schema, so it has to be enforced at the app level - checkForDuplicates( wsdlModel ); - - DataObjectList& serviceList = wsdlModel->getList("service"); - - // Iterate through the WSDL services - for (unsigned int i=0; i < serviceList.size(); i++) - { - string serviceName( serviceList[i]->getCString("name") ); - - // Iterate through the WSDL service ports - DataObjectList& portList = serviceList[i]->getList("port"); - for (unsigned int j=0; j < portList.size();j++) - { - string portName( portList[j]->getCString("name") ); - string wsBindingName(portList[j]->getCString("binding")); - - // There can only be one soap address and the check must be made - // at the application level since it cant be specified in the xsd -/* - DataObjectList& soapAddressList = portList[j]->getList("address"); - if( soapAddressList.size() != 1 ) - { - // Invalid WSDL - stringstream errMessage; - errMessage - << "service/port/address: \"" - << portName - << "\" cannot be duplicated in the WSDL definition"; - throwException(SystemConfigurationException, errMessage.str().c_str()); - } -*/ - - string targetAddress(portList[j]->getCString("address/location")); - - // get the binding specified in the WSDL service port - DataObjectPtr wsBinding = findBinding(wsBindingName); - if (!wsBinding) - { - // Invalid WSDL - stringstream errMessage; - errMessage - << "Unable to find binding \"" - << wsBindingName - << "\" in the WSDL definition"; - throwException(SystemConfigurationException, errMessage.str().c_str()); - } - - // Check if its a SOAP binding, if not go on to the next binding - // doing a find like this will work for SOAP11 and SOAP12 - DataObjectPtr wsBindingSubBinding = wsBinding->getDataObject("binding"); - string bindingURI(wsBindingSubBinding->getType().getURI()); - if (bindingURI.find("http://schemas.xmlsoap.org/wsdl/soap") == string::npos) - { - loginfo("Discarding non-SOAP Binding %s", wsBindingName.c_str() ); - continue; - } - - // Get the port type specified the WSDL binding - string wsBindingPortTypeName(wsBinding->getCString("type")); - DataObjectPtr portType = findPortType(wsBindingPortTypeName); - if (!portType) - { - // Invalid WSDL - stringstream errMessage; - errMessage - << "Unable to find PortType \"" - << wsBindingPortTypeName - << "\" in the WSDL definition"; - throwException(SystemConfigurationException, errMessage.str().c_str()); - } - string portTypeName( portType->getCString("name") ); - - // Fill in this map with operation names to WSDLOperations - // then after iterating through the operations, add the map - // to the portTypeMap, keyed off of the portTypeName - OPERATION_MAP operationMap; - - // For each binding and portType operation: - // - get the soap action, style, and use from the binding - // - get the input and/or output message types - // its ok if not all of the PortType operations are not defined in the binding - DataObjectList& bindingOperationList = wsBinding->getList("operation"); - DataObjectList& portTypeOperationList = portType->getList("operation"); - for (unsigned int k=0; k < bindingOperationList.size(); k++) - { - DataObjectPtr bindingOp = bindingOperationList[k]; - string operationName = bindingOp->getCString("name"); - - // Get the corresponding PortType operation - // I know this may not be very efficient, but its a necessary evil - bool foundPortType = false; - DataObjectPtr portTypeOp; - for (unsigned int l=0; - (!foundPortType && l < portTypeOperationList.size()); - l++) - { - //portTypeOp = portTypeOperationList[l]->getDataObject("operation"); - portTypeOp = portTypeOperationList[l]; - if (operationName == portTypeOp->getCString("name") ) - { - foundPortType = true; - } - } - - if( !foundPortType ) - { - // Invalid WSDL - stringstream errMessage; - errMessage - << "Unable to find PortType operation for binding operation: \"" - << operationName - << "\" in the WSDL definition"; - throwException(SystemConfigurationException, errMessage.str().c_str()); - } - - string soapAction = ""; - bool documentStyle = true; - bool wrappedStyle = true; - bool useEncodedInput = false; - bool useEncodedOutput = false; - WSDLOperation::soapVersion soapVer = WSDLOperation::SOAP11; - - string opType = bindingOp->getType().getURI(); - if (opType == "http://schemas.xmlsoap.org/wsdl/soap12/") - { - soapVer = WSDLOperation::SOAP12; - } - - // Get the soapAction - soapAction = bindingOp->getCString("operation/soapAction"); - - // Get the style - string style = bindingOp->getCString("operation/style"); - if (style == "") - { - style = wsBinding->getCString("binding/style"); - } - if (style != "document") - { - documentStyle = false; - wrappedStyle = false; - } - - // get the use - string use = bindingOp->getCString("input/body/use"); - if (use == "encoded") - { - useEncodedInput = true; - } - - use = bindingOp->getCString("output/body/use"); - if (use == "encoded") - { - useEncodedOutput = true; - } - - // Get the request message type from the PortType - DataObjectPtr wsMessageIn = - findMessage(portTypeOp->getCString("input/message")); - if (!wsMessageIn) - { - stringstream errMessage; - errMessage - << "unable to find PortType input message \"" - << portTypeOp->getCString("input/message") - << "\" in the wsdl definition"; - throwException(SystemConfigurationException, errMessage.str().c_str()); - } - string inputMessageType( wsMessageIn->getCString("name") ); - // If it doesnt have a namespace prefix, add the target namespace - if (inputMessageType.find("#") == string::npos) - { - inputMessageType.insert(0, (getNamespace() + "#") ); - } - - // Get the response message type from the PortType - DataObjectPtr wsMessageOut = - findMessage(portTypeOp->getCString("output/message")); - if (!wsMessageOut) - { - // TODO this is ok for one way operations, right? - stringstream errMessage; - errMessage - << "unable to find PortType output message \"" - << portTypeOp->getCString("output/message") - << "\" in the wsdl definition"; - throwException(SystemConfigurationException, errMessage.str().c_str()); - } - string outputMessageType( wsMessageOut->getCString("name") ); - // If it doesnt have a namespace prefix, add the target namespace - if (outputMessageType.find("#") == string::npos) - { - outputMessageType.insert(0, (getNamespace() + "#") ); - } - - WSDLOperation wsdlOp; - wsdlOp.setOperationName(operationName); - wsdlOp.setSoapAction(soapAction); - wsdlOp.setEndpoint(targetAddress); - wsdlOp.setSoapVersion(soapVer); - wsdlOp.setDocumentStyle(documentStyle); - wsdlOp.setWrappedStyle(wrappedStyle); - wsdlOp.setInputEncoded(useEncodedInput); - wsdlOp.setOutputEncoded(useEncodedOutput); - wsdlOp.setInputMessageType(inputMessageType); - wsdlOp.setOutputMessageType(outputMessageType); - wsdlOp.setInputMessage(wsMessageIn); - wsdlOp.setOutputMessage(wsMessageOut); - - operationMap[ operationName ] = wsdlOp; - - } // end bindingOperationList - - portTypeMap[portTypeName] = operationMap; - servicePortMap[(serviceName+"#"+portName)] = operationMap; - - } // end portTypeList - } // end serviceList - } // end method mapOperations - - void WSDLDefinition::checkForDuplicates( DataObjectPtr wsdlModel ) - { - logentry(); - - // check for duplicate message/binding/PortType/service - // with equal name attributes. This cant be enforced by - // the schema, so it has to be enforced at the app level - - std::set namesSet; - - DataObjectList &messageList = wsdlModel->getList("message"); - for( unsigned int i = 0; i < messageList.size(); i++ ) - { - if( namesSet.find( messageList[i]->getCString("name") ) == namesSet.end() ) - { - namesSet.insert( messageList[i]->getCString("name") ); - } - else - { - // Invalid WSDL - stringstream errMessage; - errMessage - << "message/name: \"" - << messageList[i]->getCString("name") - << "\" cannot be duplicated in the WSDL definition"; - throwException(SystemConfigurationException, errMessage.str().c_str()); - } - } - - namesSet.clear(); - DataObjectList &bindingList = wsdlModel->getList("binding"); - for( unsigned int i = 0; i < bindingList.size(); i++ ) - { - if( namesSet.find( bindingList[i]->getCString("name") ) == namesSet.end() ) - { - namesSet.insert( bindingList[i]->getCString("name") ); - } - else - { - // Invalid WSDL - stringstream errMessage; - errMessage - << "binding/name: \"" - << bindingList[i]->getCString("name") - << "\" cannot be duplicated in the WSDL definition"; - throwException(SystemConfigurationException, errMessage.str().c_str()); - } - } - - namesSet.clear(); - DataObjectList &portTypeList = wsdlModel->getList("portType"); - for( unsigned int i = 0; i < portTypeList.size(); i++ ) - { - if( namesSet.find( portTypeList[i]->getCString("name") ) == namesSet.end() ) - { - namesSet.insert( portTypeList[i]->getCString("name") ); - } - else - { - // Invalid WSDL - stringstream errMessage; - errMessage - << "portType/name: \"" - << portTypeList[i]->getCString("name") - << "\" cannot be duplicated in the WSDL definition"; - throwException(SystemConfigurationException, errMessage.str().c_str()); - } - } - - namesSet.clear(); - DataObjectList &serviceList = wsdlModel->getList("service"); - for( unsigned int i = 0; i < serviceList.size(); i++ ) - { - if( namesSet.find( serviceList[i]->getCString("name") ) == namesSet.end() ) - { - namesSet.insert( serviceList[i]->getCString("name") ); - } - else - { - // Invalid WSDL - stringstream errMessage; - errMessage - << "service/name: \"" - << serviceList[i]->getCString("name") - << "\" cannot be duplicated in the WSDL definition"; - throwException(SystemConfigurationException, errMessage.str().c_str()); - } - } - } - - } // end namespace model - } // end namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLDefinition.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLDefinition.h deleted file mode 100644 index baf14fcd6d..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLDefinition.h +++ /dev/null @@ -1,180 +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_model_wsdldefinition_h -#define tuscany_sca_model_wsdldefinition_h - -#include -#include -#include - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/export.h" -#include "tuscany/sca/model/WSDLOperation.h" - - -namespace tuscany -{ - namespace sca - { - namespace model - { - - class WSDLOperation; - - /** - * Holds information about a WSDL definition loaded into the runtime. - */ - class WSDLDefinition - { - public: - /** - * Constructor. - * @param wsdlModel The data object representing the WSDL document - * defining a web service. - */ - SCA_API WSDLDefinition(commonj::sdo::DataObjectPtr wsdlModel); - - /** - * Destructor. - */ - SCA_API virtual ~WSDLDefinition(); - - /** - * Returns the target namespace of the WSDL definitions. - * @return The target namespace. - */ - SCA_API std::string getNamespace(void); - - /** - * Add a WSDL model. - */ - SCA_API void addWSDLModel(commonj::sdo::DataObjectPtr wsdlModel); - - /** - * Find an operation in the WSDL definitions. - * @param serviceName The name of the service on which this - * operation is defined. - * @param portName The name of the port in the service to - * use. - * @param operationName The name of the operation to find. - * @return The operation if found. Exception thrown if not found. - */ - SCA_API const WSDLOperation& findOperation(const std::string& serviceName, - const std::string& portName, - const std::string& operationName); - - /** - * Find an operation in the WSDL definitions. - * @param portTypeName The name of the portType on which this - * operation is defined. - * @param operationName The name of the operation to find. - * @return The operation if found. Exception thrown if not found. - */ - SCA_API const WSDLOperation& findOperation(const std::string& portTypeName, - const std::string& operationName); - - /** - * Get all of the PortTypes in this WSDL definition. - * @return A standard list of standard strings, each being a different PortType - */ - SCA_API std::list getPortTypes(); - - /** - * Get all of the Operations for a particular PortType in this WSDL definition. - * @param portTypeName Get all of the operations for this portTypeName - * @return A standard list of standard strings, each of which is a different operation - */ - SCA_API std::list getOperations( const std::string &portTypeName ); - - private: - - /** - * Find a service in the wsdl definition. - * @param serviceName The name of the service. - * @return A data object describing the service if found, otherwise - * a 0 if not found. - */ - commonj::sdo::DataObjectPtr findService(const std::string& serviceName); - - /** - * Find a binding in the wsdl definition. - * @param bindingName The name of the binding to find. - * @return A data object describing the binding if found, otherwise - * a 0 if not found. - */ - commonj::sdo::DataObjectPtr findBinding(const std::string& bindingName); - - /** - * Find a portType in the wsdl definition. - * @param portTypeName The name of the portType. - * @return A data object describing the portType if found, otherwise - * a 0 if not found. - */ - commonj::sdo::DataObjectPtr findPortType(const std::string& portTypeName); - - /** - * Find a message in the wsdl definition. - * @param messageName The name of the message. - * @return A data object describing the message if found, otherwise - * a 0 if not found. - */ - commonj::sdo::DataObjectPtr findMessage(const std::string& messageName); - - /** - * Given a wsdl represented by an SDO, traverse the SDO and - * extract all of the necessary information to populate the - * operationMap with WSDLOperation objects. - * This method is called each time a wsdl model is added: so - * that would be be in the constructor and in addWSDLModel(). - * @param wsdlModel A wsdl represented by an SDO - */ - void mapOperations( commonj::sdo::DataObjectPtr wsdlModel ); - - /** - * Given a wsdl represented by an SDO, check for duplicate - * message/binding/PortType/service with equal name attributes. - * This cant be enforced by the schema, so it has to be enforced - * at the app level. If a duplicate is found, a - * SystemConfigurationException exception is thrown. - * @param wsdlModel A wsdl represented by an SDO - */ - void checkForDuplicates( commonj::sdo::DataObjectPtr wsdlModel ); - - /** - * The data object representation of the WSDL document. - */ - typedef std::vector MODEL_VECTOR; - MODEL_VECTOR wsdlModels; - - typedef std::map OPERATION_MAP; - typedef std::map STR_OPERATION_MAP; - STR_OPERATION_MAP portTypeMap; - STR_OPERATION_MAP servicePortMap; - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_wsdldefinition_h - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLInterface.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLInterface.cpp deleted file mode 100644 index 5fa45a9967..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLInterface.cpp +++ /dev/null @@ -1,107 +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/model/WSDLInterface.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - const string WSDLInterface::typeQName("http://www.osoa.org/xmlns/sca/1.0#WSDLPortType"); - - // Constructor - WSDLInterface::WSDLInterface( - const string& qname, bool remotable, bool conversational) - : Interface(remotable, conversational) - { - logentry(); - parse(qname); - } - - void WSDLInterface::parse(const string& qname) - { - logentry(); - - // PortType is of the form: #wsdl.interface() - string::size_type hash = qname.find("#"); - if (hash != string::npos) - { - // Found a hash - - // Namepace is the part before the # - namespaceURI = qname.substr(0, hash); - - if ( (hash+1) < qname.length()) - { - // Check the next part is wsdl.interface( - int ending = hash+16; - string check = qname.substr(hash+1, 15); - if (check.compare("wsdl.interface(") == 0) - { - // Find the matching ) - int endBracket = qname.find(")",ending); - if (endBracket-1 > ending+1) - { - name = qname.substr(ending, endBracket-ending); - } - else - { - // Nothing between the () - name = ""; - } - } - else - { - // not the correct characters after the #, ignore the rest - name = ""; - } - - } - else - { - // Nothing after the hash - name = ""; - } - } - else - { - // No hash at all - namespaceURI = qname; - name = ""; - } - } - - - WSDLInterface::~WSDLInterface() - { - logentry(); - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLInterface.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLInterface.h deleted file mode 100644 index b071dd221e..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLInterface.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_model_wsdlinterface_h -#define tuscany_sca_model_wsdlinterface_h - -#include - -#include "tuscany/sca/model/Interface.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - /** - * Holds information about an interface described using a WSDL - * port type. - */ - class WSDLInterface : public Interface - { - - public: - /** - * Constuctor. - * @param interfaceName Name of the WSDL interface. - */ - WSDLInterface(const std::string& qname, bool remotable, bool conversational); - - /** - * Destructor. - */ - virtual ~WSDLInterface(); - - /** - * Returns the WSDL namespace - */ - std::string getNamespaceURI() const { return namespaceURI; } - - /** - * Returns the interface name - */ - std::string getName() const { return name; } - - /** - * 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 std::string& getInterfaceTypeQName() { return typeQName; }; - - /** - * The QName of the schema type for this interface type. - */ - SCA_API static const std::string typeQName; - - private: - - /** - * Parse the WSDL qname - */ - void parse(const std::string& qname); - - /** - * WSDL namespace. - */ - std::string namespaceURI; - - /** - * Name of the WSDL interface. - */ - std::string name; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_wsdlinterface_h - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLMessagePart.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLMessagePart.cpp deleted file mode 100644 index 957d7ab3c1..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLMessagePart.cpp +++ /dev/null @@ -1,70 +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/model/WSDLMessagePart.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" - -using namespace std; -using namespace tuscany::sca::util; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - - // Default Constructor - WSDLMessagePart::WSDLMessagePart() - { - logentry(); - } - - // Constructor - WSDLMessagePart::WSDLMessagePart(std::string partName, - std::string partType, - std::string partUri) : - partName_(partName), - partType_(partType), - partUri_(partUri) - { - logentry(); - } - - WSDLMessagePart::~WSDLMessagePart() - { - logentry(); - } - - - void WSDLMessagePart::setMessagePartType(const string& inputType) - { - logentry(); - Utils::tokeniseQName(inputType, partUri_, partName_); - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLMessagePart.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLMessagePart.h deleted file mode 100644 index 2c381011ba..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLMessagePart.h +++ /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$ */ - -#ifndef tuscany_sca_model_wsdlmessagepart_h -#define tuscany_sca_model_wsdlmessagepart_h - -#include -#include -#include - -#include "tuscany/sca/export.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - - /** - * Represents a single WSDL defined message part. - */ - class WSDLMessagePart - { - public: - /** - * Default Constructor - */ - SCA_API WSDLMessagePart(); - - /** - * Constructor. - * @param partName The name of the message part. - * @param partType The type of this message part. - * @param partUri The namespace URI for the message part type. - */ - SCA_API WSDLMessagePart( std::string partName, - std::string partType, - std::string partUri ); - - /** - * Destructor. - */ - SCA_API ~WSDLMessagePart(); - - /** - * Return the name of the WSDL Message part - * @return The name of the WSDL Message part - */ - SCA_API const std::string& getPartName() const {return partName_;} - SCA_API void setPartName(const std::string& partName) {partName_ = partName;} - - /** - * The type of this WSDL Message part - * @return The type of this WSDL Message part - */ - SCA_API const std::string& getPartType() const {return partType_;} - SCA_API void setPartType(const std::string& partType) {partType_ = partType;} - - /** - * Set the WSDL message part type and namespace URI - * @return A prefixed namespace and type of the form prefix:type - */ - SCA_API void setMessagePartType(const std::string& partType); - - /** - * Return the namespace URI of the WSDL Message part - * @return The namespace URI of the WSDL Message part - */ - SCA_API const std::string& getPartUri() const {return partUri_;} - SCA_API void setPartUri(const std::string& partUri) {partUri_ = partUri;} - - private: - /** - * The name of this message part - */ - std::string partName_; - - /** - * The type of this message part - */ - std::string partType_; - - /** - * The namespace URI of the message part type - */ - std::string partUri_; - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_wsdlmessagepart_h - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLOperation.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLOperation.cpp deleted file mode 100644 index a61d122a72..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLOperation.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 -#include -#include -#include - -#include "tuscany/sca/model/WSDLOperation.h" -#include "tuscany/sca/model/WSDLMessagePart.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/core/Exceptions.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::util; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - - // Constructor - WSDLOperation::WSDLOperation() - { - logentry(); - } - - WSDLOperation::~WSDLOperation() - { - logentry(); - } - - - void WSDLOperation::setInputMessageType(const string& inputType) - { - logentry(); - Utils::tokeniseQName(inputType, inputMessageUri, inputMessageName); - } - - void WSDLOperation::setOutputMessageType(const string& outputType) - { - logentry(); - Utils::tokeniseQName(outputType, outputMessageUri, outputMessageName); - } - - void WSDLOperation::setInputMessage( commonj::sdo::DataObjectPtr inputMsg ) - { - logentry(); - - DataObjectList &partList = inputMsg->getList("part"); - for( unsigned int i=0; i < partList.size(); i++) - { - string partUri; - string partType; - string partName = partList[0]->getCString("name"); - - Utils::tokeniseQName(partList[0]->getCString("element"), partUri, partType); - WSDLMessagePart part(partName, partType, partUri); - - inputPartMap[partName] = part; - } - } - - void WSDLOperation::setOutputMessage( commonj::sdo::DataObjectPtr outputMsg ) - { - logentry(); - - DataObjectList &partList = outputMsg->getList("part"); - for( unsigned int i=0; i < partList.size(); i++) - { - string partUri; - string partType; - string partName = partList[0]->getCString("name"); - - Utils::tokeniseQName(partList[0]->getCString("element"), partUri, partType); - WSDLMessagePart part(partName, partType, partUri); - - outputPartMap[partName] = part; - } - } - - const std::list WSDLOperation::getInputMessagePartNames() const - { - logentry(); - - std::list inputPartNames; - - PART_MAP::const_iterator iter = inputPartMap.begin(); - PART_MAP::const_iterator iterEnd = inputPartMap.end(); - - for( ; iter != iterEnd; ++iter ) - { - inputPartNames.push_back( iter->first ); - } - - return inputPartNames; - } - - const std::list WSDLOperation::getOutputMessagePartNames() const - { - logentry(); - - std::list outputPartNames; - - PART_MAP::const_iterator iter = outputPartMap.begin(); - PART_MAP::const_iterator iterEnd = outputPartMap.end(); - - for( ; iter != iterEnd; ++iter ) - { - outputPartNames.push_back( iter->first ); - } - - return outputPartNames; - } - - const WSDLMessagePart& - WSDLOperation::getInputMessagePart( const std::string &name ) const - { - logentry(); - - PART_MAP::const_iterator iter = inputPartMap.find( name ); - if( iter == inputPartMap.end() ) - { - stringstream errMessage; - errMessage - << "Unable to find input WSDLMessagePart for partName: " << name; - - throwException(SystemConfigurationException, errMessage.str().c_str()); - } - - return iter->second; - } - - const WSDLMessagePart& - WSDLOperation::getOutputMessagePart( const std::string &name ) const - { - logentry(); - - PART_MAP::const_iterator iter = outputPartMap.find( name ); - if( iter == outputPartMap.end() ) - { - stringstream errMessage; - errMessage - << "Unable to find output WSDLMessagePart for partName: " << name; - - throwException(SystemConfigurationException, errMessage.str().c_str()); - } - - return iter->second; - } - - void WSDLOperation::setInputMessagePart( const std::string &partName, - WSDLMessagePart part ) - { - logentry(); - - inputPartMap[partName] = part; - } - - void WSDLOperation::setOutputMessagePart( const std::string &partName, - WSDLMessagePart part ) - { - logentry(); - - outputPartMap[partName] = part; - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLOperation.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLOperation.h deleted file mode 100644 index 48d848170a..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/WSDLOperation.h +++ /dev/null @@ -1,196 +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_model_wsdloperation_h -#define tuscany_sca_model_wsdloperation_h - -#include -#include -#include - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/export.h" -#include "tuscany/sca/model/WSDLMessagePart.h" - - -namespace tuscany -{ - namespace sca - { - namespace model - { - - /** - * Represents a single.,bound WSDL defined operation. - * This class includes information from the soapBinding - * in addition to the WSDL definition of the operation. - */ - class WSDLOperation - { - public: - /** - * Constructor. - */ - SCA_API WSDLOperation(); - - /** - * Destructor. - */ - SCA_API virtual ~WSDLOperation(); - - /** - * Return the name of the operation for use when serializing an - * outgoing message. - * @return The name of the element in the request message. - */ - SCA_API const std::string& getOperationName() const {return operationName;} - SCA_API void setOperationName(const std::string& opName) {operationName = opName;} - - /** - * The soap action string for this operation. - * @return The soap action. - */ - SCA_API const std::string& getSoapAction() const {return soapAction;} - SCA_API void setSoapAction(const std::string& soapAct) {soapAction = soapAct;} - - /** - * Return the endpoint address for the target web service. - * @return The endpoint address. - */ - SCA_API const std::string& getEndpoint() const {return endpoint;} - SCA_API void setEndpoint(const std::string& ep) {endpoint = ep;} - - enum soapVersion - { - SOAP11, - SOAP12 - }; - - SCA_API void setSoapVersion(soapVersion ver) {soapVer = ver;} - SCA_API soapVersion getSoapVersion() const {return soapVer;} - - SCA_API void setDocumentStyle(bool docStyle) {documentStyle = docStyle;} - SCA_API bool isDocumentStyle() const {return documentStyle;} - - SCA_API void setWrappedStyle(bool wrapStyle) {wrappedStyle = wrapStyle;} - SCA_API bool isWrappedStyle() const {return wrappedStyle;} - - SCA_API void setInputEncoded(bool enc) {inputEncoded = enc;} - SCA_API bool isInputEncoded() const {return inputEncoded;} - - SCA_API void setOutputEncoded(bool enc) {outputEncoded = enc;} - SCA_API bool isOutputEncoded() const {return outputEncoded;} - - /** - * Input Message URI and Name. To get the message part URI and name, you - * will have to get the WSDLMessagePart by calling getInputMessagePart() - */ - SCA_API void setInputMessageType(const std::string& inputMessageType); - SCA_API const std::string& getInputMessageUri() const {return inputMessageUri;} - SCA_API const std::string& getInputMessageName() const {return inputMessageName;} - - /** - * Output Message URI and Name. To get the message part URI and name, you - * will have to get the WSDLMessagePart by calling getOutputMessagePart() - */ - SCA_API void setOutputMessageType(const std::string& outputMessageType); - SCA_API const std::string& getOutputMessageUri() const {return outputMessageUri;} - SCA_API const std::string& getOutputMessageName() const {return outputMessageName;} - - // TODO We should add an enum for REQUEST_ONLY, RESPONSE_ONLY, REQUEST_RESPONSE - // and a setter/getter. The enum would be checked by getOutputXXX - - /** - * Parse a WSDL message represented by an SDO into the input/outputPartMap - * @param inputMsg a data object which contains the WSDL message - * ie. - * - * - */ - SCA_API void setInputMessage( commonj::sdo::DataObjectPtr inputMsg ); - SCA_API void setOutputMessage( commonj::sdo::DataObjectPtr outputMsg ); - - /** - * Manually set the input/outputPartMap, as opposed to passing in an SDO WSDL message. - * Populates the input/outputPartMap, setInput/OutputMessageType must still be called. - * @param partName the name of the message part - * @param part the message part - */ - SCA_API void setInputMessagePart( const std::string &partName, WSDLMessagePart part ); - SCA_API void setOutputMessagePart( const std::string &partName, WSDLMessagePart part ); - - /** - * Return a message part keyed off of the message part name - * @param name the message part name - * @return the message part in a WSDLMessagePart object - */ - SCA_API const WSDLMessagePart &getInputMessagePart( const std::string &name ) const; - SCA_API const WSDLMessagePart &getOutputMessagePart( const std::string &name ) const; - - /** - * Get all of the message part names - * @return a list of strings, each being a different message part name - */ - SCA_API const std::list getInputMessagePartNames() const; - SCA_API const std::list getOutputMessagePartNames() const; - - private: - /** - * The name of the operation for use when serializing an - * outgoing message. - */ - std::string operationName; - - /** - * The soap action string for this operation. - */ - std::string soapAction; - - /** - * The endpoint address of the target web service. - */ - std::string endpoint; - - bool documentStyle; - bool wrappedStyle; - bool inputEncoded; - bool outputEncoded; - soapVersion soapVer; - - std::string inputMessageUri; - std::string inputMessageName; - - std::string outputMessageUri; - std::string outputMessageName; - - typedef std::map PART_MAP; - PART_MAP inputPartMap; - PART_MAP outputPartMap; - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_wsdloperation_h - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Wire.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Wire.cpp deleted file mode 100644 index 03f475af09..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Wire.cpp +++ /dev/null @@ -1,53 +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/model/Wire.h" - -using namespace tuscany::sca::util; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - // Constructor - Wire::Wire(const std::string& source, const std::string& targ) - { - logentry(); - - Utils::tokeniseUri(source, sourceComponent, sourceReference); - target = targ; - } - - Wire::~Wire() - { - logentry(); - } - - } // End namespace model - - - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Wire.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Wire.h deleted file mode 100644 index ab136e9109..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/model/Wire.h +++ /dev/null @@ -1,94 +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_model_wire_h -#define tuscany_sca_model_wire_h - -#include - -namespace tuscany -{ - namespace sca - { - namespace model - { - /** - * Information about a wire in the model. - */ - class Wire - { - public: - - /** - * Constructor. - * @param source The source of the wire. Either the component and - * reference name (optional) or an entry point. - * @param target The target of the wire. Either a component and service - * service name (optional) or an external sevice. - */ - SCA_API Wire(const std::string& source, const std::string& target); - - /** - * Destructor. - */ - SCA_API virtual ~Wire(); - - /** - * Get the component name defined by the source of the wire. - * @return The component name which is the source of the wire. - */ - SCA_API const std::string& getSourceComponent() const { return sourceComponent; } - - /** - * Get the reference name defined by the source of the wire. - * @return The reference name which is the source of the wire. - */ - SCA_API const std::string& getSourceReference() const { return sourceReference; } - - /** - * Get the target uri defined by the target of the wire. - * @return The target uri which is the source of the wire. - */ - SCA_API const std::string& getTarget() { return target; } - - private: - /** - * The source component of the wire. - */ - std::string sourceComponent; - - /** - * The source reference of the wire. - */ - std::string sourceReference; - - /** - * The target uri of the wire. - */ - std::string target; - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_wire_h - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/DefaultLogWriter.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/DefaultLogWriter.cpp deleted file mode 100644 index 48cc0aa1e6..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/DefaultLogWriter.cpp +++ /dev/null @@ -1,51 +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/util/DefaultLogWriter.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace util - { - DefaultLogWriter::~DefaultLogWriter() - { - } - - void DefaultLogWriter::log(int level, const char* tid, const char* msg) - { - cout << tid << " "; - for (int i=0; i < level; i++) - { - cout << " "; - } - cout << msg < -#include - -#if defined(WIN32) || defined (_WINDOWS) -#include -#else -#include -#include -#include -#endif - -#include "tuscany/sca/util/File.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/util/Logging.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace util - { - File::File(const string& dir, const string& file, bool isDirectory) - : directory(dir), fileName(file), isDir(isDirectory) - { - } - File::~File() - { - } - - - Files::Files(const string& rootDir, const string& pattern, bool subdirectories, bool directories) - : rootDirectory(rootDir) - { - findFiles(rootDirectory, pattern, subdirectories, directories); - } - - Files::~Files() - { - } - - unsigned int Files::size() - { - return files.size(); - } - - const File& Files::operator[] (unsigned int index) - { - if (size() <= index) - { - throwException(SystemConfigurationException, "Index of of bounds"); - } - - FILES::iterator iter = files.begin(); - for (unsigned int i=0; id_name; - struct stat statbuf; - if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) - continue; - if (stat(entryName.c_str(), &statbuf) != 0) - { - logwarning("Unable to stat entry: %s", entryName.c_str()); - } - else - { - string filename = entry->d_name; - - if ((exactMatch && filename == pattern) || - (!exactMatch && - ((filename.find(token1) == 0) - && (filename.length() >= token2.length()) - && (filename.rfind(token2) == (filename.length() - token2.length())) ))) - { - if (S_ISDIR(statbuf.st_mode)) - { - if (directories) - { - files.push_back(File(rootDir, filename, true)); - } - } - else if (S_ISREG(statbuf.st_mode)) - { - if (!directories) - { - // Add the file to our list - files.push_back(File(rootDir, filename)); - } - } - } // end - matching filename - - // recurse if necessary - if (subdirectories && S_ISDIR(statbuf.st_mode)) - { - findFiles(entryName, pattern, subdirectories, directories); - } - } - } - - closedir(root); -#endif - } - - } // End namespace util - } // End namespace sca -} // End namespace tuscany - - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/File.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/File.h deleted file mode 100644 index 944a192cf6..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/File.h +++ /dev/null @@ -1,160 +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_util_file_h -#define tuscany_sca_util_file_h - -#include -#include - -namespace tuscany -{ - namespace sca - { - namespace util - { - /** - * File access methods. Provides platform independent - * access to files. - */ - class File - { - public: - /** - * Constructor. - * @param directory Name of the directory in which this file is located. - * Either / or \ can be used interchangeably for separating directory elements. - * @param fileName Name of the file in the dirctory. - */ - File(const std::string& directory, const std::string& fileName, bool isDirectory = false); - - /** - * Destructor. - */ - virtual ~File(); - - /** - * Return the directory in which this file is located. - * @return Name of the parent directory. - */ - const std::string& getDirectory() const {return directory;} - - /** - * Return the name of the file. - * @return Name of the file/directory. - */ - const std::string& getFileName() const {return fileName;} - - /** - * Return if this is a directory - * @return true if a directory - */ - bool isDirectory() const {return isDir;} - - /** - * Return if this is a file - * @return true if a file - */ - bool isFile() const {return !isDir;} - - private: - /** - * Name of the parent directory. - */ - std::string directory; - - /** - * Name of the file/directory - */ - std::string fileName; - - /** - * Is this a directory - */ - bool isDir; - }; - - /** - * Collection of File to provide platform independent access - * to files and directories. - */ - class Files - { - public: - /** - * Constructor which will search a given directory with a pattern and return a - * new instance of this collection class. - * @param rootDirectory The directory in which to search. - * @param pattern A pattern for matching file names. Can include * and ?. - * @param subdirectories Whether subdirectories should be searched too. - * @param directories Whether to directories or files. - */ - Files(const std::string& rootDirectory, - const std::string& pattern, - bool subdirectories = false, - bool directories = false); - - /** - * Destructor. - */ - virtual ~Files(); - - /** - * Return the number of files found. - * @return The number of files found. - */ - unsigned int size(); - - /** - * Return a File at this position in the collection. - * @param index The index into the collection. - * @return The File at this index in the collection. - */ - const File& operator[] (unsigned int index); - - private: - /** - * Search the given directory and pattern for matching files. - * @param rootDirectory The directory in which to search. - * @param pattern A pattern for matching file names. Can include * and ?. - * @param subdirectories Whether subdirectories should be searched too. - * @param directories Whether to directories or files. - */ - void findFiles(const std::string& rootDirectory, const std::string& pattern, - bool subdirectories, bool directories); - - /** - * The top level directory to search. - */ - std::string rootDirectory; - - typedef std::vector FILES; - - /** - * Vector of File. - */ - FILES files; - }; - - } // End namespace util - } // End namespace sca -} // End namespace tuscany -#endif // tuscany_sca_util_file_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/FileLogWriter.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/FileLogWriter.cpp deleted file mode 100644 index 56eb3146dd..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/FileLogWriter.cpp +++ /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$ */ - -#include - -#include "tuscany/sca/util/FileLogWriter.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace util - { - FileLogWriter::FileLogWriter(const char* logfile) - { - logFile.open(logfile, ios_base::app); - } - - FileLogWriter::~FileLogWriter() - { - logFile.close(); - } - - void FileLogWriter::log(int level, const char*tid, const char* msg) - { - logFile << tid << " "; - for (int i=0; i < level; i++) - { - logFile << " "; - } - logFile << msg < -#include - -#include "tuscany/sca/util/LogWriter.h" - -namespace tuscany -{ - namespace sca - { - namespace util - { - /** - * Log writer to write out to standard out. - */ - class FileLogWriter : public LogWriter - { - public: - FileLogWriter(const char* logfile); - - virtual ~FileLogWriter(); - - /** - * Will write to the console. - * See LogWriter#log. - */ - virtual void log(int level, const char* tid, const char* msg); - private: - std::ofstream logFile; - }; - - } // End namespace util - } // End namespace sca -} // End namespace tuscany -#endif // tuscany_sca_util_defaultlogwriter_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Library.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Library.cpp deleted file mode 100644 index 619205ab7e..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Library.cpp +++ /dev/null @@ -1,175 +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/util/Library.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/util/Logging.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace util - { - Library::Library() - : hDLL(NULL) - { - } - - Library::Library(const string& libraryName) - : name(libraryName), hDLL(NULL) - { - logentry(); - load(); - } - - Library::Library(const Library& lib) - : name(lib.name), hDLL(NULL) - { - logentry(); - if (lib.hDLL) - { - load(); - } - } - - Library& Library::operator=(const Library& lib) - { - logentry(); - if (&lib != this) - { - unload(); - name = lib.name; - load(); - } - return *this; - } - - Library::~Library() - { - logentry(); - unload(); - } - - - void Library::load() - { - logentry(); - loginfo("Library: %s", name.c_str()); - - string msg; -#if defined(WIN32) || defined (_WINDOWS) - int l = name.length(); - string dllName; - if (l>=4 && name.substr(l-4, 4)==".dll") - { - dllName = name; - } - else - { - dllName = name+".dll"; - } - SetErrorMode(SEM_FAILCRITICALERRORS); - hDLL = LoadLibrary(dllName.c_str()); - if (hDLL == NULL) - { - ostringstream msgs; - msgs << "Unable to load library: " + dllName << ", error: "; - Utils::printLastError(msgs); - msg = msgs.str(); - } -#else - int l = name.length(); - string libName; -#ifdef IS_DARWIN - string suffix = ".dylib"; -#else - string suffix = ".so"; -#endif - unsigned int suffixLength = suffix.length(); - if (l>=suffixLength && name.substr(l-suffixLength, suffixLength)==suffix) - { - libName = name; - } - else - { - int s = name.rfind("/"); - if (s == name.length()) - { - libName = name + suffix; - } - else - { - s++; - libName = name.substr(0, s) + "lib" + name.substr(s, name.length()-s) + suffix; - } - } - hDLL = dlopen(libName.c_str(), RTLD_NOW); - if (hDLL == NULL) - { - msg = "Unable to load library: " + libName + ": " + dlerror(); - } -#endif - if (hDLL == NULL) - { - throwException(SystemConfigurationException, msg.c_str()); - } - } - - void Library::unload() - { - logentry(); - loginfo("Library: %s", name.c_str()); - - if (hDLL != NULL) - { -#if defined(WIN32) || defined (_WINDOWS) - FreeLibrary(hDLL); -#else - dlclose(hDLL); -#endif - hDLL = NULL; - } - } - - void* Library::getSymbol(const string& symbol) - { - logentry(); - loginfo("Symbol: %s", symbol.c_str()); - if (!hDLL) - { - return 0; - } -#if defined(WIN32) || defined (_WINDOWS) - return GetProcAddress(hDLL, symbol.c_str()); -#else - return dlsym(hDLL, symbol.c_str()); -#endif - } - - } // End namespace util - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Library.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Library.h deleted file mode 100644 index 6b0a17d2b7..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Library.h +++ /dev/null @@ -1,103 +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_util_library_h -#define tuscany_sca_util_library_h - -#if defined(WIN32) || defined (_WINDOWS) -#include -#else -#include -#include -#endif - -#include - -#include "tuscany/sca/export.h" - - -namespace tuscany -{ - namespace sca - { - namespace util - { - /** - * Information about shared libraries and methods to - * access these shared libraries. - */ - class SCA_API Library - { - public: - Library(); - - /** - * Constructor. Will load the library. - * @param libraryName Fully qualified name of the library. - */ - Library(const std::string& libraryName); - - /** - * Destructor. Will unload the library. - */ - virtual ~Library(); - - Library(const Library& lib); - Library& operator=(const Library& lib); - - /** - * Find an externalized symbol in the library. - * @param symbol The name of the symbol to be found. - * @return The pointer to the symbol if found, otherwise 0. - */ - void* getSymbol(const std::string& symbol); - private: - /** - * Name of the library. - */ - std::string name; - - /** - * Handle to the loaded library. - */ -#if defined(WIN32) || defined (_WINDOWS) - HINSTANCE hDLL; -#else - void* hDLL; -#endif - - /** - * Load the library. - */ - void load(); - - /** - * Unload the library, if successfully loaded. - */ - void unload(); - - }; - - } // End namespace util - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_util_library_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/LogWriter.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/LogWriter.cpp deleted file mode 100644 index e551d04eda..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/LogWriter.cpp +++ /dev/null @@ -1,37 +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/LogWriter.h" - -namespace tuscany -{ - namespace sca - { - namespace util - { - LogWriter::~LogWriter() - { - } - - } // End namespace util - } // End namespace sca -} // End namespace tuscany - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/LogWriter.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/LogWriter.h deleted file mode 100644 index 5a6a5c38f7..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/LogWriter.h +++ /dev/null @@ -1,53 +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_util_logwriter_h -#define tuscany_sca_util_logwriter_h - -#include "tuscany/sca/export.h" - -namespace tuscany -{ - namespace sca - { - namespace util - { - /** - * Abstract class for extending logging to other destinations. - */ - class SCA_API LogWriter - { - public: - virtual ~LogWriter(); - - /** - * Log a message. - * @param level The level of logging for this message. - * @param tid The current thread id. - * @param msg The message to log. - */ - virtual void log(int level, const char* tid, const char* msg) = 0; - }; - - } // End namespace util - } // End namespace sca -} // End namespace tuscany -#endif // tuscany_sca_util_logwriter_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Logger.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Logger.cpp deleted file mode 100644 index 5745982f42..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Logger.cpp +++ /dev/null @@ -1,276 +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 - -#if defined(WIN32) || defined (_WINDOWS) -#include -#include -#else -#include -#include -#endif - -#include "tuscany/sca/util/Logger.h" -#include "tuscany/sca/util/DefaultLogWriter.h" -#include "tuscany/sca/util/FileLogWriter.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace util - { - LogWriter* Logger::logWriter = getLogWriter(); - - LogWriter* Logger::getLogWriter() - { - if (logWriter == 0) - { - setLogWriter(0); - - } - return logWriter; - } - - void Logger::setLogWriter(LogWriter* writer) - { - if (logWriter != writer - && logWriter != 0) - { - delete logWriter; - } - - if (writer == 0) - { - char* loggingVar = 0; - loggingVar = getenv("TUSCANY_SCACPP_LOG"); - if (loggingVar == 0) - logWriter = new DefaultLogWriter; - else - logWriter = new FileLogWriter(loggingVar); - } - else - { - logWriter = writer; - } - } - - int Logger::loggingLevel = setLogging(); - - int Logger::setLogging() - { - char* loggingVar = 0; - loggingVar = getenv("TUSCANY_SCACPP_LOGGING"); - if (loggingVar == 0) - return 0; - else - return atoi(loggingVar); - } - - void Logger::setLogging(int level) - { - loggingLevel = level; - } - - void Logger::log(int level, const char* msg) - { - if (level <= loggingLevel) - { - char tid[21]; - formatThreadID(tid); - logWriter->log(level, tid, msg); - } - } - - void Logger::formatThreadID(char* tid) - { -#if defined(WIN32) || defined (_WINDOWS) - sprintf(tid, "%lu:%lu", (unsigned long)_getpid(), (unsigned long)GetCurrentThreadId()); -#else - sprintf(tid, "%lu:%lu", (unsigned long)getpid(), (unsigned long)pthread_self()); -#endif - } - - void Logger::logArgs(int level, const char* msg, ...) - { - if (level <= loggingLevel) - { - va_list variableArguments; - va_start(variableArguments, msg); - char tid[21]; - formatThreadID(tid); - char messageBuffer[256]; -#if defined(WIN32) || defined (_WINDOWS) - int size = _vsnprintf(messageBuffer, 255, msg, variableArguments); - if (size == -1) - { - size = _vscprintf(msg, variableArguments); - char* bigMessageBuffer = new char[size+1]; - _vsnprintf(bigMessageBuffer, size, msg, variableArguments); - bigMessageBuffer[size] = '\0'; - logWriter->log(level, tid, bigMessageBuffer); - delete bigMessageBuffer; - } -#else - int size = vsnprintf(messageBuffer, 255, msg, variableArguments); - if (size > 255) - { - char* bigMessageBuffer = new char[size+1]; - vsnprintf(bigMessageBuffer, size, msg, variableArguments); - bigMessageBuffer[size] = '\0'; - logWriter->log(level, tid, bigMessageBuffer); - delete bigMessageBuffer; - } -#endif - else - { - messageBuffer[255] = '\0'; - logWriter->log(level, tid, messageBuffer); - } - va_end(variableArguments); - } - } - - void Logger::logArgs0(const char* msg, ...) - { - if (0 <= loggingLevel) - { - va_list variableArguments; - va_start(variableArguments, msg); - char tid[21]; - formatThreadID(tid); - char messageBuffer[256]; -#if defined(WIN32) || defined (_WINDOWS) - int size = _vsnprintf(messageBuffer, 255, msg, variableArguments); - if (size == -1) - { - size = _vscprintf(msg, variableArguments); - char* bigMessageBuffer = new char[size+1]; - _vsnprintf(bigMessageBuffer, size, msg, variableArguments); - bigMessageBuffer[size] = '\0'; - logWriter->log(0, tid, bigMessageBuffer); - delete bigMessageBuffer; - } -#else - int size = vsnprintf(messageBuffer, 255, msg, variableArguments); - if (size > 255) - { - char* bigMessageBuffer = new char[size+1]; - vsnprintf(bigMessageBuffer, size, msg, variableArguments); - bigMessageBuffer[size] = '\0'; - logWriter->log(0, tid, bigMessageBuffer); - delete bigMessageBuffer; - } -#endif - else - { - messageBuffer[255] = '\0'; - logWriter->log(0, tid, messageBuffer); - } - va_end(variableArguments); - } - } - void Logger::logArgs1(const char* msg, ...) - { - if (1 <= loggingLevel) - { - va_list variableArguments; - va_start(variableArguments, msg); - char tid[21]; - formatThreadID(tid); - char messageBuffer[256]; -#if defined(WIN32) || defined (_WINDOWS) - int size = _vsnprintf(messageBuffer, 255, msg, variableArguments); - if (size == -1) - { - size = _vscprintf(msg, variableArguments); - char* bigMessageBuffer = new char[size+1]; - _vsnprintf(bigMessageBuffer, size, msg, variableArguments); - bigMessageBuffer[size] = '\0'; - logWriter->log(1, tid, bigMessageBuffer); - delete bigMessageBuffer; - } -#else - int size = vsnprintf(messageBuffer, 255, msg, variableArguments); - if (size > 255) - { - char* bigMessageBuffer = new char[size+1]; - vsnprintf(bigMessageBuffer, size, msg, variableArguments); - bigMessageBuffer[size] = '\0'; - logWriter->log(1, tid, bigMessageBuffer); - delete bigMessageBuffer; - } -#endif - else - { - messageBuffer[255] = '\0'; - logWriter->log(1, tid, messageBuffer); - } - va_end(variableArguments); - } - } - void Logger::logArgs2(const char* msg, ...) - { - if (2 <= loggingLevel) - { - va_list variableArguments; - va_start(variableArguments, msg); - char tid[21]; - formatThreadID(tid); - char messageBuffer[256]; -#if defined(WIN32) || defined (_WINDOWS) - int size = _vsnprintf(messageBuffer, 255, msg, variableArguments); - if (size == -1) - { - size = _vscprintf(msg, variableArguments); - char* bigMessageBuffer = new char[size+1]; - _vsnprintf(bigMessageBuffer, size, msg, variableArguments); - bigMessageBuffer[size] = '\0'; - logWriter->log(2, tid, bigMessageBuffer); - delete bigMessageBuffer; - } -#else - int size = vsnprintf(messageBuffer, 255, msg, variableArguments); - if (size > 255) - { - char* bigMessageBuffer = new char[size+1]; - vsnprintf(bigMessageBuffer, size, msg, variableArguments); - bigMessageBuffer[size] = '\0'; - logWriter->log(2, tid, bigMessageBuffer); - delete bigMessageBuffer; - } -#endif - else - { - messageBuffer[255] = '\0'; - logWriter->log(2, tid, messageBuffer); - } - va_end(variableArguments); - } - } - - } // End namespace util - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Logger.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Logger.h deleted file mode 100644 index eccf3cf02f..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Logger.h +++ /dev/null @@ -1,136 +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_util_logger_h -#define tuscany_sca_util_logger_h - -#include "tuscany/sca/export.h" -#include "tuscany/sca/util/LogWriter.h" - -namespace tuscany -{ - namespace sca - { - namespace util - { - /** - * Provide a logging interface. - */ - class Logger { - - public: - /** - * Set the log writer to use. - * @param writer The writer to use for all subsequent logging. - */ - SCA_API static void setLogWriter(LogWriter* writer); - - /** - * Set or reset the logging level. Any message with a higher logging - * level than this value will be filtered (i.e. not shown). - * @param level The level of logging to use for all subsequent logging. - */ - SCA_API static void setLogging(int level); - - /** - * Log a message. - * @param level The log level of this message. - * @param msg The message to be logged. - */ - SCA_API static void log(int level, const char* msg); - - /** - * Log a message with variable arguments. - * @param level The log level of this message. - * @param msg The message to be logged. Must include template - * characters as described in printf. - * @param ... Variable arguments. - */ - SCA_API static void logArgs(int level, const char* msg, ...); - SCA_API static void logArgs0(const char* msg, ...); - SCA_API static void logArgs1(const char* msg, ...); - SCA_API static void logArgs2(const char* msg, ...); - - /** - * The currently set logging level - */ - SCA_API static int loggingLevel; - - private: - /** - * The current log writer. - */ - static LogWriter* logWriter; - - /** - * Get the current log writer. - * @return The current log writer. - */ - static LogWriter* getLogWriter(); - - /** - * Retrieves the logging level set as an environment variable. - */ - static int setLogging(); - - /** - * Print the current thread id into the given char buffer. - */ - static void formatThreadID(char* tid); - - /** - * Message buffer - */ - static char messageBuffer[4096]; - - }; - - class LogEntry - { - public: - - LogEntry(const char* func) - : funcName(func) - { - if (Logger::loggingLevel >= 2) - { - Logger::logArgs(2, ">> %s", funcName); - } - } - - ~LogEntry() - { - if (Logger::loggingLevel >= 2) - { - Logger::logArgs(2, "<< %s", funcName); - } - } - - private: - const char *funcName; - - }; - - } // End namespace util - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_util_logger_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Logging.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Logging.h deleted file mode 100644 index bf1419faa8..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Logging.h +++ /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. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_util_logging_h -#define tuscany_sca_util_logging_h - -#include "tuscany/sca/util/Logger.h" - -#if defined(WIN32) || defined (_WINDOWS) -#define logentry() \ -const tuscany::sca::util::LogEntry __LOGENTRY__(__FUNCTION__) -#else -#define logentry() \ -const tuscany::sca::util::LogEntry __LOGENTRY__(__PRETTY_FUNCTION__) -#endif - -#define loginfo \ -if (tuscany::sca::util::Logger::loggingLevel >= 2) tuscany::sca::util::Logger::logArgs2 - -#define logwarning \ -if (tuscany::sca::util::Logger::loggingLevel >= 1) tuscany::sca::util::Logger::logArgs1 - -#define logerror \ -if (tuscany::sca::util::Logger::loggingLevel >= 0) tuscany::sca::util::Logger::logArgs0 - -#endif // tuscany_sca_util_logging_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Mutex.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Mutex.cpp deleted file mode 100644 index 7b62000717..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Mutex.cpp +++ /dev/null @@ -1,103 +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 - -#include "tuscany/sca/util/Mutex.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/Exceptions.h" - -using namespace std; - - -namespace tuscany -{ - namespace sca - { - namespace util - { - Mutex::Mutex() - { - logentry(); -#if defined(WIN32) || defined (_WINDOWS) - InitializeCriticalSection(§ion); -#else - int rc = pthread_mutex_init(&mutex, NULL); - if (rc) - { - ostringstream msg; - msg << "Failed to create mutex, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } -#endif - } - - Mutex::~Mutex() - { - logentry(); -#if defined(WIN32) || defined (_WINDOWS) - DeleteCriticalSection(§ion); -#else - int rc = pthread_mutex_destroy(&mutex); - if (rc) { - ostringstream msg; - msg << "Failed to destroy mutex, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } -#endif - } - - void Mutex::lock() - { - logentry(); -#if defined(WIN32) || defined (_WINDOWS) - EnterCriticalSection(§ion); -#else - int rc = pthread_mutex_lock(&mutex); - if (rc) { - ostringstream msg; - msg << "Failed to lock mutex, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } -#endif - } - - void Mutex::unlock() - { - logentry(); -#if defined(WIN32) || defined (_WINDOWS) - LeaveCriticalSection(§ion); -#else - int rc = pthread_mutex_unlock(&mutex); - if (rc) { - ostringstream msg; - msg << "Failed to unlock mutex, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } -#endif - } - - } // End namespace util - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Mutex.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Mutex.h deleted file mode 100644 index d509ba6d73..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Mutex.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_util_mutex_h -#define tuscany_sca_util_mutex_h - -#if defined(WIN32) || defined (_WINDOWS) -#include -#else -#include -#endif - -#include "tuscany/sca/export.h" - - -namespace tuscany -{ - namespace sca - { - namespace util - { - /** - * Information about shared libraries and methods to - * access these shared libraries. - */ - class SCA_API Mutex - { - public: - /** - * Constructor. - */ - Mutex(); - - /** - * Destructor. - */ - virtual ~Mutex(); - - /** - * Lock the mutex. - */ - void lock(); - - /** - * Unlock the mutex. - */ - void unlock(); - - private: - - /** - * Handle to the mutex. - */ -#if defined(WIN32) || defined (_WINDOWS) - CRITICAL_SECTION section; -#else - pthread_mutex_t mutex; -#endif - - }; - - } // End namespace util - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_util_mutex_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Queue.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Queue.cpp deleted file mode 100644 index c124be572c..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Queue.cpp +++ /dev/null @@ -1,222 +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: 491752 $ $Date: 2007-01-01 22:22:23 -0800 (Mon, 01 Jan 2007) $ */ - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#pragma warning(disable: 4251) -#endif - -#include - -#include - -#include "tuscany/sca/util/Queue.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/Exceptions.h" - -using namespace std; - - -namespace tuscany -{ - namespace sca - { - namespace util - { - Queue::Queue() - { - logentry(); -#if defined(WIN32) || defined (_WINDOWS) - InitializeCriticalSection(§ion); - hevent = CreateEvent (NULL, TRUE, FALSE, NULL); -#else - int rc = pthread_mutex_init(&mutex, NULL); - if (rc) - { - ostringstream msg; - msg << "Failed to create mutex, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } - - rc = pthread_cond_init(&cond, NULL); - if (rc) - { - ostringstream msg; - msg << "Failed to create condition variable, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } -#endif - } - - Queue::~Queue() - { - logentry(); -#if defined(WIN32) || defined (_WINDOWS) - DeleteCriticalSection(§ion); - CloseHandle(hevent); -#else - int rc = pthread_mutex_destroy(&mutex); - if (rc) { - ostringstream msg; - msg << "Failed to destroy mutex, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } - - rc = pthread_cond_destroy(&cond); - if (rc) { - ostringstream msg; - msg << "Failed to destroy condition variable, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } -#endif - } - - void Queue::enqueue(void* element) - { - logentry(); -#if defined(WIN32) || defined (_WINDOWS) - EnterCriticalSection(§ion); - - try - { - queue.push(element); - - if (queue.size() == 1) - { - SetEvent(hevent); - } - } - catch (...) - { - LeaveCriticalSection(§ion); - throw; - } - LeaveCriticalSection(§ion); -#else - int rc = pthread_mutex_lock(&mutex); - if (rc) { - ostringstream msg; - msg << "Failed to lock mutex, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } - try - { - queue.push(element); - - if (queue.size() == 1) - { - rc = pthread_cond_signal(&cond); - if (rc) { - ostringstream msg; - msg << "Failed to broadcast condition variable, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } - } - - } - catch(...) - { - pthread_mutex_unlock(&mutex); - throw; - } - rc = pthread_mutex_unlock(&mutex); - if (rc) { - ostringstream msg; - msg << "Failed to unlock mutex, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } -#endif - } - - void* Queue::dequeue() - { - logentry(); - - void* element = NULL; - -#if defined(WIN32) || defined (_WINDOWS) - - EnterCriticalSection(§ion); - try - { - while (queue.size() == 0) { - LeaveCriticalSection(§ion); - WaitForSingleObject(hevent, INFINITE); - EnterCriticalSection(§ion); - } - - element = queue.front(); - queue.pop(); - - if (queue.size() == 0) - { - ResetEvent(hevent); - } - } - catch(...) - { - LeaveCriticalSection(§ion); - throw; - } - LeaveCriticalSection(§ion); - -#else - int rc = pthread_mutex_lock(&mutex); - if (rc) { - ostringstream msg; - msg << "Failed to lock mutex, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } - try - { - while (queue.size() == 0) { - rc = pthread_cond_wait(&cond, &mutex); - if (rc) { - ostringstream msg; - msg << "Failed to wait for condition variable, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } - } - - element = queue.front(); - queue.pop(); - } - catch(...) - { - pthread_mutex_unlock(&mutex); - throw; - } - rc = pthread_mutex_unlock(&mutex); - if (rc) { - ostringstream msg; - msg << "Failed to unlock mutex, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } - -#endif - - return element; - } - - } // End namespace util - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Queue.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Queue.h deleted file mode 100644 index e2ff104631..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Queue.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: 492011 $ $Date: 2007-01-02 18:15:11 -0800 (Tue, 02 Jan 2007) $ */ - -#ifndef tuscany_sca_util_queue_h -#define tuscany_sca_util_queue_h - -#if defined(WIN32) || defined (_WINDOWS) -#include -#else -#include -#endif - -#include - -#include "tuscany/sca/export.h" - - -namespace tuscany -{ - namespace sca - { - namespace util - { - /** - * A thread safe FIFO queue. - */ - class SCA_API Queue - { - public: - /** - * Constructor. - */ - Queue(); - - /** - * Destructor. - */ - virtual ~Queue(); - - /** - * Dequeue an element - */ - void* dequeue(); - - /** - * Enqueue an element - */ - void enqueue(void* element); - - private: - - /** - * The STL queue used to hold elements. - */ - std::queue queue; - - /** - * Handles to the mutex and condition variable - * used to synchronize access to the queue. - */ -#if defined(WIN32) || defined (_WINDOWS) - CRITICAL_SECTION section; - HANDLE hevent; -#else - pthread_mutex_t mutex; - pthread_cond_t cond; -#endif - - }; - - } // End namespace util - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_util_queue_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/SDOUtils.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/SDOUtils.cpp deleted file mode 100644 index 513409db6a..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/SDOUtils.cpp +++ /dev/null @@ -1,438 +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) -#endif - -#include "tuscany/sca/util/SDOUtils.h" - -using namespace std; -using namespace commonj::sdo; - -namespace tuscany -{ - namespace sca - { - namespace util - { - - /** - * Constructor - */ - SDOVisitor::SDOVisitor() - { - } - - /** - * Destructor - */ - SDOVisitor::~SDOVisitor() - { - } - - SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, bool boolData) - { - return SDOVisitor::RESULT_NOT_SUPPORTED; - } - - SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, char byteData) - { - return SDOVisitor::RESULT_NOT_SUPPORTED; - } - - SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, const char* bytesData) - { - return SDOVisitor::RESULT_NOT_SUPPORTED; - } - - SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, wchar_t charData) - { - return SDOVisitor::RESULT_NOT_SUPPORTED; - } - - SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, const SDODate& dateData) - { - return SDOVisitor::RESULT_NOT_SUPPORTED; - } - - SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, long double doubleData) - { - return SDOVisitor::RESULT_NOT_SUPPORTED; - } - - SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, float floatData) - { - return SDOVisitor::RESULT_NOT_SUPPORTED; - } - - SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, long intData) - { - return SDOVisitor::RESULT_NOT_SUPPORTED; - } - - SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, short shortData) - { - return SDOVisitor::RESULT_NOT_SUPPORTED; - } - - SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, const string& stringData) - { - return SDOVisitor::RESULT_CONTINUE; - } - - SDOVisitor::RESULT SDOVisitor::visit(DataObjectPtr parent, const Property& property, DataObjectPtr dataObjectData) - { - return SDOVisitor::RESULT_CONTINUE; - } - - const char* SDOUtils::sdoURI = "commonj.sdo"; - - SDOVisitor::RESULT SDOUtils::accept(DataObjectPtr dataObject, SDOVisitor& visitor, SDOVisitor::DEPTH depth) - { - SDOVisitor::RESULT result = SDOVisitor::RESULT_CONTINUE; - - const Type& type = dataObject->getType(); - if (type.isSequencedType()) - { - SequencePtr sequence = dataObject->getSequence(); - int size = sequence->size(); - for (int i = 0; i < size; i++) - { - if (sequence->isText(i)) - { - const string text(sequence->getCStringValue(i)); - result = visitor.visit(dataObject, *(Property*)NULL, (const string&)text); - } - else - { - const Property& seqProperty = sequence->getProperty(i); - const Type& seqType = seqProperty.getType(); - if (seqType.isDataObjectType()) - { - DataObjectPtr dob; - if (seqProperty.isMany()) - { - int index = sequence->getListIndex(i); - dob = dataObject->getList(seqProperty)[index]; - } - else - { - dob = dataObject->getDataObject(seqProperty); - } - - if (dob) - { - result = visitor.visit(dataObject, seqProperty, (DataObjectPtr)dob); - } - } - else - { - Type::Types t = seqProperty.getTypeEnum(); - switch (t) - { - case Type::BooleanType: - { - result = visitor.visit(dataObject, seqProperty, (bool)sequence->getBooleanValue(i)); - } - break; - case Type::ByteType: - { - result = visitor.visit(dataObject, seqProperty, (char)sequence->getByteValue(i)); - } - break; - case Type::CharacterType: - { - result = visitor.visit(dataObject, seqProperty, (wchar_t)sequence->getCharacterValue(i)); - } - break; - case Type::IntType: - { - result = visitor.visit(dataObject, seqProperty, (long)sequence->getIntValue(i)); - } - break; - case Type::ShortType: - { - result = visitor.visit(dataObject, seqProperty, (short)sequence->getShortValue(i)); - } - break; - case Type::DoubleType: - { - result = visitor.visit(dataObject, seqProperty, (long double)sequence->getDoubleValue(i)); - } - break; - case Type::FloatType: - { - result = visitor.visit(dataObject, seqProperty, (float)sequence->getFloatValue(i)); - } - break; - case Type::LongType: - { - result = visitor.visit(dataObject, seqProperty, (long)sequence->getLongValue(i)); - } - break; - case Type::DateType: - { - const SDODate date = sequence->getDateValue(i); - result = visitor.visit(dataObject, seqProperty, (long)(const time_t)date.getTime()); - } - break; - case Type::BigDecimalType: - case Type::BigIntegerType: - case Type::UriType: - case Type::StringType: - { - ; - const string stringData(sequence->getCStringValue(i)); - result = visitor.visit(dataObject, seqProperty, (const string&)stringData); - } - break; - case Type::BytesType: - { - unsigned int len = sequence->getLength(i); - char* byteData = new char[len]; - sequence->getBytesValue(i, byteData, len); - result = visitor.visit(dataObject, seqProperty, byteData); - delete byteData; - } - break; - default: - result = SDOVisitor::RESULT_NOT_SUPPORTED; - break; - } - if (result == SDOVisitor::RESULT_NOT_SUPPORTED) - { - ; - const string stringData(sequence->getCStringValue(i)); - result = visitor.visit(dataObject, seqProperty, (const string&)stringData); - } - } - } - if (result == SDOVisitor::RESULT_STOP) - return result; - } - } - else - { - PropertyList pl = dataObject->getInstanceProperties(); - for (unsigned int i = 0; i < pl.size(); i++) - { - if (dataObject->isSet(pl[i])) - { - if (pl[i].getType().isDataObjectType()) - { - if (pl[i].isMany()) - { - DataObjectList& doList = dataObject->getList(pl[i]); - for (unsigned int li = 0; li < doList.size(); li++) - { - DataObjectPtr dob = doList[li]; - result = visitor.visit(dataObject, pl[i], (DataObjectPtr)dob); - if (result == SDOVisitor::RESULT_STOP) - return result; - } - } - else - { - DataObjectPtr dob = dataObject->getDataObject(pl[i]); - result = visitor.visit(dataObject, pl[i], (DataObjectPtr)dob); - } - } - else - { - if (pl[i].isMany()) - { - Type::Types t = pl[i].getTypeEnum(); - DataObjectList& doList = dataObject->getList(pl[i]); - for (unsigned int li = 0; li < doList.size(); li++) - { - switch (t) - { - case Type::BooleanType: - { - result = visitor.visit(dataObject, pl[i], (bool)doList.getBoolean(li)); - } - break; - case Type::ByteType: - { - result = visitor.visit(dataObject, pl[i], (char)doList.getByte(li)); - } - break; - case Type::CharacterType: - { - result = visitor.visit(dataObject, pl[i], (wchar_t)doList.getCharacter(li)); - } - break; - case Type::IntType: - { - result = visitor.visit(dataObject, pl[i], (long)doList.getInt(li)); - } - break; - case Type::ShortType: - { - result = visitor.visit(dataObject, pl[i], (short)doList.getShort(li)); - } - break; - case Type::DoubleType: - { - result = visitor.visit(dataObject, pl[i], (long double)doList.getDouble(li)); - } - break; - case Type::FloatType: - { - result = visitor.visit(dataObject, pl[i], (float)doList.getFloat(li)); - } - break; - case Type::LongType: - { - result = visitor.visit(dataObject, pl[i], (long)doList.getLong(li)); - } - break; - case Type::DateType: - { - const SDODate date = doList.getDate(li); - result = visitor.visit(dataObject, pl[i], (long)(const time_t)date.getTime()); - } - break; - case Type::BigDecimalType: - case Type::BigIntegerType: - case Type::UriType: - case Type::StringType: - { - const string stringData(doList.getCString(li)); - result = visitor.visit(dataObject, pl[i], (const string&)stringData); - } - break; - case Type::BytesType: - { - unsigned int len = doList.getLength(li); - char* byteData = new char[len]; - doList.getBytes(li, byteData, len); - result = visitor.visit(dataObject, pl[i], byteData); - delete byteData; - } - break; - default: - result = SDOVisitor::RESULT_NOT_SUPPORTED; - break; - } - if (result == SDOVisitor::RESULT_NOT_SUPPORTED) - { - const string stringData(doList.getCString(li)); - result = visitor.visit(dataObject, pl[i], (const string&)stringData); - } - if (result == SDOVisitor::RESULT_STOP) - return result; - } - } - else - { - Type::Types t = pl[i].getTypeEnum(); - switch (t) - { - case Type::BooleanType: - { - result = visitor.visit(dataObject, pl[i], (bool)dataObject->getBoolean(pl[i])); - } - break; - case Type::ByteType: - { - result = visitor.visit(dataObject, pl[i], (char)dataObject->getByte(pl[i])); - } - break; - case Type::CharacterType: - { - result = visitor.visit(dataObject, pl[i], (wchar_t)dataObject->getCharacter(pl[i])); - } - break; - case Type::IntType: - { - result = visitor.visit(dataObject, pl[i], (long)dataObject->getInt(pl[i])); - } - break; - case Type::ShortType: - { - result = visitor.visit(dataObject, pl[i], (short)dataObject->getShort(pl[i])); - } - break; - case Type::DoubleType: - { - result = visitor.visit(dataObject, pl[i], (long double)dataObject->getDouble(pl[i])); - } - break; - case Type::FloatType: - { - result = visitor.visit(dataObject, pl[i], (float)dataObject->getFloat(pl[i])); - } - break; - case Type::LongType: - { - result = visitor.visit(dataObject, pl[i], (long)dataObject->getLong(pl[i])); - } - break; - case Type::DateType: - { - const SDODate date = dataObject->getDate(pl[i]); - result = visitor.visit(dataObject, pl[i], (long)(const time_t)date.getTime()); - } - break; - case Type::BigDecimalType: - case Type::BigIntegerType: - case Type::UriType: - case Type::StringType: - { - const string stringData(dataObject->getCString(pl[i])); - result = visitor.visit(dataObject, pl[i], (const string&)stringData); - } - break; - case Type::BytesType: - { - unsigned int len = dataObject->getLength(pl[i]); - char* byteData = new char[len]; - dataObject->getBytes(pl[i], byteData, len); - result = visitor.visit(dataObject, pl[i], byteData); - delete byteData; - } - break; - default: - result = SDOVisitor::RESULT_NOT_SUPPORTED; - break; - } - if (result == SDOVisitor::RESULT_NOT_SUPPORTED) - { - const string stringData(dataObject->getCString(pl[i])); - result = visitor.visit(dataObject, pl[i], (const string&)stringData); - } - } - } - } - if (result == SDOVisitor::RESULT_STOP) - return result; - } - } - - return SDOVisitor::RESULT_CONTINUE; - } - - } // End namespace util - } // End namespace sca -} // End namespace tuscany - diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/SDOUtils.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/SDOUtils.h deleted file mode 100644 index 5be65c355a..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/SDOUtils.h +++ /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$ */ - -#ifndef tuscany_sca_util_sdovisitor_h -#define tuscany_sca_util_sdovisitor_h - -#include -#include -#include - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/export.h" - -namespace tuscany -{ - namespace sca - { - namespace util - { - /** - * An SDO visitor interface - */ - class SCA_API SDOVisitor - { - public: - /** - * Constructor. - */ - SDOVisitor(); - - /** - * Destructor. - */ - virtual ~SDOVisitor(); - - /** - * Visit depth - */ - enum DEPTH - { - DEPTH_ZERO = 0, - DEPTH_ONE, - DEPTH_INFINITE - }; - - /** - * Visit status - */ - enum RESULT - { - RESULT_CONTINUE = 0, - RESULT_STOP, - RESULT_NOT_SUPPORTED - }; - - /** - * Visit an SDO. - */ - virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, bool boolData); - virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, char byteData); - virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, const char* bytesData); - virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, wchar_t charData); - virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, const commonj::sdo::SDODate& dateData); - virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, long double doubleData); - virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, float floatData); - virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, long intData); - virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, short shortData); - virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, const std::string& stringData); - virtual RESULT visit(commonj::sdo::DataObjectPtr parent, const commonj::sdo::Property& property, commonj::sdo::DataObjectPtr dataObjectData); - }; - - /** - * SDO utilities. - */ - class SCA_API SDOUtils - { - public: - - static SDOVisitor::RESULT accept(commonj::sdo::DataObjectPtr dataObject, SDOVisitor& visitor, SDOVisitor::DEPTH depth); - static const char* sdoURI; - - }; - - } // End namespace util - } // End namespace sca -} // End namespace tuscany -#endif // tuscany_sca_sdovisitor_file_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Thread.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Thread.cpp deleted file mode 100644 index 064a91409b..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Thread.cpp +++ /dev/null @@ -1,124 +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: 491752 $ $Date: 2007-01-01 22:22:23 -0800 (Mon, 01 Jan 2007) $ */ - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#include -#endif - -#include - -#include - -#include "tuscany/sca/util/Thread.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/Exceptions.h" - -using namespace std; - - -namespace tuscany -{ - namespace sca - { - namespace util - { - -#if defined(WIN32) || defined (_WINDOWS) - unsigned int __stdcall runThread(void *args) - { - Thread* thread = (Thread*)args; - thread->run(); - return 0; - } -#else - void* runThread(void* args) - { - Thread* thread = (Thread*)args; - thread->run(); - return NULL; - } -#endif - - Thread::Thread() -#if defined(WIN32) || defined (_WINDOWS) - : hthread(0) -#else -#endif - { - logentry(); - } - - Thread::~Thread() - { - logentry(); -#if defined(WIN32) || defined (_WINDOWS) - if (hthread != 0) - { - CloseHandle(hthread); - } -#else -#endif - } - - void Thread::start() - { - logentry(); -#if defined(WIN32) || defined (_WINDOWS) - hthread = (HANDLE)_beginthreadex(NULL, 0, runThread, this, 0, NULL); - if (hthread == 0) - { - ostringstream msg; - msg << "Failed to create thread, errno: " << __doserrno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } -#else - int rc =pthread_create(&thread, NULL, runThread, this); - if (rc) - { - ostringstream msg; - msg << "Failed to create thread, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } -#endif - } - - void Thread::join() - { - logentry(); - -#if defined(WIN32) || defined (_WINDOWS) - WaitForSingleObject(hthread, INFINITE); -#else - int rc =pthread_join(thread, NULL); - if (rc) - { - ostringstream msg; - msg << "Failed to join thread, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } -#endif - } - - } // End namespace util - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Thread.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Thread.h deleted file mode 100644 index 2ca9142994..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Thread.h +++ /dev/null @@ -1,90 +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: 492011 $ $Date: 2007-01-02 18:15:11 -0800 (Tue, 02 Jan 2007) $ */ - -#ifndef tuscany_sca_util_thread_h -#define tuscany_sca_util_thread_h - -#if defined(WIN32) || defined (_WINDOWS) -#include -#else -#include -#endif - -#include - -#include "tuscany/sca/export.h" - - -namespace tuscany -{ - namespace sca - { - namespace util - { - /** - * A portable wrapper for native threads. - */ - class SCA_API Thread - { - public: - /** - * Constructor. - */ - Thread(); - - /** - * Destructor. - */ - virtual ~Thread(); - - /** - * The method that will be run in the thread. - */ - virtual void run() = 0; - - /** - * Start the thread. - */ - void start(); - - /** - * Join the thread. - */ - void join(); - - private: - - /** - * Native thread handle. - */ -#if defined(WIN32) || defined (_WINDOWS) - HANDLE hthread; -#else - pthread_t thread; -#endif - - }; - - } // End namespace util - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_util_thread_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/ThreadLocal.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/ThreadLocal.cpp deleted file mode 100644 index 07c99b3cb1..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/ThreadLocal.cpp +++ /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$ */ - -#include - -#include - -#include "tuscany/sca/util/ThreadLocal.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/Exceptions.h" - -using namespace std; - - -namespace tuscany -{ - namespace sca - { - namespace util - { - ThreadLocal::ThreadLocal() - { - logentry(); -#if defined(WIN32) || defined (_WINDOWS) - index = TlsAlloc(); - if (index == TLS_OUT_OF_INDEXES) - { - ostringstream msg; - msg << "Failed to create thread local index, error: " << GetLastError(); - throwException(TuscanyRuntimeException, msg.str().c_str()); - } -#else - int rc = pthread_key_create(&key, NULL); - if (rc) - { - ostringstream msg; - msg << "Failed to create thread local key, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } -#endif - } - - ThreadLocal::~ThreadLocal() - { - logentry(); -#if defined(WIN32) || defined (_WINDOWS) - if (!TlsFree(index)) - { - ostringstream msg; - msg << "Failed to destroy thread local index, error: " << GetLastError(); - throwException(TuscanyRuntimeException, msg.str().c_str()); - } -#else - int rc = pthread_key_delete(key); - if (rc) { - ostringstream msg; - msg << "Failed to destroy thread local key, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } -#endif - } - - void ThreadLocal::setValue(void* value) - { - logentry(); -#if defined(WIN32) || defined (_WINDOWS) - if (!TlsSetValue(index, value)) - { - ostringstream msg; - msg << "Failed to set thread local value, error: " << GetLastError(); - throwException(TuscanyRuntimeException, msg.str().c_str()); - } -#else - int rc = pthread_setspecific(key, value); - if (rc) { - ostringstream msg; - msg << "Failed to set thread local value, errno: " << errno; - throwException(TuscanyRuntimeException, msg.str().c_str()); - } -#endif - } - - void* ThreadLocal::getValue() const - { - logentry(); -#if defined(WIN32) || defined (_WINDOWS) - return TlsGetValue(index); -#else - return pthread_getspecific(key); -#endif - } - - } // End namespace util - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/ThreadLocal.h b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/ThreadLocal.h deleted file mode 100644 index 556055f183..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/ThreadLocal.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_util_threadlocal_h -#define tuscany_sca_util_threadlocal_h - -#if defined(WIN32) || defined (_WINDOWS) -#include -#else -#include -#endif - -#include "tuscany/sca/export.h" - - -namespace tuscany -{ - namespace sca - { - namespace util - { - /** - * Information about shared libraries and methods to - * access these shared libraries. - */ - class SCA_API ThreadLocal - { - public: - /** - * Constructor. - */ - ThreadLocal(); - - /** - * Destructor. - */ - virtual ~ThreadLocal(); - - /** - * Set the ThreadLocal value. - */ - void setValue(void *value); - - /** - * Get the ThreadLocal value. - */ - void* getValue() const; - - private: - - /** - * Handle to the thread local key. - */ -#if defined(WIN32) || defined (_WINDOWS) - DWORD index; -#else - pthread_key_t key; -#endif - - }; - - } // End namespace util - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_util_threadlocal_h diff --git a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Utils.cpp b/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Utils.cpp deleted file mode 100644 index 98a929392d..0000000000 --- a/sca-cpp/trunk/runtime/core/src/tuscany/sca/util/Utils.cpp +++ /dev/null @@ -1,598 +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) -#endif - -#if defined(WIN32) || defined (_WINDOWS) -#include -#else -#include -#endif - -#include "tuscany/sca/util/Utils.h" - -using namespace std; -using namespace commonj::sdo; - -namespace tuscany -{ - namespace sca - { - namespace util - { - void Utils::tokeniseUri(const string& uri, string& token1, string& token2) - { - tokeniseString("/", uri, token1, token2); - } - - void Utils::tokeniseQName(const string& qname, string& uri, string& name) - { - tokeniseString("#", qname, uri, name); - if (name == "") - { - name = uri; - uri = ""; - } - } - - void Utils::tokeniseString( - const string& separator, - const string& str, - string& token1, - string& token2) - { - string::size_type sep = str.find(separator); - if (sep != string::npos) - { - int l = separator.length(); - token1 = str.substr(0, sep); - if ( (sep+l) < str.length()) - { - token2 = str.substr(sep+l); - } - else - { - token2 = ""; - } - } - else - { - token1 = str; - token2 = ""; - } - } - - void Utils::rTokeniseString( - const string& separator, - const string& str, - string& token1, - string& token2) - { - string::size_type sep = str.rfind(separator); - if (sep != string::npos) - { - int l = separator.length(); - token1 = str.substr(0, sep); - if ( (sep+l) < str.length()) - { - token2 = str.substr(sep+l); - } - else - { - token2 = ""; - } - } - else - { - token1 = ""; - token2 = str; - } - } - - void Utils::breakpoint() { - // dummy method used to set breakpoints - } - - ////////////////////////////////////////////////////////////////////////// - // Print a DatObject tree - ////////////////////////////////////////////////////////////////////////// - void Utils::tabs(int inc) - { - for (int ind=0; ind isSet(prop1) != dataObject2->isSet(prop2)) - { - diff.append("Property "); - diff.append(prop1.getName()); - diff.append(" is set on one DataObject but not the other"); - return false; - } - - if (dataObject1->isSet(prop1)) - { - - if (prop1.isMany() != prop2.isMany()) - { - diff.append("Property "); - diff.append(prop1.getName()); - diff.append(" is many on one DataObject but not the other"); - return false; - } - if (propertyType1.isDataType() != propertyType2.isDataType()) - { - diff.append("Property "); - diff.append(prop1.getName()); - diff.append(" is dataType on one DataObject but not the other"); - return false; - } - - ////////////////////////////////////////////////////////////////////// - // For a many-valued property get the list of values - ////////////////////////////////////////////////////////////////////// - if (prop1.isMany()) - { - DataObjectList& dol1 = dataObject1->getList(prop1); - DataObjectList& dol2 = dataObject2->getList(prop2); - if (dol1.size() != dol2.size()) - { - diff.append("Property "); - diff.append(prop1.getName()); - diff.append(" is many but has differing number of elements"); - return false; - } - - for (unsigned int j = 0; j getCString(prop1), dataObject2->getCString(prop2)) != 0) - { - diff.append("Differing value for Property "); - diff.append(prop1.getName()); - diff.append(":\n"); - diff.append(dataObject1->getCString(prop1)); - diff.append("\n"); - diff.append(dataObject2->getCString(prop2)); - return false; - } - } - - ////////////////////////////////////////////////////////////////////// - // For a dataobject compare the DOs - ////////////////////////////////////////////////////////////////////// - else - { - if(!compareDataObjects(dataObject1->getDataObject(prop1), dataObject2->getDataObject(prop2), diff)) - { - return false; - } - } - } - return true; - } - - const bool Utils::compareDataObjects(DataObjectPtr dataObject1, DataObjectPtr dataObject2, string& diff) - { - if (!dataObject1 || !dataObject2) - { - diff.append("Cannot compare null DataObjects"); - return false; - } - - const Type& dataObject1Type = dataObject1->getType(); - const Type& dataObject2Type = dataObject2->getType(); - - if( strcmp(dataObject1Type.getURI(), dataObject2Type.getURI()) != 0 || - strcmp(dataObject1Type.getName(), dataObject2Type.getName()) != 0 ) - { - diff.append("DataObject Types differ:\n"); - diff.append(dataObject1Type.getURI()); - diff.append("#"); - diff.append(dataObject1Type.getName()); - diff.append("\n"); - diff.append(dataObject2Type.getURI()); - diff.append("#"); - diff.append(dataObject2Type.getName()); - return false; - } - - ////////////////////////////////////////////////////////////////////////// - // Iterate over all the properties - ////////////////////////////////////////////////////////////////////////// - PropertyList pl1 = dataObject1->getInstanceProperties(); - PropertyList pl2 = dataObject2->getInstanceProperties(); - if (pl1.size() != pl2.size()) - { - diff.append("Differing number of properties"); - return false; - } - - if (pl1.size() != 0) - { - for (unsigned int i = 0; i < pl1.size(); i++) - { - if(!compareProperties(dataObject1, pl1[i], dataObject2, pl2[i], diff)) - { - return false; - } - } - } - else - { - if(dataObject1->getType().isOpenType() != dataObject2->getType().isOpenType() && - dataObject1->getType().isDataObjectType() != dataObject2->getType().isDataObjectType()) - { - diff.append("DataObject is open & DO type on one but not the other"); - return false; - } - - // Compare elements under an open DataObject - if(dataObject1->getType().isOpenType() && dataObject1->getType().isDataObjectType()) - { - SequencePtr sequence1 = dataObject1->getSequence(); - SequencePtr sequence2 = dataObject2->getSequence(); - - if (sequence1 != NULL && sequence2 != NULL) - { - if (sequence1->size() != sequence1->size()) - { - diff.append("Open DataObjects have differing number of elements"); - return false; - } - - for (unsigned int i = 0; i < sequence1->size(); i++) - { - if (sequence1->isText(i) != sequence2->isText(i)) - { - diff.append("Open DataObjects have differing element types at position "); - diff += ((int) i); - return false; - } - if (sequence1->isText(i)) - { - if( strcmp(sequence1->getCStringValue(i), sequence2->getCStringValue(i)) != 0) - { - diff.append("Differing value for element at position "); - diff += ((int) i); - diff.append(":\n"); - diff.append(sequence1->getCStringValue(i)); - diff.append("\n"); - diff.append(sequence2->getCStringValue(i)); - return false; - } - } - else - { - const Property& p1 = sequence1->getProperty(i); - const Property& p2 = sequence2->getProperty(i); - - if(!compareProperties(dataObject1, p1, dataObject2, p2, diff)) - { - return false; - } - } - } - } - } - } - - return true; - } - - void Utils::printDO(DataObjectPtr dataObject, int increment) - { - int inc=increment; - if (!dataObject) - return; - const Type& dataObjectType = dataObject->getType(); - tabs(inc); - cout << "DataObject type: " << dataObjectType.getURI()<< "#" << dataObjectType.getName() << endl; - inc++; - - ////////////////////////////////////////////////////////////////////////// - // Iterate over all the properties - ////////////////////////////////////////////////////////////////////////// - PropertyList pl = dataObject->getInstanceProperties(); - if (pl.size() != 0) - { - for (unsigned int i = 0; i < pl.size(); i++) - { - tabs(inc); - cout << "Property: " << pl[i].getName() << endl; - - const Type& propertyType = pl[i].getType(); - - tabs(inc); - cout << "Property Type: " << propertyType.getURI()<< "#" << propertyType.getName() << endl; - - if (dataObject->isSet(pl[i])) - { - - ////////////////////////////////////////////////////////////////////// - // For a many-valued property get the list of values - ////////////////////////////////////////////////////////////////////// - if (pl[i].isMany()) - { - inc++; - DataObjectList& dol = dataObject->getList(pl[i]); - for (unsigned int j = 0; j getCString(pl[i]) <getDataObject(pl[i]), inc); - inc--; - } - } - else - { - tabs(inc); - cout<< "Property Value: not set" <getType().isOpenType() && dataObject->getType().isDataObjectType()) - { - SequencePtr sequence = dataObject->getSequence(); - if (sequence != NULL) - { - for (unsigned int i = 0; i < sequence->size(); i++) - { - if (sequence->isText(i)) - { - tabs(inc); - cout<< "Text Value: " << sequence->getCStringValue(i) <getProperty(i); - - tabs(inc); - cout << "Property: " << p.getName() << endl; - - const Type& propertyType = p.getType(); - - tabs(inc); - cout << "Property Type: " << propertyType.getURI()<< "#" << propertyType.getName() << endl; - - if (dataObject->isSet(p)) - { - - ////////////////////////////////////////////////////////////////////// - // For a many-valued property get the list of values - ////////////////////////////////////////////////////////////////////// - if (p.isMany()) - { - inc++; - DataObjectList& dol = dataObject->getList(p); - for (unsigned int j = 0; j getCString(p) <getDataObject(p), inc); - inc--; - } - } - else - { - tabs(inc); - cout<< "Property Value: not set" <getTypes(); - for (unsigned int i = 0; i < tl.size(); i++) - { - cout << "Type: " << tl[i].getURI()<< "#" << tl[i].getName() << endl; - PropertyList pl = tl[i].getProperties(); - for (unsigned int j = 0; j < pl.size(); j++) - { - cout << "\tProperty: " << pl[j].getName() - << " type: " < -#include - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/export.h" - -namespace tuscany -{ - namespace sca - { - namespace util - { - /** - * Utility methods to parse strings and provide debugging information. - */ - class SCA_API Utils { - - public: - static void tokeniseUri(const std::string& uri, std::string& token1, std::string& token2); - static void tokeniseQName(const std::string& sdoname, std::string& uri, std::string& name); - static void tokeniseString( - const std::string& separator, - const std::string& str, - std::string& token1, - std::string& token2); - - static void rTokeniseString( - const std::string& separator, - const std::string& str, - std::string& token1, - std::string& token2); - - static void breakpoint(); - - static void printLastError(std::ostream& os); - - static void printDO(commonj::sdo::DataObjectPtr dataObject, int increment=0); - static void printTypes(commonj::sdo::DataFactoryPtr df); - static void printType(const commonj::sdo::Type& type, int increment=0); - - static const bool compareDataObjects(commonj::sdo::DataObjectPtr dataObject1, commonj::sdo::DataObjectPtr dataObject2, std::string& diff); - static const bool compareProperties(commonj::sdo::DataObjectPtr dataObject1, const commonj::sdo::Property& prop1, commonj::sdo::DataObjectPtr dataObject2, const commonj::sdo::Property& prop2, std::string& diff); - - private: - static void tabs(int increment=0); - }; - - } // End namespace util - } // End namespace sca -} // End namespace tuscany -#endif // tuscany_sca_util_utils_h diff --git a/sca-cpp/trunk/runtime/core/test/Makefile.am b/sca-cpp/trunk/runtime/core/test/Makefile.am deleted file mode 100644 index de5c2d1b1e..0000000000 --- a/sca-cpp/trunk/runtime/core/test/Makefile.am +++ /dev/null @@ -1,17 +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. - diff --git a/sca-cpp/trunk/runtime/core/test/SCATestMacros.h b/sca-cpp/trunk/runtime/core/test/SCATestMacros.h deleted file mode 100644 index 58c640f8a6..0000000000 --- a/sca-cpp/trunk/runtime/core/test/SCATestMacros.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 sca_tests_macros_h_ -#define sca_tests_macros_h_ - -#include - -#define TEST_TRACE( message ) \ - std::cout << "\tTRACE: " << message << std::endl; - -#define TEST_ASSERT( val ) \ - if( ! val ) { \ - std::cout << "Test failed in: " << __FILE__ << ": " << __LINE__ << std::endl; \ - return false; \ - } - -#define TEST_ASSERT_EQUALS( val1, val2 ) \ - if( val1 != val2 ) { \ - std::cout << "Test failed in: " << __FILE__ << ": " << __LINE__ << std::endl; \ - return false; \ - } - -#define TEST_ASSERT_NOT_EQUALS( val1, val2 ) \ - if( val1 == val2 ) { \ - std::cout << "Test failed in: " << __FILE__ << ": " << __LINE__ << std::endl; \ - return false; \ - } - -#define TEST_FAIL( message ) \ - std::cout << "Test failed in: " << __FILE__ << ":" << __LINE__ << ": " << message << std::endl; \ - return false; - -// For this macro, you must have the following variables defined: -// int testsPassed = 0; -// int testsTotal = 0; -// bool retval = false; -// The macro calls the test and increments the total and passed -// tests and logs accordingly -// -#define TEST(testName) \ - ++testsTotal; \ - try { \ - std::cout << "\nTest " << testsTotal << ": " << #testName << " ..... " << std::endl; \ - retval = testName; \ - if (retval) { \ - std::cout << "PASSED" << std::endl; \ - ++testsPassed; \ - } \ - else { \ - std::cout << "FAILED" << std::endl; \ - } \ - } \ - catch(const tuscany::sca::TuscanyRuntimeException &scaE) { \ - std::cout << "FAILED (unexpected SCA exception): " << scaE.getMessageText() \ - << std::endl; \ - } \ - catch(const commonj::sdo::SDORuntimeException &sdoE) { \ - std::cout << "FAILED (unexpected SDO exception): " << sdoE.getMessageText() \ - << std::endl; \ - } \ - catch(...) { \ - std::cout << "FAILED (unexpected unknown exception)" << std::endl; \ - } - -#endif diff --git a/sca-cpp/trunk/runtime/core/test/main.cpp b/sca-cpp/trunk/runtime/core/test/main.cpp deleted file mode 100644 index 9f9f733b49..0000000000 --- a/sca-cpp/trunk/runtime/core/test/main.cpp +++ /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: 583039 $ $Date: 2007-10-08 20:49:57 -0700 (Mon, 08 Oct 2007) $ */ - -#pragma warning(disable:4786) - -#include - -#include "tuscany/sca/core/Exceptions.h" - -#include "SCATestMacros.h" -#include "wsdlTests/wsdlTests.h" -//#include "compositeTests/compositeTests.h" - -using namespace std; - -extern "C"{ - -int main (int argc, char** argv) -{ - // These variables are used and set by the TEST macro - int testsPassed = 0; - int testsTotal = 0; - bool retval = false; - - try - { - WSDLDefinitionTest wsdlTest; - TEST( wsdlTest.testSimple() ); - - WSDLErrorsTest wsdlErrorsTest; -// TEST( wsdlErrorsTest.testDuplicateWSDLInputOutputBinding() ); // fails, JIRA 1900 -// TEST( wsdlErrorsTest.testDuplicateWSDLMessagePartNames() ); // fails, JIRA 1900 - - TEST( wsdlErrorsTest.testDuplicateWSDLBindings() ); - TEST( wsdlErrorsTest.testDuplicateWSDLMessages() ); - TEST( wsdlErrorsTest.testDuplicateWSDLServices() ); - TEST( wsdlErrorsTest.testDuplicateWSDLPortTypes() ); - - // The following 4 tests fail due to an SDO SPEC limitation: - // According to XSD rules, if a global element xsd:any has - // maxOccurs > 1 you can only have a single valued property - // The multiple SOAP addresses/bindings/bodies/operations should load - // and I should be able to get the list and throw if list.size() > 1 - // but I cant because SDO says its a single value element -// TEST( wsdlErrorsTest.testDuplicateSOAPAddress() ); -// TEST( wsdlErrorsTest.testDuplicateSOAPBinding() ); -// TEST( wsdlErrorsTest.testDuplicateSOAPBody() ); -// TEST( wsdlErrorsTest.testDuplicateSOAPOperation() ); - - TEST( wsdlErrorsTest.testMissingPortBinding() ); - TEST( wsdlErrorsTest.testMissingOperation() ); - TEST( wsdlErrorsTest.testMissingPortType() ); - TEST( wsdlErrorsTest.testMissingMessage() ); - -// TEST( wsdlErrorsTest.testMissingMessagePartName() ); // fails, JIRA 1901 -// TEST( wsdlErrorsTest.testMissingPortName() ); // fails, JIRA 1901 -// TEST( wsdlErrorsTest.testMissingMessagePartType() ); // fails, JIRA 1901 - } - catch(...) - { - // All exceptions should be caught by the TEST macro - - cout << "Unexpected exception caught" << endl; - } - - cout - << "---------------------" - << "\nTest Results" - << "\n\tTotal tests: " << testsTotal - << "\n\tTests passed: " << testsPassed - << "\n\tTests failed: " << testsTotal - testsPassed - << endl; - - return testsTotal - testsPassed; -} - -} diff --git a/sca-cpp/trunk/runtime/core/test/sca_test.bat b/sca-cpp/trunk/runtime/core/test/sca_test.bat deleted file mode 100755 index b082dd19ee..0000000000 --- a/sca-cpp/trunk/runtime/core/test/sca_test.bat +++ /dev/null @@ -1,43 +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 "%TUSCANY_SCACPP%" == "" ( -echo "TUSCANY_SCACPP not set" -goto end -) - -if "%TUSCANY_SDOCPP%" == "" ( -echo "TUSCANY_SDOCPP not set" -goto end -) - -if "%AXIS2C_HOME%" == "" ( -echo "AXIS2C_HOME not set" -goto end -) - -rem Run the client -set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% - -.\sca_test.exe - -:end -endlocal diff --git a/sca-cpp/trunk/runtime/core/test/sca_test.sh b/sca-cpp/trunk/runtime/core/test/sca_test.sh deleted file mode 100755 index 99d268af8e..0000000000 --- a/sca-cpp/trunk/runtime/core/test/sca_test.sh +++ /dev/null @@ -1,40 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi - -if [ x$AXIS2C_HOME = x ]; then -echo "AXIS2C_HOME not set" -exit; -fi - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH - -./sca_test - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/BaseWsdlTest.cpp b/sca-cpp/trunk/runtime/core/test/wsdlTests/BaseWsdlTest.cpp deleted file mode 100755 index 88563e5dfa..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/BaseWsdlTest.cpp +++ /dev/null @@ -1,127 +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: 583039 $ $Date: 2007-10-08 20:49:57 -0700 (Mon, 08 Oct 2007) $ */ - -#include "BaseWsdlTest.h" - -#include -#include - -BaseWsdlTest::BaseWsdlTest() -{ - // TODO: Should we possibly make this an arg to this class instead? - char *installRootVar = getenv( "TUSCANY_SCACPP" ); - installRoot_ = installRootVar; -} - -BaseWsdlTest::~BaseWsdlTest() -{ -} - -void BaseWsdlTest::loadXsdHelper() -{ - if( ! (xsdHelper_ == 0) ) - { - return; - } - - try - { - xsdHelper_ = commonj::sdo::HelperProvider::getXSDHelper(); - - std::string filename = installRoot_ + "/xsd/wsdl_11.xsd"; - xsdHelper_->defineFile(filename.c_str()); - - filename = installRoot_ + "/xsd/wsdl_11_http.xsd"; - xsdHelper_->defineFile(filename.c_str()); - - filename = installRoot_ + "/xsd/wsdl_11_mime.xsd"; - xsdHelper_->defineFile(filename.c_str()); - - filename = installRoot_ + "/xsd/wsdl_11_soap.xsd"; - xsdHelper_->defineFile(filename.c_str()); - - filename = installRoot_ + "/xsd/wsdl_11_soap12.xsd"; - xsdHelper_->defineFile(filename.c_str()); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - std::cerr - << "BaseWsdlTest::loadXsdHelper() SDO runtime Exception: " - << sdoE.getMessageText() - << std::endl; - - throw; - } -} - -void BaseWsdlTest::loadXmlHelper() -{ - if( ! (xmlHelper_ == 0) ) - { - return; - } - - if( xsdHelper_ == 0 ) - { - loadXsdHelper(); - } - - try - { - xmlHelper_ = commonj::sdo::HelperProvider::getXMLHelper( xsdHelper_->getDataFactory() ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - std::cerr - << "BaseWsdlTest::loadXmlHelper() SDO runtime Exception: " - << sdoE.getMessageText() - << std::endl; - - throw; - } -} - -tuscany::sca::model::WSDLDefinition * -BaseWsdlTest::loadWsdl( const std::string &wsdlPath ) -{ - loadXmlHelper(); - - tuscany::sca::model::WSDLDefinition *wsdl = 0; - - try - { - commonj::sdo::XMLDocumentPtr doc = xmlHelper_->loadFile( wsdlPath ); - wsdl = new tuscany::sca::model::WSDLDefinition( doc->getRootDataObject() ); -//tuscany::sca::util::Utils::printDO(doc->getRootDataObject()); // TODO remove this - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - std::cerr - << "BaseWsdlTest::loadWsdl() SDO runtime Exception: " - << sdoE.getMessageText() - << std::endl; - - throw; - } - - return wsdl; -} - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/BaseWsdlTest.h b/sca-cpp/trunk/runtime/core/test/wsdlTests/BaseWsdlTest.h deleted file mode 100755 index 7a2be5db5f..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/BaseWsdlTest.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef sca_tests_wsdl_BaseWsdlTest_h_ -#define sca_tests_wsdl_BaseWsdlTest_h_ - -/* - * 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: 583039 $ $Date: 2007-10-08 20:49:57 -0700 (Mon, 08 Oct 2007) $ */ - -#include - -#include -#include - -class BaseWsdlTest -{ - public: - - BaseWsdlTest(); - ~BaseWsdlTest(); - - tuscany::sca::model::WSDLDefinition *loadWsdl( const std::string &wsdlPath ); - - private: - void loadXmlHelper(); - void loadXsdHelper(); - - std::string installRoot_; - commonj::sdo::XMLHelperPtr xmlHelper_; - commonj::sdo::XSDHelperPtr xsdHelper_; - -}; - -#endif - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/WSDLDefinitionTest.cpp b/sca-cpp/trunk/runtime/core/test/wsdlTests/WSDLDefinitionTest.cpp deleted file mode 100755 index df5e22bd68..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/WSDLDefinitionTest.cpp +++ /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: 583039 $ $Date: 2007-10-08 20:49:57 -0700 (Mon, 08 Oct 2007) $ */ - -#include - -#include "SCATestMacros.h" -#include "WSDLDefinitionTest.h" - -WSDLDefinitionTest::WSDLDefinitionTest() -{ -} - -WSDLDefinitionTest::~WSDLDefinitionTest() -{ -} - -bool WSDLDefinitionTest::testSimple() -{ - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_correct/simple.wsdl" ); - - TEST_ASSERT_EQUALS( - "http://www.tuscany.com/tests/simple.wsdl", - wsdl->getNamespace() ); - - // Get the operation based on portType, operName - tuscany::sca::model::WSDLOperation wsdlOp1 = - wsdl->findOperation( "simplePortType", "simpleOperation" ); - TEST_ASSERT_EQUALS( "simpleOperation", wsdlOp1.getOperationName() ); - - // Get the operation based on service, portName, operName - tuscany::sca::model::WSDLOperation wsdlOp2 = - wsdl->findOperation( "simpleService", "simplePort", "simpleOperation" ); - TEST_ASSERT_EQUALS( "simpleOperation", wsdlOp2.getOperationName() ); - - // Check the operation names - std::list operNames = wsdl->getOperations( "simplePortType" ); - TEST_ASSERT_EQUALS( 1, operNames.size() ); - TEST_ASSERT_EQUALS( "simpleOperation", operNames.front() ); - - // Check the port type names - std::list portTypeNames = wsdl->getPortTypes(); - TEST_ASSERT_EQUALS( 1, portTypeNames.size() ); - TEST_ASSERT_EQUALS( "simplePortType", portTypeNames.front() ); - - // Everything passed - return true; -} - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/WSDLDefinitionTest.h b/sca-cpp/trunk/runtime/core/test/wsdlTests/WSDLDefinitionTest.h deleted file mode 100755 index fb536b2153..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/WSDLDefinitionTest.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef sca_tests_wsdl_WSDLDefinitionTest_h_ -#define sca_tests_wsdl_WSDLDefinitionTest_h_ - -/* - * 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: 583039 $ $Date: 2007-10-08 20:49:57 -0700 (Mon, 08 Oct 2007) $ */ - -#include "BaseWsdlTest.h" - -class WSDLDefinitionTest : public BaseWsdlTest -{ - - public: - - WSDLDefinitionTest(); - ~WSDLDefinitionTest(); - - bool testSimple(); - -}; - -#endif - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/WSDLErrorsTest.cpp b/sca-cpp/trunk/runtime/core/test/wsdlTests/WSDLErrorsTest.cpp deleted file mode 100755 index 573c88d7ad..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/WSDLErrorsTest.cpp +++ /dev/null @@ -1,545 +0,0 @@ - -#include -#include - -#include "SCATestMacros.h" -#include "WSDLErrorsTest.h" - -#include -#include -#include - -WSDLErrorsTest::WSDLErrorsTest() -{ -} - -WSDLErrorsTest::~WSDLErrorsTest() -{ -} - - - // Each wsdl in the wsdls_erroneous directory will throw a different - // exception, so we need to check for each individual exception - -bool WSDLErrorsTest::testDuplicateWSDLInputOutputBinding() -{ - TEST_TRACE( "Testing erroneous wsdl: duplicate_binding_input.wsdl" ); - - // This test fails because of JIRA 1900 - - try - { - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_binding_input.wsdl" ); - TEST_FAIL( "Wsdl should have thrown an exception" ); - } - catch( const tuscany::sca::TuscanyRuntimeException &scaE ) - { - TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); - } - catch( ... ) - { - TEST_FAIL( "Caught unexpected unknown Exception: " ); - } - - TEST_TRACE( "Testing erroneous wsdl: duplicate_binding_output.wsdl" ); - - try - { - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_binding_output.wsdl" ); - TEST_FAIL( "Wsdl should have thrown an exception" ); - } - catch( const tuscany::sca::TuscanyRuntimeException &scaE ) - { - TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); - } - catch( ... ) - { - TEST_FAIL( "Caught unexpected unknown Exception: " ); - } - - return true; -} - - -bool WSDLErrorsTest::testDuplicateWSDLMessagePartNames() -{ - TEST_TRACE( "Testing erroneous wsdl: duplicate_partNames.wsdl" ); - - // This test fails because of JIRA 1900 - - try - { - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_partNames.wsdl" ); - TEST_FAIL( "Wsdl should have thrown an exception" ); - } - catch( const tuscany::sca::TuscanyRuntimeException &scaE ) - { - TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); - } - catch( ... ) - { - TEST_FAIL( "Caught unexpected unknown Exception: " ); - } - - return true; -} - -bool WSDLErrorsTest::testDuplicateWSDLMessages() -{ - TEST_TRACE( "Testing erroneous wsdl: duplicate_messages.wsdl" ); - - try - { - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_messages.wsdl" ); - TEST_FAIL( "Wsdl should have thrown an exception" ); - } - catch( const tuscany::sca::TuscanyRuntimeException &scaE ) - { - TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + scaE.getMessageText() ); - std::string errorText( scaE.getMessageText() ); - TEST_ASSERT_NOT_EQUALS( errorText.find( "message/name" ), std::string::npos ); - TEST_ASSERT_NOT_EQUALS( errorText.find( "cannot be duplicated" ), std::string::npos ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); - } - catch( ... ) - { - TEST_FAIL( "Caught unexpected unknown Exception: " ); - } - - return true; -} - -bool WSDLErrorsTest::testDuplicateWSDLPortTypes() -{ - TEST_TRACE( "Testing erroneous wsdl: duplicate_portTypes.wsdl" ); - - try - { - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_portTypes.wsdl" ); - TEST_FAIL( "Wsdl should have thrown an exception" ); - } - catch( const tuscany::sca::TuscanyRuntimeException &scaE ) - { - TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + scaE.getMessageText() ); - std::string errorText( scaE.getMessageText() ); - TEST_ASSERT_NOT_EQUALS( errorText.find( "portType/name" ), std::string::npos ); - TEST_ASSERT_NOT_EQUALS( errorText.find( "cannot be duplicated" ), std::string::npos ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); - } - catch( ... ) - { - TEST_FAIL( "Caught unexpected unknown Exception: " ); - } - - return true; -} - -bool WSDLErrorsTest::testDuplicateWSDLBindings() -{ - TEST_TRACE( "Testing erroneous wsdl: duplicate_bindings.wsdl" ); - - try - { - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_bindings.wsdl" ); - TEST_FAIL( "Wsdl should have thrown an exception" ); - } - catch( const tuscany::sca::TuscanyRuntimeException &scaE ) - { - TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + scaE.getMessageText() ); - std::string errorText( scaE.getMessageText() ); - TEST_ASSERT_NOT_EQUALS( errorText.find( "binding/name" ), std::string::npos ); - TEST_ASSERT_NOT_EQUALS( errorText.find( "cannot be duplicated" ), std::string::npos ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); - } - catch( ... ) - { - TEST_FAIL( "Caught unexpected unknown Exception: " ); - } - - return true; -} - -bool WSDLErrorsTest::testDuplicateWSDLServices() -{ - TEST_TRACE( "Testing erroneous wsdl: duplicate_services.wsdl" ); - - try - { - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_services.wsdl" ); - TEST_FAIL( "Wsdl should have thrown an exception" ); - } - catch( const tuscany::sca::TuscanyRuntimeException &scaE ) - { - TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + scaE.getMessageText() ); - std::string errorText( scaE.getMessageText() ); - TEST_ASSERT_NOT_EQUALS( errorText.find( "service/name" ), std::string::npos ); - TEST_ASSERT_NOT_EQUALS( errorText.find( "cannot be duplicated" ), std::string::npos ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); - } - catch( ... ) - { - TEST_FAIL( "Caught unexpected unknown Exception: " ); - } - - return true; -} - -bool WSDLErrorsTest::testDuplicateSOAPAddress() -{ - TEST_TRACE( "Testing erroneous wsdl: duplicate_soap_address.wsdl" ); - - // This test fails due to an SDO SPEC limitation: - // According to XSD rules, if a global element xsd:any has - // maxOccurs > 1 you can only have a single valued property - // The multiple SOAP addresses/bindings/bodies/operations should load - // and I should be able to get the list and throw if list.size() > 1 - // but I cant because SDO says its a single value element - - try - { - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_soap_address.wsdl" ); - TEST_FAIL( "Wsdl should have thrown an exception" ); - } - catch( const tuscany::sca::TuscanyRuntimeException &scaE ) - { - TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); - } - catch( ... ) - { - TEST_FAIL( "Caught unexpected unknown Exception: " ); - } - - return true; -} - -bool WSDLErrorsTest::testDuplicateSOAPBinding() -{ - TEST_TRACE( "Testing erroneous wsdl: duplicate_soap_binding.wsdl" ); - - // This test fails due to an SDO SPEC limitation: - // According to XSD rules, if a global element xsd:any has - // maxOccurs > 1 you can only have a single valued property - // The multiple SOAP addresses/bindings/bodies/operations should load - // and I should be able to get the list and throw if list.size() > 1 - // but I cant because SDO says its a single value element - - try - { - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_soap_binding.wsdl" ); - TEST_FAIL( "Wsdl should have thrown an exception" ); - } - catch( const tuscany::sca::TuscanyRuntimeException &scaE ) - { - TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); - } - catch( ... ) - { - TEST_FAIL( "Caught unexpected unknown Exception: " ); - } - - return true; -} - -bool WSDLErrorsTest::testDuplicateSOAPBody() -{ - TEST_TRACE( "Testing erroneous wsdl: duplicate_soap_body.wsdl" ); - - // This test fails due to an SDO SPEC limitation: - // According to XSD rules, if a global element xsd:any has - // maxOccurs > 1 you can only have a single valued property - // The multiple SOAP addresses/bindings/bodies/operations should load - // and I should be able to get the list and throw if list.size() > 1 - // but I cant because SDO says its a single value element - - try - { - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_soap_body.wsdl" ); - TEST_FAIL( "Wsdl should have thrown an exception" ); - } - catch( const tuscany::sca::TuscanyRuntimeException &scaE ) - { - TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); - } - catch( ... ) - { - TEST_FAIL( "Caught unexpected unknown Exception: " ); - } - - return true; -} - -bool WSDLErrorsTest::testDuplicateSOAPOperation() -{ - TEST_TRACE( "Testing erroneous wsdl: duplicate_soap_operation.wsdl" ); - - // This test fails due to an SDO SPEC limitation: - // According to XSD rules, if a global element xsd:any has - // maxOccurs > 1 you can only have a single valued property - // The multiple SOAP addresses/bindings/bodies/operations should load - // and I should be able to get the list and throw if list.size() > 1 - // but I cant because SDO says its a single value element - - try - { - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_erroneous/duplicate_soap_operation.wsdl" ); - TEST_FAIL( "Wsdl should have thrown an exception" ); - } - catch( const tuscany::sca::TuscanyRuntimeException &scaE ) - { - TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); - } - catch( ... ) - { - TEST_FAIL( "Caught unexpected unknown Exception: " ); - } - - return true; -} - -bool WSDLErrorsTest::testMissingPortBinding() -{ - TEST_TRACE( "Testing erroneous wsdl: missing_binding_for_port.wsdl" ); - - try - { - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_erroneous/missing_binding_for_port.wsdl" ); - TEST_FAIL( "Wsdl should have thrown an exception" ); - } - catch( const tuscany::sca::TuscanyRuntimeException &scaE ) - { - TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + scaE.getMessageText() ); - std::string errorText( scaE.getMessageText() ); - TEST_ASSERT_NOT_EQUALS( errorText.find( "Unable to find binding" ), std::string::npos ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); - } - catch( ... ) - { - TEST_FAIL( "Caught unexpected unknown Exception" ); - } - - return true; -} - -bool WSDLErrorsTest::testMissingOperation() -{ - TEST_TRACE( "Testing erroneous wsdl: missing_operation.wsdl" ); - - try - { - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_erroneous/missing_operation.wsdl" ); - TEST_FAIL( "Wsdl should have thrown an exception" ); - } - catch( const tuscany::sca::TuscanyRuntimeException &scaE ) - { - TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + scaE.getMessageText() ); - std::string errorText( scaE.getMessageText() ); - TEST_ASSERT_NOT_EQUALS( errorText.find( "Unable to find PortType operation" ), std::string::npos ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); - } - catch( ... ) - { - TEST_FAIL( "Caught unexpected unknown Exception" ); - } - - return true; -} - -bool WSDLErrorsTest::testMissingPortType() -{ - TEST_TRACE( "Testing erroneous wsdl: missing_portType.wsdl" ); - - try - { - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_erroneous/missing_portType.wsdl" ); - TEST_FAIL( "Wsdl should have thrown an exception" ); - } - catch( const tuscany::sca::TuscanyRuntimeException &scaE ) - { - TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + scaE.getMessageText() ); - std::string errorText( scaE.getMessageText() ); - TEST_ASSERT_NOT_EQUALS( errorText.find( "Unable to find PortType" ), std::string::npos ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); - } - catch( ... ) - { - TEST_FAIL( "Caught unexpected unknown Exception" ); - } - - return true; -} - -bool WSDLErrorsTest::testMissingMessage() -{ - TEST_TRACE( "Testing erroneous wsdl: missing_message.wsdl" ); - - try - { - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_erroneous/missing_message.wsdl" ); - TEST_FAIL( "Wsdl should have thrown an exception" ); - } - catch( const tuscany::sca::TuscanyRuntimeException &scaE ) - { - TEST_TRACE( std::string( "Caught expected SCA Exception: " ) + scaE.getMessageText() ); - std::string errorText( scaE.getMessageText() ); - TEST_ASSERT_NOT_EQUALS( errorText.find( "unable to find PortType input message" ), std::string::npos ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); - } - catch( ... ) - { - TEST_FAIL( "Caught unexpected unknown Exception" ); - } - - return true; -} - -bool WSDLErrorsTest::testMissingMessagePartName() -{ - TEST_TRACE( "Testing erroneous wsdl: missing_name_for_part.wsdl" ); - - // This test fails because of JIRA 1901 - - try - { - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_erroneous/missing_name_for_part.wsdl" ); - TEST_FAIL( "Wsdl should have thrown an exception" ); - } - catch( const tuscany::sca::TuscanyRuntimeException &scaE ) - { - TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); - } - catch( ... ) - { - TEST_FAIL( "Caught unexpected unknown Exception: " ); - } - - return true; -} - -bool WSDLErrorsTest::testMissingPortName() -{ - TEST_TRACE( "Testing erroneous wsdl: missing_name_for_port.wsdl" ); - - // This test fails because of JIRA 1901 - - try - { - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_erroneous/missing_name_for_port.wsdl" ); - TEST_FAIL( "Wsdl should have thrown an exception" ); - } - catch( const tuscany::sca::TuscanyRuntimeException &scaE ) - { - TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); - } - catch( ... ) - { - TEST_FAIL( "Caught unexpected unknown Exception: " ); - } - - return true; -} - -bool WSDLErrorsTest::testMissingMessagePartType() -{ - TEST_TRACE( "Testing erroneous wsdl: missing_type_for_part.wsdl" ); - - // This test fails because of JIRA 1901 - - try - { - tuscany::sca::model::WSDLDefinition *wsdl = - loadWsdl( "wsdlTests/wsdls_erroneous/missing_type_for_part.wsdl" ); - TEST_FAIL( "Wsdl should have thrown an exception" ); - } - catch( const tuscany::sca::TuscanyRuntimeException &scaE ) - { - TEST_FAIL( std::string( "Caught unexpected SCA Exception: " ) + scaE.getMessageText() ); - } - catch( const commonj::sdo::SDORuntimeException &sdoE ) - { - TEST_FAIL( std::string( "Caught unexpected SDO Exception: " ) + sdoE.getMessageText() ); - } - catch( ... ) - { - TEST_FAIL( "Caught unexpected unknown Exception: " ); - } - - return true; -} - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/WSDLErrorsTest.h b/sca-cpp/trunk/runtime/core/test/wsdlTests/WSDLErrorsTest.h deleted file mode 100755 index e17d0edd28..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/WSDLErrorsTest.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef sca_tests_wsdl_WSDLErrorsTest_h_ -#define sca_tests_wsdl_WSDLErrorsTest_h_ - -#include "BaseWsdlTest.h" - -class WSDLErrorsTest : public BaseWsdlTest -{ - public: - - WSDLErrorsTest(); - ~WSDLErrorsTest(); - - bool testDuplicateWSDLInputOutputBinding(); - bool testDuplicateWSDLMessagePartNames(); - bool testDuplicateWSDLMessages(); - bool testDuplicateWSDLPortTypes(); - bool testDuplicateWSDLBindings(); - bool testDuplicateWSDLServices(); - bool testDuplicateSOAPAddress(); - bool testDuplicateSOAPBinding(); - bool testDuplicateSOAPBody(); - bool testDuplicateSOAPOperation(); - - bool testMissingPortBinding(); - bool testMissingOperation(); - bool testMissingPortName(); - bool testMissingPortType(); - bool testMissingMessage(); - bool testMissingMessagePartName(); - bool testMissingMessagePartType(); -}; - -#endif - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdlTests.h b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdlTests.h deleted file mode 100755 index f8d86133c1..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdlTests.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef sca_tests_wsdl_wsdlTests_h_ -#define sca_tests_wsdl_wsdlTests_h_ - -/* - * 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: 583039 $ $Date: 2007-10-08 20:49:57 -0700 (Mon, 08 Oct 2007) $ */ - -// This file is included by the main test program -// it just includes all the necessary wsdl headers, -// so the main doesnt have to know about all of them - -#include "wsdlTests/BaseWsdlTest.h" -#include "wsdlTests/WSDLErrorsTest.h" -#include "wsdlTests/WSDLDefinitionTest.h" - -#endif - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_correct/simple.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_correct/simple.wsdl deleted file mode 100644 index c9fe542dbd..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_correct/simple.wsdl +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_binding_input.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_binding_input.wsdl deleted file mode 100755 index 07423d3556..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_binding_input.wsdl +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_binding_output.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_binding_output.wsdl deleted file mode 100755 index 4c295bf0f5..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_binding_output.wsdl +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_bindings.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_bindings.wsdl deleted file mode 100755 index 39932da219..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_bindings.wsdl +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_messages.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_messages.wsdl deleted file mode 100755 index e0388f19d6..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_messages.wsdl +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_partnames.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_partnames.wsdl deleted file mode 100755 index 6b5b1630e0..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_partnames.wsdl +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_portTypes.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_portTypes.wsdl deleted file mode 100755 index 1bbe57bbad..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_portTypes.wsdl +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_services.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_services.wsdl deleted file mode 100755 index e16d04a5ec..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_services.wsdl +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_address.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_address.wsdl deleted file mode 100755 index 01af450396..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_address.wsdl +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_binding.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_binding.wsdl deleted file mode 100755 index a2dac5e15e..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_binding.wsdl +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_body.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_body.wsdl deleted file mode 100755 index 3918b9e6f1..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_body.wsdl +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_operation.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_operation.wsdl deleted file mode 100755 index 542d60b7cb..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/duplicate_soap_operation.wsdl +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_binding_for_port.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_binding_for_port.wsdl deleted file mode 100755 index cfcb65f149..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_binding_for_port.wsdl +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_message.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_message.wsdl deleted file mode 100755 index ec2d17204d..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_message.wsdl +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_name_for_part.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_name_for_part.wsdl deleted file mode 100755 index 4e927e222f..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_name_for_part.wsdl +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_name_for_port.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_name_for_port.wsdl deleted file mode 100755 index f182c01cb6..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_name_for_port.wsdl +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_operation.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_operation.wsdl deleted file mode 100755 index f1fd4eba9c..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_operation.wsdl +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_portType.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_portType.wsdl deleted file mode 100755 index bdfac4d13d..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_portType.wsdl +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_type_for_part.wsdl b/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_type_for_part.wsdl deleted file mode 100755 index 1706ac2f13..0000000000 --- a/sca-cpp/trunk/runtime/core/test/wsdlTests/wsdls_erroneous/missing_type_for_part.wsdl +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/xsd/sca-core.xsd b/sca-cpp/trunk/runtime/core/xsd/sca-core.xsd deleted file mode 100644 index d7661e3994..0000000000 --- a/sca-cpp/trunk/runtime/core/xsd/sca-core.xsd +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/xsd/sca-implementation-composite.xsd b/sca-cpp/trunk/runtime/core/xsd/sca-implementation-composite.xsd deleted file mode 100644 index 4bcc6747ba..0000000000 --- a/sca-cpp/trunk/runtime/core/xsd/sca-implementation-composite.xsd +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/xsd/sca-implementation-java.xsd b/sca-cpp/trunk/runtime/core/xsd/sca-implementation-java.xsd deleted file mode 100644 index e20f0a9b50..0000000000 --- a/sca-cpp/trunk/runtime/core/xsd/sca-implementation-java.xsd +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/xsd/sca-interface-java.xsd b/sca-cpp/trunk/runtime/core/xsd/sca-interface-java.xsd deleted file mode 100644 index a6028c1434..0000000000 --- a/sca-cpp/trunk/runtime/core/xsd/sca-interface-java.xsd +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/xsd/sca-interface-wsdl.xsd b/sca-cpp/trunk/runtime/core/xsd/sca-interface-wsdl.xsd deleted file mode 100644 index a3de838b7e..0000000000 --- a/sca-cpp/trunk/runtime/core/xsd/sca-interface-wsdl.xsd +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/xsd/sca.xsd b/sca-cpp/trunk/runtime/core/xsd/sca.xsd deleted file mode 100644 index 8853f25c11..0000000000 --- a/sca-cpp/trunk/runtime/core/xsd/sca.xsd +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/xsd/tuscany.xsd b/sca-cpp/trunk/runtime/core/xsd/tuscany.xsd deleted file mode 100644 index 8bad940782..0000000000 --- a/sca-cpp/trunk/runtime/core/xsd/tuscany.xsd +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/xsd/wsdl_11.xsd b/sca-cpp/trunk/runtime/core/xsd/wsdl_11.xsd deleted file mode 100644 index 7cfdc5b58b..0000000000 --- a/sca-cpp/trunk/runtime/core/xsd/wsdl_11.xsd +++ /dev/null @@ -1,307 +0,0 @@ - - - - - - - - - - - - - - This type is extended by component types to allow them to be documented - - - - - - - - - - - - - This type is extended by component types to allow attributes from other namespaces to be added. - - - - - - - - - - - - - This type is extended by component types to allow elements from other namespaces to be added. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Any top level optional element allowed to appear more then once - any child of definitions element except wsdl:types. Any extensibility element is allowed in any place. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/xsd/wsdl_11_http.xsd b/sca-cpp/trunk/runtime/core/xsd/wsdl_11_http.xsd deleted file mode 100644 index 7003bf29d8..0000000000 --- a/sca-cpp/trunk/runtime/core/xsd/wsdl_11_http.xsd +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/xsd/wsdl_11_mime.xsd b/sca-cpp/trunk/runtime/core/xsd/wsdl_11_mime.xsd deleted file mode 100644 index 46c62c822c..0000000000 --- a/sca-cpp/trunk/runtime/core/xsd/wsdl_11_mime.xsd +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/xsd/wsdl_11_soap.xsd b/sca-cpp/trunk/runtime/core/xsd/wsdl_11_soap.xsd deleted file mode 100644 index 800059d6b0..0000000000 --- a/sca-cpp/trunk/runtime/core/xsd/wsdl_11_soap.xsd +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - - - - "encodingStyle" indicates any canonicalization conventions followed in the contents of the containing element. For example, the value "http://schemas.xmlsoap.org/soap/encoding/" indicates the pattern described in SOAP specification - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/core/xsd/wsdl_11_soap12.xsd b/sca-cpp/trunk/runtime/core/xsd/wsdl_11_soap12.xsd deleted file mode 100644 index 281f2c0deb..0000000000 --- a/sca-cpp/trunk/runtime/core/xsd/wsdl_11_soap12.xsd +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/Makefile.am b/sca-cpp/trunk/runtime/extensions/Makefile.am deleted file mode 100644 index 1cc28fe80e..0000000000 --- a/sca-cpp/trunk/runtime/extensions/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. - -if WANT_ALL - CPP_EXTENSION = cpp - PYTHON_EXTENSION = python - RUBY_EXTENSION = ruby - WSBINDING_EXTENSION = ws - SCABINDING_EXTENSION = sca - RESTBINDING_EXTENSION = rest -endif -if WANT_CPP - CPP_EXTENSION = cpp -endif -if WANT_PYTHON - PYTHON_EXTENSION = python -endif -if WANT_RUBY - RUBY_EXTENSION = ruby -endif - -if WANT_WSBINDING - WSBINDING_EXTENSION = ws -endif -if WANT_SCABINDING - SCABINDING_EXTENSION = sca -endif -if WANT_RESTBINDING - RESTBINDING_EXTENSION = rest -endif -SUBDIRS = ${CPP_EXTENSION} ${WSBINDING_EXTENSION} ${SCABINDING_EXTENSION} ${RESTBINDING_EXTENSION} ${PYTHON_EXTENSION} ${RUBY_EXTENSION} diff --git a/sca-cpp/trunk/runtime/extensions/cpp/Makefile.am b/sca-cpp/trunk/runtime/extensions/cpp/Makefile.am deleted file mode 100644 index 3ef2b728b3..0000000000 --- a/sca-cpp/trunk/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 tools - -datadir=$(prefix)/extensions/cpp - -nobase_data_DATA = xsd/*.xsd - -EXTRA_DIST = xsd diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/Makefile.am b/sca-cpp/trunk/runtime/extensions/cpp/src/Makefile.am deleted file mode 100644 index f234261f5b..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/Makefile.am +++ /dev/null @@ -1,55 +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/TuscanyRuntime.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 - -moduledir=$(prefix)/extensions/cpp/module -extension = libtuscany_sca_cpp$(libsuffix) - -install-exec-hook: - test -z $(moduledir) || $(mkdir_p) $(moduledir); - -rm -f $(moduledir)/$(extension) - $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/ComponentContext.cpp b/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/ComponentContext.cpp deleted file mode 100644 index d686c4c09f..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/ComponentContext.cpp +++ /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$ */ - -#include "commonj/sdo/SDO.h" - -#include "osoa/sca/ComponentContext.h" -#include "osoa/sca/ServiceRuntimeException.h" - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/cpp/ComponentContextImpl.h" -#include "tuscany/sca/core/SCARuntime.h" - -using namespace commonj::sdo; -using namespace tuscany::sca; -using namespace tuscany::sca::cpp; -using namespace tuscany::sca::model; - -namespace osoa -{ - namespace sca - { - - // ======================================================= - // getCurrent: create a context from the current component - // ======================================================= - ComponentContext ComponentContext::getCurrent() - { - logentry(); - try - { - Component* component = tuscany::sca::SCARuntime::getCurrentRuntime()->getCurrentComponent(); - if (!component) - { - throwException(ComponentContextException, "No current component"); - } - ComponentContext* cci = new ComponentContextImpl(component); - return ComponentContext(cci); - } - catch (ServiceRuntimeException&) - { - throw; - } - catch (TuscanyRuntimeException& e) - { - throwException(ServiceRuntimeException, e); - } - } - - // =========== - // Constructor - // =========== - ComponentContext::ComponentContext(ComponentContext* implementation) - : impl(implementation) - { - logentry(); - } - - // ========== - // Destructor - // ========== - ComponentContext::~ComponentContext() - { - logentry(); - delete impl; - } - - // =================================== - // Copy constructor: create a new impl - // =================================== - ComponentContext::ComponentContext(const ComponentContext& ctx) - { - logentry(); - Component* component = ((ComponentContextImpl*)impl)->getComponent(); - impl = new ComponentContextImpl(component); - } - - // ============================= - // operator= : create a new impl - // ============================= - ComponentContext& ComponentContext::operator=(const ComponentContext& ctx) - { - logentry(); - if (this != &ctx) - { - Component* component = ((ComponentContextImpl*)impl)->getComponent(); - impl = new ComponentContextImpl(component); - } - return *this; - } - - // ========== - // getService - // ========== - void* ComponentContext::getService(const std::string& referenceName) - { - logentry(); - void* service = impl->getService(referenceName); - return service; - } - - // =========== - // getServices - // =========== - std::list ComponentContext::getServices(const std::string& referenceName) - { - logentry(); - return impl->getServices(referenceName); - } - - // ============ - // getProperties - // ============= - DataObjectPtr ComponentContext::getProperties() - { - logentry(); - DataObjectPtr properties = impl->getProperties(); - return properties; - } - - // ============ - // getDataFactory - // ============= - DataFactoryPtr ComponentContext::getDataFactory() - { - logentry(); - DataFactoryPtr dataFactory = impl->getDataFactory(); - return dataFactory; - } - - - } // End namespace sca -} // End namespace osoa diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/ComponentContext.h b/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/ComponentContext.h deleted file mode 100644 index 2c305c5161..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/ComponentContext.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 osoa_sca_componentcontext_h -#define osoa_sca_componentcontext_h - -#include -#include - -#include "commonj/sdo/SDO.h" - -#include "osoa/sca/export.h" - -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/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/CompositeContext.cpp b/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/CompositeContext.cpp deleted file mode 100644 index d3f06e1b12..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/CompositeContext.cpp +++ /dev/null @@ -1,127 +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 "commonj/sdo/SDO.h" - -#include "osoa/sca/CompositeContext.h" -#include "osoa/sca/ServiceRuntimeException.h" - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/cpp/CompositeContextImpl.h" -#include "tuscany/sca/core/SCARuntime.h" - -using namespace commonj::sdo; -using namespace tuscany::sca; -using namespace tuscany::sca::cpp; - - -namespace osoa -{ - namespace sca - { - // =========== - // Constructor - // =========== - CompositeContext::CompositeContext(CompositeContext* implementation) - : impl(implementation) - { - logentry(); - } - - // =================================== - // Copy constructor: create a new impl - // =================================== - CompositeContext::CompositeContext(const CompositeContext& ctx) - { - logentry(); - impl = new CompositeContextImpl( - tuscany::sca::SCARuntime::getCurrentRuntime()->getDefaultComponent()); - } - - // ============================= - // operator= : create a new impl - // ============================= - CompositeContext& CompositeContext::operator=(const CompositeContext& ctx) - { - logentry(); - if (this != &ctx) - { - impl = new CompositeContextImpl( - tuscany::sca::SCARuntime::getCurrentRuntime()->getDefaultComponent()); - } - return *this; - } - - // ========== - // Destructor - // ========== - CompositeContext::~CompositeContext() - { - logentry(); - delete impl; - } - - // ==================================================== - // getCurrent: create a context from the current composite - // ==================================================== - CompositeContext CompositeContext::getCurrent() - { - logentry(); - try - { - CompositeContext* cci = new CompositeContextImpl( - tuscany::sca::SCARuntime::getCurrentRuntime()->getDefaultComponent()); - - return CompositeContext(cci); - } - catch (ServiceRuntimeException&) - { - throw; - } - catch (TuscanyRuntimeException& e) - { - throwException(ServiceRuntimeException, e); - } - } - - // ============= - // locateService - // ============= - void* CompositeContext::locateService(const std::string& serviceName) - { - logentry(); - void* sp = impl->locateService(serviceName); - return sp; - } - - // ============= - // getDataFactory - // ============= - DataFactoryPtr CompositeContext::getDataFactory() - { - logentry(); - DataFactoryPtr df = impl->getDataFactory(); - return df; - } - - - } // End namespace sca -} // End namespace osoa diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/CompositeContext.h b/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/CompositeContext.h deleted file mode 100644 index a047f82e46..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/CompositeContext.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 osoa_sca_compositecontext_h -#define osoa_sca_compositecontext_h - -#include "commonj/sdo/SDO.h" - -#include "osoa/sca/export.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/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/ServiceRuntimeException.h b/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/ServiceRuntimeException.h deleted file mode 100644 index 6d64a32dd6..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/ServiceRuntimeException.h +++ /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$ */ - -#ifndef osoa_sca_serviceruntimeexception_h -#define osoa_sca_serviceruntimeexception_h - -#include "osoa/sca/export.h" - -#include "tuscany/sca/core/Exceptions.h" - -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 tuscany::sca::TuscanyRuntimeException - { - public: - ServiceRuntimeException( - const char *name="ServiceRuntimeException", - severity_level sev=Severe, - const char* msg_text="") - : tuscany::sca::TuscanyRuntimeException(name, sev, msg_text) - { - } - - ServiceRuntimeException(const tuscany::sca::TuscanyRuntimeException& e) - : tuscany::sca::TuscanyRuntimeException(e) - { - } - }; // 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/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/export.h b/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/export.h deleted file mode 100644 index 8a69913be4..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/sca.h b/sca-cpp/trunk/runtime/extensions/cpp/src/osoa/sca/sca.h deleted file mode 100644 index 6cce9453d7..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.cpp b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.cpp deleted file mode 100644 index 74a30fb772..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.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/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_cpp_initialize() - { - tuscany::sca::cpp::CPPExtension::initialize(); - } -} - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - // =================================================================== - // Constructor for the CPPExtension class. - // =================================================================== - CPPExtension::CPPExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the CPPExtension class. - // =================================================================== - CPPExtension::~CPPExtension() - { - logentry(); - } - - void CPPExtension::initialize() - { - logentry(); - SCARuntime* runtime = SCARuntime::getCurrentRuntime(); - runtime->registerImplementationExtension(new CPPImplementationExtension()); - runtime->registerInterfaceExtension(new CPPInterfaceExtension()); - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.h b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPExtension.h deleted file mode 100644 index d6c872629d..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp deleted file mode 100644 index b5312ab243..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp +++ /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$ */ - -#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" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::util; -using namespace tuscany::sca::model; - - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - // =================================================================== - // Constructor for the CPPImplementationExtension class. - // =================================================================== - CPPImplementationExtension::CPPImplementationExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the CPPImplementationExtension class. - // =================================================================== - CPPImplementationExtension::~CPPImplementationExtension() - { - logentry(); - } - - 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) - { - logentry(); - 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; - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.h b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.h deleted file mode 100644 index 8eb7b88691..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.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_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 std::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 std::string& getExtensionTypeQName() {return typeQName;} - - virtual tuscany::sca::model::ComponentType* getImplementation( - tuscany::sca::model::Composite* composite, - commonj::sdo::DataObjectPtr scdlImplementation); - - private: - static const std::string extensionName; - static const std::string typeQName; - - }; - - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_cppimplementationextension_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.cpp b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.cpp deleted file mode 100644 index 7bb84a7673..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.cpp +++ /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$ */ - -#include "tuscany/sca/cpp/CPPInterfaceExtension.h" -#include "tuscany/sca/cpp/model/CPPInterface.h" -#include "tuscany/sca/util/Logging.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - // =================================================================== - // Constructor for the CPPInterfaceExtension class. - // =================================================================== - CPPInterfaceExtension::CPPInterfaceExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the CPPInterfaceExtension class. - // =================================================================== - CPPInterfaceExtension::~CPPInterfaceExtension() - { - logentry(); - } - - 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) - { - logentry(); - - string header = scdlInterface->getCString("header"); - string className = scdlInterface->getCString("class"); - bool remotable = scdlInterface->getBoolean("remotable"); - - return new CPPInterface(header, className, remotable, false); - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.h b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.h deleted file mode 100644 index 04ac9f6970..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPInterfaceExtension.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_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 std::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 std::string& getExtensionTypeQName() {return typeQName;} - - virtual tuscany::sca::model::Interface* getInterface( - tuscany::sca::model::Composite* composite, - commonj::sdo::DataObjectPtr scdlInterface); - - private: - static const std::string extensionName; - static const std::string typeQName; - - }; - - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_cppinterfaceextension_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.cpp deleted file mode 100644 index cc45ea9fb8..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.cpp +++ /dev/null @@ -1,192 +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/ServiceRuntimeException.h" - -#include "tuscany/sca/cpp/CPPServiceProxy.h" -#include "tuscany/sca/util/Logging.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 std; -using namespace osoa::sca; -using namespace tuscany::sca::model; -using namespace tuscany::sca::util; - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - // ============================ - // Constructor: Create a proxy - // ============================ - CPPServiceProxy::CPPServiceProxy(Reference* reference) - : ServiceProxy(reference) - { - logentry(); - - // ---------------------- - // 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); - } - - // ============================ - // Constructor: Create a proxy - // ============================ - CPPServiceProxy::CPPServiceProxy(Service* service) - : ServiceProxy(0) - { - logentry(); - - // ---------------------- - // 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); - } - - void CPPServiceProxy::createProxy(Component* component, const string& name, ServiceWrapper* serviceWrapper) - { - logentry(); - - ComponentType* componentType = component->getType(); - if (!componentType) - { - string msg = "Component " + component->getName() + " has no implementation defined"; - throwException(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("Unable to locate %s in library %s", - proxyFactoryName.c_str(), fullLibraryName.c_str()); - string msg = "Unable to locate " + proxyFactoryName + " in library " + fullLibraryName; - throwException(ServiceNotFoundException, msg.c_str()); - } - - // ----------------------------------- - // Now create an instance of the proxy - // ----------------------------------- - void* proxy = proxyFactory(serviceWrapper); - if (!proxy) - { - logerror("Factory method %s in library %s returned null", - proxyFactoryName.c_str(), fullLibraryName.c_str()); - string msg = "Factory method " + proxyFactoryName + " in library " + fullLibraryName + " returned null"; - throwException(ServiceNotFoundException, msg.c_str()); - } - else - { - proxies.push_back(proxy); - } - - // ------------------------- - // Get the destructor method - // ------------------------- - destructor = (PROXYDESTRUCTOR)proxyLibrary.getSymbol(proxyDestructorName); - } - - // ========== - // Destructor - // ========== - CPPServiceProxy::~CPPServiceProxy() - { - logentry(); - - // Delete the proxies - if (destructor != NULL && proxies.size() != 0) - { - destructor(*proxies.begin()); - } - } - - CPPServiceProxy::PROXIES CPPServiceProxy::getProxies() - { - return proxies; - } - - void* CPPServiceProxy::getProxy() - { - logentry(); - - if (proxies.size() != 0) - { - return *proxies.begin(); - } - else - { - return NULL; - } - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.h b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.h deleted file mode 100644 index 8406e9bc44..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.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_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" - - -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(tuscany::sca::model::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(tuscany::sca::model::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(tuscany::sca::model::Component* component, - const std::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. - */ - tuscany::sca::util::Library proxyLibrary; - - }; - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_cppserviceproxy_h diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp deleted file mode 100644 index 1304ab92a0..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.cpp +++ /dev/null @@ -1,194 +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/ServiceRuntimeException.h" - -#include "tuscany/sca/cpp/CPPServiceWrapper.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 std; -using namespace osoa::sca; -using namespace tuscany::sca::model; -using namespace tuscany::sca::util; - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - // =========== - // Constructor - // =========== - CPPServiceWrapper::CPPServiceWrapper(Service* service) - : ServiceWrapper(service) - { - logentry(); - - component = service->getComponent(); - interf = service->getType()->getInterface(); - implementation = (CPPImplementation*)component->getType(); - } - - // ========== - // Destructor - // ========== - CPPServiceWrapper::~CPPServiceWrapper() - { - logentry(); - } - - - // ====================================================================== - // getImplementation: get an implementation for this scope - // ====================================================================== - void* CPPServiceWrapper::getImplementation() - { - logentry(); - if (implementation->getScope() == CPPImplementation::COMPOSITE) - { - // fill the cache if needed - if ( !implementation->getStaticImplementation() ) - { - implementation->setStaticImplementation(newImplementation()); - } - return implementation->getStaticImplementation(); - } - else // (scope == CPPInterface::STATELESS) - { - return newImplementation(); - } - } - - // ====================================================================== - // releaseImplementation: release the implementation for this scope - // ====================================================================== - void CPPServiceWrapper::releaseImplementation() - { - logentry(); - if (implementation->getScope() == CPPImplementation::STATELESS) - { - deleteImplementation(); - } - } - - // ====================================================================== - // invoke: wrapper call to service with setting the component context - // ====================================================================== - void CPPServiceWrapper::invoke(Operation& operation) - { - logentry(); - - SCARuntime* runtime = SCARuntime::getCurrentRuntime(); - runtime->setCurrentComponent(component); - - try - { - invokeService(operation); - } - catch (...) - { - runtime->unsetCurrentComponent(); - throw; - } - runtime->unsetCurrentComponent(); - } - - void CPPServiceWrapper::setLibrary(Library* lib) - { - wrapperLibrary = lib; - } - - // ====================================================================== - // getServiceWrapper: create a wrapper for the target ComponentService - // ====================================================================== - CPPServiceWrapper* CPPServiceWrapper::getServiceWrapper(Service* service) - { - logentry(); - - 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"; - throwException(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("Unable to locate %s in library %s", - wrapperFactoryName.c_str(), fullLibraryName.c_str()); - string msg = "Unable to locate " + wrapperFactoryName + " in library " + fullLibraryName; - throwException(ServiceNotFoundException, msg.c_str()); - } - - // ------------------------------------- - // Now create an instance of the wrapper - // ------------------------------------- - serviceWrapper = wrapperFactory(service); - if (!serviceWrapper) - { - logerror("Factory method %s in library %s returned null", - wrapperFactoryName.c_str(), fullLibraryName.c_str()); - string msg = "Factory method " + wrapperFactoryName + " in library " + fullLibraryName + " returned null"; - throwException(ServiceNotFoundException, msg.c_str()); - } - serviceWrapper->setLibrary(wrapperLib); - - return serviceWrapper; - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h deleted file mode 100644 index 899deca07a..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h +++ /dev/null @@ -1,155 +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" - -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(tuscany::sca::model::Service* service); - - /** - * Constructor. - * @param target The component service to which this wrapper refers. - */ - CPPServiceWrapper(tuscany::sca::model::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. - */ - tuscany::sca::util::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: - /** - * The component to which this wrapper refers. - */ - tuscany::sca::model::Component* component; - - /** - * A pointer to the interface which the service exposes. - */ - tuscany::sca::model::Interface* interf; - - /** - * The component implementation - */ - CPPImplementation* implementation; - - /** - * Pointer to the loaded library which contains the component - * implementation. - */ - tuscany::sca::util::Library* wrapperLibrary; - - /** - * Set the loaded library which contains the component - * implementation. - * @param lib The library. - */ - void setLibrary(tuscany::sca::util::Library* lib); - }; - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_cppservicewrapper_h diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.cpp b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.cpp deleted file mode 100644 index 3de0cb968c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.cpp +++ /dev/null @@ -1,208 +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/ServiceRuntimeException.h" - -#include "tuscany/sca/util/Logging.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" - -using namespace std; -using namespace osoa::sca; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - // =========== - // Constructor - // =========== - ComponentContextImpl::ComponentContextImpl(Component* comp) - : ComponentContext(0), component(comp) - { - logentry(); - } - - // ========== - // Destructor - // ========== - ComponentContextImpl::~ComponentContextImpl() - { - logentry(); - } - - - // ========================================================================== - // getServices: return a list of Proxies for services wired to this reference - // ========================================================================== - std::list ComponentContextImpl::getServices(const std::string& referenceName) - { - logentry(); - try - { - // -------------------------------------------------------------- - // locate reference in the current component and determine target - // -------------------------------------------------------------- - Reference* reference = component->findReference(referenceName); - if (!reference) - { - string message = "Reference not defined: "; - message = message + referenceName; - throwException(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"; - throwException(ServiceNotFoundException, message.c_str()); - } - - return serviceProxy->getProxies(); - } - catch (ServiceRuntimeException&) - { - throw; - } - catch (TuscanyRuntimeException& e) - { - throwException(ServiceRuntimeException, e); - } - - } // End getServices() - - - // =================================================================== - // getService: return a Proxy for the services wired to this reference - // =================================================================== - void* ComponentContextImpl::getService(const std::string& referenceName) - { - logentry(); - try - { - // -------------------------------------------------------------- - // locate reference in the current component and determine target - // -------------------------------------------------------------- - Reference* reference = component->findReference(referenceName); - if (!reference) - { - string message = "Reference not defined: "; - message = message + referenceName; - throwException(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; - throwException(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"; - throwException(ServiceNotFoundException, message.c_str()); - } - - void* service = serviceProxy->getProxy(); - - return service; - } - catch (ServiceRuntimeException&) - { - throw; - } - catch (TuscanyRuntimeException& e) - { - throwException(ServiceRuntimeException, e); - } - - } // End getService() - - // ============================================== - // getProperties: return the component properties - // ============================================== - DataObjectPtr ComponentContextImpl::getProperties() - { - logentry(); - try - { - DataObjectPtr properties = component->getProperties(); - return properties; - } - catch (ServiceRuntimeException&) - { - throw; - } - catch (TuscanyRuntimeException& e) - { - throwException(ServiceRuntimeException, e); - } - } - - // ============================================== - // getDataFactory: return the data factory for the composite in which - // this component resides - // ============================================== - commonj::sdo::DataFactoryPtr ComponentContextImpl::getDataFactory() - { - logentry(); - try - { - commonj::sdo::DataFactoryPtr dataFactory = component->getComposite()->getDataFactory(); - return dataFactory; - } - catch (ServiceRuntimeException&) - { - throw; - } - catch (TuscanyRuntimeException& e) - { - throwException(ServiceRuntimeException, e); - } - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.h b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.h deleted file mode 100644 index 412c276d8c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/ComponentContextImpl.h +++ /dev/null @@ -1,119 +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 "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" - - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - /** - * Contains the actual implementation of a ComponentContext interface. - */ - class ComponentContextImpl : public osoa::sca::ComponentContext - { - - public: - /** - * Constructor that takes a Component which represents the runtime - * model for this context. - */ - ComponentContextImpl(tuscany::sca::model::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 commonj::sdo::DataObjectPtr getProperties(); - - /** - * See ComponentContext. - */ - virtual commonj::sdo::DataFactoryPtr getDataFactory(); - - /** - * Returns the contained Component. - * @return The Component to which this context refers. - */ - virtual tuscany::sca::model::Component* getComponent() {return component;} - - private: - ComponentContextImpl(const ComponentContextImpl&); - ComponentContextImpl& operator=(const ComponentContextImpl&); - - /** - * Pointer to the runtime model Component to which this - * context refers. - */ - tuscany::sca::model::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( - tuscany::sca::model::Reference* serviceReference, - tuscany::sca::model::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(tuscany::sca::model::Service* target); - - }; - - } // End namespaca cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_componentcontextimpl_h diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.cpp b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.cpp deleted file mode 100644 index ae8183231e..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.cpp +++ /dev/null @@ -1,128 +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 "commonj/sdo/SDO.h" - -#include "osoa/sca/ServiceRuntimeException.h" - -#include "tuscany/sca/util/Logging.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" - -using namespace std; -using namespace commonj::sdo; -using namespace osoa::sca; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - // =========== - // Constructor - // =========== - CompositeContextImpl::CompositeContextImpl(Component* component) - : CompositeContext(0), component(component), composite((Composite*)component->getType()) - { - logentry(); - } - - // ========== - // Destructor - // ========== - CompositeContextImpl::~CompositeContextImpl() - { - logentry(); - } - - // =========================================================================== - // locateService: return a proxy connected to a wrapper for the target service - // =========================================================================== - void* CompositeContextImpl::locateService(const std::string& serviceName) - { - logentry(); - try - { - // ---------------------------- - // Locate the component service - // ---------------------------- - Service* service = composite->findComponentService(serviceName); - string msg; - if (!service) - { - msg = "Service not found: "; - msg = msg + serviceName; - throwException(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); - return serviceProxy->getProxy(); - } - catch (ServiceRuntimeException&) - { - throw; - } - catch (TuscanyRuntimeException& e) - { - throwException(ServiceRuntimeException, e); - } - } - - // ============================================== - // getDataFactory: return the data factory for the current composite - // ============================================== - DataFactoryPtr CompositeContextImpl::getDataFactory() - { - logentry(); - try - { - DataFactoryPtr dataFactory = composite->getDataFactory(); - return dataFactory; - } - catch (ServiceRuntimeException&) - { - throw; - } - catch (TuscanyRuntimeException& e) - { - throwException(ServiceRuntimeException, e); - } - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.h b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.h deleted file mode 100644 index ed0bb8b51c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/CompositeContextImpl.h +++ /dev/null @@ -1,89 +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 "osoa/sca/CompositeContext.h" - -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/cpp/CPPServiceProxy.h" - -namespace tuscany -{ - namespace sca - { - - namespace cpp - { - - /** - * Contains the actual implementation of a CompositeContext interface. - */ - class CompositeContextImpl : public osoa::sca::CompositeContext - { - - public: - /** - * Constructor that takes a Composite which represents the runtime - * model for this context. - */ - CompositeContextImpl(tuscany::sca::model::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. - */ - tuscany::sca::model::Composite* composite; - - /** - * Pointer to the runtime model Component object to which this - * context refers. - */ - tuscany::sca::model::Component* component; - - }; - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_compositecontextimpl_h diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.cpp b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.cpp deleted file mode 100644 index f8aad90f7a..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.cpp +++ /dev/null @@ -1,83 +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/TuscanyRuntime.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/core/SCARuntime.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - // =================================================================== - // Constructor for the TuscanyRuntime class. - // =================================================================== - TuscanyRuntime::TuscanyRuntime(const string& componentName, const string& root, const string& path) - { - logentry(); - loginfo("System root: %s", root.c_str()); - systemRoot = root; - loginfo("System path: %s", path.c_str()); - systemPath = path; - loginfo("Default component name: %s", componentName.c_str()); - defaultComponentName = componentName; - - runtime = new SCARuntime("", systemRoot, systemPath, "", defaultComponentName); - } - - // =================================================================== - // Destructor for the TuscanyRuntime class. - // =================================================================== - TuscanyRuntime::~TuscanyRuntime() - { - logentry(); - - delete (SCARuntime*)runtime; - } - - // =================================================================== - // Start the runtime. - // =================================================================== - void TuscanyRuntime::start() - { - logentry(); - SCARuntime::setCurrentRuntime((SCARuntime*)runtime); - } - - // =================================================================== - // Stop the runtime. - // =================================================================== - void TuscanyRuntime::stop() - { - logentry(); - SCARuntime::setCurrentRuntime(NULL); - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.h b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.h deleted file mode 100644 index b4cf31220a..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.h +++ /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$ */ - -#ifndef tuscany_sca_cpp_tuscanyruntime_h -#define tuscany_sca_cpp_tuscanyruntime_h - -#include - -#include "osoa/sca/export.h" - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - /** - * A singleton which represents the executing SCA runtime. - */ - class SCA_CPP_API TuscanyRuntime - { - public: - /** - * Default constructor - */ - TuscanyRuntime(const std::string& defaultComponentName = "", - const std::string& root = "", const std::string& path = ""); - - /** - * Destructor - */ - virtual ~TuscanyRuntime(); - - /** - * start the runtime - */ - void start(); - - /** - * stop the runtime - */ - void stop(); - - - private: - std::string systemRoot; - std::string systemPath; - std::string defaultComponentName; - - void* defaultComponent; - void* runtime; - }; - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_tuscanyruntime_h diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp deleted file mode 100644 index 56098ced93..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.cpp +++ /dev/null @@ -1,90 +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" - -using namespace std; -using namespace tuscany::sca::model; - -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), staticImpl(0) - { - } - - 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 (unsigned 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 (unsigned int ri=0; ri< references.size(); ri++) - { - Reference *reference = refiter->second; - CPPReferenceBinding* binding = new CPPReferenceBinding(reference); - reference->setBinding(binding); - refiter++; - } - } - - void CPPImplementation::setStaticImplementation(void* staticImpl) - { - this->staticImpl = staticImpl; - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h deleted file mode 100644 index 2dfdac616e..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPImplementation.h +++ /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$ */ - -#ifndef tuscany_sca_cpp_model_cppimplementation_h -#define tuscany_sca_cpp_model_cppimplementation_h - -#include -#include - -#include "tuscany/sca/model/ComponentType.h" - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - /** - * Holds information about an SCA implementation written in C++ - */ - class CPPImplementation : public tuscany::sca::model::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(tuscany::sca::model::Composite* composite, - const std::string& library, const std::string& header, const std::string&headerPath, - const std::string& headerStub, const std::string& className, Scope scope); - - /** - * Destructor - */ - virtual ~CPPImplementation(); - - /** - * Initialize a component of this type. - * @param component The component to initialize. - */ - virtual void initializeComponent(tuscany::sca::model::Component* component); - - /** - * Returns the name of the shared library. - * @return The name of the shared library. - */ - const std::string& getLibrary() const { return library; } - - /** - * Get the name of the header file. - * @return Name of the header file. - */ - const std::string& getHeader() const { return header; } - - /** - * Get the header file name without the extension. - * @return The name of the header file without any extension. - */ - const std::string& getHeaderStub() const { return headerStub; } - - /** - * Get the header path. - * @return The pathe element of the header. - */ - const std::string& getHeaderPath() const { return headerPath; } - - /** - * Get the name of the class. - * @return The class name if specified. - */ - const std::string& getClass() const { return className; } - - /** - * Returns the implementation scope - */ - Scope getScope() { return scope; } - - /** - * Returns the implementation instance (to be used if the scope is set to composite) - */ - void* getStaticImplementation() { return staticImpl; } - - /** - * Sets the implementation instance (to be used if the scope is set to composite) - */ - void setStaticImplementation(void* staticImpl); - - private: - - /** - * Name of the shared library. - */ - std::string library; - - /** - * Name of the header file describing the interface. - */ - std::string header; - - /** - * Name of the header file without the extension. - */ - std::string headerStub; - - /** - * Path element of the header. - */ - std::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. - */ - std::string className; - - /** - * Scope of the implementation - */ - Scope scope; - - /** - * Holds the implementation instance if the scope is set to composite. - */ - void* staticImpl; - }; - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_model_cppimplementation_h diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp deleted file mode 100644 index 2322d1bdf5..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.cpp +++ /dev/null @@ -1,63 +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" - -using namespace std; - -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/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.h deleted file mode 100644 index fdbf314d3d..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPInterface.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_cpp_model_cppinterface_h -#define tuscany_sca_cpp_model_cppinterface_h - -#include - -#include "tuscany/sca/model/Interface.h" - - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - /** - * Holds information about an interface described using a C++ - * header file. - */ - class CPPInterface : public tuscany::sca::model::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 std::string& header, - const std::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 std::string& getHeader() { return header; } - - /** - * Return the name of the header file without the extension. - * @return Header file name without any extension. - */ - const std::string& getHeaderStub() { return headerStub; } - - /** - * Get the name of the class. - * @return The name of the class defining the interface. - */ - const std::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 std::string& getInterfaceTypeQName() { return typeQName; }; - - private: - - /** - * Name of the header file containing the definition of the interface. - */ - std::string header; - - /** - * Name of the header file without the extension. - */ - std::string headerStub; - - /** - * Name of the class in the header file. - */ - std::string className; - - /** - * The QName of the schema type for this interface type. - */ - static const std::string typeQName; - }; - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_model_cppinterface_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.cpp b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.cpp deleted file mode 100644 index 0c12b7af43..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.cpp +++ /dev/null @@ -1,61 +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" - -using namespace tuscany::sca::model; - - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - - // Constructor - CPPReferenceBinding::CPPReferenceBinding(Reference* reference) - : ReferenceBinding(reference, ""), serviceProxy(NULL) - { - } - - // Destructor - CPPReferenceBinding::~CPPReferenceBinding() - { - } - - ServiceProxy* CPPReferenceBinding::getServiceProxy() - { - return serviceProxy; - } - - void CPPReferenceBinding::configure(ServiceBinding* binding) - { - setTargetServiceBinding(binding); - - serviceProxy = new CPPServiceProxy(getReference()); - } - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.h b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.h deleted file mode 100644 index 9860f14765..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPReferenceBinding.h +++ /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$ */ - -#ifndef tuscany_sca_cpp_model_cppreferencebinding_h -#define tuscany_sca_cpp_model_cppreferencebinding_h - -#include - -#include "tuscany/sca/model/ReferenceBinding.h" - - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - /** - * Information about a CPP service binding for service or a reference. - */ - class CPPReferenceBinding : public tuscany::sca::model::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(tuscany::sca::model::Reference* reference); - - /** - * Destructor. - */ - virtual ~CPPReferenceBinding(); - - /** - * Returns the type of binding. - */ - virtual std::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(tuscany::sca::model::ServiceBinding* serviceBinding); - - private: - - /** - * The proxy representing the reference to the client - * component. - */ - ServiceProxy* serviceProxy; - - }; - - } // End namespace cpp - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_model_cppreferencebinding_h diff --git a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.cpp b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.cpp deleted file mode 100644 index 45afea8375..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.cpp +++ /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. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/cpp/model/CPPServiceBinding.h" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -using namespace tuscany::sca::model; - -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/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.h b/sca-cpp/trunk/runtime/extensions/cpp/src/tuscany/sca/cpp/model/CPPServiceBinding.h deleted file mode 100644 index 13b88a84dd..0000000000 --- a/sca-cpp/trunk/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 - -#include "tuscany/sca/model/ServiceBinding.h" - - -namespace tuscany -{ - namespace sca - { - namespace cpp - { - /** - * Information about a CPP service binding for service or a reference. - */ - class CPPServiceBinding : public tuscany::sca::model::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(tuscany::sca::model::Service* service); - - /** - * Destructor. - */ - virtual ~CPPServiceBinding(); - - /** - * Returns the type of binding. - */ - virtual std::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/sca-cpp/trunk/runtime/extensions/cpp/tools/Makefile.am b/sca-cpp/trunk/runtime/extensions/cpp/tools/Makefile.am deleted file mode 100644 index 3a97f02513..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/Makefile.am +++ /dev/null @@ -1,25 +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_TOOLS = scagen -endif -if WANT_CPP - CPP_TOOLS = scagen -endif - -SUBDIRS = ${CPP_TOOLS} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/META-INF/LICENSE b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/META-INF/LICENSE deleted file mode 100644 index f433b1a53f..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/META-INF/LICENSE +++ /dev/null @@ -1,177 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/META-INF/NOTICE b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/META-INF/NOTICE deleted file mode 100644 index 44befbee63..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/META-INF/NOTICE +++ /dev/null @@ -1,5 +0,0 @@ -Apache Tuscany SCA Native -Copyright 2005, 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/) \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/META-INF/README b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/META-INF/README deleted file mode 100644 index 2831dadd94..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/META-INF/README +++ /dev/null @@ -1,19 +0,0 @@ -Apache Tuscany C++ M1 build (July, 2006) -=================================== - -http://incubator.apache.org/tuscany - -Tuscany is an effort undergoing incubation at the Apache Software Foundation -(ASF), sponsored by the Web Services PMC. - -Incubation is required of all newly accepted projects until a further review -indicates that the infrastructure, communications, and decision making process -have stabilized in a manner consistent with other successful ASF projects. - -While incubation status is not necessarily a reflection of the completeness or -stability of the code, it does indicate that the project has yet to be fully -endorsed by the ASF. - -Thank you for using Tuscany! - -The Tuscany Team. diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/Makefile.am b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/Makefile.am deleted file mode 100644 index 59b4d2095f..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/Makefile.am +++ /dev/null @@ -1,35 +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 = - -BUILT_SOURCES = scagen_build -EXTRA_DIST = build.xml scagen.sh src META-INF -bin_SCRIPTS = scagen.sh - -scagen_build: - ant - touch scagen_build - -clean: - rm -rf build - rm -rf docs - rm -f scagen_build - -install-exec-hook: - cp build/scagen.jar $(bindir) - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/build.xml b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/build.xml deleted file mode 100644 index 23e825a1b4..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/build.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SCA for C++ Tools]]> - - - Copyright 2005 The Apache Software Foundation or its licensors, as applicable.]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/CalculatorTest.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/CalculatorTest.java deleted file mode 100644 index 13c1273983..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/CalculatorTest.java +++ /dev/null @@ -1,33 +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. - */ - -package org.apache.tuscany.sca.cpp.tools.junit; - -import org.apache.tuscany.sca.cpp.tools.junit.TuscanyTestCase; - -/** - * This test case tests a simple Calculator service tools generation - */ -public class CalculatorTest extends TuscanyTestCase { - - public void testCalculatorCompositeAndComponent() { - testComposite("CalculatorCompositeAndComponent", check_results); - } -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/EnvHandlerTest.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/EnvHandlerTest.java deleted file mode 100644 index 48d415dd8e..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/EnvHandlerTest.java +++ /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. - */ - -package org.apache.tuscany.sca.cpp.tools.junit; - -/** - * This is a "run this first" testcase that just tests some simple operations of - * the scagen tools it uses the - * Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite SCA composite as - * input data. - */ -public class EnvHandlerTest extends TuscanyTestCase { - - /** - * Constructor for CustomerInfoTestOLD. - * - * @param arg0 - */ - public EnvHandlerTest(String arg0) { - super(arg0); - } - - /** - * Test the Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite - * proxy and wrapper generation. - */ - public void testEnvHandler() { - testComposite("MyValueServiceComposite", check_results); - } - -} diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/ImplClassWithNameSpaceButNotInClassAttrTest.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/ImplClassWithNameSpaceButNotInClassAttrTest.java deleted file mode 100644 index ca7d50ae48..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/ImplClassWithNameSpaceButNotInClassAttrTest.java +++ /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. - */ - -package org.apache.tuscany.sca.cpp.tools.junit; - -/** - * This is a "run this first" testcase that just tests some simple operations of - * the scagen tools it uses the - * Hydra.sca.core\test\testSCASystem\composites\MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr SCA composite as - * input data. - */ -public class ImplClassWithNameSpaceButNotInClassAttrTest extends TuscanyTestCase { - - /** - * Constructor for CustomerInfoTestOLD. - * - * @param arg0 - */ - public ImplClassWithNameSpaceButNotInClassAttrTest(String arg0) { - super(arg0); - } - - /** - * Test the Hydra.sca.core\test\testSCASystem\composites\MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr - * proxy and wrapper generation. - */ - public void testEnvHandler() { - testComposite("MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr", check_results); - } - -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/ImplClassWithNameSpaceTest.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/ImplClassWithNameSpaceTest.java deleted file mode 100644 index e019873489..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/ImplClassWithNameSpaceTest.java +++ /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. - */ - -package org.apache.tuscany.sca.cpp.tools.junit; - -/** - * This is a "run this first" testcase that just tests some simple operations of - * the scagen tools it uses the - * Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite SCA composite as - * input data. - */ -public class ImplClassWithNameSpaceTest extends TuscanyTestCase { - - /** - * Constructor for CustomerInfoTestOLD. - * - * @param arg0 - */ - public ImplClassWithNameSpaceTest(String arg0) { - super(arg0); - } - - /** - * Test the Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite - * proxy and wrapper generation. - */ - public void testEnvHandler() { - testComposite("MyValueServiceCompositeImplClassWithNamespace", check_results); - } - -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/IntfClassWithNameSpaceButNotInClassAttrTest.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/IntfClassWithNameSpaceButNotInClassAttrTest.java deleted file mode 100644 index 11cab070b2..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/IntfClassWithNameSpaceButNotInClassAttrTest.java +++ /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. - */ - -package org.apache.tuscany.sca.cpp.tools.junit; - -/** - * This is a "run this first" testcase that just tests some simple operations of - * the scagen tools it uses the - * Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite SCA composite as - * input data. - */ -public class IntfClassWithNameSpaceButNotInClassAttrTest extends TuscanyTestCase { - - /** - * Constructor for CustomerInfoTestOLD. - * - * @param arg0 - */ - public IntfClassWithNameSpaceButNotInClassAttrTest(String arg0) { - super(arg0); - } - - /** - * Test the Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite - * proxy and wrapper generation. - */ - public void testEnvHandler() { - testComposite("MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr", check_results); - } - -} diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/IntfClassWithNameSpaceTest.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/IntfClassWithNameSpaceTest.java deleted file mode 100644 index a26321d2a3..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/IntfClassWithNameSpaceTest.java +++ /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. - */ - -package org.apache.tuscany.sca.cpp.tools.junit; - -/** - * This is a "run this first" testcase that just tests some simple operations of - * the scagen tools it uses the - * Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite SCA composite as - * input data. - */ -public class IntfClassWithNameSpaceTest extends TuscanyTestCase { - - /** - * Constructor for CustomerInfoTestOLD. - * - * @param arg0 - */ - public IntfClassWithNameSpaceTest(String arg0) { - super(arg0); - } - - /** - * Test the Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite - * proxy and wrapper generation. - */ - public void testEnvHandler() { - testComposite("MyValueServiceCompositeIntfClassWithNamespace", check_results); - } - -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/MissingCompositeAndFragmentTest.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/MissingCompositeAndFragmentTest.java deleted file mode 100644 index e529af0dd0..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/MissingCompositeAndFragmentTest.java +++ /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. - */ - -package org.apache.tuscany.sca.cpp.tools.junit; - -/** - * This is a "run this first" testcase that just tests some simple operations of - * the scagen tools it uses the - * Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite SCA composite as - * input data. - */ -public class MissingCompositeAndFragmentTest extends TuscanyTestCase { - - /** - * Constructor for CustomerInfoTestOLD. - * - * @param arg0 - */ - public MissingCompositeAndFragmentTest(String arg0) { - super(arg0); - } - - /** - * Test the Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite - * proxy and wrapper generation. - */ - public void testEnvHandler() { - testComposite("MyValueServiceCompositeMissingScaComposite",false); - } - -} diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/SimplePublicPrivateProtectedTest.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/SimplePublicPrivateProtectedTest.java deleted file mode 100644 index 3743a1f1f9..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/SimplePublicPrivateProtectedTest.java +++ /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. - */ - -package org.apache.tuscany.sca.cpp.tools.junit; - -/** - * This is a "run this first" testcase that just tests some simple operations of - * the scagen tools it uses the - * Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite SCA composite as - * input data. - */ -public class SimplePublicPrivateProtectedTest extends TuscanyTestCase { - - /** - * Constructor for CustomerInfoTestOLD. - * - * @param arg0 - */ - public SimplePublicPrivateProtectedTest(String arg0) { - super(arg0); - } - - /** - * Test the Hydra.sca.core\test\testSCASystem\composites\MyValueServiceComposite - * proxy and wrapper generation. - */ - public void testEnvHandler() { - - testComposite("SimplePublicPrivateProtectedTest", check_results); - } - -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TestAllCompositesTest.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TestAllCompositesTest.java deleted file mode 100644 index 1f1d2108e5..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TestAllCompositesTest.java +++ /dev/null @@ -1,89 +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. - */ - -package org.apache.tuscany.sca.cpp.tools.junit; - -import java.io.File; -import java.util.HashSet; -import java.util.Set; - -import org.apache.tuscany.sca.cpp.tools.junit.TuscanyTestCase; - -/** - * This test case will test all the composites placed in the "composites" directory - * against the results in their repectice "expected_results" folders. - */ -public class TestAllCompositesTest extends TuscanyTestCase { - - String testsDir = TuscanyTestCase.junit_composites; - - Set excludes = new HashSet(); - - public TestAllCompositesTest(String arg0) { - super(arg0); - excludes.add("MyValueServiceCompositeMissingScaComposite"); - excludes.add("CVS"); - excludes.add(".svn"); - } - - - /* main exists to allow running from the java ant task */ - public static void main(String[] args) { - TestAllCompositesTest test = new TestAllCompositesTest(""); - test.testAllCompositesRegression(); - } - - public void testAllCompositesRegression() { - File dir = new File(testsDir); - - if (dir.isDirectory()) { - System.out.println("Testing all composites under " - + dir.getAbsolutePath()); - String[] test_composites = dir.list(); - - for (int i = 0; i < test_composites.length; i++) { - File test_composite = new File(testsDir, test_composites[i]); - - String composite_name = null; - if (test_composite.isDirectory()) { - composite_name = test_composite.getName(); - if (!excludes.contains(composite_name.intern())) { - testComposite(composite_name, check_results); - System.out.println("Test of composite \"" + composite_name - + "\" passed."); - continue; - } else { - System.out - .println("Ignoring excluded composite subdirectory \"" - + composite_name + "\""); - } - } - } - - } else { - - fail("Test directory is not a directory! \r The variable org.apache.tuscany.sca.cpp.tools.junit.TuscanyTestCase.root sets the location of the junit input data,\r it is currently set as " - + TuscanyTestCase.root + "\rand we expect to find a testinput\\composites directory under there."); - } - - System.out.println("testAllComposites test passed."); - } - -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TestDeployAssistTool.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TestDeployAssistTool.java deleted file mode 100644 index 0d845e1b1e..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TestDeployAssistTool.java +++ /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. - */ - -package org.apache.tuscany.sca.cpp.tools.junit; - -import java.io.File; -import java.util.HashSet; -import java.util.Set; - -/** - * This test case will test all the composites placed in the "composites" directory - * against the results in their repectice "expected_results" folders. - */ -public class TestDeployAssistTool extends TuscanyTestCase { - - String testsDir = TuscanyTestCase.junit_composites; - - Set excludes = new HashSet(); - - public TestDeployAssistTool(String arg0) { - super(arg0); - excludes.add("MyValueServiceCompositeMissingScaComposite"); - excludes.add("CVS"); - } - - /* main exists to allow running from the test script which will - * wrap this test case and pipe the satandard output to somewhere - * for checking. - */ - - public static void main(String[] args) { - TestDeployAssistTool test = new TestDeployAssistTool(""); - test.testDeployToolNullParms(); - } - - public void testDeployTool() { - //Utils.setReportArtefacts(true); - TestAllCompositesTest t = new TestAllCompositesTest(""); - File dir = new File(testsDir); - - if (dir.isDirectory()) { - String[] test_composites = dir.list(); - - for (int i = 0; i < test_composites.length; i++) { - File test_composite = new File(testsDir, test_composites[i]); - String composite_name = null; - if (test_composite.isDirectory()) { - composite_name = test_composite.getName(); - if (!excludes.contains(composite_name.intern())) { - t.testCompositeDeploy(composite_name, create_results, "c:\\colin", "cp"); - } - } - System.out.println(""); - } - } - } - - public void testDeployToolNullParms() { - //Utils.setReportArtefacts(true); - TestAllCompositesTest t = new TestAllCompositesTest(""); - File dir = new File(testsDir); - - if (dir.isDirectory()) { - String[] test_composites = dir.list(); - - for (int i = 0; i < test_composites.length; i++) { - File test_composite = new File(testsDir, test_composites[i]); - String composite_name = null; - if (test_composite.isDirectory()) { - composite_name = test_composite.getName(); - if (!excludes.contains(composite_name.intern())) { - t.testCompositeDeploy(composite_name, create_results, null, null); - } - } - System.out.println(""); - } - } - } -} - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TuscanyTestCase.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TuscanyTestCase.java deleted file mode 100644 index 5d1fa568d1..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/org/apache/tuscany/sca/cpp/tools/junit/TuscanyTestCase.java +++ /dev/null @@ -1,341 +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. - */ - -package org.apache.tuscany.sca.cpp.tools.junit; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.Reader; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.cpp.tools.common.Options; -import org.apache.tuscany.sca.cpp.tools.services.Scagen; - -/** - * A superclass for testcases that can be used to store common functions. - */ -public abstract class TuscanyTestCase extends TestCase { - - public static String root = "d:\\tuscany\\cpp\\sca\\tools\\scagen\\junit\\"; - - public static String junit_composites = root + "testinput\\composites\\"; - - public static String junit_output = root + "testoutput\\"; - - private String testcase = "TESTCASE NOT SET BY SUBCLASS"; - - String input = null; - - String output = null; - - /** - * Check the resulting files with the contents of the expected_results - * folder in the testComposite method - */ - public final static boolean check_results = true; - - /** - * Create test output but do not check it (useful for setting up new - * expected test output - */ - public final static boolean create_results = false; - - /** - * - */ - public TuscanyTestCase() { - super(); - } - - /** - * @param arg0 - */ - public TuscanyTestCase(String arg0) { - super(arg0); - } - - protected void setUp() throws Exception { - super.setUp(); - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - - /** - * Tests to see if two files are the same - this is just a scratch method at - * the moment that flags up testcase output files not matching expected - * results rather than needing to be a fully robust implementation and needs - * a little further work. - * - * @param file1 - * the first file to compare - * @param file2 - * the second file to compare - * - */ - protected boolean areFilesEqual(String file1, String file2) { - - try { - FileInputStream fis1 = new java.io.FileInputStream(file1); - FileInputStream fis2 = new java.io.FileInputStream(file2); - - BufferedReader br1 = new BufferedReader(new InputStreamReader(fis1)); - BufferedReader br2 = new BufferedReader(new InputStreamReader(fis2)); - - String line1 = br1.readLine(); - String line2 = br2.readLine(); - boolean moretodo = (line1 != null) && (line2 != null); - - for (int line = 1; moretodo; line++) { - - if (line1.equals(line2)) { - - line1 = br1.readLine(); - line2 = br2.readLine(); - - } else { - - int l1i, l2i; - - if ((l1i = line1.lastIndexOf("$Id")) > 0) { - //allow CVS strings - line1 = br1.readLine(); - } - - if ((l2i = line2.lastIndexOf("$Id")) > 0) { - //allow CVS strings - line2 = br2.readLine(); - } - - if (l1i == -1 && l2i == -1) { - - // they don't match - System.out.println("file " + file1 + " and file " - + file2); - System.out.println(" don't match at line " + line); - System.out.println("1 is :" + line1); - System.out.println("2 is :" + line2); - - return false; - } - } - - moretodo = (line1 != null) && (line2 != null); - } - - System.out.println("MATCH FOR: file " + file1 + " and file " - + file2); - return true; - - } catch (Throwable t) { - t.printStackTrace(); - return true; - } - - } - - /** - * @param outputDir - */ - protected void clearDirButNotExpectedOutputSubDir(String outputDir) { - File dir = new File(outputDir); - if (dir.isDirectory()) { - String[] files = dir.list(); - for (int i = 0; i < files.length; i++) { - File child = new File(dir, files[i]); - if (child.isDirectory()) { - if (!(child.getName().equals("expected_output") || child.getName().equals(".svn"))) { - clearDirButNotExpectedOutputSubDir(dir - .getAbsolutePath() - + File.separator + files[i]); - } - } - else - { - if( !child.delete() ) - { - System.out.println("File "+outputDir+"/"+child.getName()+" could not be deleted"); - } - } - } - } - - } - - public void testComposite(String composite, boolean check) { - - Options.reset(); - setTestcase(composite); - clearDirButNotExpectedOutputSubDir(output); - - String[] commandLine = new String[] { "-dir", input, "-output", output }; - try { - Scagen.main(commandLine); - } catch (Exception e) { - fail(e.getMessage()); - } - - if (check) { - checkDirWithExpected(output); - } - } - - public void testCompositeDeploy(String composite, boolean check, - String deployDir, String command) { - - Options.reset(); - setTestcase(composite); - clearDirButNotExpectedOutputSubDir(output); - - String[] commandLine; - if (null == deployDir) { - commandLine = new String[] { "-dir", input, "-output", - output, "-deploy"}; - } else { - commandLine = new String[] { "-dir", input, "-output", - output, "-deploy", deployDir, "-command", command }; - } - try { - Scagen.main(commandLine); - } catch (Exception e) { - fail(e.getMessage()); - } - - if (check) { - checkDirWithExpected(output); - } - } - - /** - * @param outputDirName - */ - private void checkDirWithExpected(String outputDirName) { - - File actualDir = new File(outputDirName); - if (actualDir == null || !actualDir.isDirectory()) { - fail("result directory does not exist"); - } - - File expectedDir = new File(outputDirName + File.separator - + "expected_output"); - if (expectedDir == null || !actualDir.isDirectory()) { - fail("can't check results as expected directory does not exist"); - } - - //Check every file in the expected output directory is present - //in the actual directory - - String[] expectedFiles = expectedDir.list(); - - if (expectedFiles == null) { - fail("no expected results for " + expectedDir.getPath()); - } - for (int i = 0; expectedFiles != null && i < expectedFiles.length; i++) { - File expectedFile = new File(expectedDir, expectedFiles[i]); - if (expectedFile.isDirectory()) { - // we can't check subdirectories yet - // and it conveniently skips over "CVS" - } else { - File actualFile = checkFileExistsFailIfNot(actualDir, - expectedFile.getName()); - checkFileHasNoTabsAndEndsInNewline(actualDir, expectedFile - .getName()); - if (!areFilesEqual(expectedFile.getAbsolutePath(), actualFile - .getAbsolutePath())) { - fail("odd output for " + expectedFile.getPath()); - } - - } - - } - - } - - /** - * @param actualDir - * @param name - */ - private File checkFileExistsFailIfNot(File dir, String name) { - - File f = new File(dir, name); - if (f == null || !f.exists() || !f.isFile()) { - fail("Expected result file " + f + " does not exist"); - } - return f; - - } - - /** - * @param actualDir - * @param name - */ - private void checkFileHasNoTabsAndEndsInNewline(File dir, String name) { - - try { - File f = new File(dir, name); - FileInputStream fis = new FileInputStream(f); - InputStreamReader isr = new InputStreamReader(fis); - Reader br = new BufferedReader(isr); - int ch, charBeforeMinusOne = -1; - while ((ch = br.read()) > -1) { - if (ch == '\t') { - fail("found tab in output " + f.getPath()); - } - charBeforeMinusOne = ch; - } - //The last char must be newline; - if (charBeforeMinusOne != '\n') { - fail("last char in file is not a newline in " + "(char is:" - + ch + " " + dir.getName() + File.separator + name); - } - - br.close(); - } catch (IOException e) { - e.printStackTrace(); - fail("io exception in tab/newline checker for " + dir.getName() - + File.separator + name); - return; - } - - } - - /** - * @param testcase - * The testcase to set. - */ - void setTestcase(String testcase) { - this.testcase = testcase; - input = TuscanyTestCase.junit_composites + testcase; - output = TuscanyTestCase.junit_output + testcase; - } - - /** - * @return Returns the testcase. - */ - String getTestcase() { - return testcase; - } - -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/Calculator.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/Calculator.h deleted file mode 100644 index 99c4158d1a..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/Calculator.h +++ /dev/null @@ -1,36 +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 CALCULATOR_H -#define CALCULATOR_H - - -class Calculator { - -private: - virtual long add(long a, long b) = 0; -public: - - virtual long subtract(long a, long b) = 0; -}; - - -#endif // CALCULATOR_H diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/CalculatorImpl.componentType b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/CalculatorImpl.componentType deleted file mode 100644 index a1accb0fda..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/CalculatorImpl.componentType +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/CalculatorImpl.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/CalculatorImpl.h deleted file mode 100644 index 3f97eacef2..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/CalculatorImpl.h +++ /dev/null @@ -1,37 +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 CALCULATORIMPL_H -#define CALCULATORIMPL_H - -#include "Calculator.h" - -class CalculatorImpl : public Calculator -{ -public: - CalculatorImpl(); - virtual ~CalculatorImpl(); - virtual long add(long a, long b); - virtual long subtract(long a, long b); - -}; - -#endif // diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/sca.composite b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/sca.composite deleted file mode 100644 index f2a8e56c58..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorCompositeAndComponent/sca.composite +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/otherSubFolder/CalculatorBack.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/otherSubFolder/CalculatorBack.h deleted file mode 100644 index bc14167841..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/otherSubFolder/CalculatorBack.h +++ /dev/null @@ -1,36 +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 CALCULATOR_H -#define CALCULATOR_H - - -class CalculatorBack { - - - -public: - virtual long subtractBack(long a, long b) = 0; - virtual long addBack(long a, long b) = 0; -}; - - -#endif // CALCULATOR_H diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/otherSubFolder/CalculatorForward.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/otherSubFolder/CalculatorForward.h deleted file mode 100644 index af140f9575..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/otherSubFolder/CalculatorForward.h +++ /dev/null @@ -1,35 +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 CALCULATOR_H -#define CALCULATOR_H - - -class CalculatorForward { - -public: - - virtual long subtractForward(long a, long b) = 0; - virtual long addForward(long a, long b) = 0; -}; - - -#endif // CALCULATOR_H diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/sca.composite b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/sca.composite deleted file mode 100644 index b3c5778b36..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/sca.composite +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorBackImpl.componentType b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorBackImpl.componentType deleted file mode 100644 index 715a4dfc6c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorBackImpl.componentType +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorBackImpl.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorBackImpl.h deleted file mode 100644 index d10bfb4b1a..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorBackImpl.h +++ /dev/null @@ -1,37 +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 CALCULATORIMPL_H -#define CALCULATORIMPL_H - -#include "Calculator.h" - -class CalculatorBackImpl : public Calculator -{ -public: - CalculatorImpl(); - virtual ~CalculatorImpl(); - virtual long addBack(long a, long b); - virtual long subtractBack(long a, long b); - -}; - -#endif // diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorForwardImpl.componentType b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorForwardImpl.componentType deleted file mode 100644 index 0000086167..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorForwardImpl.componentType +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorForwardImpl.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorForwardImpl.h deleted file mode 100644 index 182d9d89f2..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CalculatorSlashDirectionTest/subFolder/CalculatorForwardImpl.h +++ /dev/null @@ -1,37 +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 CALCULATORIMPL_H -#define CALCULATORIMPL_H - -#include "Calculator.h" - -class CalculatorForwardImpl : public Calculator -{ -public: - CalculatorImpl(); - virtual ~CalculatorImpl(); - virtual long addForward(long a, long b); - virtual long subtractForward(long a, long b); - -}; - -#endif // diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfo.fragment b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfo.fragment deleted file mode 100644 index 733b4700e7..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfo.fragment +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - x - 23 - 42 - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfo.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfo.h deleted file mode 100644 index d1a634999c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfo.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 CustomerInfo_h -#define CustomerInfo_h - -class CustomerInfo -{ -public: -//char (simple extra type) - virtual const char* getCustomerInformationChar(char * p1, const char* customerID ) = 0; - virtual const char* getCustomerInfoAChar(char * p1,const char*) = 0; - virtual const char* getCustomerInfoBChar(char * p1, char* customerID ) = 0; - virtual const char* getCustomerInfoCChar(char * p1, char customerID ) = 0; - virtual const char* getCustomerInfoDChar(char * p1,char) = 0; - virtual const char* getCustomerInfoEChar(char * p1 , char *) = 0; - virtual const char* getCustomerInfoFChar(char * p1, char * p1, char *customerID ) = 0; - virtual const char* getCustomerInfoGChar(char * p1, char *, char * p1,signed char *customerID ) = 0; - virtual const char* getCustomerInfoHChar(unsigned char *customerID, const char, ) = 0; - virtual const char* getCustomerInfoHChar(unsigned char *customerID, const char*) = 0; - -//long (duplicate the types) - virtual const long* getCustomerInformationLong(const long* customerID, const long* customerID ) = 0; - virtual const long* getCustomerInfoALong(const long*,const long*) = 0; - virtual const long* getCustomerInfoBLong(long* customerID, long* customerID2 ) = 0; - virtual const long* getCustomerInfoCLong(long customerID , long customerID2 ) = 0; - virtual const long* getCustomerInfoDLong(long,long) = 0; - virtual const long* getCustomerInfoELong(long *, long*) = 0; - virtual const long* getCustomerInfoFLong(long *customerID, long* customerID2 ) = 0; - virtual const long* getCustomerInfoGLong(signed long *customerID, signed long *customerID2 ) = 0; - virtual const long* getCustomerInfoHLong(signed long *customerID, signed long *customerID2 ) = 0; - -//int - virtual const int* getCustomerInformationInt(char*, const int* customerID ) = 0; - virtual const int* getCustomerInfoAInt(char*,const int*) = 0; - virtual const int* getCustomerInfoBInt(char*,int* customerID ) = 0; - virtual const int* getCustomerInfoCInt(char*,int customerID ) = 0; - virtual const int* getCustomerInfoDInt(char*,int) = 0; - virtual const int* getCustomerInfoEInt(char*,int *) = 0; - virtual const int* getCustomerInfoFInt(char*,int *customerID ) = 0; - virtual const int* getCustomerInfoGInt(char*,signed int *customerID ) = 0; - virtual const int* getCustomerInfoHInt(char*,unsigned int *customerID ) = 0; - - -//__int64 - virtual const __int64* getCustomerInformationint64(Diamond&,const __int64* customerID ) = 0; - virtual const __int64* getCustomerInfoAint64(Diamond&, const __int64*) = 0; - virtual const __int64* getCustomerInfoBint64( Diamond&, __int64* customerID ) = 0; - virtual const __int64* getCustomerInfoCint64(Diamond&,__int64 customerID ) = 0; - virtual const __int64* getCustomerInfoDint64(Diamond& myDiamond,__int64) = 0; - virtual const __int64* getCustomerInfoEint64(Diamond& myDiamond, __int64 *) = 0; - virtual const __int64* getCustomerInfoFint64(Diamond& myDiamond, __int64 *customerID ) = 0; - virtual const __int64* getCustomerInfoGint64(Diamond& myDiamond, signed __int64 *customerID ) = 0; - virtual const __int64* getCustomerInfoHint64(const Diamond& myDiamond, unsigned int64 *customerID ) = 0; - -//void - virtual const void* getCustomerInformationVoid(float& f, const __int64* customerID ) = 0; - virtual void getCustomerInfoAVoid(const float& f, const __int64*) = 0; - virtual void getCustomerInfoBVoid( ) = 0; - virtual void getCustomerInfoCVoid() = 0; - virtual void getCustomerInfoDVoid(void) = 0; - virtual char getCustomerInfoEVoid(void) = 0; - virtual char getCustomerInfoFVoid() = 0; - virtual char getCustomerInfoGVoid( void ) = 0; - -//inline - virtual inline const char * getCustomerInfoAInline(int,int,int,int, char* customer id) = 0; - inline int getCustomerInfoBInline(int*,int* f, int* g, char* customer id) = 0; - virtual inline friend const unsigned int * getCustomerInfoCInline(char* customer id) = 0; - -//tricky examples - int getCustomerInfoTrickyA(const char, const char) = 0; - int getCustomerInfoTrickyB(int myInt, int myInt) = 0; - - - - -}; - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfoImpl.componentType b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfoImpl.componentType deleted file mode 100644 index c2cfd3b399..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfoImpl.componentType +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfoImpl.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfoImpl.h deleted file mode 100644 index c325a90b1e..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplMultiParamDiffTypesTest/CustomerInfoImpl.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 CustomerInfoImpl_h -#define CustomerInfoImpl_h - -#include "CustomerInfo.h" - - - -class CustomerInfoImpl : public CustomerInfo -{ -public: - CustomerInfoImpl(); - virtual ~CustomerInfoImpl(); - virtual const char* getCustomerInformation(const char* customerID); - -}; - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfo.fragment b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfo.fragment deleted file mode 100644 index cb63dd1f06..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfo.fragment +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - x - 23 - 42 - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfo.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfo.h deleted file mode 100644 index 85fac59da8..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfo.h +++ /dev/null @@ -1,94 +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 CustomerInfo_h -#define CustomerInfo_h - -class CustomerInfo -{ -public: -//char - virtual const char* getCustomerInformationChar(const char* customerID ) = 0; - virtual const char* getCustomerInfoAChar(const char*) = 0; - virtual const char* getCustomerInfoBChar(char* customerID ) = 0; - virtual const char* getCustomerInfoCChar(char customerID ) = 0; - virtual const char* getCustomerInfoDChar(char) = 0; - virtual const char* getCustomerInfoEChar(char *) = 0; - virtual const char* getCustomerInfoFChar(char *customerID ) = 0; - virtual const char* getCustomerInfoGChar(signed char *customerID ) = 0; - virtual const char* getCustomerInfoHChar(unsigned char *customerID ) = 0; - -//long - virtual const long* getCustomerInformationLong(const long* customerID ) = 0; - virtual const long* getCustomerInfoALong(const long*) = 0; - virtual const long* getCustomerInfoBLong(long* customerID ) = 0; - virtual const long* getCustomerInfoCLong(long customerID ) = 0; - virtual const long* getCustomerInfoDLong(long) = 0; - virtual const long* getCustomerInfoELong(long *) = 0; - virtual const long* getCustomerInfoFLong(long *customerID ) = 0; - virtual const long* getCustomerInfoGLong(signed long *customerID ) = 0; - virtual const long* getCustomerInfoHLong(unsigned long *customerID ) = 0; - -//int - virtual const int* getCustomerInformationInt(const int* customerID ) = 0; - virtual const int* getCustomerInfoAInt(const int*) = 0; - virtual const int* getCustomerInfoBInt(int* customerID ) = 0; - virtual const int* getCustomerInfoCInt(int customerID ) = 0; - virtual const int* getCustomerInfoDInt(int) = 0; - virtual const int* getCustomerInfoEInt(int *) = 0; - virtual const int* getCustomerInfoFInt(int *customerID ) = 0; - virtual const int* getCustomerInfoGInt(signed int *customerID ) = 0; - virtual const int* getCustomerInfoHInt(unsigned int *customerID ) = 0; - - -//__int64 - virtual const __int64* getCustomerInformationint64(const __int64* customerID ) = 0; - virtual const __int64* getCustomerInfoAint64(const __int64*) = 0; - virtual const __int64* getCustomerInfoBint64(__int64* customerID ) = 0; - virtual const __int64* getCustomerInfoCint64(__int64 customerID ) = 0; - virtual const __int64* getCustomerInfoDint64(__int64) = 0; - virtual const __int64* getCustomerInfoEint64(__int64 *) = 0; - virtual const __int64* getCustomerInfoFint64(__int64 *customerID ) = 0; - virtual const __int64* getCustomerInfoGint64(signed __int64 *customerID ) = 0; - virtual const __int64* getCustomerInfoHint64(unsigned int64 *customerID ) = 0; - -//void - virtual const void* getCustomerInformationVoid(const __int64* customerID ) = 0; - virtual void getCustomerInfoAVoid(const __int64*) = 0; - virtual void getCustomerInfoBVoid( ) = 0; - virtual void getCustomerInfoCVoid() = 0; - virtual void getCustomerInfoDVoid(void) = 0; - -//inline - virtual inline const char * getCustomerInfoAInline(char* customer id) = 0; - inline int getCustomerInfoBInline(char* customer id) = 0; - virtual inline friend const unsigned int * getCustomerInfoCInline(char* customer id) = 0; - -//tricky examples - int getCustomerInfoTrickyA(const char) = 0; - int getCustomerInfoTrickyB(int myInt) = 0; - - - - -}; - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfoImpl.componentType b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfoImpl.componentType deleted file mode 100644 index c2cfd3b399..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfoImpl.componentType +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfoImpl.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfoImpl.h deleted file mode 100644 index 95b70c3017..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/CustomerInfoImplSingleParamDiffTypesTest/CustomerInfoImpl.h +++ /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$ */ - -#ifndef CustomerInfoImpl_h -#define CustomerInfoImpl_h - -#include "CustomerInfo.h" - - - -class CustomerInfoImpl : public CustomerInfo -{ -public: - CustomerInfoImpl(); - virtual ~CustomerInfoImpl(); - virtual const char* getCustomerInformation(const char* customerID); - -}; - -class CustomerInfoImpl2 : public CustomerInfo -{ -public: - CustomerInfoImpl(); - virtual ~CustomerInfoImpl(); - virtual const char* getCustomerInformation2(const char* customerID); - -}; - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfo.fragment b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfo.fragment deleted file mode 100644 index 5c5cb78b87..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfo.fragment +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - x - 23 - 42 - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfo.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfo.h deleted file mode 100644 index 7bd355b3ab..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfo.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef CustomerInfo_h -#define CustomerInfo_h - -class CustomerInfo -{ -public: - virtual const char* getCustomerInformation(const char* customerID) = 0; - -}; - - -class CustomerInfoSecond -{ -public: - virtual const char* getCustomerInformationSecond(const char* customerID) = 0; - -}; - - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfoImpl.componentType b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfoImpl.componentType deleted file mode 100644 index c2cfd3b399..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfoImpl.componentType +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfoImpl.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfoImpl.h deleted file mode 100644 index 540873174b..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/CustomerInfoImpl.h +++ /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. - */ - -/* $Rev$ $Date$ */ - -// Class definition for the implementation - -#ifndef CustomerInfoImpl_h -#define CustomerInfoImpl_h - -#include "CustomerInfo.h" - - - -class CustomerInfoImpl : public CustomerInfo -{ -public: - CustomerInfoImpl(); - virtual ~CustomerInfoImpl(); - virtual const char* getCustomerInformation(const char* customerID); - -}; - -class CustomerInfoImpl2 : public CustomerInfo -{ -public: - CustomerInfoImpl(); - virtual ~CustomerInfoImpl(); - virtual const char* getCustomerInformation2(const char* customerID); - -}; - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValue.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValue.h deleted file mode 100644 index 4334c82eca..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValue.h +++ /dev/null @@ -1,40 +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$ */ - -// MyValue.h: interface for the MyValueImpl class. -// -////////////////////////////////////////////////////////////////////// - -#ifndef MyValue_h -#define MyValue_h -#include -using std::string; -class MyValue -{ -public: - virtual float getMyValue(const char* customerID) = 0; - virtual float getMyValueS(const string& customerID) = 0; - virtual string getCustname(string& customerID) = 0; - virtual const string& getCustnamecs(string customerID) = 0; - -}; - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl.componentType b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl.componentType deleted file mode 100644 index c4e3b35675..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl.componentType +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl.hpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl.hpp deleted file mode 100644 index 98a342fcb0..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl.hpp +++ /dev/null @@ -1,43 +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$ */ - -// Class definition for the implementation - -#ifndef MyValueImpl_h -#define MyValueImpl_h - -#include "MyValue.h" - - - -class MyValueImpl : public MyValue -{ -public: - MyValueImpl(); - virtual ~MyValueImpl(); - virtual float getMyValue(const char* customerID); - virtual float getMyValueS(const string& customerID); - virtual string getCustname(string& customerID); - virtual const string& getCustnamecs(string customerID); - -}; - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl_stockQuote_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl_stockQuote_Proxy.h deleted file mode 100644 index 3f9feeed30..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/MyValueImpl_stockQuote_Proxy.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 MyValueImpl_stockQuote_Proxy_h -#define MyValueImpl_stockQuote_Proxy_h - -#include "StockQuoteService.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class MyValueImpl_stockQuote_Proxy : public StockQuoteService -{ -public: - MyValueImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~MyValueImpl_stockQuote_Proxy(); - virtual commonj::sdo::DataObjectPtr GetStockQuotes(commonj::sdo::DataObjectPtr); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // MyValueImpl_stockQuote_Proxy_h diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/StockQuoteService.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/StockQuoteService.h deleted file mode 100644 index 6a8fd51534..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/StockQuoteService.h +++ /dev/null @@ -1,37 +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 StockQuoteService_h -#define StockQuoteService_h -#include -#include "commonj/sdo/sdo.h" -using std::string; -class StockQuoteService -{ -public: - virtual commonj::sdo::DataObjectPtr GetStockQuotes(commonj::sdo::DataObjectPtr request) = 0; - -}; - -#endif // StockQuoteService_h diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/sca.composite b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/sca.composite deleted file mode 100644 index 9a5cfd8da5..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceComposite/sca.composite +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - MyValueServiceComponent - - - - - - - - CustomerInfoComponent - StockQuoteService - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfo.fragment b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfo.fragment deleted file mode 100644 index 48d34f7957..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfo.fragment +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - x - 23 - 42 - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfo.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfo.h deleted file mode 100644 index 928480df1f..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfo.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 CustomerInfo_h -#define CustomerInfo_h - -class CustomerInfo -{ -public: - virtual const char* getCustomerInformation(const char* customerID) = 0; - -}; - - -class CustomerInfoSecond -{ -public: - virtual const char* getCustomerInformationSecond(const char* customerID) = 0; - -}; - - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfoImpl.componentType b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfoImpl.componentType deleted file mode 100644 index c2cfd3b399..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfoImpl.componentType +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfoImpl.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfoImpl.h deleted file mode 100644 index 8d2f810db0..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/CustomerInfoImpl.h +++ /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$ */ - -// Class definition for the implementation - -#ifndef CustomerInfoImpl_h -#define CustomerInfoImpl_h - -#include "CustomerInfo.h" - - -/* -class CustomerInfoImpl : public CustomerInfo -{ -public: - CustomerInfoImpl(); - virtual ~CustomerInfoImpl(); - virtual const char* getCustomerInformation(const char* customerID); - -}; - -*/ -namespace Other { - class CustomerInfoImpl : public CustomerInfo - { - public: - CustomerInfoImpl(); - virtual ~CustomerInfoImpl(); - virtual const char* getCustomerInformationOther(const char* customerID); - - }; -} - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValue.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValue.h deleted file mode 100644 index 4334c82eca..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValue.h +++ /dev/null @@ -1,40 +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$ */ - -// MyValue.h: interface for the MyValueImpl class. -// -////////////////////////////////////////////////////////////////////// - -#ifndef MyValue_h -#define MyValue_h -#include -using std::string; -class MyValue -{ -public: - virtual float getMyValue(const char* customerID) = 0; - virtual float getMyValueS(const string& customerID) = 0; - virtual string getCustname(string& customerID) = 0; - virtual const string& getCustnamecs(string customerID) = 0; - -}; - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl.componentType b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl.componentType deleted file mode 100644 index c4e3b35675..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl.componentType +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl.hpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl.hpp deleted file mode 100644 index 98a342fcb0..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl.hpp +++ /dev/null @@ -1,43 +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$ */ - -// Class definition for the implementation - -#ifndef MyValueImpl_h -#define MyValueImpl_h - -#include "MyValue.h" - - - -class MyValueImpl : public MyValue -{ -public: - MyValueImpl(); - virtual ~MyValueImpl(); - virtual float getMyValue(const char* customerID); - virtual float getMyValueS(const string& customerID); - virtual string getCustname(string& customerID); - virtual const string& getCustnamecs(string customerID); - -}; - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl_stockQuote_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl_stockQuote_Proxy.h deleted file mode 100644 index 3f9feeed30..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/MyValueImpl_stockQuote_Proxy.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 MyValueImpl_stockQuote_Proxy_h -#define MyValueImpl_stockQuote_Proxy_h - -#include "StockQuoteService.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class MyValueImpl_stockQuote_Proxy : public StockQuoteService -{ -public: - MyValueImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~MyValueImpl_stockQuote_Proxy(); - virtual commonj::sdo::DataObjectPtr GetStockQuotes(commonj::sdo::DataObjectPtr); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // MyValueImpl_stockQuote_Proxy_h diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/StockQuoteService.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/StockQuoteService.h deleted file mode 100644 index 6a8fd51534..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/StockQuoteService.h +++ /dev/null @@ -1,37 +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 StockQuoteService_h -#define StockQuoteService_h -#include -#include "commonj/sdo/sdo.h" -using std::string; -class StockQuoteService -{ -public: - virtual commonj::sdo::DataObjectPtr GetStockQuotes(commonj::sdo::DataObjectPtr request) = 0; - -}; - -#endif // StockQuoteService_h diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/sca.composite b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/sca.composite deleted file mode 100644 index 9a5cfd8da5..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespace/sca.composite +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - MyValueServiceComponent - - - - - - - - CustomerInfoComponent - StockQuoteService - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValue.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValue.h deleted file mode 100644 index 90835ca4af..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValue.h +++ /dev/null @@ -1,40 +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$ */ - -// MyValue.h: interface for the MyValueImpl class. -// -////////////////////////////////////////////////////////////////////// - -#ifndef MyValue_h -#define MyValue_h -#include -using std::string; - -class MyValue -{ - public: - virtual float getMyValueOther(const char* customerID) = 0; - virtual float getMyValueSOther(const string& customerID) = 0; - virtual string getCustnameOther(string& customerID) = 0; - virtual const string& getCustnamecsOther(string customerID) = 0; -} - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValueImpl.componentType b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValueImpl.componentType deleted file mode 100644 index 785be08b72..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValueImpl.componentType +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValueImpl.hpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValueImpl.hpp deleted file mode 100644 index 04a785cd26..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/MyValueImpl.hpp +++ /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$ */ -// Class definition for the implementation - -#ifndef MyValueImpl_h -#define MyValueImpl_h - -#include "MyValue.h" - - -namespace myvaluecorp -{ - namespace implns - { - - class MyValueImpl : public MyValue - { - public: - MyValueImpl(); - virtual ~MyValueImpl(); - virtual float getMyValue(const char* customerID); - virtual float getMyValueS(const string& customerID); - virtual string getCustname(string& customerID); - virtual const string& getCustnamecs(string customerID); - - }; - } -} -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/sca.composite b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/sca.composite deleted file mode 100644 index 3e3c22a07b..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/sca.composite +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - MyValueServiceComponent - - - - - - - - CustomerInfoComponent - StockQuoteService - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValue.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValue.h deleted file mode 100644 index bbfcf15ed1..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValue.h +++ /dev/null @@ -1,43 +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$ */ - -// MyValue.h: interface for the MyValueImpl class. -// -////////////////////////////////////////////////////////////////////// - -#ifndef MyValue_h -#define MyValue_h -#include -using std::string; - -namespace Other { - class MyValue - { - public: - virtual float getMyValueOther(const char* customerID) = 0; - virtual float getMyValueSOther(const string& customerID) = 0; - virtual string getCustnameOther(string& customerID) = 0; - virtual const string& getCustnamecsOther(string customerID) = 0; - } -} - - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValueImpl.componentType b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValueImpl.componentType deleted file mode 100644 index 42cc4e9827..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValueImpl.componentType +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValueImpl.hpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValueImpl.hpp deleted file mode 100644 index 98a342fcb0..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/MyValueImpl.hpp +++ /dev/null @@ -1,43 +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$ */ - -// Class definition for the implementation - -#ifndef MyValueImpl_h -#define MyValueImpl_h - -#include "MyValue.h" - - - -class MyValueImpl : public MyValue -{ -public: - MyValueImpl(); - virtual ~MyValueImpl(); - virtual float getMyValue(const char* customerID); - virtual float getMyValueS(const string& customerID); - virtual string getCustname(string& customerID); - virtual const string& getCustnamecs(string customerID); - -}; - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/sca.composite b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/sca.composite deleted file mode 100644 index 510bf36337..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespace/sca.composite +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - MyValueServiceComponent - - - - - - - - CustomerInfoComponent - StockQuoteService - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValue.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValue.h deleted file mode 100644 index 10c59480a8..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValue.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$ */ - -// MyValue.h: interface for the MyValueImpl class. -// -////////////////////////////////////////////////////////////////////// - -#ifndef MyValue_h -#define MyValue_h -#include -using std::string; - -namespace Other { - class MyValue - { - public: - virtual float getMyValueOther(const char* customerID) = 0; - virtual float getMyValueSOther(const string& customerID) = 0; - virtual string getCustnameOther(string& customerID) = 0; - virtual const string& getCustnamecsOther(string customerID) = 0; - } -} -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValueImpl.componentType b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValueImpl.componentType deleted file mode 100644 index ddb463e3d7..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValueImpl.componentType +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValueImpl.hpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValueImpl.hpp deleted file mode 100644 index 98a342fcb0..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/MyValueImpl.hpp +++ /dev/null @@ -1,43 +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$ */ - -// Class definition for the implementation - -#ifndef MyValueImpl_h -#define MyValueImpl_h - -#include "MyValue.h" - - - -class MyValueImpl : public MyValue -{ -public: - MyValueImpl(); - virtual ~MyValueImpl(); - virtual float getMyValue(const char* customerID); - virtual float getMyValueS(const string& customerID); - virtual string getCustname(string& customerID); - virtual const string& getCustnamecs(string customerID); - -}; - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/sca.composite b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/sca.composite deleted file mode 100644 index 510bf36337..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/sca.composite +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - MyValueServiceComponent - - - - - - - - CustomerInfoComponent - StockQuoteService - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeMissingScaComposite/CustomerInfo.fragmentX b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeMissingScaComposite/CustomerInfo.fragmentX deleted file mode 100644 index 717ce02ede..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeMissingScaComposite/CustomerInfo.fragmentX +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - x - 23 - 42 - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeMissingScaComposite/sca.compositeX b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeMissingScaComposite/sca.compositeX deleted file mode 100644 index bbda577c28..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeMissingScaComposite/sca.compositeX +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - MyValueServiceComponent - - - - - - - - CustomerInfoComponent - StockQuoteService - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfo.fragment b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfo.fragment deleted file mode 100644 index 5c5cb78b87..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfo.fragment +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - x - 23 - 42 - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfo.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfo.h deleted file mode 100644 index 928480df1f..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfo.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 CustomerInfo_h -#define CustomerInfo_h - -class CustomerInfo -{ -public: - virtual const char* getCustomerInformation(const char* customerID) = 0; - -}; - - -class CustomerInfoSecond -{ -public: - virtual const char* getCustomerInformationSecond(const char* customerID) = 0; - -}; - - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfoImpl.componentType b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfoImpl.componentType deleted file mode 100644 index c2cfd3b399..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfoImpl.componentType +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfoImpl.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfoImpl.h deleted file mode 100644 index c275383ab4..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/CustomerInfoImpl.h +++ /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. - */ - -/* $Rev$ $Date$ */ - -// Class definition for the implementation - -#ifndef CustomerInfoImpl_h -#define CustomerInfoImpl_h - -#include "CustomerInfo.h" - - - -class CustomerInfoImpl : public CustomerInfo -{ -public: - CustomerInfoImpl(); - virtual ~CustomerInfoImpl(); - virtual const char* getCustomerInformation(const char* customerID); - -}; - -class CustomerInfoImpl2 : public CustomerInfo -{ -public: - CustomerInfoImpl(); - virtual ~CustomerInfoImpl(); - virtual const char* getCustomerInformation(const char* customerID); - -}; - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValue.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValue.h deleted file mode 100644 index 4334c82eca..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValue.h +++ /dev/null @@ -1,40 +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$ */ - -// MyValue.h: interface for the MyValueImpl class. -// -////////////////////////////////////////////////////////////////////// - -#ifndef MyValue_h -#define MyValue_h -#include -using std::string; -class MyValue -{ -public: - virtual float getMyValue(const char* customerID) = 0; - virtual float getMyValueS(const string& customerID) = 0; - virtual string getCustname(string& customerID) = 0; - virtual const string& getCustnamecs(string customerID) = 0; - -}; - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl.componentType b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl.componentType deleted file mode 100644 index c4e3b35675..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl.componentType +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl.hpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl.hpp deleted file mode 100644 index 98a342fcb0..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl.hpp +++ /dev/null @@ -1,43 +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$ */ - -// Class definition for the implementation - -#ifndef MyValueImpl_h -#define MyValueImpl_h - -#include "MyValue.h" - - - -class MyValueImpl : public MyValue -{ -public: - MyValueImpl(); - virtual ~MyValueImpl(); - virtual float getMyValue(const char* customerID); - virtual float getMyValueS(const string& customerID); - virtual string getCustname(string& customerID); - virtual const string& getCustnamecs(string customerID); - -}; - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl_stockQuote_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl_stockQuote_Proxy.h deleted file mode 100644 index 3f9feeed30..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/MyValueImpl_stockQuote_Proxy.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 MyValueImpl_stockQuote_Proxy_h -#define MyValueImpl_stockQuote_Proxy_h - -#include "StockQuoteService.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class MyValueImpl_stockQuote_Proxy : public StockQuoteService -{ -public: - MyValueImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~MyValueImpl_stockQuote_Proxy(); - virtual commonj::sdo::DataObjectPtr GetStockQuotes(commonj::sdo::DataObjectPtr); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // MyValueImpl_stockQuote_Proxy_h diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/StockQuoteService.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/StockQuoteService.h deleted file mode 100644 index 6a8fd51534..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/StockQuoteService.h +++ /dev/null @@ -1,37 +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 StockQuoteService_h -#define StockQuoteService_h -#include -#include "commonj/sdo/sdo.h" -using std::string; -class StockQuoteService -{ -public: - virtual commonj::sdo::DataObjectPtr GetStockQuotes(commonj::sdo::DataObjectPtr request) = 0; - -}; - -#endif // StockQuoteService_h diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/sca.composite b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/sca.composite deleted file mode 100644 index 9a5cfd8da5..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/MyValueServiceCompositeTwoClasses/sca.composite +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - MyValueServiceComponent - - - - - - - - CustomerInfoComponent - StockQuoteService - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfo.fragment b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfo.fragment deleted file mode 100644 index 27d28368f5..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfo.fragment +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - x - 23 - 42 - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfo.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfo.h deleted file mode 100644 index 32bf7572dc..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfo.h +++ /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. - */ - -/* $Rev$ $Date$ */ - -#ifndef CustomerInfo_h -#define CustomerInfo_h - -class CustomerInfo -{ -public: - virtual const char* getCustomerInformationCharPublic(char * p1, const char* customerID ) = 0; - virtual const char* getCustomerInfoACharPublic(char * p1,const char*) = 0; - virtual const char* getCustomerInfoBCharPublic(char * p1, char* customerID ) = 0; - -private: - virtual const char* getCustomerInformationCharPrivate(char * p1, const char* customerID ) = 0; - virtual const char* getCustomerInfoACharPrivate(char * p1,const char*) = 0; - virtual const char* getCustomerInfoBCharPrivate(char * p1, char* customerID ) = 0; - -protected: - virtual const char* getCustomerInformationCharProtected(char * p1, const char* customerID ) = 0; - virtual const char* getCustomerInfoACharProtected(char * p1,const char*) = 0; - virtual const char* getCustomerInfoBCharProtected(char * p1, char* customerID ) = 0; - - -}; - -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfoImpl.componentType b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfoImpl.componentType deleted file mode 100644 index c2cfd3b399..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfoImpl.componentType +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfoImpl.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfoImpl.h deleted file mode 100644 index 55f5813303..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testinput/composites/SimplePublicPrivateProtectedTest/CustomerInfoImpl.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$ */ - -// Class definition for the implementation - -#ifndef CustomerInfoImpl_h -#define CustomerInfoImpl_h - -#include "CustomerInfo.h" - - - -class CustomerInfoImpl : public CustomerInfo -{ -public: - CustomerInfoImpl(); - virtual ~CustomerInfoImpl(); - virtual const char* getCustomerInformation(const char* customerID); - -}; -#endif diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Proxy.cpp deleted file mode 100644 index 14bafd9ce7..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Proxy.cpp +++ /dev/null @@ -1,65 +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. - */ - -#include "CalculatorImpl_CalculatorService_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CalculatorImpl_CalculatorService_Proxy* CalculatorImpl_CalculatorService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new CalculatorImpl_CalculatorService_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void CalculatorImpl_CalculatorService_Proxy_Destructor(void* proxy) - { - delete (CalculatorImpl_CalculatorService_Proxy*)proxy; - } -} - -CalculatorImpl_CalculatorService_Proxy::CalculatorImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -CalculatorImpl_CalculatorService_Proxy::~CalculatorImpl_CalculatorService_Proxy() -{ - if (target) - delete target; -} - -long CalculatorImpl_CalculatorService_Proxy::subtract( long arg0, long arg1) -{ - tuscany::sca::Operation operation("subtract"); - operation.addParameter("a", &arg0); - operation.addParameter("b", &arg1); - long ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(long*)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Proxy.h deleted file mode 100644 index 00b163ba76..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Proxy.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. - */ - -#ifndef CalculatorImpl_CalculatorService_Proxy_h -#define CalculatorImpl_CalculatorService_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "Calculator.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class CalculatorImpl_CalculatorService_Proxy : public Calculator -{ -public: - CalculatorImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~CalculatorImpl_CalculatorService_Proxy(); - virtual long subtract( long a, long b); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // CalculatorImpl_CalculatorService_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Wrapper.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Wrapper.cpp deleted file mode 100644 index b6e5c8a9f0..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Wrapper.cpp +++ /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. - */ - -#include "CalculatorImpl_CalculatorService_Wrapper.h" - -#include "osoa/sca/sca.h" - - - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CalculatorImpl_CalculatorService_Wrapper* CalculatorImpl_CalculatorService_Wrapper_Factory(tuscany::sca::model::Service* target) - { - return new CalculatorImpl_CalculatorService_Wrapper(target); - } -} - -CalculatorImpl_CalculatorService_Wrapper::CalculatorImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) -{ - impl = (CalculatorImpl*)getImplementation(); -} - -CalculatorImpl_CalculatorService_Wrapper::~CalculatorImpl_CalculatorService_Wrapper() -{ - releaseImplementation(); -} - -void* CalculatorImpl_CalculatorService_Wrapper::newImplementation() -{ - return new CalculatorImpl; -} - -void CalculatorImpl_CalculatorService_Wrapper::deleteImplementation() -{ - delete impl; -} - -void CalculatorImpl_CalculatorService_Wrapper::invokeService(tuscany::sca::Operation& operation) -{ - const std::string& operationName = operation.getName(); - - if (operationName == "subtract") - { - long& p0 = *( long*)operation.getParameterValue(0); - long& p1 = *( long*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(long*)operation.getReturnValue() = impl->subtract(p0, p1); - } - else - { - long* ret = new long; - *ret = impl->subtract(p0, p1); - operation.setReturnValue((const long*)ret); - } - return; - } - - - throw osoa::sca::ServiceRuntimeException("Invalid operation"); - -} - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Wrapper.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Wrapper.h deleted file mode 100644 index 63bae2f75c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Wrapper.h +++ /dev/null @@ -1,43 +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. - */ - -#ifndef CalculatorImpl_CalculatorService_Wrapper_h -#define CalculatorImpl_CalculatorService_Wrapper_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "CalculatorImpl.h" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -class CalculatorImpl_CalculatorService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper -{ -public: - CalculatorImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target); - virtual ~CalculatorImpl_CalculatorService_Wrapper(); - virtual void invokeService(tuscany::sca::Operation& operation); - virtual void* newImplementation(); - virtual void deleteImplementation(); -private: - CalculatorImpl* impl; -}; - -#endif // CalculatorImpl_CalculatorService_Wrapper_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Proxy.cpp deleted file mode 100644 index 79bfdbedbb..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Proxy.cpp +++ /dev/null @@ -1,76 +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. - */ - -#include "CalculatorBackImpl_CalculatorService_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CalculatorBackImpl_CalculatorService_Proxy* CalculatorBackImpl_CalculatorService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new CalculatorBackImpl_CalculatorService_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void CalculatorBackImpl_CalculatorService_Proxy_Destructor(void* proxy) - { - delete (CalculatorBackImpl_CalculatorService_Proxy*)proxy; - } -} - -CalculatorBackImpl_CalculatorService_Proxy::CalculatorBackImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -CalculatorBackImpl_CalculatorService_Proxy::~CalculatorBackImpl_CalculatorService_Proxy() -{ - if (target) - delete target; -} - -long CalculatorBackImpl_CalculatorService_Proxy::subtractBack( long arg0, long arg1) -{ - tuscany::sca::Operation operation("subtractBack"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - long ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(long*)operation.getReturnValue(); -} - -long CalculatorBackImpl_CalculatorService_Proxy::addBack( long arg0, long arg1) -{ - tuscany::sca::Operation operation("addBack"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - long ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(long*)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Proxy.h deleted file mode 100644 index 277a3afb06..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Proxy.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. - */ - -#ifndef CalculatorBackImpl_CalculatorService_Proxy_h -#define CalculatorBackImpl_CalculatorService_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "otherSubFolder/CalculatorBack.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class CalculatorBackImpl_CalculatorService_Proxy : public CalculatorBack -{ -public: - CalculatorBackImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~CalculatorBackImpl_CalculatorService_Proxy(); - virtual long subtractBack( long a, long b); - virtual long addBack( long a, long b); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // CalculatorBackImpl_CalculatorService_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Wrapper.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Wrapper.cpp deleted file mode 100644 index 09dd09c01c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Wrapper.cpp +++ /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. - */ - -#include "CalculatorBackImpl_CalculatorService_Wrapper.h" - -#include "osoa/sca/sca.h" - - - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CalculatorBackImpl_CalculatorService_Wrapper* CalculatorBackImpl_CalculatorService_Wrapper_Factory(tuscany::sca::model::Service* target) - { - return new CalculatorBackImpl_CalculatorService_Wrapper(target); - } -} - -CalculatorBackImpl_CalculatorService_Wrapper::CalculatorBackImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) -{ - impl = (CalculatorBackImpl*)getImplementation(); -} - -CalculatorBackImpl_CalculatorService_Wrapper::~CalculatorBackImpl_CalculatorService_Wrapper() -{ - releaseImplementation(); -} - -void* CalculatorBackImpl_CalculatorService_Wrapper::newImplementation() -{ - return new CalculatorBackImpl; -} - -void CalculatorBackImpl_CalculatorService_Wrapper::deleteImplementation() -{ - delete impl; -} - -void CalculatorBackImpl_CalculatorService_Wrapper::invokeService(tuscany::sca::Operation& operation) -{ - const std::string& operationName = operation.getName(); - - if (operationName == "subtractBack") - { - long& p0 = *( long*)operation.getParameterValue(0); - long& p1 = *( long*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(long*)operation.getReturnValue() = impl->subtractBack(p0, p1); - } - else - { - long* ret = new long; - *ret = impl->subtractBack(p0, p1); - operation.setReturnValue((const long*)ret); - } - return; - } - if (operationName == "addBack") - { - long& p0 = *( long*)operation.getParameterValue(0); - long& p1 = *( long*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(long*)operation.getReturnValue() = impl->addBack(p0, p1); - } - else - { - long* ret = new long; - *ret = impl->addBack(p0, p1); - operation.setReturnValue((const long*)ret); - } - return; - } - - - throw osoa::sca::ServiceRuntimeException("Invalid operation"); - -} - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Wrapper.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Wrapper.h deleted file mode 100644 index bfa203598c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Wrapper.h +++ /dev/null @@ -1,43 +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. - */ - -#ifndef CalculatorBackImpl_CalculatorService_Wrapper_h -#define CalculatorBackImpl_CalculatorService_Wrapper_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "subFolder/CalculatorBackImpl.h" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -class CalculatorBackImpl_CalculatorService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper -{ -public: - CalculatorBackImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target); - virtual ~CalculatorBackImpl_CalculatorService_Wrapper(); - virtual void invokeService(tuscany::sca::Operation& operation); - virtual void* newImplementation(); - virtual void deleteImplementation(); -private: - CalculatorBackImpl* impl; -}; - -#endif // CalculatorBackImpl_CalculatorService_Wrapper_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Proxy.cpp deleted file mode 100644 index 19056e836d..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Proxy.cpp +++ /dev/null @@ -1,76 +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. - */ - -#include "CalculatorForwardImpl_CalculatorService_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CalculatorForwardImpl_CalculatorService_Proxy* CalculatorForwardImpl_CalculatorService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new CalculatorForwardImpl_CalculatorService_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void CalculatorForwardImpl_CalculatorService_Proxy_Destructor(void* proxy) - { - delete (CalculatorForwardImpl_CalculatorService_Proxy*)proxy; - } -} - -CalculatorForwardImpl_CalculatorService_Proxy::CalculatorForwardImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -CalculatorForwardImpl_CalculatorService_Proxy::~CalculatorForwardImpl_CalculatorService_Proxy() -{ - if (target) - delete target; -} - -long CalculatorForwardImpl_CalculatorService_Proxy::subtractForward( long arg0, long arg1) -{ - tuscany::sca::Operation operation("subtractForward"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - long ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(long*)operation.getReturnValue(); -} - -long CalculatorForwardImpl_CalculatorService_Proxy::addForward( long arg0, long arg1) -{ - tuscany::sca::Operation operation("addForward"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - long ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(long*)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Proxy.h deleted file mode 100644 index 9213ec625b..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Proxy.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. - */ - -#ifndef CalculatorForwardImpl_CalculatorService_Proxy_h -#define CalculatorForwardImpl_CalculatorService_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "otherSubFolder/CalculatorForward.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class CalculatorForwardImpl_CalculatorService_Proxy : public CalculatorForward -{ -public: - CalculatorForwardImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~CalculatorForwardImpl_CalculatorService_Proxy(); - virtual long subtractForward( long a, long b); - virtual long addForward( long a, long b); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // CalculatorForwardImpl_CalculatorService_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Wrapper.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Wrapper.cpp deleted file mode 100644 index 7b1cad7770..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Wrapper.cpp +++ /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. - */ - -#include "CalculatorForwardImpl_CalculatorService_Wrapper.h" - -#include "osoa/sca/sca.h" - - - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CalculatorForwardImpl_CalculatorService_Wrapper* CalculatorForwardImpl_CalculatorService_Wrapper_Factory(tuscany::sca::model::Service* target) - { - return new CalculatorForwardImpl_CalculatorService_Wrapper(target); - } -} - -CalculatorForwardImpl_CalculatorService_Wrapper::CalculatorForwardImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) -{ - impl = (CalculatorForwardImpl*)getImplementation(); -} - -CalculatorForwardImpl_CalculatorService_Wrapper::~CalculatorForwardImpl_CalculatorService_Wrapper() -{ - releaseImplementation(); -} - -void* CalculatorForwardImpl_CalculatorService_Wrapper::newImplementation() -{ - return new CalculatorForwardImpl; -} - -void CalculatorForwardImpl_CalculatorService_Wrapper::deleteImplementation() -{ - delete impl; -} - -void CalculatorForwardImpl_CalculatorService_Wrapper::invokeService(tuscany::sca::Operation& operation) -{ - const std::string& operationName = operation.getName(); - - if (operationName == "subtractForward") - { - long& p0 = *( long*)operation.getParameterValue(0); - long& p1 = *( long*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(long*)operation.getReturnValue() = impl->subtractForward(p0, p1); - } - else - { - long* ret = new long; - *ret = impl->subtractForward(p0, p1); - operation.setReturnValue((const long*)ret); - } - return; - } - if (operationName == "addForward") - { - long& p0 = *( long*)operation.getParameterValue(0); - long& p1 = *( long*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(long*)operation.getReturnValue() = impl->addForward(p0, p1); - } - else - { - long* ret = new long; - *ret = impl->addForward(p0, p1); - operation.setReturnValue((const long*)ret); - } - return; - } - - - throw osoa::sca::ServiceRuntimeException("Invalid operation"); - -} - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Wrapper.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Wrapper.h deleted file mode 100644 index 0cb8404ca3..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Wrapper.h +++ /dev/null @@ -1,43 +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. - */ - -#ifndef CalculatorForwardImpl_CalculatorService_Wrapper_h -#define CalculatorForwardImpl_CalculatorService_Wrapper_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "subFolder/CalculatorForwardImpl.h" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -class CalculatorForwardImpl_CalculatorService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper -{ -public: - CalculatorForwardImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target); - virtual ~CalculatorForwardImpl_CalculatorService_Wrapper(); - virtual void invokeService(tuscany::sca::Operation& operation); - virtual void* newImplementation(); - virtual void deleteImplementation(); -private: - CalculatorForwardImpl* impl; -}; - -#endif // CalculatorForwardImpl_CalculatorService_Wrapper_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp deleted file mode 100644 index 85291cd069..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp +++ /dev/null @@ -1,594 +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. - */ - -#include "CustomerInfoImpl_CustomerInfoService_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CustomerInfoImpl_CustomerInfoService_Proxy* CustomerInfoImpl_CustomerInfoService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new CustomerInfoImpl_CustomerInfoService_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void CustomerInfoImpl_CustomerInfoService_Proxy_Destructor(void* proxy) - { - delete (CustomerInfoImpl_CustomerInfoService_Proxy*)proxy; - } -} - -CustomerInfoImpl_CustomerInfoService_Proxy::CustomerInfoImpl_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -CustomerInfoImpl_CustomerInfoService_Proxy::~CustomerInfoImpl_CustomerInfoService_Proxy() -{ - if (target) - delete target; -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationChar( char* arg0, const char* arg1) -{ - tuscany::sca::Operation operation("getCustomerInformationChar"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAChar( char* arg0, const char* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoAChar"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBChar( char* arg0, char* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoBChar"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCChar( char* arg0, char arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoCChar"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDChar( char* arg0, char arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoDChar"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoEChar( char* arg0, char* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoEChar"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoFChar( char* arg0, char* arg1, char* arg2) -{ - tuscany::sca::Operation operation("getCustomerInfoFChar"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - operation.addParameter(&arg2); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoGChar( char* arg0, char* arg1, char* arg2, signed char* arg3) -{ - tuscany::sca::Operation operation("getCustomerInfoGChar"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - operation.addParameter(&arg2); - operation.addParameter(&arg3); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoHChar( unsigned char* arg0, const char arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoHChar"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoHChar( unsigned char* arg0, const char* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoHChar"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationLong(const long* arg0, const long* arg1) -{ - tuscany::sca::Operation operation("getCustomerInformationLong"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const long* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const long**)operation.getReturnValue(); -} - -const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoALong(const long* arg0, const long* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoALong"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const long* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const long**)operation.getReturnValue(); -} - -const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBLong( long* arg0, long* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoBLong"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const long* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const long**)operation.getReturnValue(); -} - -const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCLong( long arg0, long arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoCLong"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const long* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const long**)operation.getReturnValue(); -} - -const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDLong( long arg0, long arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoDLong"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const long* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const long**)operation.getReturnValue(); -} - -const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoELong( long* arg0, long* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoELong"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const long* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const long**)operation.getReturnValue(); -} - -const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoFLong( long* arg0, long* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoFLong"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const long* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const long**)operation.getReturnValue(); -} - -const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoGLong( signed long* arg0, signed long* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoGLong"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const long* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const long**)operation.getReturnValue(); -} - -const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoHLong( signed long* arg0, signed long* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoHLong"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const long* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const long**)operation.getReturnValue(); -} - -const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationInt( char* arg0, const int* arg1) -{ - tuscany::sca::Operation operation("getCustomerInformationInt"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const int**)operation.getReturnValue(); -} - -const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAInt( char* arg0, const int* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoAInt"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const int**)operation.getReturnValue(); -} - -const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBInt( char* arg0, int* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoBInt"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const int**)operation.getReturnValue(); -} - -const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCInt( char* arg0, int arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoCInt"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const int**)operation.getReturnValue(); -} - -const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDInt( char* arg0, int arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoDInt"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const int**)operation.getReturnValue(); -} - -const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoEInt( char* arg0, int* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoEInt"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const int**)operation.getReturnValue(); -} - -const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoFInt( char* arg0, int* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoFInt"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const int**)operation.getReturnValue(); -} - -const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoGInt( char* arg0, signed int* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoGInt"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const int**)operation.getReturnValue(); -} - -const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoHInt( char* arg0, unsigned int* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoHInt"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const int**)operation.getReturnValue(); -} - -const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationint64( Diamond& arg0, const __int64* arg1) -{ - tuscany::sca::Operation operation("getCustomerInformationint64"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const __int64* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const __int64**)operation.getReturnValue(); -} - -const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAint64( Diamond& arg0, const __int64* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoAint64"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const __int64* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const __int64**)operation.getReturnValue(); -} - -const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBint64( Diamond& arg0, __int64* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoBint64"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const __int64* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const __int64**)operation.getReturnValue(); -} - -const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCint64( Diamond& arg0, __int64 arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoCint64"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const __int64* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const __int64**)operation.getReturnValue(); -} - -const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDint64( Diamond& arg0, __int64 arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoDint64"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const __int64* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const __int64**)operation.getReturnValue(); -} - -const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoEint64( Diamond& arg0, __int64* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoEint64"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const __int64* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const __int64**)operation.getReturnValue(); -} - -const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoFint64( Diamond& arg0, __int64* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoFint64"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const __int64* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const __int64**)operation.getReturnValue(); -} - -const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoGint64( Diamond& arg0, signed __int64* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoGint64"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const __int64* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const __int64**)operation.getReturnValue(); -} - -const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoHint64(const Diamond& arg0, unsigned int64* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoHint64"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const __int64* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const __int64**)operation.getReturnValue(); -} - -const void* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationVoid( float& arg0, const __int64* arg1) -{ - tuscany::sca::Operation operation("getCustomerInformationVoid"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - const void* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const void**)operation.getReturnValue(); -} - -void CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAVoid(const float& arg0, const __int64* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoAVoid"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - target->invoke(operation); - return; -} - -void CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBVoid() -{ - tuscany::sca::Operation operation("getCustomerInfoBVoid"); - target->invoke(operation); - return; -} - -void CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCVoid() -{ - tuscany::sca::Operation operation("getCustomerInfoCVoid"); - target->invoke(operation); - return; -} - -void CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDVoid() -{ - tuscany::sca::Operation operation("getCustomerInfoDVoid"); - operation.addParameter(&arg0); - target->invoke(operation); - return; -} - -char CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoEVoid() -{ - tuscany::sca::Operation operation("getCustomerInfoEVoid"); - operation.addParameter(&arg0); - char ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(char*)operation.getReturnValue(); -} - -char CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoFVoid() -{ - tuscany::sca::Operation operation("getCustomerInfoFVoid"); - char ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(char*)operation.getReturnValue(); -} - -char CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoGVoid() -{ - tuscany::sca::Operation operation("getCustomerInfoGVoid"); - operation.addParameter(&arg0); - char ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(char*)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAInline( int arg0, int arg1, int arg2, int arg3, char* customer arg4) -{ - tuscany::sca::Operation operation("getCustomerInfoAInline"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - operation.addParameter(&arg2); - operation.addParameter(&arg3); - operation.addParameter(&arg4); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -int CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBInline( int* arg0, int* arg1, int* arg2, char* customer arg3) -{ - tuscany::sca::Operation operation("getCustomerInfoBInline"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - operation.addParameter(&arg2); - operation.addParameter(&arg3); - int ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(int*)operation.getReturnValue(); -} - -friend const unsigned int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCInline( char* customer arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoCInline"); - operation.addParameter(&arg0); - friend const unsigned int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(friend const unsigned int**)operation.getReturnValue(); -} - -int CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoTrickyA(const char arg0, const char arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoTrickyA"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - int ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(int*)operation.getReturnValue(); -} - -int CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoTrickyB( int arg0, int arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoTrickyB"); - operation.addParameter(&arg0); - operation.addParameter(&arg1); - int ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(int*)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h deleted file mode 100644 index cb9e4e6e2a..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h +++ /dev/null @@ -1,90 +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. - */ - -#ifndef CustomerInfoImpl_CustomerInfoService_Proxy_h -#define CustomerInfoImpl_CustomerInfoService_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "/CustomerInfo.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class CustomerInfoImpl_CustomerInfoService_Proxy : public CustomerInfo -{ -public: - CustomerInfoImpl_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~CustomerInfoImpl_CustomerInfoService_Proxy(); - virtual const char* getCustomerInformationChar( char* p1, const char* customerID); - virtual const char* getCustomerInfoAChar( char* p1, const char* ); - virtual const char* getCustomerInfoBChar( char* p1, char* customerID); - virtual const char* getCustomerInfoCChar( char* p1, char customerID); - virtual const char* getCustomerInfoDChar( char* p1, char ); - virtual const char* getCustomerInfoEChar( char* p1, char* ); - virtual const char* getCustomerInfoFChar( char* p1, char* p1, char* customerID); - virtual const char* getCustomerInfoGChar( char* p1, char* , char* p1, signed char* customerID); - virtual const char* getCustomerInfoHChar( unsigned char* customerID, const char ); - virtual const char* getCustomerInfoHChar( unsigned char* customerID, const char* ); - virtual const long* getCustomerInformationLong(const long* customerID, const long* customerID); - virtual const long* getCustomerInfoALong(const long* , const long* ); - virtual const long* getCustomerInfoBLong( long* customerID, long* customerID2); - virtual const long* getCustomerInfoCLong( long customerID, long customerID2); - virtual const long* getCustomerInfoDLong( long , long ); - virtual const long* getCustomerInfoELong( long* , long* ); - virtual const long* getCustomerInfoFLong( long* customerID, long* customerID2); - virtual const long* getCustomerInfoGLong( signed long* customerID, signed long* customerID2); - virtual const long* getCustomerInfoHLong( signed long* customerID, signed long* customerID2); - virtual const int* getCustomerInformationInt( char* , const int* customerID); - virtual const int* getCustomerInfoAInt( char* , const int* ); - virtual const int* getCustomerInfoBInt( char* , int* customerID); - virtual const int* getCustomerInfoCInt( char* , int customerID); - virtual const int* getCustomerInfoDInt( char* , int ); - virtual const int* getCustomerInfoEInt( char* , int* ); - virtual const int* getCustomerInfoFInt( char* , int* customerID); - virtual const int* getCustomerInfoGInt( char* , signed int* customerID); - virtual const int* getCustomerInfoHInt( char* , unsigned int* customerID); - virtual const __int64* getCustomerInformationint64( Diamond& , const __int64* customerID); - virtual const __int64* getCustomerInfoAint64( Diamond& , const __int64* ); - virtual const __int64* getCustomerInfoBint64( Diamond& , __int64* customerID); - virtual const __int64* getCustomerInfoCint64( Diamond& , __int64 customerID); - virtual const __int64* getCustomerInfoDint64( Diamond& myDiamond, __int64 ); - virtual const __int64* getCustomerInfoEint64( Diamond& myDiamond, __int64* ); - virtual const __int64* getCustomerInfoFint64( Diamond& myDiamond, __int64* customerID); - virtual const __int64* getCustomerInfoGint64( Diamond& myDiamond, signed __int64* customerID); - virtual const __int64* getCustomerInfoHint64(const Diamond& myDiamond, unsigned int64* customerID); - virtual const void* getCustomerInformationVoid( float& f, const __int64* customerID); - virtual void getCustomerInfoAVoid(const float& f, const __int64* ); - virtual void getCustomerInfoBVoid(); - virtual void getCustomerInfoCVoid(); - virtual void getCustomerInfoDVoid( void ); - virtual char getCustomerInfoEVoid( void ); - virtual char getCustomerInfoFVoid(); - virtual char getCustomerInfoGVoid( void ); - virtual const char* getCustomerInfoAInline( int , int , int , int , char* customer id); - virtual int getCustomerInfoBInline( int* , int* f, int* g, char* customer id); - virtual friend const unsigned int* getCustomerInfoCInline( char* customer id); - virtual int getCustomerInfoTrickyA(const char , const char ); - virtual int getCustomerInfoTrickyB( int myInt, int myInt); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // CustomerInfoImpl_CustomerInfoService_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp deleted file mode 100644 index be09a57919..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp +++ /dev/null @@ -1,872 +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. - */ - -#include "CustomerInfoImpl_CustomerInfoService_Wrapper.h" - -#include "osoa/sca/sca.h" - - - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CustomerInfoImpl_CustomerInfoService_Wrapper* CustomerInfoImpl_CustomerInfoService_Wrapper_Factory(tuscany::sca::model::Service* target) - { - return new CustomerInfoImpl_CustomerInfoService_Wrapper(target); - } -} - -CustomerInfoImpl_CustomerInfoService_Wrapper::CustomerInfoImpl_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) -{ - impl = (CustomerInfoImpl*)getImplementation(); -} - -CustomerInfoImpl_CustomerInfoService_Wrapper::~CustomerInfoImpl_CustomerInfoService_Wrapper() -{ - releaseImplementation(); -} - -void* CustomerInfoImpl_CustomerInfoService_Wrapper::newImplementation() -{ - return new CustomerInfoImpl; -} - -void CustomerInfoImpl_CustomerInfoService_Wrapper::deleteImplementation() -{ - delete impl; -} - -void CustomerInfoImpl_CustomerInfoService_Wrapper::invokeService(tuscany::sca::Operation& operation) -{ - const std::string& operationName = operation.getName(); - - if (operationName == "getCustomerInformationChar") - { - char* p0 = *( char**)operation.getParameterValue(0); - const char* p1 = *(const char**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInformationChar(p0, p1); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInformationChar(p0, p1); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoAChar") - { - char* p0 = *( char**)operation.getParameterValue(0); - const char* p1 = *(const char**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoAChar(p0, p1); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoAChar(p0, p1); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoBChar") - { - char* p0 = *( char**)operation.getParameterValue(0); - char* p1 = *( char**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoBChar(p0, p1); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoBChar(p0, p1); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoCChar") - { - char* p0 = *( char**)operation.getParameterValue(0); - char& p1 = *( char*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoCChar(p0, p1); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoCChar(p0, p1); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoDChar") - { - char* p0 = *( char**)operation.getParameterValue(0); - char& p1 = *( char*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoDChar(p0, p1); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoDChar(p0, p1); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoEChar") - { - char* p0 = *( char**)operation.getParameterValue(0); - char* p1 = *( char**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoEChar(p0, p1); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoEChar(p0, p1); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoFChar") - { - char* p0 = *( char**)operation.getParameterValue(0); - char* p1 = *( char**)operation.getParameterValue(1); - char* p2 = *( char**)operation.getParameterValue(2); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoFChar(p0, p1, p2); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoFChar(p0, p1, p2); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoGChar") - { - char* p0 = *( char**)operation.getParameterValue(0); - char* p1 = *( char**)operation.getParameterValue(1); - char* p2 = *( char**)operation.getParameterValue(2); - signed char* p3 = *( signed char**)operation.getParameterValue(3); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoGChar(p0, p1, p2, p3); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoGChar(p0, p1, p2, p3); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoHChar") - { - unsigned char* p0 = *( unsigned char**)operation.getParameterValue(0); - const char& p1 = *(const char*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoHChar(p0, p1); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoHChar(p0, p1); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoHChar") - { - unsigned char* p0 = *( unsigned char**)operation.getParameterValue(0); - const char* p1 = *(const char**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoHChar(p0, p1); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoHChar(p0, p1); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInformationLong") - { - const long* p0 = *(const long**)operation.getParameterValue(0); - const long* p1 = *(const long**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const long**)operation.getReturnValue() = impl->getCustomerInformationLong(p0, p1); - } - else - { - const long** ret = new const long*; - *ret = impl->getCustomerInformationLong(p0, p1); - operation.setReturnValue((const const long**)ret); - } - return; - } - if (operationName == "getCustomerInfoALong") - { - const long* p0 = *(const long**)operation.getParameterValue(0); - const long* p1 = *(const long**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const long**)operation.getReturnValue() = impl->getCustomerInfoALong(p0, p1); - } - else - { - const long** ret = new const long*; - *ret = impl->getCustomerInfoALong(p0, p1); - operation.setReturnValue((const const long**)ret); - } - return; - } - if (operationName == "getCustomerInfoBLong") - { - long* p0 = *( long**)operation.getParameterValue(0); - long* p1 = *( long**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const long**)operation.getReturnValue() = impl->getCustomerInfoBLong(p0, p1); - } - else - { - const long** ret = new const long*; - *ret = impl->getCustomerInfoBLong(p0, p1); - operation.setReturnValue((const const long**)ret); - } - return; - } - if (operationName == "getCustomerInfoCLong") - { - long& p0 = *( long*)operation.getParameterValue(0); - long& p1 = *( long*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const long**)operation.getReturnValue() = impl->getCustomerInfoCLong(p0, p1); - } - else - { - const long** ret = new const long*; - *ret = impl->getCustomerInfoCLong(p0, p1); - operation.setReturnValue((const const long**)ret); - } - return; - } - if (operationName == "getCustomerInfoDLong") - { - long& p0 = *( long*)operation.getParameterValue(0); - long& p1 = *( long*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const long**)operation.getReturnValue() = impl->getCustomerInfoDLong(p0, p1); - } - else - { - const long** ret = new const long*; - *ret = impl->getCustomerInfoDLong(p0, p1); - operation.setReturnValue((const const long**)ret); - } - return; - } - if (operationName == "getCustomerInfoELong") - { - long* p0 = *( long**)operation.getParameterValue(0); - long* p1 = *( long**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const long**)operation.getReturnValue() = impl->getCustomerInfoELong(p0, p1); - } - else - { - const long** ret = new const long*; - *ret = impl->getCustomerInfoELong(p0, p1); - operation.setReturnValue((const const long**)ret); - } - return; - } - if (operationName == "getCustomerInfoFLong") - { - long* p0 = *( long**)operation.getParameterValue(0); - long* p1 = *( long**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const long**)operation.getReturnValue() = impl->getCustomerInfoFLong(p0, p1); - } - else - { - const long** ret = new const long*; - *ret = impl->getCustomerInfoFLong(p0, p1); - operation.setReturnValue((const const long**)ret); - } - return; - } - if (operationName == "getCustomerInfoGLong") - { - signed long* p0 = *( signed long**)operation.getParameterValue(0); - signed long* p1 = *( signed long**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const long**)operation.getReturnValue() = impl->getCustomerInfoGLong(p0, p1); - } - else - { - const long** ret = new const long*; - *ret = impl->getCustomerInfoGLong(p0, p1); - operation.setReturnValue((const const long**)ret); - } - return; - } - if (operationName == "getCustomerInfoHLong") - { - signed long* p0 = *( signed long**)operation.getParameterValue(0); - signed long* p1 = *( signed long**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const long**)operation.getReturnValue() = impl->getCustomerInfoHLong(p0, p1); - } - else - { - const long** ret = new const long*; - *ret = impl->getCustomerInfoHLong(p0, p1); - operation.setReturnValue((const const long**)ret); - } - return; - } - if (operationName == "getCustomerInformationInt") - { - char* p0 = *( char**)operation.getParameterValue(0); - const int* p1 = *(const int**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const int**)operation.getReturnValue() = impl->getCustomerInformationInt(p0, p1); - } - else - { - const int** ret = new const int*; - *ret = impl->getCustomerInformationInt(p0, p1); - operation.setReturnValue((const const int**)ret); - } - return; - } - if (operationName == "getCustomerInfoAInt") - { - char* p0 = *( char**)operation.getParameterValue(0); - const int* p1 = *(const int**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const int**)operation.getReturnValue() = impl->getCustomerInfoAInt(p0, p1); - } - else - { - const int** ret = new const int*; - *ret = impl->getCustomerInfoAInt(p0, p1); - operation.setReturnValue((const const int**)ret); - } - return; - } - if (operationName == "getCustomerInfoBInt") - { - char* p0 = *( char**)operation.getParameterValue(0); - int* p1 = *( int**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const int**)operation.getReturnValue() = impl->getCustomerInfoBInt(p0, p1); - } - else - { - const int** ret = new const int*; - *ret = impl->getCustomerInfoBInt(p0, p1); - operation.setReturnValue((const const int**)ret); - } - return; - } - if (operationName == "getCustomerInfoCInt") - { - char* p0 = *( char**)operation.getParameterValue(0); - int& p1 = *( int*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const int**)operation.getReturnValue() = impl->getCustomerInfoCInt(p0, p1); - } - else - { - const int** ret = new const int*; - *ret = impl->getCustomerInfoCInt(p0, p1); - operation.setReturnValue((const const int**)ret); - } - return; - } - if (operationName == "getCustomerInfoDInt") - { - char* p0 = *( char**)operation.getParameterValue(0); - int& p1 = *( int*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const int**)operation.getReturnValue() = impl->getCustomerInfoDInt(p0, p1); - } - else - { - const int** ret = new const int*; - *ret = impl->getCustomerInfoDInt(p0, p1); - operation.setReturnValue((const const int**)ret); - } - return; - } - if (operationName == "getCustomerInfoEInt") - { - char* p0 = *( char**)operation.getParameterValue(0); - int* p1 = *( int**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const int**)operation.getReturnValue() = impl->getCustomerInfoEInt(p0, p1); - } - else - { - const int** ret = new const int*; - *ret = impl->getCustomerInfoEInt(p0, p1); - operation.setReturnValue((const const int**)ret); - } - return; - } - if (operationName == "getCustomerInfoFInt") - { - char* p0 = *( char**)operation.getParameterValue(0); - int* p1 = *( int**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const int**)operation.getReturnValue() = impl->getCustomerInfoFInt(p0, p1); - } - else - { - const int** ret = new const int*; - *ret = impl->getCustomerInfoFInt(p0, p1); - operation.setReturnValue((const const int**)ret); - } - return; - } - if (operationName == "getCustomerInfoGInt") - { - char* p0 = *( char**)operation.getParameterValue(0); - signed int* p1 = *( signed int**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const int**)operation.getReturnValue() = impl->getCustomerInfoGInt(p0, p1); - } - else - { - const int** ret = new const int*; - *ret = impl->getCustomerInfoGInt(p0, p1); - operation.setReturnValue((const const int**)ret); - } - return; - } - if (operationName == "getCustomerInfoHInt") - { - char* p0 = *( char**)operation.getParameterValue(0); - unsigned int* p1 = *( unsigned int**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const int**)operation.getReturnValue() = impl->getCustomerInfoHInt(p0, p1); - } - else - { - const int** ret = new const int*; - *ret = impl->getCustomerInfoHInt(p0, p1); - operation.setReturnValue((const const int**)ret); - } - return; - } - if (operationName == "getCustomerInformationint64") - { - Diamond& p0 = *(Diamond*)operation.getParameterValue(0); - const __int64* p1 = *(const __int64**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const __int64**)operation.getReturnValue() = impl->getCustomerInformationint64(p0, p1); - } - else - { - const __int64** ret = new const __int64*; - *ret = impl->getCustomerInformationint64(p0, p1); - operation.setReturnValue((const const __int64**)ret); - } - return; - } - if (operationName == "getCustomerInfoAint64") - { - Diamond& p0 = *(Diamond*)operation.getParameterValue(0); - const __int64* p1 = *(const __int64**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoAint64(p0, p1); - } - else - { - const __int64** ret = new const __int64*; - *ret = impl->getCustomerInfoAint64(p0, p1); - operation.setReturnValue((const const __int64**)ret); - } - return; - } - if (operationName == "getCustomerInfoBint64") - { - Diamond& p0 = *(Diamond*)operation.getParameterValue(0); - __int64* p1 = *( __int64**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoBint64(p0, p1); - } - else - { - const __int64** ret = new const __int64*; - *ret = impl->getCustomerInfoBint64(p0, p1); - operation.setReturnValue((const const __int64**)ret); - } - return; - } - if (operationName == "getCustomerInfoCint64") - { - Diamond& p0 = *(Diamond*)operation.getParameterValue(0); - __int64& p1 = *( __int64*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoCint64(p0, p1); - } - else - { - const __int64** ret = new const __int64*; - *ret = impl->getCustomerInfoCint64(p0, p1); - operation.setReturnValue((const const __int64**)ret); - } - return; - } - if (operationName == "getCustomerInfoDint64") - { - Diamond& p0 = *(Diamond*)operation.getParameterValue(0); - __int64& p1 = *( __int64*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoDint64(p0, p1); - } - else - { - const __int64** ret = new const __int64*; - *ret = impl->getCustomerInfoDint64(p0, p1); - operation.setReturnValue((const const __int64**)ret); - } - return; - } - if (operationName == "getCustomerInfoEint64") - { - Diamond& p0 = *(Diamond*)operation.getParameterValue(0); - __int64* p1 = *( __int64**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoEint64(p0, p1); - } - else - { - const __int64** ret = new const __int64*; - *ret = impl->getCustomerInfoEint64(p0, p1); - operation.setReturnValue((const const __int64**)ret); - } - return; - } - if (operationName == "getCustomerInfoFint64") - { - Diamond& p0 = *(Diamond*)operation.getParameterValue(0); - __int64* p1 = *( __int64**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoFint64(p0, p1); - } - else - { - const __int64** ret = new const __int64*; - *ret = impl->getCustomerInfoFint64(p0, p1); - operation.setReturnValue((const const __int64**)ret); - } - return; - } - if (operationName == "getCustomerInfoGint64") - { - Diamond& p0 = *(Diamond*)operation.getParameterValue(0); - signed __int64* p1 = *( signed __int64**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoGint64(p0, p1); - } - else - { - const __int64** ret = new const __int64*; - *ret = impl->getCustomerInfoGint64(p0, p1); - operation.setReturnValue((const const __int64**)ret); - } - return; - } - if (operationName == "getCustomerInfoHint64") - { - Diamond& p0 = *(Diamond*)operation.getParameterValue(0); - unsigned int64* p1 = *( unsigned int64**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoHint64(p0, p1); - } - else - { - const __int64** ret = new const __int64*; - *ret = impl->getCustomerInfoHint64(p0, p1); - operation.setReturnValue((const const __int64**)ret); - } - return; - } - if (operationName == "getCustomerInformationVoid") - { - float& p0 = *(float*)operation.getParameterValue(0); - const __int64* p1 = *(const __int64**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const void**)operation.getReturnValue() = impl->getCustomerInformationVoid(p0, p1); - } - else - { - const void** ret = new const void*; - *ret = impl->getCustomerInformationVoid(p0, p1); - operation.setReturnValue((const const void**)ret); - } - return; - } - if (operationName == "getCustomerInfoAVoid") - { - float& p0 = *(float*)operation.getParameterValue(0); - const __int64* p1 = *(const __int64**)operation.getParameterValue(1); - impl->getCustomerInfoAVoid(p0, p1); - return; - } - if (operationName == "getCustomerInfoBVoid") - { - impl->getCustomerInfoBVoid(); - return; - } - if (operationName == "getCustomerInfoCVoid") - { - impl->getCustomerInfoCVoid(); - return; - } - if (operationName == "getCustomerInfoDVoid") - { - impl->getCustomerInfoDVoid(); - return; - } - if (operationName == "getCustomerInfoEVoid") - { - - if(operation.getReturnValue() != NULL) - { - *(char*)operation.getReturnValue() = impl->getCustomerInfoEVoid(); - } - else - { - char* ret = new char; - *ret = impl->getCustomerInfoEVoid(); - operation.setReturnValue((const char*)ret); - } - return; - } - if (operationName == "getCustomerInfoFVoid") - { - - if(operation.getReturnValue() != NULL) - { - *(char*)operation.getReturnValue() = impl->getCustomerInfoFVoid(); - } - else - { - char* ret = new char; - *ret = impl->getCustomerInfoFVoid(); - operation.setReturnValue((const char*)ret); - } - return; - } - if (operationName == "getCustomerInfoGVoid") - { - - if(operation.getReturnValue() != NULL) - { - *(char*)operation.getReturnValue() = impl->getCustomerInfoGVoid(); - } - else - { - char* ret = new char; - *ret = impl->getCustomerInfoGVoid(); - operation.setReturnValue((const char*)ret); - } - return; - } - if (operationName == "getCustomerInfoAInline") - { - int& p0 = *( int*)operation.getParameterValue(0); - int& p1 = *( int*)operation.getParameterValue(1); - int& p2 = *( int*)operation.getParameterValue(2); - int& p3 = *( int*)operation.getParameterValue(3); - char* customer p4 = *( char* customer*)operation.getParameterValue(4); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoAInline(p0, p1, p2, p3, p4); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoAInline(p0, p1, p2, p3, p4); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoBInline") - { - int* p0 = *( int**)operation.getParameterValue(0); - int* p1 = *( int**)operation.getParameterValue(1); - int* p2 = *( int**)operation.getParameterValue(2); - char* customer p3 = *( char* customer*)operation.getParameterValue(3); - - if(operation.getReturnValue() != NULL) - { - *(int*)operation.getReturnValue() = impl->getCustomerInfoBInline(p0, p1, p2, p3); - } - else - { - int* ret = new int; - *ret = impl->getCustomerInfoBInline(p0, p1, p2, p3); - operation.setReturnValue((const int*)ret); - } - return; - } - if (operationName == "getCustomerInfoCInline") - { - char* customer p0 = *( char* customer*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(friend const unsigned int**)operation.getReturnValue() = impl->getCustomerInfoCInline(p0); - } - else - { - friend const unsigned int** ret = new friend const unsigned int*; - *ret = impl->getCustomerInfoCInline(p0); - operation.setReturnValue((const friend const unsigned int**)ret); - } - return; - } - if (operationName == "getCustomerInfoTrickyA") - { - const char& p0 = *(const char*)operation.getParameterValue(0); - const char& p1 = *(const char*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(int*)operation.getReturnValue() = impl->getCustomerInfoTrickyA(p0, p1); - } - else - { - int* ret = new int; - *ret = impl->getCustomerInfoTrickyA(p0, p1); - operation.setReturnValue((const int*)ret); - } - return; - } - if (operationName == "getCustomerInfoTrickyB") - { - int& p0 = *( int*)operation.getParameterValue(0); - int& p1 = *( int*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(int*)operation.getReturnValue() = impl->getCustomerInfoTrickyB(p0, p1); - } - else - { - int* ret = new int; - *ret = impl->getCustomerInfoTrickyB(p0, p1); - operation.setReturnValue((const int*)ret); - } - return; - } - - - throw osoa::sca::ServiceRuntimeException("Invalid operation"); - -} - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h deleted file mode 100644 index 94b1d5cb4d..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h +++ /dev/null @@ -1,43 +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. - */ - -#ifndef CustomerInfoImpl_CustomerInfoService_Wrapper_h -#define CustomerInfoImpl_CustomerInfoService_Wrapper_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "CustomerInfoImpl.h" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -class CustomerInfoImpl_CustomerInfoService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper -{ -public: - CustomerInfoImpl_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target); - virtual ~CustomerInfoImpl_CustomerInfoService_Wrapper(); - virtual void invokeService(tuscany::sca::Operation& operation); - virtual void* newImplementation(); - virtual void deleteImplementation(); -private: - CustomerInfoImpl* impl; -}; - -#endif // CustomerInfoImpl_CustomerInfoService_Wrapper_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp deleted file mode 100644 index f3b2540ba8..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp +++ /dev/null @@ -1,504 +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. - */ - -#include "CustomerInfoImpl_CustomerInfoService_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CustomerInfoImpl_CustomerInfoService_Proxy* CustomerInfoImpl_CustomerInfoService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new CustomerInfoImpl_CustomerInfoService_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void CustomerInfoImpl_CustomerInfoService_Proxy_Destructor(void* proxy) - { - delete (CustomerInfoImpl_CustomerInfoService_Proxy*)proxy; - } -} - -CustomerInfoImpl_CustomerInfoService_Proxy::CustomerInfoImpl_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -CustomerInfoImpl_CustomerInfoService_Proxy::~CustomerInfoImpl_CustomerInfoService_Proxy() -{ - if (target) - delete target; -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationChar(const char* arg0) -{ - tuscany::sca::Operation operation("getCustomerInformationChar"); - operation.addParameter(&arg0); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAChar(const char* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoAChar"); - operation.addParameter(&arg0); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBChar( char* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoBChar"); - operation.addParameter(&arg0); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCChar( char arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoCChar"); - operation.addParameter(&arg0); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDChar( char arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoDChar"); - operation.addParameter(&arg0); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoEChar( char* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoEChar"); - operation.addParameter(&arg0); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoFChar( char* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoFChar"); - operation.addParameter(&arg0); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoGChar( signed char* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoGChar"); - operation.addParameter(&arg0); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoHChar( unsigned char* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoHChar"); - operation.addParameter(&arg0); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationLong(const long* arg0) -{ - tuscany::sca::Operation operation("getCustomerInformationLong"); - operation.addParameter(&arg0); - const long* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const long**)operation.getReturnValue(); -} - -const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoALong(const long* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoALong"); - operation.addParameter(&arg0); - const long* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const long**)operation.getReturnValue(); -} - -const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBLong( long* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoBLong"); - operation.addParameter(&arg0); - const long* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const long**)operation.getReturnValue(); -} - -const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCLong( long arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoCLong"); - operation.addParameter(&arg0); - const long* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const long**)operation.getReturnValue(); -} - -const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDLong( long arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoDLong"); - operation.addParameter(&arg0); - const long* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const long**)operation.getReturnValue(); -} - -const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoELong( long* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoELong"); - operation.addParameter(&arg0); - const long* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const long**)operation.getReturnValue(); -} - -const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoFLong( long* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoFLong"); - operation.addParameter(&arg0); - const long* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const long**)operation.getReturnValue(); -} - -const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoGLong( signed long* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoGLong"); - operation.addParameter(&arg0); - const long* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const long**)operation.getReturnValue(); -} - -const long* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoHLong( unsigned long* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoHLong"); - operation.addParameter(&arg0); - const long* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const long**)operation.getReturnValue(); -} - -const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationInt(const int* arg0) -{ - tuscany::sca::Operation operation("getCustomerInformationInt"); - operation.addParameter(&arg0); - const int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const int**)operation.getReturnValue(); -} - -const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAInt(const int* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoAInt"); - operation.addParameter(&arg0); - const int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const int**)operation.getReturnValue(); -} - -const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBInt( int* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoBInt"); - operation.addParameter(&arg0); - const int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const int**)operation.getReturnValue(); -} - -const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCInt( int arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoCInt"); - operation.addParameter(&arg0); - const int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const int**)operation.getReturnValue(); -} - -const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDInt( int arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoDInt"); - operation.addParameter(&arg0); - const int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const int**)operation.getReturnValue(); -} - -const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoEInt( int* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoEInt"); - operation.addParameter(&arg0); - const int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const int**)operation.getReturnValue(); -} - -const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoFInt( int* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoFInt"); - operation.addParameter(&arg0); - const int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const int**)operation.getReturnValue(); -} - -const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoGInt( signed int* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoGInt"); - operation.addParameter(&arg0); - const int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const int**)operation.getReturnValue(); -} - -const int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoHInt( unsigned int* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoHInt"); - operation.addParameter(&arg0); - const int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const int**)operation.getReturnValue(); -} - -const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationint64(const __int64* arg0) -{ - tuscany::sca::Operation operation("getCustomerInformationint64"); - operation.addParameter(&arg0); - const __int64* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const __int64**)operation.getReturnValue(); -} - -const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAint64(const __int64* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoAint64"); - operation.addParameter(&arg0); - const __int64* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const __int64**)operation.getReturnValue(); -} - -const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBint64( __int64* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoBint64"); - operation.addParameter(&arg0); - const __int64* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const __int64**)operation.getReturnValue(); -} - -const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCint64( __int64 arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoCint64"); - operation.addParameter(&arg0); - const __int64* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const __int64**)operation.getReturnValue(); -} - -const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDint64( __int64 arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoDint64"); - operation.addParameter(&arg0); - const __int64* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const __int64**)operation.getReturnValue(); -} - -const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoEint64( __int64* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoEint64"); - operation.addParameter(&arg0); - const __int64* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const __int64**)operation.getReturnValue(); -} - -const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoFint64( __int64* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoFint64"); - operation.addParameter(&arg0); - const __int64* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const __int64**)operation.getReturnValue(); -} - -const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoGint64( signed __int64* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoGint64"); - operation.addParameter(&arg0); - const __int64* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const __int64**)operation.getReturnValue(); -} - -const __int64* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoHint64( unsigned int64* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoHint64"); - operation.addParameter(&arg0); - const __int64* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const __int64**)operation.getReturnValue(); -} - -const void* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationVoid(const __int64* arg0) -{ - tuscany::sca::Operation operation("getCustomerInformationVoid"); - operation.addParameter(&arg0); - const void* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const void**)operation.getReturnValue(); -} - -void CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAVoid(const __int64* arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoAVoid"); - operation.addParameter(&arg0); - target->invoke(operation); - return; -} - -void CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBVoid() -{ - tuscany::sca::Operation operation("getCustomerInfoBVoid"); - target->invoke(operation); - return; -} - -void CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCVoid() -{ - tuscany::sca::Operation operation("getCustomerInfoCVoid"); - target->invoke(operation); - return; -} - -void CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoDVoid() -{ - tuscany::sca::Operation operation("getCustomerInfoDVoid"); - operation.addParameter(&arg0); - target->invoke(operation); - return; -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoAInline( char* customer arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoAInline"); - operation.addParameter(&arg0); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -int CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBInline( char* customer arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoBInline"); - operation.addParameter(&arg0); - int ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(int*)operation.getReturnValue(); -} - -friend const unsigned int* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoCInline( char* customer arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoCInline"); - operation.addParameter(&arg0); - friend const unsigned int* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(friend const unsigned int**)operation.getReturnValue(); -} - -int CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoTrickyA(const char arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoTrickyA"); - operation.addParameter(&arg0); - int ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(int*)operation.getReturnValue(); -} - -int CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoTrickyB( int arg0) -{ - tuscany::sca::Operation operation("getCustomerInfoTrickyB"); - operation.addParameter(&arg0); - int ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(int*)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h deleted file mode 100644 index 75f912d3ae..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.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. - */ - -#ifndef CustomerInfoImpl_CustomerInfoService_Proxy_h -#define CustomerInfoImpl_CustomerInfoService_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "/CustomerInfo.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class CustomerInfoImpl_CustomerInfoService_Proxy : public CustomerInfo -{ -public: - CustomerInfoImpl_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~CustomerInfoImpl_CustomerInfoService_Proxy(); - virtual const char* getCustomerInformationChar(const char* customerID); - virtual const char* getCustomerInfoAChar(const char* ); - virtual const char* getCustomerInfoBChar( char* customerID); - virtual const char* getCustomerInfoCChar( char customerID); - virtual const char* getCustomerInfoDChar( char ); - virtual const char* getCustomerInfoEChar( char* ); - virtual const char* getCustomerInfoFChar( char* customerID); - virtual const char* getCustomerInfoGChar( signed char* customerID); - virtual const char* getCustomerInfoHChar( unsigned char* customerID); - virtual const long* getCustomerInformationLong(const long* customerID); - virtual const long* getCustomerInfoALong(const long* ); - virtual const long* getCustomerInfoBLong( long* customerID); - virtual const long* getCustomerInfoCLong( long customerID); - virtual const long* getCustomerInfoDLong( long ); - virtual const long* getCustomerInfoELong( long* ); - virtual const long* getCustomerInfoFLong( long* customerID); - virtual const long* getCustomerInfoGLong( signed long* customerID); - virtual const long* getCustomerInfoHLong( unsigned long* customerID); - virtual const int* getCustomerInformationInt(const int* customerID); - virtual const int* getCustomerInfoAInt(const int* ); - virtual const int* getCustomerInfoBInt( int* customerID); - virtual const int* getCustomerInfoCInt( int customerID); - virtual const int* getCustomerInfoDInt( int ); - virtual const int* getCustomerInfoEInt( int* ); - virtual const int* getCustomerInfoFInt( int* customerID); - virtual const int* getCustomerInfoGInt( signed int* customerID); - virtual const int* getCustomerInfoHInt( unsigned int* customerID); - virtual const __int64* getCustomerInformationint64(const __int64* customerID); - virtual const __int64* getCustomerInfoAint64(const __int64* ); - virtual const __int64* getCustomerInfoBint64( __int64* customerID); - virtual const __int64* getCustomerInfoCint64( __int64 customerID); - virtual const __int64* getCustomerInfoDint64( __int64 ); - virtual const __int64* getCustomerInfoEint64( __int64* ); - virtual const __int64* getCustomerInfoFint64( __int64* customerID); - virtual const __int64* getCustomerInfoGint64( signed __int64* customerID); - virtual const __int64* getCustomerInfoHint64( unsigned int64* customerID); - virtual const void* getCustomerInformationVoid(const __int64* customerID); - virtual void getCustomerInfoAVoid(const __int64* ); - virtual void getCustomerInfoBVoid(); - virtual void getCustomerInfoCVoid(); - virtual void getCustomerInfoDVoid( void ); - virtual const char* getCustomerInfoAInline( char* customer id); - virtual int getCustomerInfoBInline( char* customer id); - virtual friend const unsigned int* getCustomerInfoCInline( char* customer id); - virtual int getCustomerInfoTrickyA(const char ); - virtual int getCustomerInfoTrickyB( int myInt); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // CustomerInfoImpl_CustomerInfoService_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp deleted file mode 100644 index 896a129145..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp +++ /dev/null @@ -1,760 +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. - */ - -#include "CustomerInfoImpl_CustomerInfoService_Wrapper.h" - -#include "osoa/sca/sca.h" - - - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CustomerInfoImpl_CustomerInfoService_Wrapper* CustomerInfoImpl_CustomerInfoService_Wrapper_Factory(tuscany::sca::model::Service* target) - { - return new CustomerInfoImpl_CustomerInfoService_Wrapper(target); - } -} - -CustomerInfoImpl_CustomerInfoService_Wrapper::CustomerInfoImpl_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) -{ - impl = (CustomerInfoImpl*)getImplementation(); -} - -CustomerInfoImpl_CustomerInfoService_Wrapper::~CustomerInfoImpl_CustomerInfoService_Wrapper() -{ - releaseImplementation(); -} - -void* CustomerInfoImpl_CustomerInfoService_Wrapper::newImplementation() -{ - return new CustomerInfoImpl; -} - -void CustomerInfoImpl_CustomerInfoService_Wrapper::deleteImplementation() -{ - delete impl; -} - -void CustomerInfoImpl_CustomerInfoService_Wrapper::invokeService(tuscany::sca::Operation& operation) -{ - const std::string& operationName = operation.getName(); - - if (operationName == "getCustomerInformationChar") - { - const char* p0 = *(const char**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInformationChar(p0); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInformationChar(p0); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoAChar") - { - const char* p0 = *(const char**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoAChar(p0); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoAChar(p0); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoBChar") - { - char* p0 = *( char**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoBChar(p0); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoBChar(p0); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoCChar") - { - char& p0 = *( char*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoCChar(p0); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoCChar(p0); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoDChar") - { - char& p0 = *( char*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoDChar(p0); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoDChar(p0); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoEChar") - { - char* p0 = *( char**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoEChar(p0); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoEChar(p0); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoFChar") - { - char* p0 = *( char**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoFChar(p0); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoFChar(p0); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoGChar") - { - signed char* p0 = *( signed char**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoGChar(p0); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoGChar(p0); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoHChar") - { - unsigned char* p0 = *( unsigned char**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoHChar(p0); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoHChar(p0); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInformationLong") - { - const long* p0 = *(const long**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const long**)operation.getReturnValue() = impl->getCustomerInformationLong(p0); - } - else - { - const long** ret = new const long*; - *ret = impl->getCustomerInformationLong(p0); - operation.setReturnValue((const const long**)ret); - } - return; - } - if (operationName == "getCustomerInfoALong") - { - const long* p0 = *(const long**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const long**)operation.getReturnValue() = impl->getCustomerInfoALong(p0); - } - else - { - const long** ret = new const long*; - *ret = impl->getCustomerInfoALong(p0); - operation.setReturnValue((const const long**)ret); - } - return; - } - if (operationName == "getCustomerInfoBLong") - { - long* p0 = *( long**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const long**)operation.getReturnValue() = impl->getCustomerInfoBLong(p0); - } - else - { - const long** ret = new const long*; - *ret = impl->getCustomerInfoBLong(p0); - operation.setReturnValue((const const long**)ret); - } - return; - } - if (operationName == "getCustomerInfoCLong") - { - long& p0 = *( long*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const long**)operation.getReturnValue() = impl->getCustomerInfoCLong(p0); - } - else - { - const long** ret = new const long*; - *ret = impl->getCustomerInfoCLong(p0); - operation.setReturnValue((const const long**)ret); - } - return; - } - if (operationName == "getCustomerInfoDLong") - { - long& p0 = *( long*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const long**)operation.getReturnValue() = impl->getCustomerInfoDLong(p0); - } - else - { - const long** ret = new const long*; - *ret = impl->getCustomerInfoDLong(p0); - operation.setReturnValue((const const long**)ret); - } - return; - } - if (operationName == "getCustomerInfoELong") - { - long* p0 = *( long**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const long**)operation.getReturnValue() = impl->getCustomerInfoELong(p0); - } - else - { - const long** ret = new const long*; - *ret = impl->getCustomerInfoELong(p0); - operation.setReturnValue((const const long**)ret); - } - return; - } - if (operationName == "getCustomerInfoFLong") - { - long* p0 = *( long**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const long**)operation.getReturnValue() = impl->getCustomerInfoFLong(p0); - } - else - { - const long** ret = new const long*; - *ret = impl->getCustomerInfoFLong(p0); - operation.setReturnValue((const const long**)ret); - } - return; - } - if (operationName == "getCustomerInfoGLong") - { - signed long* p0 = *( signed long**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const long**)operation.getReturnValue() = impl->getCustomerInfoGLong(p0); - } - else - { - const long** ret = new const long*; - *ret = impl->getCustomerInfoGLong(p0); - operation.setReturnValue((const const long**)ret); - } - return; - } - if (operationName == "getCustomerInfoHLong") - { - unsigned long* p0 = *( unsigned long**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const long**)operation.getReturnValue() = impl->getCustomerInfoHLong(p0); - } - else - { - const long** ret = new const long*; - *ret = impl->getCustomerInfoHLong(p0); - operation.setReturnValue((const const long**)ret); - } - return; - } - if (operationName == "getCustomerInformationInt") - { - const int* p0 = *(const int**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const int**)operation.getReturnValue() = impl->getCustomerInformationInt(p0); - } - else - { - const int** ret = new const int*; - *ret = impl->getCustomerInformationInt(p0); - operation.setReturnValue((const const int**)ret); - } - return; - } - if (operationName == "getCustomerInfoAInt") - { - const int* p0 = *(const int**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const int**)operation.getReturnValue() = impl->getCustomerInfoAInt(p0); - } - else - { - const int** ret = new const int*; - *ret = impl->getCustomerInfoAInt(p0); - operation.setReturnValue((const const int**)ret); - } - return; - } - if (operationName == "getCustomerInfoBInt") - { - int* p0 = *( int**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const int**)operation.getReturnValue() = impl->getCustomerInfoBInt(p0); - } - else - { - const int** ret = new const int*; - *ret = impl->getCustomerInfoBInt(p0); - operation.setReturnValue((const const int**)ret); - } - return; - } - if (operationName == "getCustomerInfoCInt") - { - int& p0 = *( int*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const int**)operation.getReturnValue() = impl->getCustomerInfoCInt(p0); - } - else - { - const int** ret = new const int*; - *ret = impl->getCustomerInfoCInt(p0); - operation.setReturnValue((const const int**)ret); - } - return; - } - if (operationName == "getCustomerInfoDInt") - { - int& p0 = *( int*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const int**)operation.getReturnValue() = impl->getCustomerInfoDInt(p0); - } - else - { - const int** ret = new const int*; - *ret = impl->getCustomerInfoDInt(p0); - operation.setReturnValue((const const int**)ret); - } - return; - } - if (operationName == "getCustomerInfoEInt") - { - int* p0 = *( int**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const int**)operation.getReturnValue() = impl->getCustomerInfoEInt(p0); - } - else - { - const int** ret = new const int*; - *ret = impl->getCustomerInfoEInt(p0); - operation.setReturnValue((const const int**)ret); - } - return; - } - if (operationName == "getCustomerInfoFInt") - { - int* p0 = *( int**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const int**)operation.getReturnValue() = impl->getCustomerInfoFInt(p0); - } - else - { - const int** ret = new const int*; - *ret = impl->getCustomerInfoFInt(p0); - operation.setReturnValue((const const int**)ret); - } - return; - } - if (operationName == "getCustomerInfoGInt") - { - signed int* p0 = *( signed int**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const int**)operation.getReturnValue() = impl->getCustomerInfoGInt(p0); - } - else - { - const int** ret = new const int*; - *ret = impl->getCustomerInfoGInt(p0); - operation.setReturnValue((const const int**)ret); - } - return; - } - if (operationName == "getCustomerInfoHInt") - { - unsigned int* p0 = *( unsigned int**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const int**)operation.getReturnValue() = impl->getCustomerInfoHInt(p0); - } - else - { - const int** ret = new const int*; - *ret = impl->getCustomerInfoHInt(p0); - operation.setReturnValue((const const int**)ret); - } - return; - } - if (operationName == "getCustomerInformationint64") - { - const __int64* p0 = *(const __int64**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const __int64**)operation.getReturnValue() = impl->getCustomerInformationint64(p0); - } - else - { - const __int64** ret = new const __int64*; - *ret = impl->getCustomerInformationint64(p0); - operation.setReturnValue((const const __int64**)ret); - } - return; - } - if (operationName == "getCustomerInfoAint64") - { - const __int64* p0 = *(const __int64**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoAint64(p0); - } - else - { - const __int64** ret = new const __int64*; - *ret = impl->getCustomerInfoAint64(p0); - operation.setReturnValue((const const __int64**)ret); - } - return; - } - if (operationName == "getCustomerInfoBint64") - { - __int64* p0 = *( __int64**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoBint64(p0); - } - else - { - const __int64** ret = new const __int64*; - *ret = impl->getCustomerInfoBint64(p0); - operation.setReturnValue((const const __int64**)ret); - } - return; - } - if (operationName == "getCustomerInfoCint64") - { - __int64& p0 = *( __int64*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoCint64(p0); - } - else - { - const __int64** ret = new const __int64*; - *ret = impl->getCustomerInfoCint64(p0); - operation.setReturnValue((const const __int64**)ret); - } - return; - } - if (operationName == "getCustomerInfoDint64") - { - __int64& p0 = *( __int64*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoDint64(p0); - } - else - { - const __int64** ret = new const __int64*; - *ret = impl->getCustomerInfoDint64(p0); - operation.setReturnValue((const const __int64**)ret); - } - return; - } - if (operationName == "getCustomerInfoEint64") - { - __int64* p0 = *( __int64**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoEint64(p0); - } - else - { - const __int64** ret = new const __int64*; - *ret = impl->getCustomerInfoEint64(p0); - operation.setReturnValue((const const __int64**)ret); - } - return; - } - if (operationName == "getCustomerInfoFint64") - { - __int64* p0 = *( __int64**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoFint64(p0); - } - else - { - const __int64** ret = new const __int64*; - *ret = impl->getCustomerInfoFint64(p0); - operation.setReturnValue((const const __int64**)ret); - } - return; - } - if (operationName == "getCustomerInfoGint64") - { - signed __int64* p0 = *( signed __int64**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoGint64(p0); - } - else - { - const __int64** ret = new const __int64*; - *ret = impl->getCustomerInfoGint64(p0); - operation.setReturnValue((const const __int64**)ret); - } - return; - } - if (operationName == "getCustomerInfoHint64") - { - unsigned int64* p0 = *( unsigned int64**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const __int64**)operation.getReturnValue() = impl->getCustomerInfoHint64(p0); - } - else - { - const __int64** ret = new const __int64*; - *ret = impl->getCustomerInfoHint64(p0); - operation.setReturnValue((const const __int64**)ret); - } - return; - } - if (operationName == "getCustomerInformationVoid") - { - const __int64* p0 = *(const __int64**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const void**)operation.getReturnValue() = impl->getCustomerInformationVoid(p0); - } - else - { - const void** ret = new const void*; - *ret = impl->getCustomerInformationVoid(p0); - operation.setReturnValue((const const void**)ret); - } - return; - } - if (operationName == "getCustomerInfoAVoid") - { - const __int64* p0 = *(const __int64**)operation.getParameterValue(0); - impl->getCustomerInfoAVoid(p0); - return; - } - if (operationName == "getCustomerInfoBVoid") - { - impl->getCustomerInfoBVoid(); - return; - } - if (operationName == "getCustomerInfoCVoid") - { - impl->getCustomerInfoCVoid(); - return; - } - if (operationName == "getCustomerInfoDVoid") - { - impl->getCustomerInfoDVoid(); - return; - } - if (operationName == "getCustomerInfoAInline") - { - char* customer p0 = *( char* customer*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoAInline(p0); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoAInline(p0); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoBInline") - { - char* customer p0 = *( char* customer*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(int*)operation.getReturnValue() = impl->getCustomerInfoBInline(p0); - } - else - { - int* ret = new int; - *ret = impl->getCustomerInfoBInline(p0); - operation.setReturnValue((const int*)ret); - } - return; - } - if (operationName == "getCustomerInfoCInline") - { - char* customer p0 = *( char* customer*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(friend const unsigned int**)operation.getReturnValue() = impl->getCustomerInfoCInline(p0); - } - else - { - friend const unsigned int** ret = new friend const unsigned int*; - *ret = impl->getCustomerInfoCInline(p0); - operation.setReturnValue((const friend const unsigned int**)ret); - } - return; - } - if (operationName == "getCustomerInfoTrickyA") - { - const char& p0 = *(const char*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(int*)operation.getReturnValue() = impl->getCustomerInfoTrickyA(p0); - } - else - { - int* ret = new int; - *ret = impl->getCustomerInfoTrickyA(p0); - operation.setReturnValue((const int*)ret); - } - return; - } - if (operationName == "getCustomerInfoTrickyB") - { - int& p0 = *( int*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(int*)operation.getReturnValue() = impl->getCustomerInfoTrickyB(p0); - } - else - { - int* ret = new int; - *ret = impl->getCustomerInfoTrickyB(p0); - operation.setReturnValue((const int*)ret); - } - return; - } - - - throw osoa::sca::ServiceRuntimeException("Invalid operation"); - -} - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h deleted file mode 100644 index 94b1d5cb4d..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h +++ /dev/null @@ -1,43 +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. - */ - -#ifndef CustomerInfoImpl_CustomerInfoService_Wrapper_h -#define CustomerInfoImpl_CustomerInfoService_Wrapper_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "CustomerInfoImpl.h" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -class CustomerInfoImpl_CustomerInfoService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper -{ -public: - CustomerInfoImpl_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target); - virtual ~CustomerInfoImpl_CustomerInfoService_Wrapper(); - virtual void invokeService(tuscany::sca::Operation& operation); - virtual void* newImplementation(); - virtual void deleteImplementation(); -private: - CustomerInfoImpl* impl; -}; - -#endif // CustomerInfoImpl_CustomerInfoService_Wrapper_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.cpp deleted file mode 100644 index 6f2c95f45b..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.cpp +++ /dev/null @@ -1,64 +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. - */ - -#include "CustomerInfoImpl2_CustomerInfoService_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CustomerInfoImpl2_CustomerInfoService_Proxy* CustomerInfoImpl2_CustomerInfoService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new CustomerInfoImpl2_CustomerInfoService_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void CustomerInfoImpl2_CustomerInfoService_Proxy_Destructor(void* proxy) - { - delete (CustomerInfoImpl2_CustomerInfoService_Proxy*)proxy; - } -} - -CustomerInfoImpl2_CustomerInfoService_Proxy::CustomerInfoImpl2_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -CustomerInfoImpl2_CustomerInfoService_Proxy::~CustomerInfoImpl2_CustomerInfoService_Proxy() -{ - if (target) - delete target; -} - -const char* CustomerInfoImpl2_CustomerInfoService_Proxy::getCustomerInformation(const char* arg0) -{ - tuscany::sca::Operation operation("getCustomerInformation"); - operation.addParameter("customerID", &arg0); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.h deleted file mode 100644 index 594f404d13..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.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. - */ - -#ifndef CustomerInfoImpl2_CustomerInfoService_Proxy_h -#define CustomerInfoImpl2_CustomerInfoService_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "/CustomerInfo.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class CustomerInfoImpl2_CustomerInfoService_Proxy : public CustomerInfo -{ -public: - CustomerInfoImpl2_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~CustomerInfoImpl2_CustomerInfoService_Proxy(); - virtual const char* getCustomerInformation(const char* customerID); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // CustomerInfoImpl2_CustomerInfoService_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.cpp deleted file mode 100644 index 57add811a2..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.cpp +++ /dev/null @@ -1,83 +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. - */ - -#include "CustomerInfoImpl2_CustomerInfoService_Wrapper.h" - -#include "osoa/sca/sca.h" - - - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CustomerInfoImpl2_CustomerInfoService_Wrapper* CustomerInfoImpl2_CustomerInfoService_Wrapper_Factory(tuscany::sca::model::Service* target) - { - return new CustomerInfoImpl2_CustomerInfoService_Wrapper(target); - } -} - -CustomerInfoImpl2_CustomerInfoService_Wrapper::CustomerInfoImpl2_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) -{ - impl = (CustomerInfoImpl2*)getImplementation(); -} - -CustomerInfoImpl2_CustomerInfoService_Wrapper::~CustomerInfoImpl2_CustomerInfoService_Wrapper() -{ - releaseImplementation(); -} - -void* CustomerInfoImpl2_CustomerInfoService_Wrapper::newImplementation() -{ - return new CustomerInfoImpl2; -} - -void CustomerInfoImpl2_CustomerInfoService_Wrapper::deleteImplementation() -{ - delete impl; -} - -void CustomerInfoImpl2_CustomerInfoService_Wrapper::invokeService(tuscany::sca::Operation& operation) -{ - const std::string& operationName = operation.getName(); - - if (operationName == "getCustomerInformation") - { - const char* p0 = *(const char**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInformation(p0); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInformation(p0); - operation.setReturnValue((const const char**)ret); - } - return; - } - - - throw osoa::sca::ServiceRuntimeException("Invalid operation"); - -} - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.h deleted file mode 100644 index b85533cfd4..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.h +++ /dev/null @@ -1,43 +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. - */ - -#ifndef CustomerInfoImpl2_CustomerInfoService_Wrapper_h -#define CustomerInfoImpl2_CustomerInfoService_Wrapper_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "CustomerInfoImpl.h" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -class CustomerInfoImpl2_CustomerInfoService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper -{ -public: - CustomerInfoImpl2_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target); - virtual ~CustomerInfoImpl2_CustomerInfoService_Wrapper(); - virtual void invokeService(tuscany::sca::Operation& operation); - virtual void* newImplementation(); - virtual void deleteImplementation(); -private: - CustomerInfoImpl2* impl; -}; - -#endif // CustomerInfoImpl2_CustomerInfoService_Wrapper_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Proxy.cpp deleted file mode 100644 index b0d9424ad4..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Proxy.cpp +++ /dev/null @@ -1,92 +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. - */ - -#include "MyValueImpl_MyValueService_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - MyValueImpl_MyValueService_Proxy* MyValueImpl_MyValueService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new MyValueImpl_MyValueService_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void MyValueImpl_MyValueService_Proxy_Destructor(void* proxy) - { - delete (MyValueImpl_MyValueService_Proxy*)proxy; - } -} - -MyValueImpl_MyValueService_Proxy::MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -MyValueImpl_MyValueService_Proxy::~MyValueImpl_MyValueService_Proxy() -{ - if (target) - delete target; -} - -float MyValueImpl_MyValueService_Proxy::getMyValue(const char* arg0) -{ - tuscany::sca::Operation operation("getMyValue"); - operation.addParameter("customerID", &arg0); - float ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(float*)operation.getReturnValue(); -} - -float MyValueImpl_MyValueService_Proxy::getMyValueS(const string& arg0) -{ - tuscany::sca::Operation operation("getMyValueS"); - operation.addParameter("customerID", &arg0); - float ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(float*)operation.getReturnValue(); -} - -string MyValueImpl_MyValueService_Proxy::getCustname( string& arg0) -{ - tuscany::sca::Operation operation("getCustname"); - operation.addParameter("customerID", &arg0); - string ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(string*)operation.getReturnValue(); -} - -const string& MyValueImpl_MyValueService_Proxy::getCustnamecs( string arg0) -{ - tuscany::sca::Operation operation("getCustnamecs"); - operation.addParameter("customerID", &arg0); - target->invoke(operation); - return *(const string*)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Proxy.h deleted file mode 100644 index d61c806e44..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Proxy.h +++ /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. - */ - -#ifndef MyValueImpl_MyValueService_Proxy_h -#define MyValueImpl_MyValueService_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "MyValue.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class MyValueImpl_MyValueService_Proxy : public MyValue -{ -public: - MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~MyValueImpl_MyValueService_Proxy(); - virtual float getMyValue(const char* customerID); - virtual float getMyValueS(const string& customerID); - virtual string getCustname( string& customerID); - virtual const string& getCustnamecs( string customerID); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // MyValueImpl_MyValueService_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Wrapper.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Wrapper.cpp deleted file mode 100644 index 7f38178f9c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Wrapper.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. - */ - -#include "MyValueImpl_MyValueService_Wrapper.h" - -#include "osoa/sca/sca.h" - - - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - MyValueImpl_MyValueService_Wrapper* MyValueImpl_MyValueService_Wrapper_Factory(tuscany::sca::model::Service* target) - { - return new MyValueImpl_MyValueService_Wrapper(target); - } -} - -MyValueImpl_MyValueService_Wrapper::MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) -{ - impl = (MyValueImpl*)getImplementation(); -} - -MyValueImpl_MyValueService_Wrapper::~MyValueImpl_MyValueService_Wrapper() -{ - releaseImplementation(); -} - -void* MyValueImpl_MyValueService_Wrapper::newImplementation() -{ - return new MyValueImpl; -} - -void MyValueImpl_MyValueService_Wrapper::deleteImplementation() -{ - delete impl; -} - -void MyValueImpl_MyValueService_Wrapper::invokeService(tuscany::sca::Operation& operation) -{ - const std::string& operationName = operation.getName(); - - if (operationName == "getMyValue") - { - const char* p0 = *(const char**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(float*)operation.getReturnValue() = impl->getMyValue(p0); - } - else - { - float* ret = new float; - *ret = impl->getMyValue(p0); - operation.setReturnValue((const float*)ret); - } - return; - } - if (operationName == "getMyValueS") - { - string& p0 = *(string*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(float*)operation.getReturnValue() = impl->getMyValueS(p0); - } - else - { - float* ret = new float; - *ret = impl->getMyValueS(p0); - operation.setReturnValue((const float*)ret); - } - return; - } - if (operationName == "getCustname") - { - string& p0 = *(string*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(string*)operation.getReturnValue() = impl->getCustname(p0); - } - else - { - string* ret = new string; - *ret = impl->getCustname(p0); - operation.setReturnValue((const string*)ret); - } - return; - } - if (operationName == "getCustnamecs") - { - string& p0 = *( string*)operation.getParameterValue(0); - const string& ret = impl->getCustnamecs(p0); - operation.setReturnValue(&ret); - return; - } - - - throw osoa::sca::ServiceRuntimeException("Invalid operation"); - -} - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Wrapper.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Wrapper.h deleted file mode 100644 index d3eef80e8f..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Wrapper.h +++ /dev/null @@ -1,43 +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. - */ - -#ifndef MyValueImpl_MyValueService_Wrapper_h -#define MyValueImpl_MyValueService_Wrapper_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "MyValueImpl.hpp" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -class MyValueImpl_MyValueService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper -{ -public: - MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target); - virtual ~MyValueImpl_MyValueService_Wrapper(); - virtual void invokeService(tuscany::sca::Operation& operation); - virtual void* newImplementation(); - virtual void deleteImplementation(); -private: - MyValueImpl* impl; -}; - -#endif // MyValueImpl_MyValueService_Wrapper_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_customerInfo_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_customerInfo_Proxy.cpp deleted file mode 100644 index e6800aa311..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_customerInfo_Proxy.cpp +++ /dev/null @@ -1,64 +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. - */ - -#include "MyValueImpl_customerInfo_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - MyValueImpl_customerInfo_Proxy* MyValueImpl_customerInfo_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new MyValueImpl_customerInfo_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void MyValueImpl_customerInfo_Proxy_Destructor(void* proxy) - { - delete (MyValueImpl_customerInfo_Proxy*)proxy; - } -} - -MyValueImpl_customerInfo_Proxy::MyValueImpl_customerInfo_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -MyValueImpl_customerInfo_Proxy::~MyValueImpl_customerInfo_Proxy() -{ - if (target) - delete target; -} - -const char* MyValueImpl_customerInfo_Proxy::getCustomerInformation(const char* arg0) -{ - tuscany::sca::Operation operation("getCustomerInformation"); - operation.addParameter("customerID", &arg0); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_customerInfo_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_customerInfo_Proxy.h deleted file mode 100644 index 3d1d279b7c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_customerInfo_Proxy.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. - */ - -#ifndef MyValueImpl_customerInfo_Proxy_h -#define MyValueImpl_customerInfo_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "CustomerInfo.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class MyValueImpl_customerInfo_Proxy : public CustomerInfo -{ -public: - MyValueImpl_customerInfo_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~MyValueImpl_customerInfo_Proxy(); - virtual const char* getCustomerInformation(const char* customerID); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // MyValueImpl_customerInfo_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_stockQuote_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_stockQuote_Proxy.cpp deleted file mode 100644 index d3fd4fbaf0..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_stockQuote_Proxy.cpp +++ /dev/null @@ -1,64 +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. - */ - -#include "MyValueImpl_stockQuote_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - MyValueImpl_stockQuote_Proxy* MyValueImpl_stockQuote_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new MyValueImpl_stockQuote_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void MyValueImpl_stockQuote_Proxy_Destructor(void* proxy) - { - delete (MyValueImpl_stockQuote_Proxy*)proxy; - } -} - -MyValueImpl_stockQuote_Proxy::MyValueImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -MyValueImpl_stockQuote_Proxy::~MyValueImpl_stockQuote_Proxy() -{ - if (target) - delete target; -} - -commonj::sdo::DataObjectPtr MyValueImpl_stockQuote_Proxy::GetStockQuotes( commonj::sdo::DataObjectPtr arg0) -{ - tuscany::sca::Operation operation("GetStockQuotes"); - operation.addParameter("request", &arg0); - commonj::sdo::DataObjectPtr ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(commonj::sdo::DataObjectPtr*)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_stockQuote_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_stockQuote_Proxy.h deleted file mode 100644 index ad5cee3ca7..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_stockQuote_Proxy.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. - */ - -#ifndef MyValueImpl_stockQuote_Proxy_h -#define MyValueImpl_stockQuote_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "StockQuoteService.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class MyValueImpl_stockQuote_Proxy : public StockQuoteService -{ -public: - MyValueImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~MyValueImpl_stockQuote_Proxy(); - virtual commonj::sdo::DataObjectPtr GetStockQuotes( commonj::sdo::DataObjectPtr request); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // MyValueImpl_stockQuote_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp deleted file mode 100644 index 95c63da613..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp +++ /dev/null @@ -1,64 +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. - */ - -#include "CustomerInfoImpl_CustomerInfoService_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CustomerInfoImpl_CustomerInfoService_Proxy* CustomerInfoImpl_CustomerInfoService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new CustomerInfoImpl_CustomerInfoService_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void CustomerInfoImpl_CustomerInfoService_Proxy_Destructor(void* proxy) - { - delete (CustomerInfoImpl_CustomerInfoService_Proxy*)proxy; - } -} - -CustomerInfoImpl_CustomerInfoService_Proxy::CustomerInfoImpl_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -CustomerInfoImpl_CustomerInfoService_Proxy::~CustomerInfoImpl_CustomerInfoService_Proxy() -{ - if (target) - delete target; -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformation(const char* arg0) -{ - tuscany::sca::Operation operation("getCustomerInformation"); - operation.addParameter("customerID", &arg0); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h deleted file mode 100644 index 2bf1b90e87..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.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. - */ - -#ifndef CustomerInfoImpl_CustomerInfoService_Proxy_h -#define CustomerInfoImpl_CustomerInfoService_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "/CustomerInfo.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class CustomerInfoImpl_CustomerInfoService_Proxy : public CustomerInfo -{ -public: - CustomerInfoImpl_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~CustomerInfoImpl_CustomerInfoService_Proxy(); - virtual const char* getCustomerInformation(const char* customerID); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // CustomerInfoImpl_CustomerInfoService_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp deleted file mode 100644 index b32cf3863a..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp +++ /dev/null @@ -1,83 +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. - */ - -#include "CustomerInfoImpl_CustomerInfoService_Wrapper.h" - -#include "osoa/sca/sca.h" - -using Other::CustomerInfoImpl; - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CustomerInfoImpl_CustomerInfoService_Wrapper* CustomerInfoImpl_CustomerInfoService_Wrapper_Factory(tuscany::sca::model::Service* target) - { - return new CustomerInfoImpl_CustomerInfoService_Wrapper(target); - } -} - -CustomerInfoImpl_CustomerInfoService_Wrapper::CustomerInfoImpl_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) -{ - impl = (CustomerInfoImpl*)getImplementation(); -} - -CustomerInfoImpl_CustomerInfoService_Wrapper::~CustomerInfoImpl_CustomerInfoService_Wrapper() -{ - releaseImplementation(); -} - -void* CustomerInfoImpl_CustomerInfoService_Wrapper::newImplementation() -{ - return new CustomerInfoImpl; -} - -void CustomerInfoImpl_CustomerInfoService_Wrapper::deleteImplementation() -{ - delete impl; -} - -void CustomerInfoImpl_CustomerInfoService_Wrapper::invokeService(tuscany::sca::Operation& operation) -{ - const std::string& operationName = operation.getName(); - - if (operationName == "getCustomerInformation") - { - const char* p0 = *(const char**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInformation(p0); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInformation(p0); - operation.setReturnValue((const const char**)ret); - } - return; - } - - - throw osoa::sca::ServiceRuntimeException("Invalid operation"); - -} - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h deleted file mode 100644 index 82995c96b0..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h +++ /dev/null @@ -1,43 +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. - */ - -#ifndef CustomerInfoImpl_CustomerInfoService_Wrapper_h -#define CustomerInfoImpl_CustomerInfoService_Wrapper_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "CustomerInfoImpl.h" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -class CustomerInfoImpl_CustomerInfoService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper -{ -public: - CustomerInfoImpl_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target); - virtual ~CustomerInfoImpl_CustomerInfoService_Wrapper(); - virtual void invokeService(tuscany::sca::Operation& operation); - virtual void* newImplementation(); - virtual void deleteImplementation(); -private: - Other::CustomerInfoImpl* impl; -}; - -#endif // CustomerInfoImpl_CustomerInfoService_Wrapper_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.cpp deleted file mode 100644 index b0d9424ad4..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.cpp +++ /dev/null @@ -1,92 +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. - */ - -#include "MyValueImpl_MyValueService_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - MyValueImpl_MyValueService_Proxy* MyValueImpl_MyValueService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new MyValueImpl_MyValueService_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void MyValueImpl_MyValueService_Proxy_Destructor(void* proxy) - { - delete (MyValueImpl_MyValueService_Proxy*)proxy; - } -} - -MyValueImpl_MyValueService_Proxy::MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -MyValueImpl_MyValueService_Proxy::~MyValueImpl_MyValueService_Proxy() -{ - if (target) - delete target; -} - -float MyValueImpl_MyValueService_Proxy::getMyValue(const char* arg0) -{ - tuscany::sca::Operation operation("getMyValue"); - operation.addParameter("customerID", &arg0); - float ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(float*)operation.getReturnValue(); -} - -float MyValueImpl_MyValueService_Proxy::getMyValueS(const string& arg0) -{ - tuscany::sca::Operation operation("getMyValueS"); - operation.addParameter("customerID", &arg0); - float ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(float*)operation.getReturnValue(); -} - -string MyValueImpl_MyValueService_Proxy::getCustname( string& arg0) -{ - tuscany::sca::Operation operation("getCustname"); - operation.addParameter("customerID", &arg0); - string ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(string*)operation.getReturnValue(); -} - -const string& MyValueImpl_MyValueService_Proxy::getCustnamecs( string arg0) -{ - tuscany::sca::Operation operation("getCustnamecs"); - operation.addParameter("customerID", &arg0); - target->invoke(operation); - return *(const string*)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.h deleted file mode 100644 index d61c806e44..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.h +++ /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. - */ - -#ifndef MyValueImpl_MyValueService_Proxy_h -#define MyValueImpl_MyValueService_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "MyValue.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class MyValueImpl_MyValueService_Proxy : public MyValue -{ -public: - MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~MyValueImpl_MyValueService_Proxy(); - virtual float getMyValue(const char* customerID); - virtual float getMyValueS(const string& customerID); - virtual string getCustname( string& customerID); - virtual const string& getCustnamecs( string customerID); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // MyValueImpl_MyValueService_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.cpp deleted file mode 100644 index ac104f9aaf..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.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. - */ - -#include "MyValueImpl_MyValueService_Wrapper.h" - -#include "osoa/sca/sca.h" - -using Other::MyValueImpl; - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - MyValueImpl_MyValueService_Wrapper* MyValueImpl_MyValueService_Wrapper_Factory(tuscany::sca::model::Service* target) - { - return new MyValueImpl_MyValueService_Wrapper(target); - } -} - -MyValueImpl_MyValueService_Wrapper::MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) -{ - impl = (MyValueImpl*)getImplementation(); -} - -MyValueImpl_MyValueService_Wrapper::~MyValueImpl_MyValueService_Wrapper() -{ - releaseImplementation(); -} - -void* MyValueImpl_MyValueService_Wrapper::newImplementation() -{ - return new MyValueImpl; -} - -void MyValueImpl_MyValueService_Wrapper::deleteImplementation() -{ - delete impl; -} - -void MyValueImpl_MyValueService_Wrapper::invokeService(tuscany::sca::Operation& operation) -{ - const std::string& operationName = operation.getName(); - - if (operationName == "getMyValue") - { - const char* p0 = *(const char**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(float*)operation.getReturnValue() = impl->getMyValue(p0); - } - else - { - float* ret = new float; - *ret = impl->getMyValue(p0); - operation.setReturnValue((const float*)ret); - } - return; - } - if (operationName == "getMyValueS") - { - string& p0 = *(string*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(float*)operation.getReturnValue() = impl->getMyValueS(p0); - } - else - { - float* ret = new float; - *ret = impl->getMyValueS(p0); - operation.setReturnValue((const float*)ret); - } - return; - } - if (operationName == "getCustname") - { - string& p0 = *(string*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(string*)operation.getReturnValue() = impl->getCustname(p0); - } - else - { - string* ret = new string; - *ret = impl->getCustname(p0); - operation.setReturnValue((const string*)ret); - } - return; - } - if (operationName == "getCustnamecs") - { - string& p0 = *( string*)operation.getParameterValue(0); - const string& ret = impl->getCustnamecs(p0); - operation.setReturnValue(&ret); - return; - } - - - throw osoa::sca::ServiceRuntimeException("Invalid operation"); - -} - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.h deleted file mode 100644 index df388bf43d..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.h +++ /dev/null @@ -1,43 +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. - */ - -#ifndef MyValueImpl_MyValueService_Wrapper_h -#define MyValueImpl_MyValueService_Wrapper_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "MyValueImpl.hpp" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -class MyValueImpl_MyValueService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper -{ -public: - MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target); - virtual ~MyValueImpl_MyValueService_Wrapper(); - virtual void invokeService(tuscany::sca::Operation& operation); - virtual void* newImplementation(); - virtual void deleteImplementation(); -private: - Other::MyValueImpl* impl; -}; - -#endif // MyValueImpl_MyValueService_Wrapper_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_customerInfo_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_customerInfo_Proxy.cpp deleted file mode 100644 index e6800aa311..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_customerInfo_Proxy.cpp +++ /dev/null @@ -1,64 +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. - */ - -#include "MyValueImpl_customerInfo_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - MyValueImpl_customerInfo_Proxy* MyValueImpl_customerInfo_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new MyValueImpl_customerInfo_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void MyValueImpl_customerInfo_Proxy_Destructor(void* proxy) - { - delete (MyValueImpl_customerInfo_Proxy*)proxy; - } -} - -MyValueImpl_customerInfo_Proxy::MyValueImpl_customerInfo_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -MyValueImpl_customerInfo_Proxy::~MyValueImpl_customerInfo_Proxy() -{ - if (target) - delete target; -} - -const char* MyValueImpl_customerInfo_Proxy::getCustomerInformation(const char* arg0) -{ - tuscany::sca::Operation operation("getCustomerInformation"); - operation.addParameter("customerID", &arg0); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_customerInfo_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_customerInfo_Proxy.h deleted file mode 100644 index 3d1d279b7c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_customerInfo_Proxy.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. - */ - -#ifndef MyValueImpl_customerInfo_Proxy_h -#define MyValueImpl_customerInfo_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "CustomerInfo.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class MyValueImpl_customerInfo_Proxy : public CustomerInfo -{ -public: - MyValueImpl_customerInfo_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~MyValueImpl_customerInfo_Proxy(); - virtual const char* getCustomerInformation(const char* customerID); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // MyValueImpl_customerInfo_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_stockQuote_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_stockQuote_Proxy.cpp deleted file mode 100644 index d3fd4fbaf0..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_stockQuote_Proxy.cpp +++ /dev/null @@ -1,64 +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. - */ - -#include "MyValueImpl_stockQuote_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - MyValueImpl_stockQuote_Proxy* MyValueImpl_stockQuote_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new MyValueImpl_stockQuote_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void MyValueImpl_stockQuote_Proxy_Destructor(void* proxy) - { - delete (MyValueImpl_stockQuote_Proxy*)proxy; - } -} - -MyValueImpl_stockQuote_Proxy::MyValueImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -MyValueImpl_stockQuote_Proxy::~MyValueImpl_stockQuote_Proxy() -{ - if (target) - delete target; -} - -commonj::sdo::DataObjectPtr MyValueImpl_stockQuote_Proxy::GetStockQuotes( commonj::sdo::DataObjectPtr arg0) -{ - tuscany::sca::Operation operation("GetStockQuotes"); - operation.addParameter("request", &arg0); - commonj::sdo::DataObjectPtr ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(commonj::sdo::DataObjectPtr*)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_stockQuote_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_stockQuote_Proxy.h deleted file mode 100644 index ad5cee3ca7..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_stockQuote_Proxy.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. - */ - -#ifndef MyValueImpl_stockQuote_Proxy_h -#define MyValueImpl_stockQuote_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "StockQuoteService.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class MyValueImpl_stockQuote_Proxy : public StockQuoteService -{ -public: - MyValueImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~MyValueImpl_stockQuote_Proxy(); - virtual commonj::sdo::DataObjectPtr GetStockQuotes( commonj::sdo::DataObjectPtr request); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // MyValueImpl_stockQuote_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.cpp deleted file mode 100644 index 21d956f547..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.cpp +++ /dev/null @@ -1,92 +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. - */ - -#include "MyValueImpl_MyValueService_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - MyValueImpl_MyValueService_Proxy* MyValueImpl_MyValueService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new MyValueImpl_MyValueService_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void MyValueImpl_MyValueService_Proxy_Destructor(void* proxy) - { - delete (MyValueImpl_MyValueService_Proxy*)proxy; - } -} - -MyValueImpl_MyValueService_Proxy::MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -MyValueImpl_MyValueService_Proxy::~MyValueImpl_MyValueService_Proxy() -{ - if (target) - delete target; -} - -float MyValueImpl_MyValueService_Proxy::getMyValueOther(const char* arg0) -{ - tuscany::sca::Operation operation("getMyValueOther"); - operation.addParameter("customerID", &arg0); - float ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(float*)operation.getReturnValue(); -} - -float MyValueImpl_MyValueService_Proxy::getMyValueSOther(const string& arg0) -{ - tuscany::sca::Operation operation("getMyValueSOther"); - operation.addParameter("customerID", &arg0); - float ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(float*)operation.getReturnValue(); -} - -string MyValueImpl_MyValueService_Proxy::getCustnameOther( string& arg0) -{ - tuscany::sca::Operation operation("getCustnameOther"); - operation.addParameter("customerID", &arg0); - string ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(string*)operation.getReturnValue(); -} - -const string& MyValueImpl_MyValueService_Proxy::getCustnamecsOther( string arg0) -{ - tuscany::sca::Operation operation("getCustnamecsOther"); - operation.addParameter("customerID", &arg0); - target->invoke(operation); - return *(const string*)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.h deleted file mode 100644 index bb92aa0556..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.h +++ /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. - */ - -#ifndef MyValueImpl_MyValueService_Proxy_h -#define MyValueImpl_MyValueService_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "MyValue.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class MyValueImpl_MyValueService_Proxy : public MyValue -{ -public: - MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~MyValueImpl_MyValueService_Proxy(); - virtual float getMyValueOther(const char* customerID); - virtual float getMyValueSOther(const string& customerID); - virtual string getCustnameOther( string& customerID); - virtual const string& getCustnamecsOther( string customerID); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // MyValueImpl_MyValueService_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.cpp deleted file mode 100644 index de0f0a0563..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.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. - */ - -#include "MyValueImpl_MyValueService_Wrapper.h" - -#include "osoa/sca/sca.h" - -using myvaluecorp::implns::MyValueImpl; - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - MyValueImpl_MyValueService_Wrapper* MyValueImpl_MyValueService_Wrapper_Factory(tuscany::sca::model::Service* target) - { - return new MyValueImpl_MyValueService_Wrapper(target); - } -} - -MyValueImpl_MyValueService_Wrapper::MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) -{ - impl = (MyValueImpl*)getImplementation(); -} - -MyValueImpl_MyValueService_Wrapper::~MyValueImpl_MyValueService_Wrapper() -{ - releaseImplementation(); -} - -void* MyValueImpl_MyValueService_Wrapper::newImplementation() -{ - return new MyValueImpl; -} - -void MyValueImpl_MyValueService_Wrapper::deleteImplementation() -{ - delete impl; -} - -void MyValueImpl_MyValueService_Wrapper::invokeService(tuscany::sca::Operation& operation) -{ - const std::string& operationName = operation.getName(); - - if (operationName == "getMyValueOther") - { - const char* p0 = *(const char**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(float*)operation.getReturnValue() = impl->getMyValueOther(p0); - } - else - { - float* ret = new float; - *ret = impl->getMyValueOther(p0); - operation.setReturnValue((const float*)ret); - } - return; - } - if (operationName == "getMyValueSOther") - { - string& p0 = *(string*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(float*)operation.getReturnValue() = impl->getMyValueSOther(p0); - } - else - { - float* ret = new float; - *ret = impl->getMyValueSOther(p0); - operation.setReturnValue((const float*)ret); - } - return; - } - if (operationName == "getCustnameOther") - { - string& p0 = *(string*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(string*)operation.getReturnValue() = impl->getCustnameOther(p0); - } - else - { - string* ret = new string; - *ret = impl->getCustnameOther(p0); - operation.setReturnValue((const string*)ret); - } - return; - } - if (operationName == "getCustnamecsOther") - { - string& p0 = *( string*)operation.getParameterValue(0); - const string& ret = impl->getCustnamecsOther(p0); - operation.setReturnValue(&ret); - return; - } - - - throw osoa::sca::ServiceRuntimeException("Invalid operation"); - -} - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.h deleted file mode 100644 index cfc7c4c07a..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.h +++ /dev/null @@ -1,43 +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. - */ - -#ifndef MyValueImpl_MyValueService_Wrapper_h -#define MyValueImpl_MyValueService_Wrapper_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "MyValueImpl.hpp" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -class MyValueImpl_MyValueService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper -{ -public: - MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target); - virtual ~MyValueImpl_MyValueService_Wrapper(); - virtual void invokeService(tuscany::sca::Operation& operation); - virtual void* newImplementation(); - virtual void deleteImplementation(); -private: - myvaluecorp::implns::MyValueImpl* impl; -}; - -#endif // MyValueImpl_MyValueService_Wrapper_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.cpp deleted file mode 100644 index 21d956f547..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.cpp +++ /dev/null @@ -1,92 +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. - */ - -#include "MyValueImpl_MyValueService_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - MyValueImpl_MyValueService_Proxy* MyValueImpl_MyValueService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new MyValueImpl_MyValueService_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void MyValueImpl_MyValueService_Proxy_Destructor(void* proxy) - { - delete (MyValueImpl_MyValueService_Proxy*)proxy; - } -} - -MyValueImpl_MyValueService_Proxy::MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -MyValueImpl_MyValueService_Proxy::~MyValueImpl_MyValueService_Proxy() -{ - if (target) - delete target; -} - -float MyValueImpl_MyValueService_Proxy::getMyValueOther(const char* arg0) -{ - tuscany::sca::Operation operation("getMyValueOther"); - operation.addParameter("customerID", &arg0); - float ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(float*)operation.getReturnValue(); -} - -float MyValueImpl_MyValueService_Proxy::getMyValueSOther(const string& arg0) -{ - tuscany::sca::Operation operation("getMyValueSOther"); - operation.addParameter("customerID", &arg0); - float ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(float*)operation.getReturnValue(); -} - -string MyValueImpl_MyValueService_Proxy::getCustnameOther( string& arg0) -{ - tuscany::sca::Operation operation("getCustnameOther"); - operation.addParameter("customerID", &arg0); - string ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(string*)operation.getReturnValue(); -} - -const string& MyValueImpl_MyValueService_Proxy::getCustnamecsOther( string arg0) -{ - tuscany::sca::Operation operation("getCustnamecsOther"); - operation.addParameter("customerID", &arg0); - target->invoke(operation); - return *(const string*)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.h deleted file mode 100644 index 210da9a64c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Proxy.h +++ /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. - */ - -#ifndef MyValueImpl_MyValueService_Proxy_h -#define MyValueImpl_MyValueService_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "MyValue.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class MyValueImpl_MyValueService_Proxy : public Other::MyValue -{ -public: - MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~MyValueImpl_MyValueService_Proxy(); - virtual float getMyValueOther(const char* customerID); - virtual float getMyValueSOther(const string& customerID); - virtual string getCustnameOther( string& customerID); - virtual const string& getCustnamecsOther( string customerID); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // MyValueImpl_MyValueService_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.cpp deleted file mode 100644 index f84fcf496b..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.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. - */ - -#include "MyValueImpl_MyValueService_Wrapper.h" - -#include "osoa/sca/sca.h" - - - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - MyValueImpl_MyValueService_Wrapper* MyValueImpl_MyValueService_Wrapper_Factory(tuscany::sca::model::Service* target) - { - return new MyValueImpl_MyValueService_Wrapper(target); - } -} - -MyValueImpl_MyValueService_Wrapper::MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) -{ - impl = (MyValueImpl*)getImplementation(); -} - -MyValueImpl_MyValueService_Wrapper::~MyValueImpl_MyValueService_Wrapper() -{ - releaseImplementation(); -} - -void* MyValueImpl_MyValueService_Wrapper::newImplementation() -{ - return new MyValueImpl; -} - -void MyValueImpl_MyValueService_Wrapper::deleteImplementation() -{ - delete impl; -} - -void MyValueImpl_MyValueService_Wrapper::invokeService(tuscany::sca::Operation& operation) -{ - const std::string& operationName = operation.getName(); - - if (operationName == "getMyValueOther") - { - const char* p0 = *(const char**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(float*)operation.getReturnValue() = impl->getMyValueOther(p0); - } - else - { - float* ret = new float; - *ret = impl->getMyValueOther(p0); - operation.setReturnValue((const float*)ret); - } - return; - } - if (operationName == "getMyValueSOther") - { - string& p0 = *(string*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(float*)operation.getReturnValue() = impl->getMyValueSOther(p0); - } - else - { - float* ret = new float; - *ret = impl->getMyValueSOther(p0); - operation.setReturnValue((const float*)ret); - } - return; - } - if (operationName == "getCustnameOther") - { - string& p0 = *(string*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(string*)operation.getReturnValue() = impl->getCustnameOther(p0); - } - else - { - string* ret = new string; - *ret = impl->getCustnameOther(p0); - operation.setReturnValue((const string*)ret); - } - return; - } - if (operationName == "getCustnamecsOther") - { - string& p0 = *( string*)operation.getParameterValue(0); - const string& ret = impl->getCustnamecsOther(p0); - operation.setReturnValue(&ret); - return; - } - - - throw osoa::sca::ServiceRuntimeException("Invalid operation"); - -} - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.h deleted file mode 100644 index d3eef80e8f..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.h +++ /dev/null @@ -1,43 +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. - */ - -#ifndef MyValueImpl_MyValueService_Wrapper_h -#define MyValueImpl_MyValueService_Wrapper_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "MyValueImpl.hpp" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -class MyValueImpl_MyValueService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper -{ -public: - MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target); - virtual ~MyValueImpl_MyValueService_Wrapper(); - virtual void invokeService(tuscany::sca::Operation& operation); - virtual void* newImplementation(); - virtual void deleteImplementation(); -private: - MyValueImpl* impl; -}; - -#endif // MyValueImpl_MyValueService_Wrapper_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.cpp deleted file mode 100644 index 21d956f547..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.cpp +++ /dev/null @@ -1,92 +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. - */ - -#include "MyValueImpl_MyValueService_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - MyValueImpl_MyValueService_Proxy* MyValueImpl_MyValueService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new MyValueImpl_MyValueService_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void MyValueImpl_MyValueService_Proxy_Destructor(void* proxy) - { - delete (MyValueImpl_MyValueService_Proxy*)proxy; - } -} - -MyValueImpl_MyValueService_Proxy::MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -MyValueImpl_MyValueService_Proxy::~MyValueImpl_MyValueService_Proxy() -{ - if (target) - delete target; -} - -float MyValueImpl_MyValueService_Proxy::getMyValueOther(const char* arg0) -{ - tuscany::sca::Operation operation("getMyValueOther"); - operation.addParameter("customerID", &arg0); - float ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(float*)operation.getReturnValue(); -} - -float MyValueImpl_MyValueService_Proxy::getMyValueSOther(const string& arg0) -{ - tuscany::sca::Operation operation("getMyValueSOther"); - operation.addParameter("customerID", &arg0); - float ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(float*)operation.getReturnValue(); -} - -string MyValueImpl_MyValueService_Proxy::getCustnameOther( string& arg0) -{ - tuscany::sca::Operation operation("getCustnameOther"); - operation.addParameter("customerID", &arg0); - string ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(string*)operation.getReturnValue(); -} - -const string& MyValueImpl_MyValueService_Proxy::getCustnamecsOther( string arg0) -{ - tuscany::sca::Operation operation("getCustnamecsOther"); - operation.addParameter("customerID", &arg0); - target->invoke(operation); - return *(const string*)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.h deleted file mode 100644 index 210da9a64c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Proxy.h +++ /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. - */ - -#ifndef MyValueImpl_MyValueService_Proxy_h -#define MyValueImpl_MyValueService_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "MyValue.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class MyValueImpl_MyValueService_Proxy : public Other::MyValue -{ -public: - MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~MyValueImpl_MyValueService_Proxy(); - virtual float getMyValueOther(const char* customerID); - virtual float getMyValueSOther(const string& customerID); - virtual string getCustnameOther( string& customerID); - virtual const string& getCustnamecsOther( string customerID); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // MyValueImpl_MyValueService_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.cpp deleted file mode 100644 index f84fcf496b..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.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. - */ - -#include "MyValueImpl_MyValueService_Wrapper.h" - -#include "osoa/sca/sca.h" - - - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - MyValueImpl_MyValueService_Wrapper* MyValueImpl_MyValueService_Wrapper_Factory(tuscany::sca::model::Service* target) - { - return new MyValueImpl_MyValueService_Wrapper(target); - } -} - -MyValueImpl_MyValueService_Wrapper::MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) -{ - impl = (MyValueImpl*)getImplementation(); -} - -MyValueImpl_MyValueService_Wrapper::~MyValueImpl_MyValueService_Wrapper() -{ - releaseImplementation(); -} - -void* MyValueImpl_MyValueService_Wrapper::newImplementation() -{ - return new MyValueImpl; -} - -void MyValueImpl_MyValueService_Wrapper::deleteImplementation() -{ - delete impl; -} - -void MyValueImpl_MyValueService_Wrapper::invokeService(tuscany::sca::Operation& operation) -{ - const std::string& operationName = operation.getName(); - - if (operationName == "getMyValueOther") - { - const char* p0 = *(const char**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(float*)operation.getReturnValue() = impl->getMyValueOther(p0); - } - else - { - float* ret = new float; - *ret = impl->getMyValueOther(p0); - operation.setReturnValue((const float*)ret); - } - return; - } - if (operationName == "getMyValueSOther") - { - string& p0 = *(string*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(float*)operation.getReturnValue() = impl->getMyValueSOther(p0); - } - else - { - float* ret = new float; - *ret = impl->getMyValueSOther(p0); - operation.setReturnValue((const float*)ret); - } - return; - } - if (operationName == "getCustnameOther") - { - string& p0 = *(string*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(string*)operation.getReturnValue() = impl->getCustnameOther(p0); - } - else - { - string* ret = new string; - *ret = impl->getCustnameOther(p0); - operation.setReturnValue((const string*)ret); - } - return; - } - if (operationName == "getCustnamecsOther") - { - string& p0 = *( string*)operation.getParameterValue(0); - const string& ret = impl->getCustnamecsOther(p0); - operation.setReturnValue(&ret); - return; - } - - - throw osoa::sca::ServiceRuntimeException("Invalid operation"); - -} - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.h deleted file mode 100644 index d3eef80e8f..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.h +++ /dev/null @@ -1,43 +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. - */ - -#ifndef MyValueImpl_MyValueService_Wrapper_h -#define MyValueImpl_MyValueService_Wrapper_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "MyValueImpl.hpp" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -class MyValueImpl_MyValueService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper -{ -public: - MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target); - virtual ~MyValueImpl_MyValueService_Wrapper(); - virtual void invokeService(tuscany::sca::Operation& operation); - virtual void* newImplementation(); - virtual void deleteImplementation(); -private: - MyValueImpl* impl; -}; - -#endif // MyValueImpl_MyValueService_Wrapper_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.cpp deleted file mode 100644 index 543b370282..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.cpp +++ /dev/null @@ -1,64 +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. - */ - -#include "CustomerInfoImpl2_CustomerInfoService_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CustomerInfoImpl2_CustomerInfoService_Proxy* CustomerInfoImpl2_CustomerInfoService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new CustomerInfoImpl2_CustomerInfoService_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void CustomerInfoImpl2_CustomerInfoService_Proxy_Destructor(void* proxy) - { - delete (CustomerInfoImpl2_CustomerInfoService_Proxy*)proxy; - } -} - -CustomerInfoImpl2_CustomerInfoService_Proxy::CustomerInfoImpl2_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -CustomerInfoImpl2_CustomerInfoService_Proxy::~CustomerInfoImpl2_CustomerInfoService_Proxy() -{ - if (target) - delete target; -} - -const char* CustomerInfoImpl2_CustomerInfoService_Proxy::getCustomerInformation(const char* arg0) -{ - tuscany::sca::Operation operation("getCustomerInformation"); - operation.addParameter(&arg0); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.h deleted file mode 100644 index 594f404d13..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Proxy.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. - */ - -#ifndef CustomerInfoImpl2_CustomerInfoService_Proxy_h -#define CustomerInfoImpl2_CustomerInfoService_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "/CustomerInfo.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class CustomerInfoImpl2_CustomerInfoService_Proxy : public CustomerInfo -{ -public: - CustomerInfoImpl2_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~CustomerInfoImpl2_CustomerInfoService_Proxy(); - virtual const char* getCustomerInformation(const char* customerID); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // CustomerInfoImpl2_CustomerInfoService_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.cpp deleted file mode 100644 index 191dd3eed2..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.cpp +++ /dev/null @@ -1,83 +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. - */ - -#include "CustomerInfoImpl2_CustomerInfoService_Wrapper.h" - -#include "osoa/sca/sca.h" - -using myvaluecorp::implns::CustomerInfoImpl2; - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CustomerInfoImpl2_CustomerInfoService_Wrapper* CustomerInfoImpl2_CustomerInfoService_Wrapper_Factory(tuscany::sca::model::Service* target) - { - return new CustomerInfoImpl2_CustomerInfoService_Wrapper(target); - } -} - -CustomerInfoImpl2_CustomerInfoService_Wrapper::CustomerInfoImpl2_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) -{ - impl = (CustomerInfoImpl2*)getImplementation(); -} - -CustomerInfoImpl2_CustomerInfoService_Wrapper::~CustomerInfoImpl2_CustomerInfoService_Wrapper() -{ - releaseImplementation(); -} - -void* CustomerInfoImpl2_CustomerInfoService_Wrapper::newImplementation() -{ - return new CustomerInfoImpl2; -} - -void CustomerInfoImpl2_CustomerInfoService_Wrapper::deleteImplementation() -{ - delete impl; -} - -void CustomerInfoImpl2_CustomerInfoService_Wrapper::invokeService(tuscany::sca::Operation& operation) -{ - const std::string& operationName = operation.getName(); - - if (operationName == "getCustomerInformation") - { - const char* p0 = *(const char**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInformation(p0); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInformation(p0); - operation.setReturnValue((const const char**)ret); - } - return; - } - - - throw osoa::sca::ServiceRuntimeException("Invalid operation"); - -} - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.h deleted file mode 100644 index a57f5c4613..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.h +++ /dev/null @@ -1,43 +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. - */ - -#ifndef CustomerInfoImpl2_CustomerInfoService_Wrapper_h -#define CustomerInfoImpl2_CustomerInfoService_Wrapper_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "CustomerInfoImpl.h" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -class CustomerInfoImpl2_CustomerInfoService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper -{ -public: - CustomerInfoImpl2_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target); - virtual ~CustomerInfoImpl2_CustomerInfoService_Wrapper(); - virtual void invokeService(tuscany::sca::Operation& operation); - virtual void* newImplementation(); - virtual void deleteImplementation(); -private: - myvaluecorp::implns::CustomerInfoImpl2* impl; -}; - -#endif // CustomerInfoImpl2_CustomerInfoService_Wrapper_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Proxy.cpp deleted file mode 100644 index fe996eabdb..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Proxy.cpp +++ /dev/null @@ -1,92 +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. - */ - -#include "MyValueImpl_MyValueService_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - MyValueImpl_MyValueService_Proxy* MyValueImpl_MyValueService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new MyValueImpl_MyValueService_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void MyValueImpl_MyValueService_Proxy_Destructor(void* proxy) - { - delete (MyValueImpl_MyValueService_Proxy*)proxy; - } -} - -MyValueImpl_MyValueService_Proxy::MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -MyValueImpl_MyValueService_Proxy::~MyValueImpl_MyValueService_Proxy() -{ - if (target) - delete target; -} - -float MyValueImpl_MyValueService_Proxy::getMyValue(const char* arg0) -{ - tuscany::sca::Operation operation("getMyValue"); - operation.addParameter(&arg0); - float ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(float*)operation.getReturnValue(); -} - -float MyValueImpl_MyValueService_Proxy::getMyValueS(const string& arg0) -{ - tuscany::sca::Operation operation("getMyValueS"); - operation.addParameter(&arg0); - float ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(float*)operation.getReturnValue(); -} - -string MyValueImpl_MyValueService_Proxy::getCustname( string& arg0) -{ - tuscany::sca::Operation operation("getCustname"); - operation.addParameter(&arg0); - string ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(string*)operation.getReturnValue(); -} - -const string& MyValueImpl_MyValueService_Proxy::getCustnamecs( string arg0) -{ - tuscany::sca::Operation operation("getCustnamecs"); - operation.addParameter(&arg0); - target->invoke(operation); - return *(const string*)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Proxy.h deleted file mode 100644 index d61c806e44..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Proxy.h +++ /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. - */ - -#ifndef MyValueImpl_MyValueService_Proxy_h -#define MyValueImpl_MyValueService_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "MyValue.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class MyValueImpl_MyValueService_Proxy : public MyValue -{ -public: - MyValueImpl_MyValueService_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~MyValueImpl_MyValueService_Proxy(); - virtual float getMyValue(const char* customerID); - virtual float getMyValueS(const string& customerID); - virtual string getCustname( string& customerID); - virtual const string& getCustnamecs( string customerID); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // MyValueImpl_MyValueService_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Wrapper.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Wrapper.cpp deleted file mode 100644 index 5bbd07a72a..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Wrapper.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. - */ - -#include "MyValueImpl_MyValueService_Wrapper.h" - -#include "osoa/sca/sca.h" - -using myvaluecorp::implns::MyValueImpl; - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - MyValueImpl_MyValueService_Wrapper* MyValueImpl_MyValueService_Wrapper_Factory(tuscany::sca::model::Service* target) - { - return new MyValueImpl_MyValueService_Wrapper(target); - } -} - -MyValueImpl_MyValueService_Wrapper::MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) -{ - impl = (MyValueImpl*)getImplementation(); -} - -MyValueImpl_MyValueService_Wrapper::~MyValueImpl_MyValueService_Wrapper() -{ - releaseImplementation(); -} - -void* MyValueImpl_MyValueService_Wrapper::newImplementation() -{ - return new MyValueImpl; -} - -void MyValueImpl_MyValueService_Wrapper::deleteImplementation() -{ - delete impl; -} - -void MyValueImpl_MyValueService_Wrapper::invokeService(tuscany::sca::Operation& operation) -{ - const std::string& operationName = operation.getName(); - - if (operationName == "getMyValue") - { - const char* p0 = *(const char**)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(float*)operation.getReturnValue() = impl->getMyValue(p0); - } - else - { - float* ret = new float; - *ret = impl->getMyValue(p0); - operation.setReturnValue((const float*)ret); - } - return; - } - if (operationName == "getMyValueS") - { - string& p0 = *(string*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(float*)operation.getReturnValue() = impl->getMyValueS(p0); - } - else - { - float* ret = new float; - *ret = impl->getMyValueS(p0); - operation.setReturnValue((const float*)ret); - } - return; - } - if (operationName == "getCustname") - { - string& p0 = *(string*)operation.getParameterValue(0); - - if(operation.getReturnValue() != NULL) - { - *(string*)operation.getReturnValue() = impl->getCustname(p0); - } - else - { - string* ret = new string; - *ret = impl->getCustname(p0); - operation.setReturnValue((const string*)ret); - } - return; - } - if (operationName == "getCustnamecs") - { - string& p0 = *( string*)operation.getParameterValue(0); - const string& ret = impl->getCustnamecs(p0); - operation.setReturnValue(&ret); - return; - } - - - throw osoa::sca::ServiceRuntimeException("Invalid operation"); - -} - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Wrapper.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Wrapper.h deleted file mode 100644 index cfc7c4c07a..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Wrapper.h +++ /dev/null @@ -1,43 +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. - */ - -#ifndef MyValueImpl_MyValueService_Wrapper_h -#define MyValueImpl_MyValueService_Wrapper_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "MyValueImpl.hpp" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -class MyValueImpl_MyValueService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper -{ -public: - MyValueImpl_MyValueService_Wrapper(tuscany::sca::model::Service* target); - virtual ~MyValueImpl_MyValueService_Wrapper(); - virtual void invokeService(tuscany::sca::Operation& operation); - virtual void* newImplementation(); - virtual void deleteImplementation(); -private: - myvaluecorp::implns::MyValueImpl* impl; -}; - -#endif // MyValueImpl_MyValueService_Wrapper_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_customerInfo_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_customerInfo_Proxy.cpp deleted file mode 100644 index ffcc1d0003..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_customerInfo_Proxy.cpp +++ /dev/null @@ -1,64 +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. - */ - -#include "MyValueImpl_customerInfo_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - MyValueImpl_customerInfo_Proxy* MyValueImpl_customerInfo_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new MyValueImpl_customerInfo_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void MyValueImpl_customerInfo_Proxy_Destructor(void* proxy) - { - delete (MyValueImpl_customerInfo_Proxy*)proxy; - } -} - -MyValueImpl_customerInfo_Proxy::MyValueImpl_customerInfo_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -MyValueImpl_customerInfo_Proxy::~MyValueImpl_customerInfo_Proxy() -{ - if (target) - delete target; -} - -const char* MyValueImpl_customerInfo_Proxy::getCustomerInformation(const char* arg0) -{ - tuscany::sca::Operation operation("getCustomerInformation"); - operation.addParameter(&arg0); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_customerInfo_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_customerInfo_Proxy.h deleted file mode 100644 index 3d1d279b7c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_customerInfo_Proxy.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. - */ - -#ifndef MyValueImpl_customerInfo_Proxy_h -#define MyValueImpl_customerInfo_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "CustomerInfo.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class MyValueImpl_customerInfo_Proxy : public CustomerInfo -{ -public: - MyValueImpl_customerInfo_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~MyValueImpl_customerInfo_Proxy(); - virtual const char* getCustomerInformation(const char* customerID); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // MyValueImpl_customerInfo_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_stockQuote_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_stockQuote_Proxy.cpp deleted file mode 100644 index 6e4d0600bd..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_stockQuote_Proxy.cpp +++ /dev/null @@ -1,64 +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. - */ - -#include "MyValueImpl_stockQuote_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - MyValueImpl_stockQuote_Proxy* MyValueImpl_stockQuote_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new MyValueImpl_stockQuote_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void MyValueImpl_stockQuote_Proxy_Destructor(void* proxy) - { - delete (MyValueImpl_stockQuote_Proxy*)proxy; - } -} - -MyValueImpl_stockQuote_Proxy::MyValueImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -MyValueImpl_stockQuote_Proxy::~MyValueImpl_stockQuote_Proxy() -{ - if (target) - delete target; -} - -commonj::sdo::DataObjectPtr MyValueImpl_stockQuote_Proxy::GetStockQuotes( commonj::sdo::DataObjectPtr arg0) -{ - tuscany::sca::Operation operation("GetStockQuotes"); - operation.addParameter(&arg0); - commonj::sdo::DataObjectPtr ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(commonj::sdo::DataObjectPtr*)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_stockQuote_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_stockQuote_Proxy.h deleted file mode 100644 index ad5cee3ca7..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_stockQuote_Proxy.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. - */ - -#ifndef MyValueImpl_stockQuote_Proxy_h -#define MyValueImpl_stockQuote_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "StockQuoteService.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class MyValueImpl_stockQuote_Proxy : public StockQuoteService -{ -public: - MyValueImpl_stockQuote_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~MyValueImpl_stockQuote_Proxy(); - virtual commonj::sdo::DataObjectPtr GetStockQuotes( commonj::sdo::DataObjectPtr request); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // MyValueImpl_stockQuote_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.cpp deleted file mode 100644 index 4c3d626bfb..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.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. - */ - -#include "CustomerInfoImpl_CustomerInfoService_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CustomerInfoImpl_CustomerInfoService_Proxy* CustomerInfoImpl_CustomerInfoService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new CustomerInfoImpl_CustomerInfoService_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void CustomerInfoImpl_CustomerInfoService_Proxy_Destructor(void* proxy) - { - delete (CustomerInfoImpl_CustomerInfoService_Proxy*)proxy; - } -} - -CustomerInfoImpl_CustomerInfoService_Proxy::CustomerInfoImpl_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -CustomerInfoImpl_CustomerInfoService_Proxy::~CustomerInfoImpl_CustomerInfoService_Proxy() -{ - if (target) - delete target; -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInformationCharPublic( char* arg0, const char* arg1) -{ - tuscany::sca::Operation operation("getCustomerInformationCharPublic"); - operation.addParameter("p1", &arg0); - operation.addParameter("customerID", &arg1); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoACharPublic( char* arg0, const char* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoACharPublic"); - operation.addParameter("p1", &arg0); - operation.addParameter("", &arg1); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - -const char* CustomerInfoImpl_CustomerInfoService_Proxy::getCustomerInfoBCharPublic( char* arg0, char* arg1) -{ - tuscany::sca::Operation operation("getCustomerInfoBCharPublic"); - operation.addParameter("p1", &arg0); - operation.addParameter("customerID", &arg1); - const char* ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(const char**)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h deleted file mode 100644 index a9b56bdb5c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Proxy.h +++ /dev/null @@ -1,43 +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. - */ - -#ifndef CustomerInfoImpl_CustomerInfoService_Proxy_h -#define CustomerInfoImpl_CustomerInfoService_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "/CustomerInfo.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class CustomerInfoImpl_CustomerInfoService_Proxy : public CustomerInfo -{ -public: - CustomerInfoImpl_CustomerInfoService_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~CustomerInfoImpl_CustomerInfoService_Proxy(); - virtual const char* getCustomerInformationCharPublic( char* p1, const char* customerID); - virtual const char* getCustomerInfoACharPublic( char* p1, const char* ); - virtual const char* getCustomerInfoBCharPublic( char* p1, char* customerID); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // CustomerInfoImpl_CustomerInfoService_Proxy_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp deleted file mode 100644 index 2aa9fcbdf2..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp +++ /dev/null @@ -1,118 +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. - */ - -#include "CustomerInfoImpl_CustomerInfoService_Wrapper.h" - -#include "osoa/sca/sca.h" - - - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CustomerInfoImpl_CustomerInfoService_Wrapper* CustomerInfoImpl_CustomerInfoService_Wrapper_Factory(tuscany::sca::model::Service* target) - { - return new CustomerInfoImpl_CustomerInfoService_Wrapper(target); - } -} - -CustomerInfoImpl_CustomerInfoService_Wrapper::CustomerInfoImpl_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) -{ - impl = (CustomerInfoImpl*)getImplementation(); -} - -CustomerInfoImpl_CustomerInfoService_Wrapper::~CustomerInfoImpl_CustomerInfoService_Wrapper() -{ - releaseImplementation(); -} - -void* CustomerInfoImpl_CustomerInfoService_Wrapper::newImplementation() -{ - return new CustomerInfoImpl; -} - -void CustomerInfoImpl_CustomerInfoService_Wrapper::deleteImplementation() -{ - delete impl; -} - -void CustomerInfoImpl_CustomerInfoService_Wrapper::invokeService(tuscany::sca::Operation& operation) -{ - const std::string& operationName = operation.getName(); - - if (operationName == "getCustomerInformationCharPublic") - { - char* p0 = *( char**)operation.getParameterValue(0); - const char* p1 = *(const char**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInformationCharPublic(p0, p1); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInformationCharPublic(p0, p1); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoACharPublic") - { - char* p0 = *( char**)operation.getParameterValue(0); - const char* p1 = *(const char**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoACharPublic(p0, p1); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoACharPublic(p0, p1); - operation.setReturnValue((const const char**)ret); - } - return; - } - if (operationName == "getCustomerInfoBCharPublic") - { - char* p0 = *( char**)operation.getParameterValue(0); - char* p1 = *( char**)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(const char**)operation.getReturnValue() = impl->getCustomerInfoBCharPublic(p0, p1); - } - else - { - const char** ret = new const char*; - *ret = impl->getCustomerInfoBCharPublic(p0, p1); - operation.setReturnValue((const const char**)ret); - } - return; - } - - - throw osoa::sca::ServiceRuntimeException("Invalid operation"); - -} - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h deleted file mode 100644 index 94b1d5cb4d..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h +++ /dev/null @@ -1,43 +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. - */ - -#ifndef CustomerInfoImpl_CustomerInfoService_Wrapper_h -#define CustomerInfoImpl_CustomerInfoService_Wrapper_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "CustomerInfoImpl.h" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -class CustomerInfoImpl_CustomerInfoService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper -{ -public: - CustomerInfoImpl_CustomerInfoService_Wrapper(tuscany::sca::model::Service* target); - virtual ~CustomerInfoImpl_CustomerInfoService_Wrapper(); - virtual void invokeService(tuscany::sca::Operation& operation); - virtual void* newImplementation(); - virtual void deleteImplementation(); -private: - CustomerInfoImpl* impl; -}; - -#endif // CustomerInfoImpl_CustomerInfoService_Wrapper_h - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/lib/readme.txt b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/lib/readme.txt deleted file mode 100644 index d99c666c6a..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/lib/readme.txt +++ /dev/null @@ -1,4 +0,0 @@ -Place a junit.jar file (not shipped as part of Tuscany) -in this directory to get the scagen build.xml Ant build -file to find it and Junit classes (without setting the -property "junit.jar.folder". diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/scagen.bat b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/scagen.bat deleted file mode 100644 index 8ab5e4abdf..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/scagen.bat +++ /dev/null @@ -1,19 +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. - -@java -jar %~d0%~p0scagen.jar %* diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/scagen.sh b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/scagen.sh deleted file mode 100755 index c50f28b98f..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/scagen.sh +++ /dev/null @@ -1,21 +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. - - -java -jar scagen.jar -dir $2 -output $4 \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/BodyPart.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/BodyPart.java deleted file mode 100644 index 4ccbe0c750..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/BodyPart.java +++ /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. - */ - -/* @version $Rev$ $Date$ */ - - -/* - * Branched from the original class that was also contributed to the - * org.apache.axis.tools.common package. - */ - -package org.apache.tuscany.sca.cpp.tools.common; - -/** - * A snippet of C or C++ source code. If this snippet ends with a return - * statement, this body part also contains the return value. - */ -public class BodyPart { - public final static int TRAILING = 0; - - public final static int RETURN = 1; - - public final static int CATCH = 2; - - private String codeFragment; - - private String returnValue = null; - - private Parameter caughtValue = null; - - private int type; - - BodyPart(String cf) { - codeFragment = cf; - type = TRAILING; - } - - BodyPart(String cf, String rv) { - codeFragment = cf; - if (null != rv && !Utils.isSpace(rv)) { - type = RETURN; - returnValue = rv; - } else - type = TRAILING; - } - - BodyPart(String cf, Parameter cv) { - codeFragment = cf; - caughtValue = cv; - type = CATCH; - } - - public String getCodeFragment() { - return codeFragment; - } - - public boolean isTrailing() { - return TRAILING == type; - } - - public boolean isReturn() { - return RETURN == type; - } - - public boolean isCatch() { - return CATCH == type; - } - - public String getReturnValue() { - if (returnValue != null) - return returnValue.trim(); - else - return null; - } - - public Parameter getCaughtValue() { - return caughtValue; - } -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/CParsingTool.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/CParsingTool.java deleted file mode 100644 index 669901b4b5..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/CParsingTool.java +++ /dev/null @@ -1,124 +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. - */ - -/* @version $Rev$ $Date$ */ - -/* - * Branched from the original class that was also contributed to the - * org.apache.axis.tools.common package. - */ -package org.apache.tuscany.sca.cpp.tools.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -/** - * The superclass of tools that parse C/C++ code. This CParsingTool provides - * some useful common methods. - */ -public class CParsingTool { - protected boolean failed = false; - - protected Headers headers = new Headers(); - - protected CParsingTool(String[] args) throws Exception { - String text = new String(); - for (int i = 0; i < args.length; i++) - text += args[i] + " "; - Utils.outputDebugString(text); - - Options.set(args); - String config = (String) Options.getOption("-config"); - if (null != config) - Configuration.initialise(config); - } - - /** - * Read in any include files before the main processing of the tool is done. - * This constructs the Headers. - */ - protected Headers preparseHeaders(String option) throws Exception { - Headers headers = new Headers(); - Object o = Options.getOption(option); - if (null != o) { - Utils.outputDebugString("Pre-parsing headers..."); - List includeList; - if (o instanceof List) - includeList = (List) o; - else { - includeList = new ArrayList(); - includeList.add(o); - } - Iterator it = includeList.iterator(); - while (it.hasNext()) { - File include = new File((String) it.next()); - if (!include.isDirectory()) - Utils.rude("Bad include directory " + include); - - DirectoryTree tree = new DirectoryTree(headers, new HashSet( - Arrays.asList(new Object[] { "hpp", "h" }))); - tree.walkTree(include, null, 0); - } - Utils.outputDebugString("Parsing files..."); - } - - return headers; - } - - /** - * Checks the source directory looks good. - */ - protected File checkFile(String option) throws Exception { - String name = (String) Options.getOption(option); - if (null == name) { - printUsage(); - System.exit(-1); - } - - File file = new File(name); - if (!file.isFile() && !file.isDirectory()) - Utils.rude("Bad file or directory " + file); - return file; - } - - /** - * Checks the target directory and creates it if it doesn't already exist. - */ - protected File maybeCreateDirectory(String option) throws Exception { - String name = (String) Options.getOption(option); - if (null == name) { - printUsage(); - System.exit(-1); - } - - File file = new File(name); - if (!file.exists() && !file.mkdir()) - Utils.screenMessage("Failed to create directory " + file); - return file; - } - - protected void printUsage() { - System.out.println("usage: ??"); - } -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Configuration.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Configuration.java deleted file mode 100644 index 246a489c9c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Configuration.java +++ /dev/null @@ -1,132 +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. - */ - -/* @version $Rev$ $Date$ */ - - -/* - * Branched from the original class that was also contributed to the - * org.apache.axis.tools.common package. - */ -package org.apache.tuscany.sca.cpp.tools.common; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -/** - * Encapsulates the tool's configuration file - */ -public class Configuration { - private static Set files = new HashSet(); - - private static Set classes = new HashSet(); - - private static Set methods = new HashSet(); - - private static Set macros = new HashSet(); - - private static Set defines = new HashSet(); - - private static Set attributes = new HashSet(); - - private static Map others = new HashMap(); - - /** - * No one creates an instance of this class. - */ - private Configuration() { - } - - /** - * Reads in the configuration file - */ - public static void initialise(String filename) throws Exception { - File file = new File(filename); - FileReader fr = new FileReader(file); - BufferedReader br = new BufferedReader(fr); - String line = br.readLine(); - for (int lineno = 1; null != line; lineno++, line = br.readLine()) { - // Ignore lines starting with a # (comments) and blank lines - if (line.startsWith("#")) - continue; - boolean blank = true; - for (int i = 0; i < line.length() && blank; i++) - if (!Character.isWhitespace(line.charAt(i))) - blank = false; - if (blank) - continue; - - int equals = line.indexOf("="); - if (-1 == equals) - Utils.rude("Bad line in configuration file " + filename - + " lineno " + lineno); - String key = line.substring(0, equals).trim(); - String value = line.substring(equals + 1).trim(); - if ("excludefile".equals(key)) { - files.add(value); - } else if ("excludeclass".equals(key)) { - classes.add(value); - } else if ("excludemethod".equals(key)) { - methods.add(value); - } else if ("macro".equals(key)) { - macros.add(value); - } else if ("define".equals(key)) { - defines.add(value); - } else if ("attribute".equals(key)) { - attributes.add(value); - } else { - others.put(key, value); - } - } - } - - public static boolean fileExcluded(String s) { - return files.contains(s); - } - - public static boolean classExcluded(String s) { - return classes.contains(s); - } - - public static boolean methodExcluded(String className, String method) { - return methods.contains(className + "::" + method); - } - - public static boolean isMacro(String s) { - return macros.contains(s); - } - - public static boolean isDefine(String s) { - return defines.contains(s); - } - - public static boolean isAttribute(String s) { - return attributes.contains(s); - } - - public static String getConfigured(String key) { - return (String) others.get(key); - } -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/DirectoryTree.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/DirectoryTree.java deleted file mode 100644 index 36d0af18b3..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/DirectoryTree.java +++ /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. - */ - -/* @version $Rev$ $Date$ */ - -/* - * Branched from the original class that was also contributed to the - * org.apache.axis.tools.common package. - */ -package org.apache.tuscany.sca.cpp.tools.common; - -import java.io.File; -import java.util.Set; -import java.util.StringTokenizer; - -public class DirectoryTree { - private FileActor actor; - - private Set extensions; - - public DirectoryTree(FileActor actor, Set extensions) { - this.actor = actor; - this.extensions = extensions; - } - - /** - * Starts adding trace into the given file. If the given file is a directory - * then this the starting directory and all code beneath and in this - * directory will be given trace. - * - * @param source - - * either the starting directory or one file to add trace to. - */ - public void walkTree(File source, File target, int depth) throws Exception { - depth++; - boolean noTarget = (null == target); - - if (!source.canRead()) - Utils.rude("Cannot read from source directory " + source); - if (!noTarget && !target.canWrite()) - Utils.rude("Cannot write to target directory " + target); - - if (source.isDirectory()) { - File[] filesInDirectory = source.listFiles(); - for (int i = 0; i < filesInDirectory.length; i++) { - File file = filesInDirectory[i]; - String name = file.getName(); - int dot = name.lastIndexOf('.'); - String ext = null; - if (-1 != dot) - ext = name.substring(dot + 1); - - if (file.isDirectory()) { - File newTarget = null; - if (!noTarget) { - StringTokenizer st = new StringTokenizer( - file.getPath(), "\\/"); - String newdir = null; - while (st.hasMoreTokens()) - newdir = st.nextToken(); - String targetName = maybeAppendSeparator(target - .toString()); - newTarget = new File(targetName + newdir); - if (!newTarget.mkdir()) - Utils.rude("Failed to create target directory " - + newTarget); - } - - // recurse - walkTree(file, newTarget, depth); - } else if (file.isFile() - && (extensions == null || (!file.isHidden() && extensions - .contains(ext)))) { - // this is a file and we need to add trace into it ! - actor.actOnFile(file, target, depth); - } - } - } else { - actor.actOnFile(source, target, depth); - } - } - - public static String maybeAppendSeparator(String name) { - if (!name.endsWith("/") && !name.endsWith("\\")) - name += "/"; - return name; - } -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/FileActor.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/FileActor.java deleted file mode 100644 index a2bb4ba858..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/FileActor.java +++ /dev/null @@ -1,37 +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. - */ - -/* @version $Rev$ $Date$ */ - -/* - * Branched from the original class that was also contributed to the - * org.apache.axis.tools.common package. - */ -package org.apache.tuscany.sca.cpp.tools.common; - -import java.io.File; - -/** - * DirectoryTree calls this interface to allow implementations of this interface - * to act on a file in the directory tree. - */ -public interface FileActor { - public void actOnFile(File source, File target, int depth) throws Exception; -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/FilePart.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/FilePart.java deleted file mode 100644 index b6bdf92878..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/FilePart.java +++ /dev/null @@ -1,80 +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. - */ - -/* @version $Rev$ $Date$ */ - -/* - * Branched from the original class that was also contributed to the - * org.apache.axis.tools.common package. - */ - -package org.apache.tuscany.sca.cpp.tools.common; - -/** - * A piece of C++ source code - */ -public class FilePart { - public final static int UNKNOWN = 0; - - public final static int COMMENT = 1; - - public final static int METHOD = 2; - - public final static int FIELD = 3; - - public final static int BEGINSCOPE = 4; - - public final static int ENDSCOPE = 5; - - public final static int DIRECTIVE = 6; - - public final static int WHITESPACE = 7; - - public final static int MACRO = 8; - - public final static int CLASSATTRIBUTE = 9; - - public final static int ENUM = 10; - - public final static int PROTOTYPE = 11; - - public final static int TYPEDEF = 12; - - protected String cppsource; - - protected int type; - - FilePart(String s, int type) { - cppsource = s; - this.type = type; - } - - public int getType() { - return type; - } - - int length() { - return cppsource.length(); - } - - public String toString() { - return cppsource; - } -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Headers.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Headers.java deleted file mode 100644 index 533e1fd14a..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Headers.java +++ /dev/null @@ -1,167 +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. - */ - -/* @version $Rev$ $Date$ */ - -/* - * Branched from the original class that was also contributed to the - * org.apache.axis.tools.common package. - */ -package org.apache.tuscany.sca.cpp.tools.common; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -public class Headers implements FileActor { - private ArrayList instanceMethods = new ArrayList(); - - private ArrayList staticMethods = new ArrayList(); - - private ArrayList allMethods = new ArrayList(); - - private ArrayList classNames = new ArrayList(); - - private boolean failed = false; - - public void actOnFile(File header, File ignored, int depth) - throws Exception { - if (Configuration.fileExcluded(header.getName())) { - Utils.outputDebugString("excluding " + header + "..."); - return; - } - - Utils.outputDebugString("pre-parsing " + header + "..."); - FileReader fr = null; - try { - fr = new FileReader(header); - } catch (FileNotFoundException fnfe) { - throw fnfe; - } - BufferedReader inputFile = new BufferedReader(fr); - - try { - InputCppSourceCode code = new InputCppSourceCode(inputFile, header - .getName()); - Iterator it = code.getPartIterator(); - while (it.hasNext()) { - FilePart fp = (FilePart) (it.next()); - if (fp.getType() != FilePart.PROTOTYPE) - continue; - PrototypePart pp = (PrototypePart) fp; - String className = pp.className(); - if (null == className) - continue; - String trimClassName = className; - if (className.endsWith("::")) - trimClassName = className.substring(0, - className.length() - 2); - if (!classNames.contains(trimClassName)) - classNames.add(trimClassName); - - Signature sign = new Signature(fp.toString()); - sign.setClassName(className); - //Tuscany - sign.setScope(pp.getSignature().getScope()); - sign.setNamespace(pp.getSignature().getNamespace()); - - // "Clean" the signature by stripping off attributes, - // semicolons, etc - Signature cleaned = new Signature(sign.toStringWithoutAttrs()); - //Tuscany - problem - cleaned.setClassName(className); - cleaned.setScope(pp.getSignature().getScope()); - cleaned.setNamespace(pp.getSignature().getNamespace()); - //Tuscany - end of problem - - - if (-1 == sign.getAttributes().indexOf("static")) - instanceMethods.add(cleaned); - else - staticMethods.add(cleaned); - } - } catch (ParsingException pe) { - failed = true; - } - - inputFile.close(); - allMethods.addAll(staticMethods); - allMethods.addAll(instanceMethods); - } - - public boolean failed() { - return failed; - } - - public boolean isInstanceMethod(Signature sign) { - Iterator it = instanceMethods.iterator(); - while (it.hasNext()) { - Signature s = (Signature) it.next(); - if (s.equals(sign)) - return true; - } - return false; - } - - public boolean isStaticMethod(Signature sign) { - Iterator it = staticMethods.iterator(); - while (it.hasNext()) { - Signature s = (Signature) it.next(); - if (s.equals(sign)) - return true; - } - return false; - } - - public List getMethods(String method) { - ArrayList list = new ArrayList(); - if (null == method) - return list; - - Iterator it = allMethods.iterator(); - while (it.hasNext()) { - Signature s = (Signature) it.next(); - if (method.equals(s.getMethodName())) - list.add(s); - } - return list; - } - - /** - * Tuscany change - a method to get all the method signatures at once - */ - public List getAllMethods() { - ArrayList list = new ArrayList(); - Iterator it = allMethods.iterator(); - while (it.hasNext()) { - Signature s = (Signature) it.next(); - list.add(s); - } - return list; - } - - public boolean isClassName(String text) { - return classNames.contains(text); - } -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/InputCppSourceCode.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/InputCppSourceCode.java deleted file mode 100644 index 225909e1d1..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/InputCppSourceCode.java +++ /dev/null @@ -1,425 +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. - */ - -/* @version $Rev$ $Date$ */ - -/* - * Branched from the original class that was also contributed to the - * org.apache.axis.tools.common package. - */ -package org.apache.tuscany.sca.cpp.tools.common; - -import java.io.BufferedReader; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.StringTokenizer; - -public class InputCppSourceCode { - - private ArrayList parts = new ArrayList(); - - private String name; - - public InputCppSourceCode(BufferedReader br, String name) throws Exception { - this.name = name; - - String s = null; - StringBuffer buff = new StringBuffer(); - for (int i = 1;; i++) { - try { - s = br.readLine(); - } catch (Exception e) { - System.err.println("Ignoring exception thrown parsing file " - + name + " line number " + i); - e.printStackTrace(); - break; - } - if (s == null) - break; - buff.append(s + "\n"); - } - String str = buff.toString(); - - // TODO: When checking for rest.startsWith("struct") should - // check the next letter after struct is not alphanumeric otherwise - // we'll get false matches on a function called structify() for - // instance. Also applies to enum, union, public, typedef, etc - - String rest, text = ""; - int scopedepth = 0; - String scope = "public"; - String currentClass = null; - String currentNamespace = null; - for (int idx = 0; idx < str.length(); /* No idx++ */ - ) { - rest = str.substring(idx); - if (Character.isWhitespace(rest.charAt(0))) { - int ridx = 0; - while (ridx < rest.length() - && Character.isWhitespace(rest.charAt(ridx))) - ridx++; - text = rest.substring(0, ridx); - FilePart fp = new FilePart(text, FilePart.WHITESPACE); - parts.add(fp); - idx += ridx; - - } else if (rest.startsWith("/*")) { - int ridx = rest.indexOf("*/"); // Don't use Utils here - text = str.substring(idx, idx + ridx + 2); - FilePart fp = new FilePart(text, FilePart.COMMENT); - parts.add(fp); - idx += text.length(); - - } else if (rest.startsWith("//")) { - text = str.substring(idx, idx + rest.indexOf("\n")); - FilePart fp = new FilePart(text, FilePart.COMMENT); - parts.add(fp); - idx += text.length(); - - } else if (rest.startsWith("#")) { - int ridx = rest.indexOf("\n"); - char c = rest.charAt(ridx - 1); - while (-1 != ridx && '\\' == c) { - String rest2 = rest.substring(ridx + 1); - ridx += rest2.indexOf("\n") + 1; - c = rest.charAt(ridx - 1); - } - text = str.substring(idx, idx + ridx); - FilePart fp = new FilePart(text, FilePart.DIRECTIVE); - parts.add(fp); - idx += text.length(); - - } else if (rest.startsWith("}")) { - if (scopedepth <= 0) //Tuscany need to increase scopedepth for - // namespaces? - Utils.rude("Braces do not match", name, lineNo(str, idx), - rest.substring(0, rest.indexOf("\n"))); - else - scopedepth--; - // TODO: better checking that this brace really ends the class - if (0 == scopedepth) - currentClass = null; - scope = "public"; - parts.add(new FilePart("}", FilePart.ENDSCOPE)); - idx++; - - } else if (rest.startsWith(";")) { - parts.add(new FilePart(";", FilePart.FIELD)); - idx++; - - } else if (!Character.isLetter(rest.charAt(0)) - && '~' != rest.charAt(0) && '_' != rest.charAt(0)) { - Utils.rude("Lines must start with a letter ", name, lineNo(str, - idx), rest.substring(0, rest.indexOf("\n"))); - - } else if (MacroPart.isAMacro(rest)) { - MacroPart mp = MacroPart.create(rest); - parts.add(mp); - idx += mp.length(); - - } else if (beginsScope(rest)) { - - //Tuscany a namespace comes in here - scopedepth++; - text = rest.substring(0, Utils.indexOf(rest, "{") + 1); - FilePart fp = new FilePart(text, FilePart.BEGINSCOPE); - parts.add(fp); - idx += text.length(); - if (Utils.startsWith(text, "class")) { - // TODO: cope with comments here - // TODO: split out classes into a ClassPart - StringTokenizer st = new StringTokenizer(text, - Utils.whitespace + ":{"); - st.nextToken(); // step over "class" - while (st.hasMoreTokens()) { - String word = st.nextToken(); - if (Configuration.isAttribute(word)) - continue; - currentClass = word; - break; - } - } - - //Tuscany - if (Utils.startsWith(text, "namespace")) { - // TODO: cope with comments here - StringTokenizer st = new StringTokenizer(text, - Utils.whitespace + "{"); - st.nextToken(); // step over "namespace" - String word = ""; - while (st.hasMoreTokens()) { - word = st.nextToken(); - if (word.equals("{")) { - break; - } - - } - - if(currentNamespace == null) - { - currentNamespace = word; - } - else - { - currentNamespace += "::" + word; - } - //We have not got to the class yet - //so will need ot deal with the namespace - //when we do - } - // Tuscany end - - } else if (isEnumOrUnion(rest)) { - int ridx = Utils.findMatching(rest, '{', '}') + 1; - String rest2 = rest.substring(ridx); - ridx = idx + ridx + Utils.indexOf(rest2, ';') + 1; - text = str.substring(idx, ridx); - FilePart fp = new FilePart(text, FilePart.ENUM); - parts.add(fp); - idx += text.length(); - - } else if (scopedepth > 0 - && (rest.startsWith("public") - || rest.startsWith("protected") || rest - .startsWith("private"))) { - int colon = rest.indexOf(":"); - if (-1 == colon) - Utils.rude("No colon found after public or private ", name, - lineNo(str, idx), rest.substring(0, rest - .indexOf("\n"))); - scope = str.substring(idx, idx + colon); - text = str.substring(idx, idx + colon + 1); - FilePart fp = new FilePart(text, FilePart.CLASSATTRIBUTE); - parts.add(fp); - idx += text.length(); - - } else if (Utils.startsWith(rest, "typedef")) { - int semicolon = Utils.indexOf(rest, ';'); - int brace = Utils.indexOf(rest, '{'); - - if (-1 == semicolon) - Utils.rude("No semicolon found after typedef", name, - lineNo(str, idx), rest.substring(0, rest - .indexOf("\n"))); - - if (-1 == brace || semicolon < brace) { - // Simple typedef - text = str.substring(idx, idx + semicolon + 1); - } else { - // Typedef of a struct, etc - int endbrace = Utils.findMatching(rest, '{', '}'); - String rest2 = rest.substring(endbrace); - semicolon = Utils.indexOf(rest2, ';'); - text = str.substring(idx, idx + endbrace + semicolon + 1); - } - FilePart fp = new FilePart(text, FilePart.TYPEDEF); - parts.add(fp); - idx += text.length(); - - } else { - if (isMethod(rest)) { - - int brace = Utils.indexOf(rest, '{'); - Signature signature = new Signature(str.substring(idx, idx - + brace)); - if (signature.failed()) - Utils.rude("Signature parsing failed", name, lineNo( - str, idx), signature.getOriginal()); - if (null != currentClass - && null == signature.getClassName()) - signature.setClassName(currentClass); - signature.setScope(scope); - signature.setNamespace(currentNamespace); - - String body = rest.substring(brace); - int endBrace = Utils.findMatching(body, '{', '}'); - body = body.substring(0, endBrace + 1); - int endIdx = idx + signature.originalLength() - + body.length(); - text = str.substring(idx, endIdx); - MethodPart mp = new MethodPart(text, signature, body); - parts.add(mp); - idx += text.length(); - - } else if (isField(rest)) { - int semicolon = Utils.indexOf(rest, ';'); - text = str.substring(idx, idx + semicolon + 1); - FilePart fp = new FilePart(text, FilePart.FIELD); - parts.add(fp); - idx += text.length(); - - } else if (isPrototype(rest)) { - int semicolon = Utils.indexOf(rest, ';'); - text = str.substring(idx, idx + semicolon + 1); - PrototypePart pp = new PrototypePart(text, currentClass, currentNamespace); - pp.setScope(scope); - parts.add(pp); - idx += text.length(); - - } else { - //TODO other file parts here - not sure if there are any - // others? - Utils.rude("Unrecognised file part", name, - lineNo(str, idx), rest.substring(0, rest - .indexOf("\n"))); - } // end if - } // end if - } // end for - } - - public Iterator getPartIterator() { - return parts.iterator(); - } - - private int lineNo(String s, int idx) { - int n = 0; - for (int i = 0; i < idx && i < s.length(); i++) - if ('\n' == s.charAt(i)) - n++; - return n; - } - - /** - * Find out whether we are defining a class, struct or extern "C" which may - * contain function implementations. These will have braces which begin a - * new scope. Ignore function prototypes that return a struct. struct mystr { - * int f1; }; struct mystr func(); struct mystr func() { struct mystr a; - * return a; } - */ - private static boolean beginsScope(String s) throws ParsingException { - if (isMethod(s)) - return false; - - int brace = Utils.indexOf(s, '{'); - int semicolon = Utils.indexOf(s, ';'); - - // Return false for class prototypes, but true for class definitions. - if (Utils.startsWith(s, "class")) { - if (-1 == brace) - return false; - if (-1 == semicolon) - return true; - return brace < semicolon; - } - - if (Utils.startsWith(s, "struct")) { - if (-1 == brace || -1 == semicolon) - return false; - return brace < semicolon; - } - - //Tuscany handle namespace for prototypes - //in a similar way to "class" - if (Utils.startsWith(s, "namespace")) { - if (-1 == brace || -1 == semicolon) - return false; - return brace < semicolon; - } - - return startsWithExternScope(s); - } - - /** - * There are 4 types of extern ... extern int field; extern int func(); - * extern "C" int func() { return 2; } extern "C" { int func() { return 2; } } - * This method should return true only for the last of these three examples - * since only the last one creates a new scope using braces. - */ - private static boolean startsWithExternScope(String s) - throws ParsingException { - if (!s.startsWith("extern")) - return false; - - int brace = Utils.indexOf(s, '{'); - int semicolon = Utils.indexOf(s, ';'); - int bracket = Utils.indexOf(s, '('); - - if (-1 == brace) - return false; - return (-1 == semicolon || brace < semicolon) - && (-1 == bracket || brace < bracket); - } - - /** - * Find out whether we are defining an enum or union which will contain - * braces. Ignore function prototypes that return an enum or union. enum - * colour { red, blue }; enum colour func(); enum colour func() { return - * colour.red; } - */ - private static boolean isEnumOrUnion(String s) throws ParsingException { - if ((!Utils.startsWith(s, "enum") && !Utils.startsWith(s, "union")) - || isMethod(s)) - return false; - - int brace = Utils.indexOf(s, '{'); - int semicolon = Utils.indexOf(s, ';'); - return -1 != brace && (-1 == semicolon || brace < semicolon); - } - - /** - * Rules to recognise fields and methods... - * - * Fields must contain a semicolon Methods may or may not contain a - * semicolon Prototypes must contain a semicolon Fields may or may not - * contain a brace (array initialisers do) Methods must contain a brace - * Prototypes must not contain a brace Fields may or may not contain a - * bracket (casts do) Methods must contain a bracket Prototypes must contain - * a bracket - * - * It's a method if it contains a bracket and then a brace before the first - * semicolon (if there is a semicolon). It's a prototype if it's not a - * method and it contains brackets before a semicolon. It's a field if it's - * not a method or a prototype and it contains a semicolon. If it's not a - * field, a method or a prototype and we haven't recognised it previously - * then it's an error. - */ - private static boolean isMethod(String s) throws ParsingException { - int semicolon = Utils.indexOf(s, ';'); - int brace = Utils.indexOf(s, '{'); - int bracket = Utils.indexOf(s, '('); - - return (-1 != bracket && -1 != brace && bracket < brace && (-1 == semicolon || brace < semicolon)); - } - - private static boolean isPrototype(String s) throws ParsingException { - int semicolon = Utils.indexOf(s, ';'); - int bracket = Utils.indexOf(s, '('); - return !isMethod(s) && -1 != semicolon && -1 != bracket - && bracket < semicolon; - } - - private static boolean isField(String s) throws ParsingException { - int semicolon = Utils.indexOf(s, ';'); - return !isMethod(s) && !isPrototype(s) && -1 != semicolon; - } - - public String getName() { - return name; - } - - public String toString() { - StringBuffer text = new StringBuffer(); - for (int i = 0; i < parts.size(); i++) { - text.append(((FilePart) (parts.get(i))).toString()); - } - return text.toString(); - } - -} diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/MacroPart.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/MacroPart.java deleted file mode 100644 index 317ad2fc44..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/MacroPart.java +++ /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. - */ - -/* @version $Rev$ $Date$ */ - -/* - * Branched from the original class that was also contributed to the - * org.apache.axis.tools.common package. - */ - -/* - * A C or C++ macro as it is used in the source code - */ -package org.apache.tuscany.sca.cpp.tools.common; - -class MacroPart extends FilePart { - /** - * Factory method to create a MacroPart. - * - * @param s - * unparsed source code which may start with a define or macro. - */ - static MacroPart create(String s) { - String orig = getOriginalText(s); - if (null == orig) - return null; - return new MacroPart(orig); - } - - MacroPart(String s) { - super(s, FilePart.MACRO); - } - - /** - * @param s - * unparsed source code which may start with a define or macro. - * @return all of s up to the end of the define or macro. - */ - private static String getOriginalText(String s) { - String name = getName(s); - int len = name.length(); - if (null == name) - return null; - else if (Configuration.isDefine(name)) { - return s.substring(0, len); - } else if (Configuration.isMacro(name)) { - String rest = s.substring(len); - len += Utils.findMatching(rest, '(', ')'); - return s.substring(0, len + 1); - } else - return null; - } - - static boolean isAMacro(String s) { - if (s == null || 0 == s.length()) - return false; - String name = getName(s); - return Configuration.isMacro(name) || Configuration.isDefine(name); - } - - private static String getName(String s) { - int i; - for (i = 0; i < s.length(); i++) - if (!Character.isLetterOrDigit(s.charAt(i)) && '_' != s.charAt(i)) - break; - if (s.length() == i) - return null; - return s.substring(0, i); - } -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/MethodPart.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/MethodPart.java deleted file mode 100644 index a25610c1f9..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/MethodPart.java +++ /dev/null @@ -1,133 +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. - */ - -/* @version $Rev$ $Date$ */ - -/* - * Branched from the original class that was also contributed to the - * org.apache.axis.tools.common package. - */ -package org.apache.tuscany.sca.cpp.tools.common; - -import java.util.ArrayList; - -/** - * A C or C++ method from a piece of source code. The method has a signature and - * a body (the bit between the braces). - */ -public class MethodPart extends FilePart { - private Signature signature; - - private String body; - - MethodPart(String s, Signature signature, String body) { - super(s, METHOD); - this.signature = signature; - this.body = body; - } - - public Signature getSignature() { - return signature; - } - - public String getOriginalSignature() { - return signature.getOriginal(); - } - - /** - * Returns the method body as code snippets, each ending with a place where - * a trace statement belongs. The end of the first code snippet is where the - * entry trace should go. The end of every other snippet is a return from - * the method. - */ - public BodyPart[] getBodyParts() throws ParsingException { - String b = body; // Don't alter field member - if (b.startsWith("{")) - b = b.substring(1); - - // Add in trace exit at all the return statements in the method. - ArrayList al = new ArrayList(); - int idxR = Utils.indexOf(b, "return"); - int idxC = Utils.indexOf(b, "catch"); - while (-1 != idxR || -1 != idxC) { - if (-1 == idxC || (-1 != idxR && idxR < idxC)) { - String frag = b.substring(0, idxR); - String rest = b.substring(idxR + "return".length()); - - int semicolon = Utils.indexOf(rest, ';'); - if (-1 == semicolon) - Utils.rude("Missing semicolon in " + signature); - String retVal = rest.substring(0, semicolon); - BodyPart bp = new BodyPart(frag, retVal); - al.add(bp); - b = b.substring(idxR + "return".length() + retVal.length() + 1); - } else { - String frag = b.substring(0, idxC); - String rest = b.substring(idxC); - - int brace = Utils.indexOf(rest, "{"); - if (-1 == brace) - Utils.rude("Missing open brace in " + signature); - Signature signature = new Signature(rest.substring(0, brace)); - frag = frag + rest.substring(0, brace + 1); - BodyPart bp = new BodyPart(frag, signature.getParameters()[0]); - al.add(bp); - b = rest.substring(brace + 1); - } - idxR = Utils.indexOf(b, "return"); - idxC = Utils.indexOf(b, "catch"); - } - - // Add in trace exit before the last } if there are no returns in - // the method or there is code after the last return and the method - // returns void. - // int f1(){try{return f2();}catch(Exception& e){throw;}} - // has code after the last return but having a traceexit before the - // last brace wouldn't compile since the method returns an int. We - // cope with this by only adding in a traceexit before the last brace - // if the method returns void. That may mean we add in an unreachable - // traceexit which may give a compiler warning, but that should be - // benign. - // - // TODO: Not quite good enough for - // void f(int a){if(a){printf("a");}else{printf("!a");return;}} - // as a trace exit is needed before the last } in case a>0 but - // void f(int a){if(a){printf("a");return;}else{printf("!a");return;}} - // would give compiler warnings about unreachable code if a trace - // exit is added before the last brace. This could be tricky to fix. - if ((0 == al.size() || -1 != Utils.indexOf(b, ';')) - && null == signature.getReturnType().getType()) { - - int last = b.lastIndexOf('}'); - if (-1 == last) - Utils.rude("Missing end brace in " + signature); - String b2 = b.substring(0, last); - al.add(new BodyPart(b2)); - b = b.substring(last); - } - - // The final body part is the last } - al.add(new BodyPart(b)); - - BodyPart[] bps = new BodyPart[al.size()]; - System.arraycopy(al.toArray(), 0, bps, 0, al.size()); - return bps; - } -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Options.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Options.java deleted file mode 100644 index 6e951f03de..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Options.java +++ /dev/null @@ -1,164 +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. - */ - -/* @version $Rev$ $Date$ */ - -/* - * Branched from the original class that was also contributed to the - * org.apache.axis.tools.common package. - * - */ -package org.apache.tuscany.sca.cpp.tools.common; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -/** - * Command line options passed to a tool's main program. All command line - * options should begin with a dash "-". Some command line options take a value - * which is the next parameter after the option. Others do not. - */ -public class Options { - static HashMap pairs = new HashMap(); - - static List values = new ArrayList(); - - /** - * No one constructs this class. - */ - private Options() { - } - - public static void reset() { - pairs = new HashMap(); - values = new ArrayList(); - } - - /** - * Initialises the options based on the args passed to main - */ - public static void set(String args[]) { - for (int i = 0; i < args.length; i++) { - if (args[i].startsWith("-")) { - if ((i + 1 <= args.length - 1) && // next one is testable - !args[i + 1].startsWith("-") // and it starts with a "-" - ) { - String key = args[i]; - Object pairValue = pairs.get(key); - if (null == pairValue) { - pairs.put(args[i], args[i + 1]); - } else if (pairValue instanceof String) { - List l = new ArrayList(); - l.add(pairValue); - l.add(args[i + 1]); - pairs.put(key, l); - } else if (pairValue instanceof List) { - ((List) pairValue).add(args[i + 1]); - } - i++; // Step over value for this key - } else - values.add(args[i]); - } - } - } - - public static Object getOption(String key) { - return pairs.get(key); - } - - static boolean isOptionSet(String key) { - return values.contains(key) || null!=pairs.get(key); - } - - /** - * This option will cause scagen to print out messages - * about the artefacts it is processing - * @return - */ - public static boolean verbose() { - return isOptionSet("-verbose"); - } - - /** - * This option will cause scagen to print out some - * basic internal log type messages - * @return - */ - public static boolean debug() { - return isOptionSet("-debug"); - } - - /** - * This option will cause scagen to print out some - * text that can be used or pasted into a command - * file to copy all the relevant artefacts from - * where they are found or generated to a specific - * deployment location - * - * @return - */ - public static boolean deploy() { - return isOptionSet("-deploy"); - } - - /** - * This option will prevent scagen from actually writing out - * the generated files. It is useful if used in conjunction - * with the "-deploy" option. - * @return - */ - public static boolean noGenerate() { - return isOptionSet("-nogenerate"); - } - - /** - * This option is useful only when used in conjunction with - * the "-deploy" option. It changes the output to be more like the - * source code of a command script to copy the files to a - * specific place. - * @return - */ - public static boolean outputCommand() { - return isOptionSet("-outputCommand"); - } - - /** - * This option is useful only when used in conjunction with - * the "-deploy" option. It changes the output to be a simple - * list of artefacts. It has no effect if the "-outputCommand" - * option is set. - * - * @return - */ - public static boolean list() { - return isOptionSet("-list"); - } - - /** - * This option is maintained for compatibility with the - * original package source. It is not used by new scagen code. - * - * @return - */ - public static boolean quiet() { - return isOptionSet("-quiet"); - } -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Parameter.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Parameter.java deleted file mode 100644 index 2d98e0a836..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Parameter.java +++ /dev/null @@ -1,216 +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. - */ - -/* @version $Rev$ $Date$ */ - -/* - * Branched from the original class that was also contributed to the - * org.apache.axis.tools.common package. - * - */ -package org.apache.tuscany.sca.cpp.tools.common; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -/** - * A parameter from a method signature. The parameter is the datatype plus its - * name but not its value. - */ -public class Parameter { - private ArrayList type = new ArrayList(); - - private String name = null; - - private boolean failed = false; - - /** - * Defaults to a parameter in a parameter list so it HAS a parameter name in - * it - */ - Parameter(List parts) { - this(parts, false); - } - - /** - * A parameter which is a return type does not have a parameter name. - * Parameters in a parameter list do have parameter names embedded in them - */ - Parameter(List parts, boolean isRetType) { - if (parts == null || parts.size() == 0) - return; - - // Tuscany: The original code below from apache axis blocks int - // getCustomer(long) - // i.e. no spaces in parameter list. - // We do not need to deal with "..." as parameters to SCS methods. - // - // if (!isRetType && parts.size() == 1) { - // if ("...".equals(parts.get(0))) { - // type.add("..."); - // name = ""; - // } else if (!"void".equals(parts.get(0))) - // failed = true; // Seems like bad C++ code here - // return; - // } - - if (isRetType) { - Iterator it = parts.iterator(); - while (it.hasNext()) - type.add(it.next()); - - // Some methods return have void on their signature and others - // have nothing. So to make them both the same, if a method - // doesn't return anything make type null. - // TODO: This assumption is wrong - methods that return nothing - // default to returning an int! - if (1 == type.size() && "void".equals(type.get(0))) - type = new ArrayList(); - - } else { - // Cope with array subscripts [] after the name - int arrIdx = -1; - for (int i = 0; i < parts.size(); i++) { - String tok = (String) parts.get(i); - if ("[".equals(tok)) { - arrIdx = i; - break; - } - } - - // Find the name - int nameIdx = parts.size() - 1; - if (-1 != arrIdx) - nameIdx = arrIdx - 1; - - // Even in real method declarations, parameters may not have a name - boolean noName = false; - name = (String) parts.get(nameIdx); - // Tuscany: The original code below from apache axis - // was updated to work with signatures of - // the form fn(int) a non-named, no-space, parameter list. - // if (Utils.cPrimitives.contains(name) || - // Utils.cTypeQualifiers.contains(name) ) - // - if (Utils.cPrimitives.contains(name) - || Utils.cTypeQualifiers.contains(name) - || parts.size() == 1) - noName = true; - - if (noName) { - name = null; - for (int i = 0; i < parts.size(); i++) - type.add(parts.get(i)); - } else { - // Construct the type - for (int i = 0; i < nameIdx; i++) - type.add(parts.get(i)); - - if (-1 != arrIdx) - for (int i = arrIdx; i < parts.size(); i++) - type.add(parts.get(i)); - } - } - } - - public boolean failed() { - return failed; - } - - public String getType() { - String s = null; - Iterator it = type.iterator(); - while (it.hasNext()) { - String next = (String) it.next(); - if (null == s) - s = next; - else if ("*".equals(next) || "&".equals(next)) - s += next; - else - s += " " + next; - } - return s; - } - - public String getTypeWithoutConst() { - String s = null; - Iterator it = type.iterator(); - while (it.hasNext()) { - String next = (String) it.next(); - if ("const".equals(next)) - continue; - else if (null == s) - s = next; - else if ("*".equals(next) || "&".equals(next)) - s += next; - else - s += " " + next; - } - return s; - } - - public String getName() { - return name; - } - - public boolean isVoid() { - return 0 == type.size(); - } - - public boolean isDotDotDot() { - return 1 == type.size() && "...".equals(type.get(0)); - } - - /** - * For two parameters to match their types must match or both be null, but - * the parameters names don't have to match. Just because a parameter is - * called something different in a header file as in the the source file - * doesn't mean it's a different parameter. - */ - public boolean equals(Object o) { - if (null == o || !(o instanceof Parameter)) - return false; - Parameter that = (Parameter) o; - if (type.size() != that.type.size()) - return false; - for (int i = 0; i < type.size(); i++) { - String s1 = (String) type.get(i); - String s2 = (String) that.type.get(i); - if (!Utils.safeEquals(s1, s2)) - return false; - } - return true; - } - - public String toString() { - if (0 == type.size()) - return "void"; - if (null == name) - return getType(); - return getType() + " " + name; - } - - public Iterator iterator() { - if (null == type) - return null; - return type.iterator(); - } -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/ParsingException.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/ParsingException.java deleted file mode 100644 index 876d2dc3e0..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/ParsingException.java +++ /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. - */ - -/* @version $Rev$ $Date$ */ - - -/* - * Branched from the original class that was also contributed to the - * org.apache.axis.tools.common package. - * - */ -package org.apache.tuscany.sca.cpp.tools.common; - -public class ParsingException extends Exception { - - public ParsingException() { - super(); - } - - public ParsingException(String message) { - super(message); - } - - public ParsingException(String message, Throwable cause) { - super(message, cause); - } - - public ParsingException(Throwable cause) { - super(cause); - } -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/PrototypePart.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/PrototypePart.java deleted file mode 100644 index e51b2d781c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/PrototypePart.java +++ /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. - */ - -/* @version $Rev$ $Date$ */ - -/* - * Branched from the original class that was also contributed to the - * org.apache.axis.tools.common package. - * - */ -package org.apache.tuscany.sca.cpp.tools.common; - -/** - * A function prototype in an include file and possibly in a class definition. - */ -public class PrototypePart extends FilePart { - private Signature signature; - - public PrototypePart(String s, String className, String namespace) { - super(s, PROTOTYPE); - signature = new Signature(s); - if (null != className) - signature.setClassName(className); - if (null != namespace && namespace.length()>0) - signature.setNamespace(namespace); - } - - String className() { - return signature.getClassName(); - } - - public Signature getSignature() { - return signature; - } - - public void setScope(String scope) { - signature.setScope(scope); - } -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Signature.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Signature.java deleted file mode 100644 index d7052b7843..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Signature.java +++ /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. - */ - -/* @version $Rev$ $Date$ */ - -/* - * Branched from the original class that was also contributed to the - * org.apache.axis.tools.common package. - * - */ -package org.apache.tuscany.sca.cpp.tools.common; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -/** - * A C or C++ method signature with the ability to parse it. TODO: properly - * support variable length argument lists using "..." TODO: passing or returning - * function pointers (hopefully not needed) TODO: Cope with ~ Classname() - */ -public class Signature { - private String originalText; - - private String attributes; - - private String className = null; - - private String namespace = null; - - private String methodName = null; - - private Parameter returnType = null; - - private Parameter[] params = null; - - private String trailingAttributes; - - private String scope = "public"; - - private boolean failed = false; - - private boolean traceable = true; - - private final static Set knownAttrs = new HashSet(Arrays - .asList(new Object[] { "public", "private", "extern", "\"C\"", - "virtual", "static", "inline" })); - - private final static Set specialOperators = new HashSet( - Arrays.asList(new Object[] { "(", ")", "*", ",", "&", "]", "[", - "=", "~" })); - - /** - * Takes an unparsed signature string and parses it. - * - * TODO: Should optionally pass in the className here in case it's an inline - * method implementation inside the class{}. Just so the className comes out - * in the trace. - */ - Signature(String s) { - originalText = s; - - try { - List tokens = tokenise(s); - - ArrayList alAttrs = new ArrayList(); - ArrayList alName = new ArrayList(); - ArrayList alParms = new ArrayList(); - ArrayList alTrailAttrs = new ArrayList(); - ArrayList alInits = new ArrayList(); - if (!splitUp(tokens, alAttrs, alName, alParms, alTrailAttrs, - alInits)) { - failed = true; - return; - } - - parseAttributes(alAttrs); - parseNameAndRetType(alName); - parseParameters(alParms); - parseTrailingAttributes(alTrailAttrs); - - // Ignore any tokens after the ) since these are (hopefully) - // constructor initialisers - - traceable = !Configuration.methodExcluded(className, methodName); - } catch (NullPointerException npe) { - failed = true; - traceable = false; - } - } - - /** - * Parse the signature into tokens. This removes whitespace and comments and - * separates out "*", ",", "(", ")", "&", "[" and "]". - */ - private static List tokenise(String s) { - ArrayList tokens = new ArrayList(); - String tok = null; - boolean space = true; - for (int i = 0; i < s.length(); i++) { - char c = s.charAt(i); - if (Character.isWhitespace(c)) { - space = true; - continue; - } - if (space) { - if (tok != null) - tokens.add(tok); - tok = "" + c; - } else - tok += c; - space = false; - - if (tok.endsWith("/*")) { - String sub = s.substring(i); - int endcomm = sub.indexOf("*/"); - if (endcomm == -1) - break; - i += endcomm + 1; - if (tok.equals("/*")) - tok = ""; - else - tok = tok.substring(0, tok.length() - 2); - continue; - } - - if (tok.endsWith("//")) { - String sub = s.substring(i); - int endcomm = sub.indexOf("\n"); - if (endcomm == -1) - break; - i += endcomm; - if (tok.equals("//")) - tok = ""; - else - tok = tok.substring(0, tok.length() - 1); - continue; - } - - if (tok.endsWith("::")) - space = true; - - String sc = "" + c; - if (specialOperators.contains(sc)) { - if (!tok.equals(sc)) { - tokens.add(tok.substring(0, tok.length() - 1)); - tok = sc; - } - space = true; - } - } - tokens.add(tok); - return tokens; - } - - /** - * Split up a tokenised method signature into a list of attributes, a list - * of name and return type tokens, a list of parameter tokens and a list of - * initialiser tokens. - */ - private static boolean splitUp(List tokens, List attrs, List nameAndRet, - List parms, List trailAttrs, List inits) { - - // nameStart points to the start of the return type if there is one - // else the start of the method name - int nameStart; - for (nameStart = 0; nameStart < tokens.size(); nameStart++) { - String tok = (String) (tokens.get(nameStart)); - if (!knownAttrs.contains(tok) && !Configuration.isAttribute(tok)) - break; - } - if (nameStart == tokens.size()) - return false; - - // initStart points to the initialisers, or thrown exceptions after - // the parameter list. throw is a keyword so we can safely search for - // it. - int initStart = tokens.size(); - for (int i = nameStart; i < tokens.size(); i++) { - String tok = (String) tokens.get(i); - if ((tok.startsWith(":") && !tok.startsWith("::")) - || "throw".equals(tok)) - initStart = i; - } - - int parmEnd; - for (parmEnd = initStart - 1; parmEnd > nameStart; parmEnd--) - if (")".equals(tokens.get(parmEnd))) - break; - if (parmEnd == nameStart) - return false; - - int parmStart = parmEnd; - for (parmStart = parmEnd; parmStart > nameStart; parmStart--) - if ("(".equals(tokens.get(parmStart))) - break; - - for (int i = 0; i < tokens.size(); i++) { - Object tok = tokens.get(i); - if (i < nameStart || Configuration.isAttribute((String) tok)) - attrs.add(tok); - else if (i < parmStart) - nameAndRet.add(tok); - else if (i <= parmEnd) - parms.add(tok); - else if (i < initStart) - trailAttrs.add(tok); - else - inits.add(tok); - } - return true; - } - - private void parseAttributes(List list) { - attributes = new String(); - Iterator it = list.iterator(); - while (it.hasNext()) { - if (attributes.length() > 0) - attributes += " "; - String next = (String) it.next(); - - //Tuscancy - //the scope is not present in the attributes - //but is set later in the InputCppSource contructor - if ("public".equals(next) || "protected".equals(next) - || "private".equals(next)) - scope = next; - attributes += next; - } - } - - private void parseNameAndRetType(List list) { - int size = list.size(); - int idx; - // "operator" is a key word so if it's present we know we're - // dealing with operator overloading. The operator that's been - // overloaded might have been split up into multiple tokens. - for (idx = 0; idx < size; idx++) - if ("operator".equals(list.get(idx))) - break; - - if (idx < size) { - methodName = ""; - for (int i = idx; i < size; i++) - methodName += (String) list.get(i); - } else { // No operator overloading - methodName = "" + list.get(size - 1); - idx = size - 1; - } - - // If it's a destructor, the "~" will be split out into a separate - // token, so add it onto the methodName here. - if (idx > 0 && "~".equals(list.get(idx - 1))) { - methodName = "~" + methodName; - idx--; - } - - // The class name comes before the method name - while (idx > 0 && ((String) list.get(idx - 1)).endsWith("::")) { - if (null == className) - className = (String) list.get(idx - 1); - else - className = (String) list.get(idx - 1) + className; - idx--; - } - - // Whatever's left before the classname/methodname must be the - // return type - ArrayList retParm = new ArrayList(); - for (int i = 0; i < idx; i++) - retParm.add(list.get(i)); - - returnType = new Parameter(retParm, true); - } - - /** - * Constructs the parameter list - */ - private void parseParameters(List list) { - ArrayList alParams = new ArrayList(); - Iterator it = list.iterator(); - String token = (String) it.next(); // step over the ( - while (it.hasNext() && !")".equals(token)) { - token = (String) it.next(); - - int template = 0; // Depth of template scope - boolean foundEquals = false; - // Ignore default value for an optional parameter - ArrayList parm = new ArrayList(); - while (!token.equals(")") && (!token.equals(",") || template > 0)) { - if (token.equals("=")) - foundEquals = true; - if (!foundEquals) - parm.add(token); - if (contains(token, "<")) - template++; - if (contains(token, ">")) - template--; - token = (String) it.next(); - } - - // No parameters so break out - if (token.equals(")") && 0 == parm.size()) - break; - - Parameter p = new Parameter(parm); - if (p.failed()) { - failed = true; - return; - } - - // Copes with void func(void) - if (!p.isVoid()) - alParams.add(p); - } - - int size = alParams.size(); - if (size > 0) { - params = new Parameter[size]; - System.arraycopy(alParams.toArray(), 0, params, 0, size); - } - } - - private void parseTrailingAttributes(List list) { - trailingAttributes = new String(); - Iterator it = list.iterator(); - while (it.hasNext()) { - if (trailingAttributes.length() > 0) - trailingAttributes += " "; - trailingAttributes += (String) it.next(); - } - } - - public String getOriginal() { - return originalText; - } - - public int originalLength() { - return originalText.length(); - } - - public boolean failed() { - return failed; - } - - public String getAttributes() { - return attributes; - } - - public String getClassName() { - return className; - } - - /** - * @param namespace The namespace to set. - */ - public void setNamespace(String namespace) { - this.namespace = namespace; - } - - /** - * @return Returns the namespace. - */ - public String getNamespace() { - return namespace; - } - - public String getTrimClassName() { - return trimClassName(className); - } - - public String getMethodName() { - return methodName; - } - - public Parameter getReturnType() { - return returnType; - } - - public Parameter[] getParameters() { - return params; - } - - public boolean isConstructor() { - return className != null && methodName != null - && trimClassName(className).equals(methodName); - } - - public boolean isDestructor() { - return className != null && methodName != null - && methodName.startsWith("~") - && methodName.endsWith(trimClassName(className)); - } - - private static String trimClassName(String name) { - if (name.endsWith("::")) - return name.substring(0, name.length() - 2); - return name; - } - - void setClassName(String className) { - if (null == className) - return; - if (!className.endsWith("::")) - className += "::"; - this.className = className; - } - - public String getScope() { - return scope; - } - - /** - * Sets the scope, but only if the scope is not set by an explicit attribute - * in the signature. - */ - public void setScope(String scope) { - if (-1 == attributes.indexOf(this.scope)) - this.scope = scope; - } - - /** - * Should this method be traced? - */ - public boolean traceable() { - return traceable; - } - - private static boolean contains(String src, String tgt) { - if (src == null || tgt == null) - return false; - if (-1 == src.indexOf(tgt)) - return false; - return true; - } - - public boolean equals(Object obj) { - if (null == obj || !(obj instanceof Signature)) - return false; - Signature that = (Signature) obj; - if (!Utils.safeEquals(className, that.className)) - return false; - if (!Utils.safeEquals(methodName, that.methodName)) - return false; - if (!Utils.safeEquals(returnType, that.returnType)) - return false; - if (null == params && null == that.params) - return true; - if (null != params && null == that.params) - return false; - if (null == params && null != that.params) - return false; - if (params.length != that.params.length) - return false; - for (int i = 0; i < params.length; i++) - if (!Utils.safeEquals(params[i], that.params[i])) - return false; - return true; - } - - public String toStringWithoutAttrs() { - String s = new String(); - if (returnType != null) - s += returnType + " "; - if (className != null) - s += className; - s += methodName + "("; - for (int i = 0; params != null && i < params.length; i++) { - if (i > 0) - s += ", "; - s += params[i].toString(); - } - s += ")"; - return s; - } - - public String toString() { - String s = attributes; - if (attributes.length() > 0) - s += " "; - s += toStringWithoutAttrs(); - if (trailingAttributes.length() > 0) - s += " " + trailingAttributes; - return s; - } -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Utils.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Utils.java deleted file mode 100644 index d26c5ec5ae..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/Utils.java +++ /dev/null @@ -1,556 +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. - */ - -/* @version $Rev$ $Date$ */ - -/* -* Branched from the original class that was also contributed to the -* org.apache.axis.tools.common package. -* -*/ -package org.apache.tuscany.sca.cpp.tools.common; - -import java.io.File; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -//Apache Common Logging -//import org.apache.commons.logging.Log; -//import org.apache.commons.logging.LogFactory; - -/** -* Static utility methods. Some of these methods are similar to the methods on -* java.lang.String except they are aware of C/C++ comments and string literals. -* -* TODO: Many of these methods would perform better using StringBuffer not -* String -*/ -public final class Utils { - // All the C primitive data types - public final static Set cPrimitives = new HashSet(Arrays - .asList(new Object[] { "void", "byte", "char", "unsigned", - "signed", "int", "short", "long", "double", "float", - "struct", "class", "enum", "union" })); - - // All the qualifiers that can affect C types - public final static Set cTypeQualifiers = new HashSet( - Arrays.asList(new Object[] { "(", ")", "*", ",", "&", "]", "[", - "const" })); - - public final static String whitespace = " \t\r\n"; - - //private static Log log = LogFactory.getLog(CLASS.class); - - /** - * Never instantiate this class - */ - private Utils() { - } - - /** - * Is this string all whitespace? - */ - static boolean isSpace(String s) { - for (int i = 0; i < s.length(); i++) - if (!Character.isWhitespace(s.charAt(i))) - return false; - return true; - } - - // TODO look for other trailing chars like { (because of class{) - static boolean startsWith(String source, String target) { - if (source == null || target == null) - return false; - if (!source.startsWith(target)) - return false; - if (source.length() == target.length()) - return true; - if (Character.isWhitespace(source.charAt(target.length()))) - return true; - return false; - } - - /** - * Performs a C-aware version of String.indexOf(char) in that it skips - * characters in string literals and comments. - */ - static int indexOf(String s, char c) throws ParsingException { - if ('"' == c) - rude("Utils.indexOf cannot be passed quotes"); - - for (int i = 0; i < s.length(); i++) { - if (s.charAt(i) == c) - return i; - - i = skip(s.substring(i), i); - if (-1 == i) - return -1; - } - return -1; - } - - /** - * Performs a C-aware version of String.indexOf(String) in that it skips - * characters in string literals and comments and makes sure that the target - * string is not embedded in a longer word. - */ - static int indexOf(String s, String t) { - char t0 = t.charAt(0); - for (int i = 0; i < s.length(); i++) { - if (s.charAt(i) == t0 - && s.substring(i).startsWith(t)) { - - - // When finding a single non-alphanumeric character - if(t.length() == 1 && !Character.isLetterOrDigit(t0)) - return i; - - // When finding an alphanumeric string - if((0 == i || !Character.isLetterOrDigit(s.charAt(i - 1))) // Check we're matching at the start of a word - && (s.length() == (i + t.length()) || !Character - .isLetterOrDigit(s.charAt(i + t.length())))) // Check we're still matching by the end of the word - return i; - } - - i = skip(s.substring(i), i); - if (-1 == i) - return -1; - } - return -1; - } - - /** - * Matches braces or quotes and is C-aware. It skips characters in string - * literals and comments. - */ - static int findMatching(String s, char c1, char c2) { - int depth = 0; - for (int i = 0; i < s.length(); i++) { - if (s.charAt(i) == c1) - depth++; - else if (s.charAt(i) == c2) { - depth--; - if (depth == 0) - return i; - } else { - i = skip(s.substring(i), i); - if (-1 == i) - return -1; - } - } - return -1; - } - - /** - * Failed to parse the source code for some reason. This method prints out a - * suitably rude message, and then what? I haven't quite decided yet. - * - * TODO: Do something sensible here like throw an Exception which will give - * up on this file completely and tidy up the output file. It may be just - * too dangerous to try to carry on. But we need to fail in such a way that - * the build system knows that we've failed for this file and can build this - * file without trace. - */ - public static void rude(String reason, String filename, int lineno, - String codefragment) throws ParsingException { - - String text = "Bad C++ code!! "; - if (reason != null) - text += reason; - if (filename != null) - text += " " + filename + " lineno=" + lineno; - if (codefragment != null) - text += " <" + codefragment + ">"; - System.err.println(text); - throw new ParsingException(); - } - - /** - * This method reports an error level problem - * - * @param reason - * why we have an error level problem - */ - public static void rude(String reason) throws ParsingException { - // Apache commons logging - // log.error(Object line, null); - // or for now.... - rude(reason, null, 0, null); - } - - /** - * This method reports an error level problem - * - * @param reason - * why we have an error level problem - */ - public static void screenMessage(String msg) { - // Apache commons logging - // log.error(Object line, null); - // or for now.... - System.out.println(msg); - } - - /** - * Escapes special characters like " so that they can be output in a C - * string literal. Also removes newlines, since C string literals can't be - * split over lines. - */ - String pretty(String s) { - StringBuffer sb = new StringBuffer(s); - for (int i = 0; i < sb.length(); i++) - switch (sb.charAt(i)) { - case '"': - sb = sb.insert(i, '\\'); - i++; - break; - case '\n': - sb = sb.deleteCharAt(i); - i--; - break; - } - return sb.toString(); - } - - private static boolean startsWithComment(String s) { - if (null == s || s.length() < 2) - return false; - if (s.startsWith("//")) - return true; - if (s.startsWith("/*")) - return true; - return false; - } - - private static int endOfComment(String s) { - int idx; - if (s.startsWith("//")) - idx = s.indexOf("\n"); - else { - idx = s.indexOf("*/"); - if (-1 != idx) - idx++; // Step over */ - } - return idx; - } - - private static boolean startsWithStringLiteral(String s) { - if (null == s || s.length() < 1) - return false; - if (s.startsWith("\"") || s.startsWith("'")) - return true; - return false; - } - - private static int endOfStringLiteral(String s) { - boolean escape = false; - char c0 = s.charAt(0); - for (int i = 1; i < s.length(); i++) { - if (!escape && s.charAt(i) == c0) - return i; - - // \" or \' does not end the literal - if ('\\' == s.charAt(i)) - // Escaping a \ should switch escape off so \\' does end - // the literal - escape = !escape; - else - escape = false; - } - return -1; - } - - /** - * If the String s starts with a string literal or a comment, return i plus - * the index of the end of the literal or comment. String literals are - * enclosed in " or ' and comments start with /* or //. - */ - private static int skip(String s, int i) { - int j = 0; - if (startsWithStringLiteral(s)) { - j = endOfStringLiteral(s); - if (-1 == j) - return -1; - } else if (startsWithComment(s)) { - j = endOfComment(s); - if (-1 == j) - return -1; - } - return i + j; - } - - /** - * A better method than .equals() because it doesn't NullPointerException - * when one of the parameters is null. - */ - public static boolean safeEquals(Object o1, Object o2) { - if (null == o1 && null == o2) - return true; - if (null == o1 && null != o2) - return false; - if (null != o1 && null == o2) - return false; - return o1.equals(o2); - } - - public static void outputDebugString(String line) { - if (!Options.quiet()) { - if (Options.debug()) - // Apache commons logging - // log.debug(Object line, null); - // or for now - System.out.println(line); - } - } - - /** - * This static method allows different parts of the code to inform about - * significant events. Code interested in specific types of event can - * register a listener against that type (not written yet) - * - * @param eventType - * An int type enum indicating the type of event. - * @param message - * A message that can be output to the user. - */ - public static final int EVENT_TYPE_XML_ITEM_PARSED = 1; - - public static final int EVENT_TYPE_FILE_PARSED = 2; - - public static final int EVENT_TYPE_FILE_CREATE = 3; - - public static final int VERBOSE_LIMIT = 1024; - - public static final int DEPLOYMENT_ARTEFACT = VERBOSE_LIMIT; - - public static final int DEPLOYMENT_ARTEFACT_ENCOUNTERED = DEPLOYMENT_ARTEFACT + 1; - - public static final int DEPLOYMENT_ARTEFACT_GENERATED = DEPLOYMENT_ARTEFACT + 2; - - public static final int DEPLOYMENT_INPUT_DIRECTORY = DEPLOYMENT_ARTEFACT + 3; - - public static final int DEPLOYMENT_OUTPUT_DIRECTORY = DEPLOYMENT_ARTEFACT + 4; - - private static boolean reportArtefacts = false; - - /** - * An easily callable method to allow tracking/reposting of events in scagen - * and other tools. - * - * @param eventType - * used for classifying event - * @param message - * a user readable message - */ - public static void postEvent(int eventType, String message) { - if (Options.verbose() && eventType < VERBOSE_LIMIT) { - screenMessage(message); - } - - if ((eventType & DEPLOYMENT_ARTEFACT) > 0) { - reportArtefact(message, eventType); - } - - } - - /** - * @param message - * The user message - * @param eventType - * The type of event (input or output). This is used to determine - * if the path name of the file starts with the COMPOSITE_ROOT - * directory or the given output directory as the one of these - * prefixes is removed from the path name in order to give the - * new (destination) path relative to the new composite root - * - * - */ - - static String scagenInputDir = "COMPOSITE_ROOT"; - - static String scagenOutputDir = "SCAGEN_OUTPUT"; - - static String newCompositeRoot = "NEW_COMPOSITE_ROOT"; - - static String generatedDirName = "$sourceDir1"; - - private static void reportArtefact(String message, int eventType) { - - if (Utils.isReportArtefacts()) { - - // Changing the value of the variable below will alter the output of - // the - // deploy assist strings: - // true will result in a "copy source NEW_COMPOSITE_ROOT\dest" output - // and - // false will result in a "inputDir c:\fred" - // "outputDir c:\bob" - // "input c:\fred\sca.composite" - // "output c:\bob\proxy.h" type output - String command = null; - - try { - newCompositeRoot = (String) Options.getOption("-deploy"); - command = (String) Options.getOption("-command"); - } catch (Exception e) { - // let it default - } - - if (null == newCompositeRoot) { - newCompositeRoot = "DEPLOY_COMPOSITE_ROOT"; - } - - if (null == command) { - command = "copy"; - } - - if (Options.outputCommand()) { - - String tail = message; - switch (eventType) { - case DEPLOYMENT_ARTEFACT_ENCOUNTERED: - if (message.startsWith(scagenInputDir)) { - tail = message.substring(scagenInputDir.length()); - } - - String dest = joinPathElements(newCompositeRoot, tail); - - System.out.println(command + " " + platformSlashes(message) - + " " + platformSlashes(dest)); - break; - - case DEPLOYMENT_ARTEFACT_GENERATED: - if (message.startsWith(scagenOutputDir)) { - tail = message.substring(scagenOutputDir.length()); - } - - dest = joinPathElements(newCompositeRoot, tail); - System.out.println(command + " " + platformSlashes(message) - + " " + platformSlashes(dest)); - break; - case DEPLOYMENT_INPUT_DIRECTORY: - scagenInputDir = message; - //System.out.println("inputDir " + message); - break; - case DEPLOYMENT_OUTPUT_DIRECTORY: - scagenOutputDir = message; - //System.out.println("outputDir " + message); - break; - default: - break; - } - - } else { - - if (Options.list()) { - switch (eventType) { - case DEPLOYMENT_ARTEFACT_ENCOUNTERED: - case DEPLOYMENT_ARTEFACT_GENERATED: - System.out.println(platformSlashes(message)); - break; - case DEPLOYMENT_INPUT_DIRECTORY: - case DEPLOYMENT_OUTPUT_DIRECTORY: - default: - break; - } - } else { - switch (eventType) { - case DEPLOYMENT_ARTEFACT_ENCOUNTERED: - //TODO make efficient - System.out.println("$sourceDir1" - + platformSlashes(message.substring(scagenInputDir.length()))); - break; - case DEPLOYMENT_ARTEFACT_GENERATED: - //TODO make efficient - System.out.println(generatedDirName - + platformSlashes(message.substring(scagenOutputDir.length()))); - break; - case DEPLOYMENT_INPUT_DIRECTORY: - scagenInputDir = platformSlashes(message); - System.out.println("sourceDir1=" + scagenInputDir); - break; - case DEPLOYMENT_OUTPUT_DIRECTORY: - scagenOutputDir = platformSlashes(message); - if (!scagenInputDir.equals(scagenOutputDir)) { - generatedDirName = "$sourceDir2"; - System.out.println("sourceDir2=" + scagenOutputDir); - } else { - //generatedDirName = "sourceDir1"; - } - break; - default: - break; - } - } - } - } - } - - /** - * @param tail - * @param tail - * @return - */ - public static String joinPathElements(String root, String tail) { - String separator; - // Stick in a "/" (File.separator) if required. - if ((tail.substring(0, 1).equals("/") || newCompositeRoot.substring( - root.length() - 1, root.length()).equals("/")) - || (tail.substring(0, 1).equals("\\") || root.substring( - root.length() - 1, root.length()).equals("\\")) - - ) { - separator = ""; - } else { - separator = File.separator; - } - String dest = newCompositeRoot + separator + tail; - return dest; - } - - /** - * @param reportArtefacts - * The reportArtefacts to set. - */ - public static void setReportArtefacts(boolean reportArtefacts) { - Utils.reportArtefacts = reportArtefacts; - } - - /** - * @return Returns the reportArtefacts. - */ - private static boolean isReportArtefacts() { - return reportArtefacts; - } - - private static String platformSlashes(String path) { - if (null == path) { - return path; - } - // We need a double level of \\ escapes if the slashes are - // this way round. - String separatorForRegex = File.separator - .replaceAll("\\\\", "\\\\\\\\"); - return path.replaceAll("[/\\\\]+", separatorForRegex); - - } - -} diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/package.html b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/package.html deleted file mode 100644 index c423477193..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/common/package.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - -Design documentation for org\apache\tuscany\sca\cpp\tools\common - - - - -
      - -

      Overview

      - -This package can be used to reflect across C++ source code. It can produce -a network of descriptive objects describing C++ Headers, Signatures, Parameters and so -on that it finds in a given location of the file system. -Each of the descriptive objects has a set of getters that return either -the descriptive child objects, or for primitives, the string that represents the actual -value such as "int" or "myFunction". -

      -There are also various utility methods that help with navigating the information, for example the Signature -class has an isConstructor method. The API Javadoc contains further details of these. -

      -The package can scan a directory using a file mask to identify what types -of files are to be scanned. In this application we are interested only -in the function prototypes in the C++ header files. -

      -The implementation was originated using some java code that was also -contributed to the Apache org.apache.axis.tools.common package. Care -has been taken that the original code was not sourced via Apache. If -this project is adopted by Apache then it is very possible that this -package could be merged with or made obsolete by org.apache.axis.tools.common -and because of this the design and interfaces have been preserved from -the original code as much as possible. - -

      -

      - - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ComponentDomNodeHandler.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ComponentDomNodeHandler.java deleted file mode 100644 index 28974b41a6..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ComponentDomNodeHandler.java +++ /dev/null @@ -1,366 +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. - */ - -/* @version $Rev$ $Date$ */ - -package org.apache.tuscany.sca.cpp.tools.services; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sca.cpp.tools.common.Headers; -import org.apache.tuscany.sca.cpp.tools.common.Signature; -import org.apache.tuscany.sca.cpp.tools.common.Utils; -import org.w3c.dom.Node; - -/** - * This class will do the required processing for the element of a - * sca composite file. - */ -public class ComponentDomNodeHandler extends GenericDomNodeHandler { - - /** - * This method will do the "normal" processing and then trigger a call to - * processComponentNode. - * - * @param node - * the node being processed - * @param contextXPath - * the XPath to the node - * @param handlers - * the map pf element names to DomNodeHandlers - * @param parameters - * a map of XPaths to parameters values found so far - */ - - public void handleNode(Node node, String contextXPath, Map handlers, - Map parameters) { - - // Pick up attrs and the interface.cpp child elements - super.handleNode(node, contextXPath, handlers, parameters); - - try { - //OK now go and create the wrapper and proxy for the service - processComponentNode(contextXPath, parameters); - } catch (Exception e) { - e.printStackTrace(); - } - - } - - /** - * This method basically moved from the text names of things to operating on - * the actual Files. It will also verify or work out the correct class name - * for the implmentation and complain if this does match at least one - * potential service method in the class. - * - * @param contextXPath - * used to pull the correct values from the parameters map (as - * there can be multiple implementation.cpp elelements in there). - * @param parameters - * a map of XPath keys to attribute values - * @throws Exception - */ - private void processComponentNode(String contextXPath, Map parameters) - throws Exception { - - String implHeader = (String) parameters.get(contextXPath - + "/implementation.cpp/@header"); - String implClass = (String) parameters.get(contextXPath - + "/implementation.cpp/@class"); - - File compositeOrFragmentFile = (File) parameters - .get("compositeOrFragmentFile"); - File implHeaderFile = null; - if (null != compositeOrFragmentFile) { - File dir = compositeOrFragmentFile.getParentFile(); - implHeaderFile = new File(dir, implHeader); - } else { - throw new InternalError( - "Internal error: composite or fragment file not present in internal parameters"); - } - - try { - String resolvedImplClassName = getClassName(implHeaderFile, - implClass); - - // Check or retrieve the impl Class name. - if (null == resolvedImplClassName) { - try { - //A class attribute was set but there were no methods of - // the - // class in the header - System.out - .println("Classname given (" - + implClass - + ") does not match any header file method's classes in file: " - + implHeaderFile.getCanonicalPath()); - } catch (IOException e) { - System.out - .println("Classname given (" - + implClass - + ") does not match any header file method's classes in file: " - + implHeaderFile.getAbsolutePath()); - } - return; - } else { - File target = (File) parameters.get("targetFile"); - // go into the .componentType file and generate the cpp - processComponentTypeFile(implHeaderFile, target, - resolvedImplClassName); - - } - } catch (Exception e) { - String compName = (String) parameters - .get("/compositeFragment/component/@name"); - Utils - .screenMessage("Problem interpreting header or class attributes in " - + compName - + " component, in " - + compositeOrFragmentFile.getPath() + " file"); - System.exit(-2); - } - - } - - /** - * The purpose of this method is to move from the DOM parameters to dealing - * with the actual Files involved. It is from this method that we kick off - * the processing of the componentType file. - * - * @param header - * the implementation header - * @param target - * the directory for the output - * @param implClass - * @throws Exception - */ - private void processComponentTypeFile(File header, File target, - String implClass) throws Exception { - - // The componentType files should be in the same dir as the Impl - // header... - if (header == null || target == null) { - return; - } - - File componentTypeDirectory = header.getParentFile(); - String headerFileName = header.getName(); - String componentTypeName = headerFileName.substring(0, headerFileName - .lastIndexOf(".")); - - File componentTypeFile = new File(componentTypeDirectory, - componentTypeName + ".componentType"); - - ComponentTypeFileHandler ctParser = new ComponentTypeFileHandler(); - - // The implClass is used in the generated wrapper code so we need to - // store - // it so we can tunnel through the standard actOnFile signature. - - int namespaceEnd = -1; - if (null != implClass) { - namespaceEnd = implClass.lastIndexOf("::"); - } - - String namespace = null; - - if (-1 != namespaceEnd) { - namespace = implClass.substring(0, namespaceEnd); - ctParser.setParameter("implNamespace", namespace); - implClass = implClass.substring(namespaceEnd + 2); - } - - if (implClass != null) { - ctParser.setParameter("implClass", implClass); - } - - try { - ctParser.handleComponentTypeFile(componentTypeFile, target); - } catch (Exception e) { - Utils - .screenMessage("There has been a problem parsing the componentType file: " - + componentTypeFile.getCanonicalPath()); - Utils.screenMessage(" the reported errors is " - + e.getLocalizedMessage()); - Utils.screenMessage(" and the java exception stack is below."); - e.printStackTrace(); - throw e; - } - } - - /** - * The resolve and check the classname of the service. If we have an - * implementation class name we have to check that there is: at least one - * (non-private, non constructor or finalizer) method of that class in the - * header If there is no implementation class then we will return the class - * of the first non-private/constructor/finalizer method we find. - * - * @param header - * @param implementationCppClass - * @return - * @throws Exception - */ - private String getClassName(File header, String implementationCppClass) - throws Exception { - String methodClassName = null; - List methods = null; - - if (null == header) { - return null; - } - - Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_ENCOUNTERED, header - .getAbsolutePath()); - Utils.postEvent(Utils.EVENT_TYPE_FILE_PARSED, - "Scagen processing C++ implementation header " - + header.getAbsolutePath()); - - try { - Headers headers = new Headers(); - - headers.actOnFile(header, null, 1); - - methods = headers.getAllMethods(); - - } catch (FileNotFoundException fnfe) { - String path; - try { - path = header.getCanonicalPath(); - } catch (IOException e1) { - path = header.getPath(); - } - Utils.screenMessage("The header file: " + path - + " referenced cannot be found."); - throw fnfe; - } catch (Exception e) { - String path = header.getPath(); - Utils.screenMessage("The header file: " + path - + " referenced is not valid. Reason given is " - + e.getLocalizedMessage()); - throw e; - } - - // We need at least some methods - if (null == methods) { - return null; - } - - // We need at least one service method of to do anything - methods = trimMethodsOfPrivatesConstructorsAndDestrutors(methods); - if (null == methods || methods.size() == 0) { - return null; - } - - // If the user specifies an implementation class then we need at - // least one service method of that class - if (implementationCppClass != null) { - methods = filterMethodsToOneClass(methods, implementationCppClass); - - if (null == methods || methods.size() == 0) { - return null; - } else { - // There was at least one method of the correct type - return implementationCppClass; - } - } else { - // Implementation class is null so we return the fully qualified classname of the - // first service method - Signature s = (Signature) methods.get(0); - String className = s.getTrimClassName(); - String namespace = s.getNamespace(); - if( namespace != null && namespace.length() > 0) - { - className = namespace + "::" + className; - } - - return className; - } - } - - /** - * Filter the mthods supplied to only ones fo the supplied class. - * - * @param methods - * the list of methods - * @param implementationCppClass - * the class we wish - * @return a list of methods of the correct class - */ - private List filterMethodsToOneClass(List methods, - String implementationCppClass) { - - if (null == methods) { - return null; - } - - if (null == implementationCppClass - || implementationCppClass.length() == 0) { - return null; - } - - for (Iterator iter = methods.listIterator(); iter.hasNext();) { - Signature method = (Signature) iter.next(); - - String className = method.getTrimClassName(); - String namespace = method.getNamespace(); - - if (namespace != null && namespace.length() > 0) { - className = namespace + "::" + className; - } - - if (!implementationCppClass.equals(className)) { - iter.remove(); - } - } - - return methods; - - } - - /** - * This method removes contructor and destructor methods from the list. - * - * @param methods - * the list of methods - * @return - */ - private List trimMethodsOfPrivatesConstructorsAndDestrutors(List methods) { - - if (null == methods) { - return null; - } - - for (Iterator iter = methods.listIterator(); iter.hasNext();) { - Signature method = (Signature) iter.next(); - - if (method.isConstructor() || method.isDestructor()) { - iter.remove(); - } - } - - return methods; - } - -} diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ComponentTypeFileHandler.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ComponentTypeFileHandler.java deleted file mode 100644 index 6c86fa25b5..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ComponentTypeFileHandler.java +++ /dev/null @@ -1,130 +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. - */ - -/* @version $Rev$ $Date$ */ - -package org.apache.tuscany.sca.cpp.tools.services; - -import java.io.File; - -import org.apache.tuscany.sca.cpp.tools.common.FileActor; -import org.apache.tuscany.sca.cpp.tools.common.Utils; - -/** - * The purpose of this class is to specialise the map of XML element handlers - * for a XXX.componentType file that is used by the XMLFileActor - */ -public class ComponentTypeFileHandler extends XMLFileActor { - - static { - // We set up a map for each element type we wish to handle - // this alows the XML handling code to be generic and type free - // while the handlers don't have to do mcuh XML handling. - - GenericDomNodeHandler gdnh = new GenericDomNodeHandler(); - handlers.put("componentType", gdnh); - handlers.put("interface.cpp", gdnh); - - ServiceDomNodeHandler sdnh = new ServiceDomNodeHandler(); - handlers.put("service", sdnh); - - ReferenceDomNodeHandler rdnh = new ReferenceDomNodeHandler(); - handlers.put("reference", rdnh); - } - - /** - * This method just exists to add the default starting depth of 1 to the - * underlying actOnFile interface - * - * @param componentTypeXML - * @param target - * @throws Exception - */ - public void handleComponentTypeFile(File componentTypeXML, File target) - throws Exception { - // We have already set up the XML element handlers. - actOnFile(componentTypeXML, target, 1); - // We need do no more, the service and reference handlers - // ServiceDomNodeHandler and ReferenceDomNodeHandler - // will take appropriate action. - } - - /** - * This method is the main FileActor method - * - * @see FileActor#actOnFile(File, File, int) Here we create an initial DOM - * and kick off the processing (using the handler map that has been set - * up by the concrete subclass). - * - * @param compositeXML - * the composite or fragment file - * @param target - * the target directory - * @param depth - * not uesed here but in the - * @see FileActor#actOnFile(File, File, int) interface to allow for - * recursive diving into a directory structure. - */ - public void actOnFile(File fileXML, File target, int depth) - throws Exception { - - if (null == fileXML || null == target) { - return; - } - - parameters.put("componentTypeFile", fileXML); - - Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_ENCOUNTERED, fileXML.getAbsolutePath()); - Utils.postEvent(Utils.EVENT_TYPE_FILE_PARSED, "Scagen processing SCA componentType file " + fileXML.getAbsolutePath()); - - super.actOnFile(fileXML, target, depth); - - } - - /** - * @return an error message - usually over-ridden. - */ - protected String getContextMessage() { - - String composite = ((File) parameters.get("compositeOrFragmentFile")).getPath(); - if (null == composite) { - composite = "unknown"; - } - - String component = (String) parameters.get("/composite/component/@name"); - if (null == component) { - component = (String) parameters - .get("/compositeFragment/component/@name"); - } - if (null == component) { - composite = "unknown"; - } - - String msg = "when processing composite " + composite; - - msg = msg - + "\nin this composite file, the component \"" - + component - + "\" has an implementation.cpp element with a header attribute \nwhere the C++ header can be found but it has no matching .componentType file present in\nthe same directory as the header."; - - return msg; - } - -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/CompositeOrFragmentFileHandler.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/CompositeOrFragmentFileHandler.java deleted file mode 100644 index 3eb8dc7d98..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/CompositeOrFragmentFileHandler.java +++ /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. - */ - -/* @version $Rev$ $Date$ */ - -package org.apache.tuscany.sca.cpp.tools.services; - -import java.io.File; - -import org.apache.tuscany.sca.cpp.tools.common.FileActor; -import org.apache.tuscany.sca.cpp.tools.common.Utils; - -/** - * The purpose of this class is purely to specialise the handler map to one with - * a specific ComponentDomNodeHandler. - */ -public class CompositeOrFragmentFileHandler extends XMLFileActor { - - static { - - GenericDomNodeHandler gdnh = new GenericDomNodeHandler(); - - /* - * We use a specific Component node handler in order to be able to - * process multiple components in the same XML file - */ - ComponentDomNodeHandler componentdnh = new ComponentDomNodeHandler(); - handlers.put("component", componentdnh); - - /* - * We are interested inthe elements below but they only need standard - * processing - */ - handlers.put("composite", gdnh); - handlers.put("compositeFragment", gdnh); - handlers.put("implementation.cpp", gdnh); - } - - /** - * This method is the main FileActor method - * - * @see FileActor#actOnFile(File, File, int) Here we create an initial DOM - * and kick off the processing (using the handler map that has been set - * up by the concrete subclass). - * - * @param compositeXML - * the composite or fragment file - * @param target - * the target directory - * @param depth - * not uesed here but in the - * @see FileActor#actOnFile(File, File, int) interface to allow for - * recursive diving into a directory structure. - */ - public void actOnFile(File compositeXML, File target, int depth) - throws Exception { - - if (null == compositeXML || null == target) { - return; - } - - parameters.put("compositeOrFragmentFile", compositeXML); - - Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_ENCOUNTERED, compositeXML - .getAbsolutePath()); - - Utils.postEvent(Utils.EVENT_TYPE_FILE_PARSED, - "Scagen processing SCA composite file " - + compositeXML.getAbsolutePath()); - - super.actOnFile(compositeXML, target, depth); - - } -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DirectoryScanner.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DirectoryScanner.java deleted file mode 100644 index 9cf7952afa..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DirectoryScanner.java +++ /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. - */ - -/* @version $Rev$ $Date$ */ - -package org.apache.tuscany.sca.cpp.tools.services; - -import java.io.File; -import java.util.Set; - -import org.apache.tuscany.sca.cpp.tools.common.FileActor; -import org.apache.tuscany.sca.cpp.tools.common.Utils; - -public class DirectoryScanner { - private FileActor actor; - - private Set actOnTheseFileExtensions; - - public DirectoryScanner(FileActor actor, Set extensions) { - this.actor = actor; - this.actOnTheseFileExtensions = extensions; - } - - /** - * - * @param source - * The composite root directory - * @param target - * The directory that will hold the generated output - * @param depth - * The depth from the initial starting point, not significant for - * the Scagen tool as we are only interested in the composite root - * directory but present due to the FileActor actOnFile interface - * method. This code is pulled from the code in the CParsingTool - * class and further work is needed to remove the duplication. - * Tnterface has been left unchanged as we hope to reconverge the - * parser here with the original one once the changes are fed - * back into the original code. - * @throws Exception - */ - public void walkTree(File source, File target, int depth) throws Exception { - depth++; - boolean noTarget = (null == target); - - if (!source.canRead()) - Utils.rude("Cannot read from source directory " + source); - if (!noTarget && !target.canWrite()) - Utils.rude("Cannot write to target directory " + target); - - if (source.isDirectory()) { - File[] filesInDirectory = source.listFiles(); - for (int i = 0; i < filesInDirectory.length; i++) { - File file = filesInDirectory[i]; - String name = file.getName(); - int dot = name.lastIndexOf('.'); - String ext = null; - if (-1 != dot) { - ext = name.substring(dot + 1); - } - - if (file.isFile() - && (actOnTheseFileExtensions == null || (!file - .isHidden() && actOnTheseFileExtensions - .contains(ext)))) { - // this is a file we need to act on! - actor.actOnFile(file, target, depth); - } - } - } else { - return; // Do not act on single files for now we expect a composite - // root directory - // and the "main" class checks its parameters to ensure this is so. - } - } - -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DomHandler.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DomHandler.java deleted file mode 100644 index 0756b5fc3b..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DomHandler.java +++ /dev/null @@ -1,83 +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. - */ - -/* @version $Rev$ $Date$ */ - -package org.apache.tuscany.sca.cpp.tools.services; - -import java.util.Map; - -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * The purpose of this class it to provide a generic class that can handle both - * a DOM and a DOM node. - * - */ -public class DomHandler extends GenericDomNodeHandler { - /** - * This method will run through the initial level of the DOM using the - * handlers map - * - * @param dom - * the document being consumed - * @param handlers - * the map from element name to node handler - * @param parameters - * a map of parameters - this is often used by a handler to place - * a name-value pair, the name is often an Xpath representation - * of the location of the data in the DOM but handlers are free - * to use whatever they like - the contextXpath is generated as - * an Xpath prefix for those handlers that wish to use it. - */ - public static void handleDom(Document dom, Map handlers, Map parameters) { - if (dom != null) { - NodeList childNodes = dom.getChildNodes(); - for (int i = 0; i < childNodes.getLength(); i++) { - Node childNode = childNodes.item(i); - mapNodeToHandlerAndHandle(childNode, "/" - + childNode.getNodeName(), handlers, parameters); - } - } - } - - /** - * - * @param node - * The DOM node being consumed - * @param contextXPath - * The XPath to this node - * @param handlers - * The map from element name to node handler - * @param parameters - * A map of parameters - this is often used by a handler to place - * a name-value pair, the name is often an Xpath representation - * of the location of the data in the DOM but handlers are free - * to use whatever they like - the contextXpath is generated as - * an Xpath prefix for those handlers that wish to use it. - */ - public void handleNode(Node node, String contextXPath, Map handlers, - Map parameters) { - mapNodeToHandlerAndHandle(node, contextXPath, handlers, parameters); - } - -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DomNodeHandler.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DomNodeHandler.java deleted file mode 100644 index 37c2a1a81c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/DomNodeHandler.java +++ /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. - */ - -/* @version $Rev$ $Date$ */ - -package org.apache.tuscany.sca.cpp.tools.services; - -import java.util.Map; - -import org.w3c.dom.Node; - -public interface DomNodeHandler { - - public static int ELEMENT = 1; - /** - * An interface for classes that can process DOM nodes. - * - * @param node the DOM node being consumed - * @param contextXPath the XPath to this node - * @param handlers The map from element name to node handler - * @param parameters A map of parameters - this is often used by a handler to place - * a name-value pair, the name is often an Xpath like representation of the - * location of the data in the DOM but handlers are free to use whatever - * they like - the contextXpath is generated as an Xpath prefix for those - * handlers that wish to use it. - */ - void handleNode( Node node, String contextXPath, Map handlers, Map parameters ); - -} diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/GenericDomNodeHandler.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/GenericDomNodeHandler.java deleted file mode 100644 index 1ec393959d..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/GenericDomNodeHandler.java +++ /dev/null @@ -1,220 +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. - */ - -/* @version $Rev$ $Date$ */ - -package org.apache.tuscany.sca.cpp.tools.services; - -import java.io.File; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; -import java.util.Map.Entry; - -import org.apache.tuscany.sca.cpp.tools.common.Utils; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * - * - * - * - */ -public class GenericDomNodeHandler implements DomNodeHandler { - /** - * This method parses the DOM attributes into name value pairs in the - * parameter map each valued keyed by its XPath. - * - * @param node - * the DOM node being processed - * @param contextPath - * the XPath to the DOM node being processed - * @param parameters - * a scratchpad map of name value pairs - */ - public void transferAttrsToParameters(Node node, String contextPath, - Map parameters) { - - if (node == null || contextPath == null || parameters == null) - return; - - NamedNodeMap attrs = node.getAttributes(); - if (attrs != null) { - for (int i = 0; i < attrs.getLength(); i++) { - Node attr = attrs.item(i); - parameters.put(contextPath + "/" + "@" + attr.getNodeName(), - attr.getNodeValue()); - - // Report the library name to the deployment tool if required. - if ("library".equals(attr.getNodeName())) { - //This is a path relative to the composite root. - //so we need to add it in. - File mod = (File) parameters.get("compositeOrFragmentFile"); - if (null != mod) { - String separatorForRegex = File.separator.replaceAll( - "\\\\", "\\\\\\\\"); - - String end = attr.getNodeValue().replaceAll("[/\\\\]+", - separatorForRegex); - - if (!end.startsWith(File.separator)) { - end = File.separator + end; - } - - String fullPath = mod.getParentFile().getAbsolutePath() - + end; - Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_ENCOUNTERED, - fullPath); - } - - } - - } - } - return; - } - - /** - * This method will iterate through the DOM node's children and call the - * appropriate handler for each one. - * - * @param node - * the DOM node being processed - * @param contextPath - * the XPath to the DOM node being processed - * @param handlers - * a map of element name to handler objects - * @param parameters - * a scratchpad map of name value pairs - */ - public void handleChildElements(Node node, String contextPath, - Map handlers, Map parameters) { - - if (node == null || contextPath == null) - return; - - NodeList children = node.getChildNodes(); - if (children != null) { - for (int i = 0; i < children.getLength(); i++) { - Node child = children.item(i); - mapNodeToHandlerAndHandle(child, contextPath + "/" - + child.getNodeName(), handlers, parameters); - } - } - return; - } - - /** - * This method will resolve any registered handler for a particular DOM - * element and call the handleNode method on it. If the handlers map has a - * mapping from "entity" to an instance of EntityHandler which implements - * the DomNodeHandler interface then any node that looks like - * - * - * Will be passed to the EntityHandler to process. - * - * @param node - * the DOM node being processed - * @param contextPath - * the XPath to the DOM node being processed - * @param handlers - * a map of element name to handler objects - * @param parameters - * a scratchpad map of name value pairs - */ - public static void mapNodeToHandlerAndHandle(Node node, String contextPath, - Map handlers, Map parameters) { - if (node != null && node.getNodeType() == DomNodeHandler.ELEMENT) { - String nodeName = node.getNodeName(); - if (nodeName != null && nodeName.length() > 0) { - DomNodeHandler handler = (DomNodeHandler) handlers - .get(nodeName); - if (handler != null) { - handler.handleNode(node, contextPath, handlers, parameters); - } - } - } - } - - /** - * This method will place the attributes in this node into the parameter map - * keyed by the XPath and recursively continue processing for any - * sub-elements of the node. - * - * @param node - * The DOM node being consumed - * @param contextXPath - * The XPath to this node - * @param handlers - * The map from element name to node handler - * @param parameters - * A map of parameters - this is often used by a handler to place - * a name-value pair, the name is often an Xpath representation - * of the location of the data in the DOM but handlers are free - * to use whatever they like - the contextXpath is generated as - * an Xpath prefix for those handlers that wish to use it. - */ - public void handleNode(Node node, String contextXPath, Map handlers, - Map parameters) { - - clearParametersAtThisXPath(contextXPath, parameters); - transferAttrsToParameters(node, contextXPath, parameters); - handleChildElements(node, contextXPath, handlers, parameters); - } - - /** - * @param contextXPath - * @param parameters - */ - private void clearParametersAtThisXPath(String contextXPath, Map parameters) { - - // TODO: Slow but works, improve parameters mechanism overall - // to make this unecessary - if (contextXPath == null || parameters == null) { - return; - } - - // We want to clear both /compositeFragment and /composite - // subtrees when we come across the root of either.. - if (contextXPath.equals("/compositeFragment")) { - //clear both this and "composite" - contextXPath = "/composite"; - } - - Set parms = parameters.entrySet(); - if (null != parms) { - Iterator iter = parms.iterator(); - Map.Entry item = null; - String thisKey; - - while (iter.hasNext()) { - item = (Entry) iter.next(); - thisKey = (String) item.getKey(); - if (thisKey.startsWith(contextXPath)) { - //System.out.println(" removing " + thisKey + " for " + - // item.getValue().toString() + " against " + contextXPath); - iter.remove(); - } - } - } - } -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/LittleClass.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/LittleClass.java deleted file mode 100644 index e7036037c6..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/LittleClass.java +++ /dev/null @@ -1,33 +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. - */ - -/* @version $Rev$ $Date$ */ - -package org.apache.tuscany.sca.cpp.tools.services; - -/** - * This class is just a convenient application class that is loaded in order to - * get the application class loader. We are interested in the application class - * loader as we use its getResource method to resolve XML files independantly of - * where they are. - */ -public class LittleClass { - -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ReferenceDomNodeHandler.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ReferenceDomNodeHandler.java deleted file mode 100644 index 5631249769..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ReferenceDomNodeHandler.java +++ /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. - */ - -/* @version $Rev$ $Date$ */ - -package org.apache.tuscany.sca.cpp.tools.services; - -import java.util.Map; - -import org.apache.tuscany.sca.cpp.tools.common.Options; -import org.w3c.dom.Node; - -/** - * The purpose of this class is to process a element in a - * componentType file and then trigger a call to the method in ServicesGenerator - * to process the interface header file - */ -public class ReferenceDomNodeHandler extends GenericDomNodeHandler { - - /* - * (non-Javadoc) - * - * @see org.apache.tuscany.sca.cpp.services.DomNodeHandler#handleNode(org.w3c.dom.Node, - * java.lang.String, java.util.Map, java.util.Map) - */ - public void handleNode(Node node, String contextXPath, Map handlers, - Map parameters) { - - // Pick up attrs and children - super.handleNode(node, contextXPath, handlers, parameters); - - //OK we know we are handling a reference - //now go and create the wrapper and proxy for it if it is a C++ reference - if(parameters.containsKey("/componentType/reference/interface.cpp/@header")) { - createProxyForReference(parameters); - } - - } - - /** - * This method is really just an adapter that adapts the -dir Option to a - * value int he parameters map for "composite_root" - * - * @param parameters - * the map of name-value parameters. - */ - private void createProxyForReference(Map parameters) { - try { - String mr = (String) Options.getOption("-dir"); - parameters.put("composite_root", mr); - ServicesGenerator.handleInterfaceHeader(parameters, true); - - } catch (Exception e) { - e.printStackTrace(); - } - - } -} diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/Scagen.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/Scagen.java deleted file mode 100644 index 19e983c6b1..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/Scagen.java +++ /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. - */ - -/* @version $Rev$ $Date$ */ - -package org.apache.tuscany.sca.cpp.tools.services; - -import java.io.File; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -import org.apache.tuscany.sca.cpp.tools.common.CParsingTool; -import org.apache.tuscany.sca.cpp.tools.common.Options; -import org.apache.tuscany.sca.cpp.tools.common.Utils; - -/** - * This is the main top level class. Its purpose is to create a - * Composite/FragmentFile handler visitor and pass it to a DirectoryScanner for - * processing. - */ -public class Scagen extends CParsingTool { - - public static Set COMPOSITE_EXTENSIONS = new HashSet(Arrays - .asList(new Object[] { "composite", "fragment" })); - - /** - * @throws Exception - * - */ - public Scagen(String[] args) throws Exception { - super(args); - } - - /** - * Take a directory scanning class and create a vistor that knows how to - * handle any .composite or .fragment that the scanner comes across. - * - * @param args - * standard main args. THe values we expect in this class are - * scagen -dir input_dir -output output_dir - * - */ - public static void main(String[] args) { - boolean failed = false; - try { - Scagen env = new Scagen(args); - CompositeOrFragmentFileHandler composite_handler = new CompositeOrFragmentFileHandler(); - - // Check and access the input SCA composite directory - String name = (String) Options.getOption("-dir"); - if (null == name) { - Utils - .screenMessage("Please provide a SCA composite directory name as a \"-dir\" option."); - env.printUsage(); - System.exit(-1); - } - File source = new File(name); - if (!source.isFile() && !source.isDirectory()) { - Utils - .screenMessage("The SCA composite directory provided as the \"-dir\" option cannot be accessed,"); - Utils.screenMessage("the option given was: " + source); - env.printUsage(); - System.exit(-1); - } - - String deployDir = null; - try { - deployDir = (String) Options.getOption("-deploy"); - if (null != deployDir || Options.deploy()) { - Utils.setReportArtefacts(true); - } - } catch (Exception e) { - // let it default to null - } - - Utils.postEvent(Utils.DEPLOYMENT_INPUT_DIRECTORY, source - .getAbsolutePath()); - - // We check the -output option here as we wish to - // reuse the env.maybeCreateDirectory method - // unchanged from the original that went into axis and it will do a - // System.exit if there is no matching Option - String outputDirName = (String) Options.getOption("-output"); - if (null == outputDirName) { - Utils - .screenMessage("Please provide an output directory name for the generated files as a \"-output\" option."); - env.printUsage(); - System.exit(-1); - } - - File outputDir = new File(outputDirName); - - // Check we can create the output directory - if (outputDir == null || !outputDir.exists() && !outputDir.mkdir()) { - Utils.screenMessage("Failed to create output directory: " - + outputDirName); - env.printUsage(); - System.exit(-1); - } - - Utils.postEvent(Utils.DEPLOYMENT_OUTPUT_DIRECTORY, outputDir - .getAbsolutePath()); - - DirectoryScanner scanner = new DirectoryScanner(composite_handler, - COMPOSITE_EXTENSIONS); - scanner.walkTree(source, outputDir, 1); - - if (0 == composite_handler.getFilesActedOn()) { - Utils - .screenMessage("No SCA composite or fragment files were found in: " - + source); - } - - failed = composite_handler.failed; - - } catch (Exception exception) { - Utils - .screenMessage("Unexpected error occurred while runnning the Scagen tool. The Java exception is below."); - exception.printStackTrace(); - failed = true; - } - - if (failed) { - Utils - .outputDebugString("Finished! (but encountered problems parsing composites)"); - System.exit(-2); - } - - Utils.outputDebugString("Finished!"); - } - - /** - * Provide a hint to the user on how to call this class - */ - protected void printUsage() { - System.out - .println("usage: Java Scagen -dir -output [-verbose] [-deploy ] [-nogenerate] [-outputCommand] [-command ]"); - System.out - .println(" -dir : the SCA composite root directory"); - System.out - .println(" -output : a directory to put the generated output into"); - System.out.println(" [-verbose]: report on what scagen is doing"); - System.out - .println(" [-deploy ]: output text to help in deploying the composite's artefacts"); - System.out - .println(" [-command ]: a string that is injected into the deploy text"); - System.out - .println(" [-list]: change the deploy output text to a simple list of artefacts"); - System.out - .println(" [-outputCommand]: change the deploy output text to command text format"); - System.out - .println(" output is of form \"copy_cmd file1 file1\""); - System.out - .println(" [-nogenerate]: do not generate proxies and wrappers"); - - } - -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ServiceDomNodeHandler.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ServiceDomNodeHandler.java deleted file mode 100644 index cedb4bdb54..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ServiceDomNodeHandler.java +++ /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. - */ - -/* @version $Rev$ $Date$ */ - -package org.apache.tuscany.sca.cpp.tools.services; - -import java.util.Map; - -import org.apache.tuscany.sca.cpp.tools.common.Options; -import org.w3c.dom.Node; - -public class ServiceDomNodeHandler extends GenericDomNodeHandler { - - /* - * (non-Javadoc) - * - * @see org.apache.tuscany.sca.cpp.services.DomNodeHandler#handleNode(org.w3c.dom.Node, - * java.lang.String, java.util.Map, java.util.Map) - */ - public void handleNode(Node node, String contextXPath, Map handlers, - Map parameters) { - - // Pick up attrs and the interface.cpp child elements - super.handleNode(node, contextXPath, handlers, parameters); - - // Only generate if this is a C++ service - if(parameters.containsKey("/componentType/service/interface.cpp/@header")) { - //OK now go and create the wrapper and proxy for the service - createWrapperAndProxyForService(parameters); - } - - } - - /** - * This method will generate the wrapper and proxy C++ and header files for - * the service. - * - * @param parameters - * a map of name-value parameters - */ - private void createWrapperAndProxyForService(Map parameters) { - - try { - String mr = (String) Options.getOption("-dir"); - parameters.put("composite_root", mr); - ServicesGenerator.handleInterfaceHeader(parameters, false); - - } catch (Exception e) { - e.printStackTrace(); - } - - } -} diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ServicesGenerator.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ServicesGenerator.java deleted file mode 100644 index 956db364a1..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/ServicesGenerator.java +++ /dev/null @@ -1,831 +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. - */ - -/* @version $Rev$ $Date$ */ - -package org.apache.tuscany.sca.cpp.tools.services; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -import javax.xml.transform.stream.StreamSource; - -import org.apache.tuscany.sca.cpp.tools.common.CParsingTool; -import org.apache.tuscany.sca.cpp.tools.common.Headers; -import org.apache.tuscany.sca.cpp.tools.common.Options; -import org.apache.tuscany.sca.cpp.tools.common.Parameter; -import org.apache.tuscany.sca.cpp.tools.common.Signature; -import org.apache.tuscany.sca.cpp.tools.common.Utils; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Text; - -/** - * This class is the main class that handles the function that parses a C++ - * interface header file into a DOM that holds all the semantic information - * about the interface - method names, parameters and return values. It then - * uses XSLT to generate different "views" of this data plus the parameter map - * from other sources that are the C++ programs for the proxy and wrapper - * implementations and headers. - */ -public class ServicesGenerator extends CParsingTool { - - private static final String OPERATION_NAME_ATTR = "operationNameAttr"; - - private static final String HEADER_NAME_ATTR = "headerNameAttr"; - - private static final String SCA_OPERATION = "scaOperation"; - - private static final String SCA_SERVICE = "scaService"; - - private static final String SCA_OPERATION_RETURN_TYPE = "scaOperationReturnType"; - - private static final String SCA_OPERATION_PARAMETER = "scaOperationParameter"; - - private static final String SCA_OPERATION_PARAMETER_NAME_ATTR = "scaOperationParameterNameAttr"; - - private static final String SCA_OPERATION_PARAMETER_CONST_ATTR = "scaOperationParameterConstAttr"; - - private static final String SCA_INTERFACE_NAME_ATTR = "scaInterfaceNameAttr"; - - private static final String CPP_HEADER = "cppHeader"; - - private static boolean TESTING = true; - - private static TransformerFactory txmf = null; - - private static ServicesGenerator instance = null; - - public ServicesGenerator(String[] args) throws Exception { - super(args); - txmf = TransformerFactory.newInstance(); - } - - /** - * - * @param parameters - * @param forReference - * true if we are creating a proxy for a reference (rather than - * for a service) - * @throws Exception - * - * The design is - *
        - *
      • handleInterfaceHeader - *
      • createDOMofMethods - *
      • createProxyCPPFromDom(outputDir, dom); - *
      • createProxyHeaderFromDom(outputDir, dom); - *
      - * - * plus if we are not generating for a reference element - *
        - *
      • createWrapperCPPFromDom(outputDir, dom); - *
      • createWrapperHeaderFromDom(outputDir, dom); - *
          - * Each of the create.... methods calls createOutputFromDom with a different - * style sheet. - * - */ - public static void handleInterfaceHeader(Map parameters, - boolean forReference) throws Exception { - boolean failed = false; - - String type = null; - if (forReference) { - type = "reference"; - } else { - type = "service"; - } - String interfaceHeaderFilename = (String) parameters - .get("/componentType/" + type + "/interface.cpp/@header"); - - String componentTypeFileHeaderName = interfaceHeaderFilename; - - String sca_composite_root = (String) Options.getOption("-dir"); - parameters.put("composite_root", sca_composite_root); - - if (sca_composite_root != null && interfaceHeaderFilename != null - && interfaceHeaderFilename.length() > 0) { - String separator; - // Stick in a "/" (File.separator) if required. - if ((interfaceHeaderFilename.substring(0, 1).equals("/") || sca_composite_root - .substring(sca_composite_root.length() - 1, - sca_composite_root.length()).equals("/")) - || (interfaceHeaderFilename.substring(0, 1).equals("\\") || sca_composite_root - .substring(sca_composite_root.length() - 1, - sca_composite_root.length()).equals("\\")) - - ) { - separator = ""; - } else { - separator = File.separator; - } - interfaceHeaderFilename = sca_composite_root + separator - + interfaceHeaderFilename; - } - - File outputDir = (File) parameters.get("targetDirectoryFile"); - - String[] args = new String[] { "-source", interfaceHeaderFilename, - "-target", outputDir.getPath() }; - ServicesGenerator gen = new ServicesGenerator(args); - File file; - try { - if (null == interfaceHeaderFilename) { - gen.printUsage(); - System.exit(-1); - } - - file = new File(interfaceHeaderFilename); - if (!file.isFile()) { - if (file.isDirectory()) { - Utils - .rude("This tool works at the header file level and not for directories like " - + file); - } - Utils.rude("Bad file or directory " + file); - } - File source = file; - if (!outputDir.exists() && !outputDir.mkdir()) - Utils.rude("Failed to create directory " + outputDir); - - // The class below is the one that will go through the header - // file(s) - Headers headers = new Headers(); - - if (null != interfaceHeaderFilename) { - Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_ENCOUNTERED, file - .getAbsolutePath()); - Utils.postEvent(Utils.EVENT_TYPE_FILE_PARSED, - "Scagen processing C++ interface header " - + file.getAbsolutePath()); - headers.actOnFile(file, outputDir, 1); - Utils.outputDebugString("Parsing files..."); - } - - String nameOfSorR = null; - String referenceName = null; - String serviceName = null; - - if (forReference) { - - Object rn = parameters.get("/componentType/reference/@name"); - - if (rn instanceof String) { - referenceName = (String) rn; - nameOfSorR = referenceName; - } - } else { - - Object sn = parameters.get("/componentType/service/@name"); - - if (sn instanceof String) { - serviceName = (String) sn; - nameOfSorR = serviceName; - } - } - - String compositeXmlFileHeader = null; - String compositeXmlFileHeaderNoExt = null; - Object compositeh = parameters - .get("/composite/component/implementation.cpp/@header"); - - if (compositeh == null) { - compositeh = parameters - .get("/compositeFragment/component/implementation.cpp/@header"); - } - - if (compositeh instanceof String) { - File f = new File((String) compositeh); - compositeXmlFileHeader = (String) compositeh; - - String fname = f.getName(); - compositeXmlFileHeaderNoExt = fname.substring(0, fname - .lastIndexOf('.')); - - } - - String implClassNameAttrFromCompositeFile = (String) parameters - .get("implClass"); - String implClassNamespaceAttrFromCompositeFile = (String) parameters - .get("implNamespace"); - - if(implClassNamespaceAttrFromCompositeFile == null || implClassNamespaceAttrFromCompositeFile.length() == 0) - { - implClassNamespaceAttrFromCompositeFile = ""; - } - else - { - implClassNamespaceAttrFromCompositeFile += "::"; - } - - String interfaceClassNameAttrFromComponentTypeFile; - if (forReference) { - interfaceClassNameAttrFromComponentTypeFile = (String) parameters - .get("/componentType/reference/interface.cpp/@class"); - } else { - interfaceClassNameAttrFromComponentTypeFile = (String) parameters - .get("/componentType/service/interface.cpp/@class"); - } - - List methods = headers.getAllMethods(); - - // Pull out one of the methods' namespace attributes. - String intfNamespace = null; - if (methods.size() > 0) { - Signature method = (Signature) methods.get(0); - intfNamespace = method.getNamespace(); - } - - if (interfaceClassNameAttrFromComponentTypeFile != null) { - methods = filterToPublicMethodsOfGivenClass(methods, - interfaceClassNameAttrFromComponentTypeFile, true); - } else { - //We want to filter to methods of the class whose - //name matches the header file name. - // String intfClassName = (String) parameters.get("intfClass"); - // - String headerFileBase = file.getName().replaceAll( - "\\.h|\\.hpp|\\.h++", ""); - - methods = filterToPublicMethodsOfGivenClass(methods, - headerFileBase, false); - } - - Document dom = createDOMofMethods(methods, source, serviceName, - referenceName, nameOfSorR, null, - componentTypeFileHeaderName, compositeXmlFileHeader, - compositeXmlFileHeaderNoExt, intfNamespace, - interfaceClassNameAttrFromComponentTypeFile, - implClassNameAttrFromCompositeFile, implClassNamespaceAttrFromCompositeFile); - -// // Print out the generated DOM -// StringWriter sw = new StringWriter(); -// OutputFormat outputFormat = new OutputFormat("xml", "UTF-8", true); -// XMLSerializer serializer = new XMLSerializer(sw, outputFormat); -// serializer.serialize(dom); -// System.out.println("DOM:\n"+sw.toString()); - - - createProxyCPPFromDom(outputDir, dom); - createProxyHeaderFromDom(outputDir, dom); - - if (!forReference) { - createWrapperCPPFromDom(outputDir, dom); - createWrapperHeaderFromDom(outputDir, dom); - } - - } catch (Exception exception) { - exception.printStackTrace(); - failed = true; - } - - if (failed) { - Utils.outputDebugString("Finished! (but encountered problems)"); - System.exit(-2); - } - } - - /** - * This methods takes a list of methods and filters them to only contain the - * public methods of the given class - * - * @param methods - * a list of methods - * @param className - * we will return a list of only this classes methods from the - * methods parameter - * @param attrSpecified - * if the user does not specify one we ignore namespaces - * @return - */ - private static List filterToPublicMethodsOfGivenClass(List methods, - String className, boolean useNamespace) { - if (methods != null && className != null && className.length() > 0) { - for (Iterator iter = methods.listIterator(); iter.hasNext();) { - Signature method = (Signature) iter.next(); - String scope = method.getScope(); - String sig = method.getOriginal(); - String namespace = method.getNamespace(); - - String qualifiedClassName; - if (useNamespace && null != namespace && 0 < namespace.length()) { - qualifiedClassName = namespace + "::" - + method.getTrimClassName(); - } else { - qualifiedClassName = method.getTrimClassName(); - } - - // If we are not public or the classname does not match - // remove... - if (!qualifiedClassName.equals(className) - || -1 == scope.indexOf("public")) { - iter.remove(); - } - } - } - return methods; - } - - /** - * Use an XSLT transformation to create a Proxy "view" of the DOM - * information - * - * @param outputDir - * where to put the C++ - * @param dom - * the DOM of semantic method information - * @throws TransformerException - */ - private static void createProxyCPPFromDom(File outputDir, Document dom) - throws TransformerException { - - //Create the Filename from the Service Name in the DOM - if (dom == null) { - return; - } - - String serviceOrReferenceName = "noSorRNameDefined"; - - String implClass = "nocompositeXmlFileHeaderDefined"; - - Element topNode = dom.getDocumentElement(); - if (null != topNode) { - Attr attr = topNode.getAttributeNode("nameOfSorR"); - if (attr != null) { - serviceOrReferenceName = attr.getNodeValue(); - } - - attr = topNode.getAttributeNode("implClass"); - if (attr != null) { - implClass = attr.getNodeValue(); - } - } - - File proxyCPP = new File(outputDir, implClass + "_" - + serviceOrReferenceName + "_Proxy.cpp"); - if (null != proxyCPP) { - - Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_GENERATED, proxyCPP - .getAbsolutePath()); - Utils.postEvent(Utils.EVENT_TYPE_FILE_CREATE, - "Scagen creating SCA for C++ proxy implementation " - + proxyCPP.getAbsolutePath()); - } - - createOutputFromDom(dom, proxyCPP, - "org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyCPP.xsl"); - - } - - /** - * Use an XSLT transformation to create a Wrapper "view" of the DOM - * information - * - * @param outputDir - * where to put the C++ - * @param dom - * the DOM of semantic method information - * @throws TransformerException - */ - private static void createWrapperCPPFromDom(File outputDir, Document dom) - throws TransformerException { - - //Create the Filename from the Service Name in the DOM - if (dom == null) { - return; - } - - String serviceName = "noServiceDefined"; - - String implClass = "nocompositeXmlFileHeaderDefined"; - - Element topNode = dom.getDocumentElement(); - if (null != topNode) { - Attr attr = topNode.getAttributeNode("serviceName"); - if (attr != null) { - serviceName = attr.getNodeValue(); - } - - attr = topNode.getAttributeNode("implClass"); - if (attr != null) { - implClass = attr.getNodeValue(); - } - } - - File wrapperCPP = new File(outputDir, implClass + "_" + serviceName - + "_Wrapper.cpp"); - if (null != wrapperCPP) { - Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_GENERATED, wrapperCPP - .getAbsolutePath()); - Utils.postEvent(Utils.EVENT_TYPE_FILE_CREATE, - "Scagen creating SCA for C++ wrapper implementation " - + wrapperCPP.getAbsolutePath()); - } - createOutputFromDom(dom, wrapperCPP, - "org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperCPP.xsl"); - - } - - /** - * Use an XSLT transformation to create a Proxy header "view" of the DOM - * information - * - * @param outputDir - * where to put the C++ - * @param dom - * the DOM of sematic method information - * @throws TransformerException - */ - private static void createProxyHeaderFromDom(File outputDir, Document dom) - throws TransformerException { - - //Create the Filename from the Service Name in the DOM - if (dom == null) { - return; - } - - String serviceOrReferenceName = "noServiceDefined"; - String intfClass = "noInterfaceClassNameOrDefaultDefined"; - String implClass = "noImplementationClassOrDefaultDefined"; - - Element topNode = dom.getDocumentElement(); - if (null != topNode) { - Attr attr = topNode.getAttributeNode("nameOfSorR"); - if (attr != null) { - serviceOrReferenceName = attr.getNodeValue(); - } - attr = topNode.getAttributeNode("intfClass"); - if (attr != null) { - intfClass = attr.getNodeValue(); - } - attr = topNode.getAttributeNode("implClass"); - if (attr != null) { - implClass = attr.getNodeValue(); - } - } - - File proxyHeader = new File(outputDir, implClass + "_" - + serviceOrReferenceName + "_Proxy.h"); - if (null != proxyHeader) { - Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_GENERATED, proxyHeader - .getAbsolutePath()); - Utils.postEvent(Utils.EVENT_TYPE_FILE_CREATE, - "Scagen creating SCA for C++ proxy header " - + proxyHeader.getAbsolutePath()); - } - - createOutputFromDom(dom, proxyHeader, - "org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyHeader.xsl"); - - } - - /** - * Use an XSLT transformation to create a Wrapper header "view" of the DOM - * information - * - * @param outputDir - * where to put the C++ - * @param dom - * the DOM of sematic method information - * @throws TransformerException - */ - private static void createWrapperHeaderFromDom(File outputDir, Document dom) - throws TransformerException { - - //Create the Filename from the Service Name in the DOM - if (dom == null) { - return; - } - - String serviceName = "noServiceDefined"; - - String implClass = "nocompositeXmlFileHeaderDefined"; - - Element topNode = dom.getDocumentElement(); - if (null != topNode) { - Attr attr = topNode.getAttributeNode("serviceName"); - if (attr != null) { - serviceName = attr.getNodeValue(); - } - - attr = topNode.getAttributeNode("implClass"); - if (attr != null) { - implClass = attr.getNodeValue(); - } - } - - File wrapperHeader = new File(outputDir, implClass + "_" + serviceName - + "_Wrapper.h"); - - if (null != wrapperHeader) { - Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_GENERATED, wrapperHeader - .getAbsolutePath()); - Utils.postEvent(Utils.EVENT_TYPE_FILE_CREATE, - "Scagen creating SCA for C++ wrapper header " - + wrapperHeader.getAbsolutePath()); - } - createOutputFromDom(dom, wrapperHeader, - "org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperHeader.xsl"); - - } - - /** - * This method will return a class loader that can see the resources that - * are parts of "this" package. - */ - private static ClassLoader getALoader() { - - LittleClass lc; - try { - lc = new LittleClass(); - return lc.getClass().getClassLoader(); - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } - - /** - * This method will generically process the DOM using a stylesheet passed - * in. - * - * @param dom - * the source of data (the model) - * @param outputFile - * where to put the result - * @param xslTransformationFileName - * the xsl file containing the "view" - * @throws TransformerException - */ - private static void createOutputFromDom(Document dom, File outputFile, - String xslTransformationFileName) throws TransformerException { - - if(Options.noGenerate()){ - return; - } - - InputStream stream = getALoader().getResourceAsStream( - xslTransformationFileName); - StreamSource ss = new StreamSource(stream); - StreamResult out = new StreamResult(outputFile); - try { - Transformer xslt = txmf.newTransformer(ss); - - // Unless a width is set, there will be only line breaks but no - // indentation. - // The IBM JDK and the Sun JDK don't agree on the property name, - // so we set them both. - // - try { - xslt.setOutputProperty( - "{http://xml.apache.org/xalan}indent-amount", "2"); - } catch (Throwable t) { - //OK to ignore this, depends on XSLT engine and one will fail - } - try { - xslt.setOutputProperty( - "{http://xml.apache.org/xslt}indent-amount", "2"); - } catch (Throwable t) { - //OK to ignore this, depends on XSLT engine and one will fail - } - - DOMSource from = new DOMSource(dom); - - xslt.transform(from, out); - - } catch (TransformerConfigurationException e) { - e.printStackTrace(); - throw (e); - } catch (TransformerException e) { - e.printStackTrace(); - throw (e); - } finally { - try { - stream.close(); - } catch (IOException e1) { - // unlikely but if - // we can't close it, we can't close it - } - } - - } - - //TODO clear up the parameter list below to make it smaller if - // possible - /** - * This method will create A DOM containing all the semantic information - * that it can extract from a C++ header file. - * - * @param methods - * a list of methods that are going into the DOM - * @param source - * the header file the methods came from - * @param serviceName - * the name of the service - * @referenceName the name of the reference - * @nameOfSorR the non null one of the two parameters above - * @headerClassName the name of the header class - * @param compositeXmlFileImplHeaderNameWithPathAndExt - * the source filename - * @param compositeXmlFileHeaderNoExtorPath - * the shortname of the source file - * @param implClass - * the implementation class - * @param intfClass - * the interface we are turning into a service - * @return - */ - private static Document createDOMofMethods(List methods, File source, - String serviceName, String referenceName, String nameOfSorR, - String headerClassName, - String componentTypeXmlFileIntfHeaderNameWithPathAndExt, - String compositeXmlFileImplHeaderNameWithPathAndExt, - String compositeXmlFileHeaderNoExtorPath, String intfNamespace, - String intfClass, String implClass, String implNamespace) { - - if (methods == null) { - return null; - } - - // Create a DOM of the methods - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - Document document = null; - try { - DocumentBuilder builder = factory.newDocumentBuilder(); - document = builder.newDocument(); - - Element root = (Element) document.createElement(CPP_HEADER); - - root.setAttribute(HEADER_NAME_ATTR, source.getPath()); - - document.appendChild(root); - - Element intf = (Element) document.createElement(SCA_SERVICE); - root.appendChild(intf); - - // Go through all the signatures we have collected... - Signature s = null; - for (Iterator iter = methods.iterator(); iter.hasNext();) { - s = (Signature) iter.next(); - - // Each signature is an operation - Element op = document.createElement(SCA_OPERATION); - op.setAttribute(OPERATION_NAME_ATTR, s.getMethodName()); - intf.appendChild(op); - - Parameter[] parms = s.getParameters(); - if (parms != null) { - - for (int i = 0; i < parms.length; i++) { - Element parm = (Element) document - .createElement(SCA_OPERATION_PARAMETER); - String type_string = parms[i].getTypeWithoutConst() - .toString(); - - type_string = type_string.replaceAll(":: ", "::"); - - Text text = document.createTextNode(type_string); - parm.appendChild(text); - parm.setAttribute(SCA_OPERATION_PARAMETER_NAME_ATTR, - parms[i].getName()); - - if (parms[i].getTypeWithoutConst().intern() != parms[i] - .getType().intern()) { - parm.setAttribute( - SCA_OPERATION_PARAMETER_CONST_ATTR, "true"); - } - - op.appendChild(parm); - // TO DO only really stores the value - // unsafely/temporarily - // which is fine while we handle everything at the - // end of parsing the "leaf" that represents that actual - // interface/service but the below will cause the second - // service - // processed to overwite the first one in the DOM. I we - // wish - // to do some overall processing at the end we will have - // to - // use a better more XPath like key that varies by - // instance - // of the service. - intf.setAttribute(SCA_INTERFACE_NAME_ATTR, s - .getTrimClassName()); - } - } - - Element rc = document.createElement(SCA_OPERATION_RETURN_TYPE); - rc.appendChild(document.createTextNode(s.getReturnType() - .toString().replaceAll(":: ", "::"))); - op.appendChild(rc); - - root.appendChild(intf); - } - - // Set the name of the Service - // here, if we are not passed one we use - // the classname from the last header function signature... - if (serviceName == null && s != null) { - serviceName = s.getTrimClassName(); - } - - // this is used for the proxy file name but we need to - // use the reference name if this is pulled in due to it - // being a reference!!! - if (serviceName != null) - root.setAttribute("serviceName", serviceName); - if (referenceName != null) - root.setAttribute("referenceName", referenceName); - if (nameOfSorR != null) - root.setAttribute("nameOfSorR", nameOfSorR); - - if (implClass != null) { - root.setAttribute("implClass", implClass); - } else { - root.setAttribute("implClass", compositeXmlFileHeaderNoExtorPath); - } - - if (implClass != null) { - root.setAttribute("implNamespace", implNamespace); - } - - // default class name to the name of the header... - if (headerClassName == null && source != null) { - headerClassName = source.getName().replaceAll( - "\\.h|\\.hpp|\\.h++", ""); - } - root.setAttribute("headerClassName", headerClassName); - - if (null == intfClass) { - intfClass = headerClassName; - } - - if (null != intfNamespace) { - root.setAttribute("namespace", intfNamespace); - if (null != intfClass && !intfClass.startsWith(intfNamespace)) { - intfClass = intfNamespace + "::" + intfClass; - } - } - - root.setAttribute("intfClass", intfClass); - - if (componentTypeXmlFileIntfHeaderNameWithPathAndExt == null) { - componentTypeXmlFileIntfHeaderNameWithPathAndExt = "componentTypeHeader"; - } - root.setAttribute("componentTypeHeader", - componentTypeXmlFileIntfHeaderNameWithPathAndExt); - - if (compositeXmlFileImplHeaderNameWithPathAndExt == null) { - compositeXmlFileImplHeaderNameWithPathAndExt = "compositeXmlFileImplHeader"; - } - root.setAttribute("compositeXmlFileHeader", - compositeXmlFileImplHeaderNameWithPathAndExt); - - if (compositeXmlFileHeaderNoExtorPath == null) { - compositeXmlFileHeaderNoExtorPath = "compositeXmlFileHeaderNoExt"; - } - root.setAttribute("compositeXmlFileHeaderNoExt", - compositeXmlFileHeaderNoExtorPath); - - } catch (ParserConfigurationException pce) { - // Parser with specified options can't be built - pce.printStackTrace(); - } - - return document; - - } - -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/XMLFileActor.java b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/XMLFileActor.java deleted file mode 100644 index dd260c9787..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/XMLFileActor.java +++ /dev/null @@ -1,208 +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. - */ - -/* @version $Rev$ $Date$ */ - -package org.apache.tuscany.sca.cpp.tools.services; - -import java.io.File; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMResult; -import javax.xml.transform.dom.DOMSource; - -import org.apache.tuscany.sca.cpp.tools.common.FileActor; -import org.apache.tuscany.sca.cpp.tools.common.Utils; -import org.w3c.dom.Document; -import org.xml.sax.SAXException; - -/** - * The purpose of this abstract class is to provide a home for the standard - * processing that is involved in turning a XML file into an internal DOM. - */ -public abstract class XMLFileActor implements FileActor { - - protected static Map handlers = new HashMap(); - - protected static Map parameters = new HashMap(); - - public boolean failed; - - private int filesActedOn=0; - - protected static TransformerFactory transformerFactory = TransformerFactory - .newInstance(); - - /** - * This method is the main FileActor method - * - * @see FileActor#actOnFile(File, File, int) Here we create an initial DOM - * and kick off the processing (using the handler map that has been set - * up by the concrete subclass). - * - * @param compositeXML - * the composite or fragment file - * @param target - * the target directory - * @param depth - * not uesed here but in the - * @see FileActor#actOnFile(File, File, int) interface to allow for - * recursive diving into a directory structure. - */ - public void actOnFile(File compositeXML, File target, int depth) - throws Exception { - - if (null == compositeXML || null == target) { - return; - } - - filesActedOn++; - - parameters.put("sourceFile", compositeXML); - parameters.put("targetFile", target); - - if (transformerFactory.getFeature(DOMSource.FEATURE) - && transformerFactory.getFeature(DOMResult.FEATURE)) { - Document dom = createDomFromXMLFile(compositeXML); - if (dom != null) { - parameters.put("targetDirectoryFile", target); - DomHandler.handleDom(dom, handlers, parameters); - } - } - } - - /** - * This method builds an in memory DOM from an XML file - * - * @param xmlSourceFile - * the XML file we are handling - * @return the resulting document - */ - protected Document createDomFromXMLFile(File xmlSourceFile) { - Document dom = null; - DocumentBuilderFactory f = DocumentBuilderFactory.newInstance(); - //We do not validate via f.setValidating(true); - f.setNamespaceAware(true); - - try { - DocumentBuilder parser = f.newDocumentBuilder(); - dom = parser.parse(xmlSourceFile); - } catch (SAXException sxe) { - String path; - try { - path = xmlSourceFile.getCanonicalPath(); - } catch (IOException e) { - path = xmlSourceFile.getPath(); - } - Utils.screenMessage("There has been a SAXException of type " - + sxe.getLocalizedMessage()); - if (null != xmlSourceFile) { - Utils.screenMessage(" when processing file " + path); - } else { - Utils.screenMessage(" as the input file is null."); - } - -// Leave for possible future debug option -// Utils.screenMessage(" The returned Java exception is below."); -// if (sxe.getException() != null) -// sxe.getException().printStackTrace(); -// else -// sxe.printStackTrace(); - } catch (ParserConfigurationException pce) { - String path; - try { - path = xmlSourceFile.getCanonicalPath(); - } catch (IOException e) { - path = xmlSourceFile.getPath(); - } - Utils - .screenMessage("There has been a ParserConfigurationException of type " - + pce.getLocalizedMessage()); - if (null != xmlSourceFile) { - Utils.screenMessage(" when processing file " + path); - } else { - Utils.screenMessage(" as the input file is null."); - } - -// Leave for possible future debug option -// Utils.screenMessage(" The returned Java exception is below."); -// pce.printStackTrace(); - - } catch (IOException ioe) { - String path; - try { - path = xmlSourceFile.getCanonicalPath(); - } catch (IOException e) { - path = xmlSourceFile.getPath(); - } - - Utils.screenMessage("Unable to open file " + path); - Utils.screenMessage(this.getContextMessage()); - - - - } - - return dom; - } - - /** - * @return an error message - usually over-ridden. - */ - private String getContextMessage() { - return "Check the file exists and can be read."; - } - - /** - * Set a parameter - * - * @param name - * @param value - */ - public void setParameter(String name, Object value) { - parameters.put(name, value); - } - - /** - * Get a parameter - * - * @param name - * @param value - * @return the value of the parameter - */ - public Object getParameter(String name, Object value) { - return parameters.get(name); - } - - - - /** - * @return Returns the filesActedOn. - */ - public int getFilesActedOn() { - return filesActedOn; - } -} \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/package.html b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/package.html deleted file mode 100644 index ea15ca587b..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/package.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - -Design documentation for org\apache\tuscany\sca\cpp\tools\services - - - - -
          - -

          Overview

          - - - -

          This package contains classes that generate C++ wrappers and -proxies for C++ implementations of SCA services.

          - -

          What the package does

          - -

          The Scagen class main method will take in an input and -output directory name. The input directory is taken to be the SCA composite root -directory.  The tool will generate the wrapper and proxy headers and methods -bodies in the output directory.

          - -

          These proxies and wrappers enable the SCA for C++ runtime to -act as a conduit for SCA C++ calls in a type free manner. Client code can call -the type specific functions that are in the generated proxy classes. The call -is marshalled into a generic format and a SCA for C++ runtime function with a -standard signature is invoked. The details of the call are passed as data.

          - -

          On the other end of the runtime, a generated function with a -standard signature is called, this function will inspect the data that -represents the call’s method name and call the appropriate type specific -function in the C++ implementation.

          - -

          The Input Data Used

          - -

          The input directory passed to the Scagen method is taken to -be the SCA composite root directory. All the sca.composite and .fragment files in -that directory are inspected to resolve all the <component/> elements -within them.

          - -

          Each <component/> element found is inspected to see if -it has a <implementation.cpp/> element within it.

          - -

          Each <implementation.cpp/> element should have a -header attribute that represents a C++ header file that contains function -prototypes for the C++ implementation of the service. An optional class -attribute can be used to select one class if more than one that is present in -the header file. The default class is the one with the same name as the header -file. The tool will verify that the implementation header contains an -appropriate class prototype.

          - - - -

          The directory that contains the implementation header should -also contain a matching .componentType file for the equivalent SCA component. So -for example, a MyServiceImpl.h file would have a corresponding MyServiceImpl.componentType -file in the same directory.

          - - - -

          Each componentType file is inspected for <service/> -and <reference/> elements. For each <service/> element that is -found that contains a <interface.cpp/> element within it,

          - -

          the header attribute of the <interface.cpp/> is taken -as the filename of the C++ interface header for the SCA service.  This C++ -header file is opened and used as a means for specifying the SCA service -resulting in an appropriate wrapper and proxy being generated for this service -interface. Both method bodies and headers are generated in the given output -directory. The processing of a <reference/> element is the same except -that only a proxy header and implementation are generated.

          - - - - - -

          Outline Design: How it Works

          - - - -

          The basic approach is to scan in the XML files by first -creating a DOM document tree of them and then recursively rifling through the DOM  -with some generic code in the XMLFileActorClass by default this processing will -build up a map which maps the XPath location of attributes to their values. -Additionally subclasses can add to a “handlers map” which maps from the name of -a particular element to an object that implements the DomNodeHandler interface. -If the XMLFileActor code comes across any element that has an equivalent handler -in the handler map the objects handleNode method will be called.

          - -

          Typically the DomNodeHandler’s handle node interface will -use XPath to pull out the parameters that it is interested in from the -parameters map that is being built up by the generic code.

          - -

          This design was chosen as the Java level specified for the -original implementation did not have direct XPath query of XML data but it was -known that this would be available in Java 1.5 onwards. The design allows the -DOM and parameters map handling to be replaced in the future with JRE 1.5 code -with less impact on the rest of the code.

          - - - -

          The processing leads to the parsing of the C++ interface -files using the org\apache\tuscany\sca\cpp\tools\common package. This results -in a Headers object

          - -

          that contains a List of Signature objects, each one -representing a function prototype found in the header.

          - - - -

          We are aiming to get all the semantic data we want to use -into a DOM document (this represents the model of our input data) and then use -XSLT to create the 4 different views of this data:

          - -

          Proxy C++ header

          - -

          Proxy C++  body

          - -

          Wrapper C++ header

          - -

          Wrapper C++ body

          - - - -

          So we prepopulate the DOM with parameter data that comes -from the XML files and then iterate through the Signatures that are returned -from the C++ header parser transferring the useful data into the DOM.

          - - - -

          We than use 4 XSLT stylesheets to generate the C++ output -files as required.

          - -
          - - - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyCPP.xsl b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyCPP.xsl deleted file mode 100644 index 3d9dafa103..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyCPP.xsl +++ /dev/null @@ -1,278 +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. - */ - - - -#include "osoa/sca/sca.h" - - - - - - - - - - _ - - _Proxy - - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - -* - -_Factory(tuscany::sca::ServiceWrapper* target) - { - return new (target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void - -_Destructor(void* proxy) - { - delete (*)proxy; - } -} - - -::(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -::~() -{ - if (target) - delete target; -} - - - - - - - - - - - - _ - - _Proxy - -#include " - -.h" - - - - - - - - - - - _ - - _Proxy - - - - - - - - -:: -( - - - - - - - - - const - - - - - - - - , - - - - - -) -{ - - -} - - - - - - - - - -0 - - - - - - - - tuscany::sca::Operation operation(" - - "); - - - - - - - - target->invoke(operation); - - - - - - - - - - - - return; - - - - - - - return *(*)operation.getReturnValue(); - - - - return *(*)operation.getReturnValue(); - - - - - - - - - - - - - - - - - ret; - operation.setReturnValue(&ret); - - - - - - - - - - - - - - operation.addParameter("", &); - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyHeader.xsl b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyHeader.xsl deleted file mode 100644 index 2f5edb3a93..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfProxyHeader.xsl +++ /dev/null @@ -1,228 +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. - */ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #ifndef _h - - - - #define _h - - - - - #if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - - - - - - - - - - #include "" - - - - #include "tuscany/sca/core/ServiceWrapper.h" - - - - - - - - - - -class - - : public - -{ -public: - (tuscany::sca::ServiceWrapper*); - - virtual ~(); - - - -private: - tuscany::sca::ServiceWrapper* target; -}; - - - - - - - -#endif // _h - - - - - - - - - - - - - - - virtual - - -( - - - - - - - - const - - - - - - - , - - - -); - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperCPP.xsl b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperCPP.xsl deleted file mode 100644 index f983917e36..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperCPP.xsl +++ /dev/null @@ -1,290 +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. - */ - - - -#include "osoa/sca/sca.h" - -using ; - - - - - - - - - - - - - - - - - - _ - - _Wrapper - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - -* - -_Factory(tuscany::sca::model::Service* target) - { - return new (target); - } -} - - -::(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) -{ - impl = (*)getImplementation(); -} - - -::~() -{ - releaseImplementation(); -} - -void* -::newImplementation() -{ - return new ; -} - -void -::deleteImplementation() -{ - delete impl; -} - -void ::invokeService(tuscany::sca::Operation& operation) -{ - const std::string& operationName = operation.getName(); - - - - - - throw osoa::sca::ServiceRuntimeException("Invalid operation"); - -} - - - - - - _ - - _Wrapper - -#include " - -.h" - - - - - - - - - if (operationName == " - -") - { - - - - } - - - - - - - - - - - - - - - - - - return; - - - - - - - - - - - - - - - - p = *( - *)operation.getParameterValue(); - - - - const - p = *( - const - - *)operation.getParameterValue(); - - - - commonj::sdo::DataObjectPtr& p = *(commonj::sdo::DataObjectPtr*)operation.getParameterValue(); - - - const & p = *( - const - - *)operation.getParameterValue(); - - - - - - - - - - - - - - - ; - - - ret = ; - - operation.setReturnValue(&ret); - - - - if(operation.getReturnValue() != NULL) - { - *(*)operation.getReturnValue() = ; - } - else - { - * ret = new ; - *ret = ; - operation.setReturnValue((const *)ret); - } - - - - - - impl->( - - - - - - - - - -) - - - -p - - - - , - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperHeader.xsl b/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperHeader.xsl deleted file mode 100644 index c8157fe2f6..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperHeader.xsl +++ /dev/null @@ -1,191 +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. - */ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #ifndef _h - - - - #define _h - - - - - #if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - - - - - - - - - - #include "" - - - - #include "tuscany/sca/cpp/CPPServiceWrapper.h" - - - - - - - - - - -class - - : public tuscany::sca::cpp::CPPServiceWrapper -{ -public: - (tuscany::sca::model::Service* target); - - virtual ~(); - virtual void invokeService(tuscany::sca::Operation& operation); - virtual void* newImplementation(); - virtual void deleteImplementation(); - -private: - - * impl; -}; - - - - - - - -#endif // _h - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/xsd/sca-implementation-cpp.xsd b/sca-cpp/trunk/runtime/extensions/cpp/xsd/sca-implementation-cpp.xsd deleted file mode 100644 index ac2004bd73..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/xsd/sca-implementation-cpp.xsd +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/cpp/xsd/sca-interface-cpp.xsd b/sca-cpp/trunk/runtime/extensions/cpp/xsd/sca-interface-cpp.xsd deleted file mode 100644 index a8493fe726..0000000000 --- a/sca-cpp/trunk/runtime/extensions/cpp/xsd/sca-interface-cpp.xsd +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/php/AUTHORS b/sca-cpp/trunk/runtime/extensions/php/AUTHORS deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/sca-cpp/trunk/runtime/extensions/php/COPYING b/sca-cpp/trunk/runtime/extensions/php/COPYING deleted file mode 100755 index 6b0b1270ff..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/COPYING +++ /dev/null @@ -1,203 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/sca-cpp/trunk/runtime/extensions/php/ChangeLog b/sca-cpp/trunk/runtime/extensions/php/ChangeLog deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/sca-cpp/trunk/runtime/extensions/php/INSTALL b/sca-cpp/trunk/runtime/extensions/php/INSTALL deleted file mode 100644 index 059a43057b..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/INSTALL +++ /dev/null @@ -1,2 +0,0 @@ -Please read the GettingStarted.html document for information on -building and installing Tuscany SCA Native PHP extemstion diff --git a/sca-cpp/trunk/runtime/extensions/php/LICENSE b/sca-cpp/trunk/runtime/extensions/php/LICENSE deleted file mode 100755 index f433b1a53f..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/LICENSE +++ /dev/null @@ -1,177 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/sca-cpp/trunk/runtime/extensions/php/Makefile.am b/sca-cpp/trunk/runtime/extensions/php/Makefile.am deleted file mode 100644 index fb661fec63..0000000000 --- a/sca-cpp/trunk/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 samples - -datadir=$(prefix) - -nobase_data_DATA = xsd/*.xsd - -EXTRA_DIST = xsd \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/php/NEWS b/sca-cpp/trunk/runtime/extensions/php/NEWS deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/sca-cpp/trunk/runtime/extensions/php/NOTICE b/sca-cpp/trunk/runtime/extensions/php/NOTICE deleted file mode 100644 index b240b0a121..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/NOTICE +++ /dev/null @@ -1,5 +0,0 @@ -Apache Tuscany SCA Native -Copyright 2005, 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/) \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/php/README b/sca-cpp/trunk/runtime/extensions/php/README deleted file mode 100644 index ad96622516..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/README +++ /dev/null @@ -1,276 +0,0 @@ -PHP Extension for C++ SCA README -================================ - -Overview --------- - -The PHP extension for C++ SCA allows PHP scripts to be used to implement SCA components. -This is achieved by using the C++ SCA extension API to drive script execution through the -PHP embedding SAPI. In its current incarnation the PHP Extension requires that a full SCDL -description is provided for each PHP component, i.e. we are not yet making use of the meta data -provided by the annotations that can appear in PHP SCA components. - -There are various styles of PHP script that are supported. The examples here are taken from -the PHPCalculator sample and if you look at the SCDL files provided with the sample you can -see the component type and composite files that tie these components into the working system - -SCA Service ------------ - -/** - * @service - * @binding.ws - */ -class Divide { - - /** - * @reference - * @binding.tuscany cppDivideService - */ - public $another_divide; - - /** - * Division - * - * @param float $num1 (the first number) - * @param float $num2 (the second number) - * @return float The result - */ - function div($num1, $num2) { - return $this->another_divide->div($num1, $num2); - } - -} - -PHP Class ---------- - -class Multiply { - function mul($num1, $num2) { - $result = $num1 * $num2; - - $log_proxy = SCA::getService("log_service"); - $log_proxy->log_message($result); - - return $result; - } -} - -PHP Function ------------- - -function sub($num1, $num2){ - $result = $num1 - $num2; - - $log_proxy = SCA::getService("log_service"); - $log_proxy->log_message($result); - - return $result; -} - -PHP Script ----------- - -$num1 = $_REQUEST[0]; -$num2 = $_REQUEST[1]; - -$result = $num1 + $num2; - -$log_proxy = SCA::getService("log_service"); -$log_proxy->log_message($result); - -echo $result; - -TODO ----- -* I struggled for a long time with a missing symbol problem loading sdo.so at runtime on linux. - I got round this by creating a standalone Makefile for the CalculatorClient exe. All the - shared objects that are loaded are compiled with the normal automake toolchain still but this - solves the problem. I need to investigate in detail what's going on here. Having someone - else try building with the full automake configuration would be insteresting -* The problem from above does appear when running SCA behind axis hence I am unable to test with - remote clients -* The SCA_SDO build generates sdo.so and the Tuscany PHP Extension tries to load libsdo.so. - One side needs fixing. For now I just copy the library -* SDO passing in and out of components is coded but not tested -* Returning values from plain PHP scripts (scripts without classes and functions) is not - operating correctly -* Error handling needs looking at. Many situations are not trapped and those - that are may not be reported correctly -* Reorganize the extension code so that Tuscany SCA can be loaded by PHP running in Apache - and accessed through SCA references. This will play the same role as SCA running hosted - in Axis2C and will open up the service bindings implemented in PHP SCA_SDO. -* Implement meta data exchange between the PHP SCA implementation and the Tuscany C++ SCA - implementations so that selected parts of the SCDL definition can be omitted. -* There is a threading issue with the way that we are firing up the PHP embedding SAPI - TSRM should solve it fails on the embedding initialization for some reason. - -Dependencies ------------- -PHP5.2.0 source code - - (http://php.net/) - The binary release of PHP doesn't ship with the header files required to build - against the PHP embedding SAPI and runtime libraries. So go get the PHP source - code and build PHP. PHP will need to be configured correctly in order to - work properly when embedded in C++ SCA. Here are some sample configuration - statements but they will need to be tailored for you specific environment: - - Winodws - ------- - cscript configure.js --with-extra-includes=win32build\include; - libxml2-2.6.26.threads\include; - iconv-1.9.1.win32\include; - libcurl-7.15.4-nossl\include - --with-extra-libs=win32build\lib; - libxml2-2.6.26.threads\lib; - iconv-1.9.1.win32\lib; - libcurl-7.15.4-nossl\lib - --enable-debug - --enable-soap - --enable-apache2handler=shared - --enable-embed - --with-curl=C:\simon\apps\libcurl-7.15.4-nossl - - Note. This configure line is artificially broken across sever lines to aid - readability here. You will need to join it all back together on one line to - run it. - - Linux - ----- - ./configure --enable-debug \ - --enable-soap \ - --enable-fastcgi \ - --with-zlib \ - --enable-embed \ - --with-tsrm-pthreads \ - --enable-maintainer-zts - Note. debug, pthreads, maintainer-zts, fastcgi are not absolute requirements but just - represent the environment I was testing with when I wrote this. - -SCA_SDO PECL extension AVOCET branch source code - (http://pecl.php.net/package/SCA_SDO) - Provides the SCA framework for PHP and the necessary mediation code to translate - between Tuscany SCA and PHP SCA. Go get the AVOCET branch from PECL cvs - - export CVSROOT=:pserver:cvsread@cvs.php.net/repository - cvs export -r AVOCET pecl/sdo - - The process to build this code varies quite considerably between windows and Linux. - Take a look at the instructions in the SCA_SDO manual, follow the documentation link - from the projects PECL page (http://uk2.php.net/sdo/). - - Once built you will need to copy the library sdo.so to - libsdo.so so that the Tuscany PHPExtension can load it given the makefile - configuration as it stands. For example, on linux - - ln -s sdo.so libsdo.so - - -Building on windows -------------------- - -The Visual C++ Express solution provided with C++ SCA includes a project -to build the PHP extension. This project relies on being able to access the -PHP include files from the source code directory and the PHP lib files from the -binary install. Make sure your environment is set as follows before you start -Visual C++ Express (if you do this after you start Visual C++ Express it will -not pick up the changes) - -PHP_HOME = the root directory of the PHP 5.2.0 source code install -PATH = ensure that the root directory of the PHP 5.2.0 binary install appears - -PHP_SCA_SDO_HOME = the directory in which the SCA_SDO pecl extension source is installed - -These changes come over and above the environment changes you need to make -to build the core C++ SCA software. I have the following set in my environment but -of course the details depend on where you have the various bits of software installed. - -AXIS2C_HOME=c:\axis2c-bin-0.96-win32 -LIBXML2_HOME=c:\libxml2-2.6.26.ein32 -ICONV_HOME=c:\iconv-1.9.2.win32 -ZLIB_HOME=c:\zlib-1.2.3.win32 -TUSCANY_SCACPP=c:\sca\deploy -TUSCANY_SDOCPP=c:\sdo\deploy - -Now compile the PHP extension. Compiling with VC++ Express requires some care - -1/ Ensure that the PHP include files are configured correctly for - compiling against C++ SCA in Visual C++ express - - See - http://bugs.php.net/bug.php?id=39130 - - Comment out two lines in $(PHP_HOME)/main/config.w32.h: - #define _USE_32BIT_TIME_T 1 - #define HAVE_STDLIB_H 1 - - -Building on Linux ------------------ - -The PHP extension comes with a set of automake files so that the PHP extension is built -at the same time as all of the other extensions assuming that appropriate environment -variables are set. The build.sh script that can be found under the top level sca directory -checks whether the PHP_LIB and PHP_INCLUDE variables are set and if so enables compilation -of the PHP extension automatically by adding --enable-php to the configure line. - -There are a number of environment variables that the build depends on. I find setting the -following variables useful. - -# the location of libxm2 -export LIBXML2_LIB=/usr/lib -export LIBXML2_INCLUDE=/usr/include/libxml2 - -# the location of PHP -export PHP_LIB=/usr/local/lib -export PHP_INCLUDE=/usr/local/include/php - -# the location of the PHP SCA_SDO extension source -# the lib location depends oh the configuration options used -# when building PHP so beware -export PHP_SCA_SDO_INCLUDE=where ever you install the SCA_SDO package source -export PHP_SCA_SDO_LIB=$PHP_LIB/php/extensions/no-debug-zts-20060613/ - -# the location of axis2 -export AXIS2C_HOME=/usr/local/axis2c-bin-0.96-linux - -# the install directories for the tuscany sca and sdo projects -export TUSCANY_SDOCPP=/usr/local/tuscany/cpp/sdo/deploy -export TUSCANY_SCACPP=/usr/local/tuscany/cpp/sca/deploy - -Once these are set running sca/build.sh should compile and install the PHP extension. - -Testing the PHP Extension -------------------------- - -In order to run the PHP extension successfully as an embedded component of the -C++ SCA runtime the PHP environment must be configured correctly. This configuration -is provided by the php.ini file. The location of this file depends on your installation -of PHP but by default is as follows. - -/usr/local/bin - PHP executables -/usr/local/lib/php.ini - the ini file that tell PHP where to look for scripts and - extension libraries -/usr/local/lib/php - PHP runtime installation, extension files and tests - -As is usually the case your milage may vary but wherever PHP is installed you will find -a similar set of directories. To force PHP to look in the correct place use the following -setting - -# tell PHP specifically where to find php.ini rather than relying on the default -set PHPRC=/usr/local/lib - -The php.ini file must be configured to load the SCA_SDO extension so you would expect to -see the following modifications to the file. - -; around line 528 you need to set the variable that tells PHP where to -; load extension libraries from. This varies depending on how PHP has been -; compiled and installed, for example, -extension_dir = "/usr/local/lib/php/extensions/no-debug-zts-20060613/" - -; around line 512 you need to set the variable that tells PHP where to -; load included scripts from. There are windows and unix versions. Here -; is a Unix example -include_path=".:/usr/local/lib/php:/usr/local/lib/php/PEAR:/usr/local/tuscany/cppsca/samples/PHPCalculator/deploy/sample.calculator" - -; around line 673 you will find the end of the list of enabled extensions. We need to turn -; on SDO so add the following line. sdo.so should be found in "extension_dir". -extension=sdo.so - diff --git a/sca-cpp/trunk/runtime/extensions/php/autogen.sh b/sca-cpp/trunk/runtime/extensions/php/autogen.sh deleted file mode 100755 index af38864985..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/autogen.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# 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. - -for i in "libtoolize --force" aclocal autoconf autoheader -do - echo -n "Running $i..." - $i || exit 1 - echo 'done.' -done - -echo -n 'Running automake...' -automake --add-missing -echo 'done.' -exit 0 - diff --git a/sca-cpp/trunk/runtime/extensions/php/build.sh b/sca-cpp/trunk/runtime/extensions/php/build.sh deleted file mode 100755 index 41e96d0565..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/build.sh +++ /dev/null @@ -1,55 +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. - -SCA_PHP_EXTENSION_HOME=`pwd` - -if [ x$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi - -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$PHP_LIB = x ]; then -echo "PHP_LIB not set." -exit; -elif [ x$PHP_INCLUDE = x ]; then -echo "PHP_INCLUDE not set." -exit; -elif [ x$PHP_SCA_SDO_INCLUDE = x ]; then -echo "PHP_SCA_SDO_INCLUDE not set." -exit; -elif [ x$PHP_SCA_SDO_LIB = x ]; then -echo "PHP_SCA_SDO_LIB not set." -exit; -fi -echo "Building PHP extension with PHP installed at $PHP_LIB, $PHP_INCLUDE" -echo "and PHP SCA and SDO installed at $PHP_SCA_SDO_LIB, $PHP_SCA_SDO_INCLUDE" - -#cd ${TUSCANY_SCACPP_HOME}/samples -#./autogen.sh - -cd ${SCA_PHP_EXTENSION_HOME} -./autogen.sh - - -./configure --prefix=${TUSCANY_SCACPP}/extensions/php -make -make install - diff --git a/sca-cpp/trunk/runtime/extensions/php/configure.ac b/sca-cpp/trunk/runtime/extensions/php/configure.ac deleted file mode 100644 index d68d262b78..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/configure.ac +++ /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. - -dnl run autogen.sh to generate the configure script. - -AC_PREREQ(2.59) -AC_INIT(tuscany_sca_php, 1.0-incubator-M3) -AC_CANONICAL_SYSTEM -AM_CONFIG_HEADER(tuscany_sca_php_config.h) -AM_INIT_AUTOMAKE([tar-ustar]) -AC_PREFIX_DEFAULT(/usr/local/tuscany/sca/extensions/php) - -# Checks for programs. -AC_PROG_CXX -AC_PROG_CC -AC_PROG_CPP -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MAKE_SET -AC_PROG_LIBTOOL - -# Check for running on Darwin -AC_MSG_CHECKING([Checking if running on Darwin]) -UNAME=`uname -s` -if test "x$UNAME" = "xDarwin"; then - AC_DEFINE([IS_DARWIN], [1], [Set to 1 when running on Darwin - Mac OSX]) - AC_MSG_RESULT(yes) - AC_SUBST([libsuffix],[".dylib"]) - is_darwin=true -else - AC_MSG_RESULT(no) - AC_SUBST([libsuffix],[".so"]) - is_darwin=false -fi -AM_CONDITIONAL([DARWIN], [test x$is_darmin = xtrue]) - -# Checks for libraries. - -# Checks for header files. -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_CHECK_HEADERS([inttypes.h stdlib.h string.h sys/time.h unistd.h]) - -# Checks for typedefs, structures, and compiler characteristics. -AC_HEADER_STDBOOL -AC_C_CONST -AC_C_INLINE - -# Checks for library functions. -AC_FUNC_CLOSEDIR_VOID -AC_FUNC_STAT -AC_FUNC_VPRINTF -AC_CHECK_FUNCS([getcwd putenv strdup]) -# AC_CONFIG_SUBDIRS([samples]) - - -AC_CONFIG_FILES([Makefile - src/Makefile - samples/Makefile - samples/PHPCalculator/Makefile - samples/PHPCalculator/sample.calculator/Makefile - samples/PHPCalculator/sample.calculator.client/Makefile - ]) -AC_OUTPUT - diff --git a/sca-cpp/trunk/runtime/extensions/php/samples/Makefile.am b/sca-cpp/trunk/runtime/extensions/php/samples/Makefile.am deleted file mode 100644 index 920828ef4f..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/samples/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 = PHPCalculator \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/Makefile.am b/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/Makefile.am deleted file mode 100644 index fd34c6442a..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/Makefile.am +++ /dev/null @@ -1,21 +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. - -deploydir=$(prefix)/samples/PHPCalculator/deploy -SUBDIRS = sample.calculator sample.calculator.client -EXTRA_DIST = *.composite -deploy_DATA = *.composite diff --git a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/README b/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/README deleted file mode 100644 index dbee1f5f85..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/README +++ /dev/null @@ -1,32 +0,0 @@ -Tuscany SCA for C++ Samples - PHP Calculator Sample -=================================================== - -This is a simple sample to show how an SCA composite can wire together -a number of components to implement a Calculator service and expose that service as -to a number of different tpyes of client. The sample components are implemented in various -ways to demonstrate the different features of the PHP SCA extension. - -There are two sub projects in this workspace: - - sample.calculator - This contains the source code and SCDL artifacts for the SCA Calculator - composite implementing the sample Calculator - - - sample.calculator.client - A sample client which does a local call to the Calculator service - -A Python client is used because the work to enable PHP to host SCA is not done yet - -Windows -======= -tba - -Linux -===== - -The make install will deploy this under $TUSCANY_SCACPP/extensions/php/samples - -To run the sample - -cd $TUSCANY_SCACPP/extensions/php/samples/PHPCalculator/deploy/sample.calculator.client -./runclient.sh - diff --git a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator.app.composite b/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator.app.composite deleted file mode 100644 index ada4d89a1c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator.app.composite +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/Makefile.am b/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/Makefile.am deleted file mode 100644 index 548f9bdcb8..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/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. - -deploydir=$(prefix)/samples/PHPCalculator/deploy -clientdir=$(deploydir)/sample.calculator.client - -client_DATA = *.py -client_SCRIPTS = runclient.sh -EXTRA_DIST = *.py *.php runclient.sh - diff --git a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/calculator_client.py b/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/calculator_client.py deleted file mode 100644 index d4b37ee2b2..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/calculator_client.py +++ /dev/null @@ -1,50 +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 a simple sample that provides a Python -# client for the Calculator sample - - -import sys -import sca - -op = sys.argv[1] -val1 = sys.argv[2] -val2 = sys.argv[3] - -# Locate the calculator service -calc = sca.locateservice("CalculatorComponent/CalculatorService") - -# Invoke the calculator operations -if op == 'add': - result = calc.add(val1, val2) - -elif op == 'sub': - result = calc.sub(val1, val2) - -elif op == 'mul': - result = calc.mul(val1, val2) - -elif op == 'div': - result = calc.div(val1, val2) - - -print "calculator_client: ",op,"(",val1,",",val2,") = ",result - diff --git a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/runclient.sh b/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/runclient.sh deleted file mode 100755 index 54ebfdbde4..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator.client/runclient.sh +++ /dev/null @@ -1,48 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -if [ x$PYTHON_LIB != x ]; then -echo "Using Python library installed at $PYTHON_LIB" -export LD_LIBRARY_PATH=$PYTHON_LIB:$LD_LIBRARY_PATH -export PATH=$PYTHON_LIB/../bin:$PATH -fi - -export LD_LIBRARY_PATH=$PHP_SCA_SDO_LIB:$TUSCANY_SCACPP/lib:$TUSCANY_SCACPP/extensions/python/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH -export PYTHONPATH=$TUSCANY_SCACPP/extensions/python/lib:$PYTHONPATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ -export TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent -export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -cd $TUSCANY_SCACPP_ROOT/sample.calculator.client -python calculator_client.py mul 7 6 diff --git a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Calculator.componentType b/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Calculator.componentType deleted file mode 100644 index 5a6c3a199e..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Calculator.componentType +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Calculator.php b/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Calculator.php deleted file mode 100644 index f0f35bab56..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Calculator.php +++ /dev/null @@ -1,89 +0,0 @@ -add_service->add($num1, $num2); - } - - /** - * Subtraction - * - * @param float $num1 (the first number) - * @param float $num2 (the second number) - * @return float The result - */ - function sub($num1, $num2) { - return $num1 - $num2; -// return $this->sub_service->sub($num1, $num2); - } - - /** - * Multiplication - * - * @param float $num1 (the first number) - * @param float $num2 (the second number) - * @return float The result - */ - function mul($num1, $num2) { - return $this->mul_service->mul($num1, $num2); - } - - /** - * Division - * - * @param float $num1 (the first number) - * @param float $num2 (the second number) - * @return float The result - */ - function div($num1, $num2) { - return $this->div_service->div($num1, $num2); - } -} - -?> diff --git a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Divide.componentType b/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Divide.componentType deleted file mode 100644 index b50b20d9c6..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Divide.componentType +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Divide.php b/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Divide.php deleted file mode 100644 index 5a08e5b063..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Divide.php +++ /dev/null @@ -1,47 +0,0 @@ -log_message($result); - - return $result; - - } - -} - -?> diff --git a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Log.componentType b/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Log.componentType deleted file mode 100644 index f945c6af8c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Log.componentType +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Log.php b/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Log.php deleted file mode 100644 index 0a955f36d3..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Log.php +++ /dev/null @@ -1,36 +0,0 @@ -toLog('>>> ' . $message); - } -} - -?> diff --git a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Makefile.am b/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Makefile.am deleted file mode 100644 index 10020c4f03..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/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. - -deploydir=$(prefix)/samples/PHPCalculator/deploy -compositedir=$(deploydir)/sample.calculator - -composite_DATA = *.composite *.componentType *.php -EXTRA_DIST = *.composite *.componentType *.php - diff --git a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Multiply.php b/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Multiply.php deleted file mode 100644 index ed2e75edc8..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/Multiply.php +++ /dev/null @@ -1,39 +0,0 @@ -log_service->log_message($result); - - return $result; - } -} - -?> diff --git a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/sample.calculator.composite b/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/sample.calculator.composite deleted file mode 100644 index f1a82a70db..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/samples/PHPCalculator/sample.calculator/sample.calculator.composite +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - DivideComponent - - - - - - LogComponent - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/php/src/Makefile.am b/sca-cpp/trunk/runtime/extensions/php/src/Makefile.am deleted file mode 100644 index d0b04262f5..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/Makefile.am +++ /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. - -libdir=$(prefix)/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/PHPInterfaceExtension.cpp \ -tuscany/sca/php/PHPServiceWrapper.cpp \ -tuscany/sca/php/PHPServiceProxy.cpp \ -tuscany/sca/php/sca.cpp \ -tuscany/sca/php/model/PHPImplementation.cpp \ -tuscany/sca/php/model/PHPInterface.cpp \ -tuscany/sca/php/model/PHPReferenceBinding.cpp \ -tuscany/sca/php/model/PHPServiceBinding.cpp - -libtuscany_sca_php_la_LIBADD = -L${TUSCANY_SCACPP}/lib -ltuscany_sca \ - -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \ - -L${PHP_LIB} -lphp5 \ - -L${PHP_SCA_SDO_LIB} -lsdo - -INCLUDES = -I${TUSCANY_SCACPP}/include \ - -I${TUSCANY_SDOCPP}/include \ - -I${PHP_INCLUDE} \ - -I${PHP_INCLUDE}/main \ - -I${PHP_INCLUDE}/Zend \ - -I${PHP_INCLUDE}/TSRM \ - -I${PHP_INCLUDE}/sapi/embed \ - -I${PHP_SCA_SDO_INCLUDE} - -moduledir=$(prefix)/module -extension = libtuscany_sca_php$(libsuffix) - -install-exec-hook: - test -z $(moduledir) || $(mkdir_p) $(moduledir); - -rm -f $(moduledir)/$(extension) - $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.cpp b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.cpp deleted file mode 100644 index 0ffb660139..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.cpp +++ /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$ */ - -#include "tuscany/sca/php/PHPExtension.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/php/PHPImplementationExtension.h" -#include "tuscany/sca/php/PHPInterfaceExtension.h" - - -extern "C" -{ -#if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) -#endif - void tuscany_sca_php_initialize() - { - tuscany::sca::php::PHPExtension::initialize(); - } -} - -namespace tuscany -{ - namespace sca - { - namespace php - { - // =================================================================== - // Constructor for the PHPExtension class. - // =================================================================== - PHPExtension::PHPExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the PHPExtension class. - // =================================================================== - PHPExtension::~PHPExtension() - { - logentry(); - } - - void PHPExtension::initialize() - { - logentry(); - SCARuntime::getCurrentRuntime()->registerImplementationExtension(new PHPImplementationExtension()); - SCARuntime::getCurrentRuntime()->registerInterfaceExtension(new PHPInterfaceExtension()); - } - - } // End namespace php - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.h b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.h deleted file mode 100644 index 971ed93c86..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.cpp b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.cpp deleted file mode 100644 index 101667302f..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.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/PHPImplementationExtension.h" -#include "tuscany/sca/php/model/PHPImplementation.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace php - { - // =================================================================== - // Constructor for the PHPImplementationExtension class. - // =================================================================== - PHPImplementationExtension::PHPImplementationExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the PHPImplementationExtension class. - // =================================================================== - PHPImplementationExtension::~PHPImplementationExtension() - { - logentry(); - } - - 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) - { - logentry(); - - string module = scdlImplementation->getCString("module"); - string className = scdlImplementation->getCString("class"); - - PHPImplementation* phpImpl = new PHPImplementation(composite, module, className); - - return phpImpl; - } - - } // End namespace php - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.h b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.h deleted file mode 100644 index 604c4ea102..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPImplementationExtension.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_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 std::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 std::string& getExtensionTypeQName() {return typeQName;} - - virtual tuscany::sca::model::ComponentType* getImplementation( - tuscany::sca::model::Composite* composite, - commonj::sdo::DataObjectPtr scdlImplementation); - - private: - static const std::string extensionName; - static const std::string typeQName; - - }; - - - } // End namespace php - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_php_phpimplementationextension_h - diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.cpp b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.cpp deleted file mode 100644 index a07c499dec..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.cpp +++ /dev/null @@ -1,76 +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/PHPInterfaceExtension.h" -#include "tuscany/sca/php/model/PHPInterface.h" -#include "tuscany/sca/util/Logging.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace php - { - // =================================================================== - // Constructor for the PHPInterfaceExtension class. - // =================================================================== - PHPInterfaceExtension::PHPInterfaceExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the PHPInterfaceExtension class. - // =================================================================== - PHPInterfaceExtension::~PHPInterfaceExtension() - { - logentry(); - } - - const string PHPInterfaceExtension::extensionName("php"); - const string PHPInterfaceExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#PHPInterface"); - - // =================================================================== - // loadModelElement - load the info from interface.php - // =================================================================== - tuscany::sca::model::Interface* PHPInterfaceExtension::getInterface(Composite* composite, DataObjectPtr scdlInterface) - { - logentry(); - - // Determine the type - string ifType = scdlInterface->getType().getName(); - if (ifType == "PHPInterface") - { - bool remotable = scdlInterface->getBoolean("remotable"); - bool conversational = scdlInterface->getBoolean("conversational"); - - return new PHPInterface(remotable, conversational); - } - return 0; - } - - } // End namespace php - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.h b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.h deleted file mode 100644 index 4279376300..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.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_php_phpinterfaceextension_h -#define tuscany_sca_php_phpinterfaceextension_h - -#include "tuscany/sca/extension/InterfaceExtension.h" - -namespace tuscany -{ - namespace sca - { - namespace php - { - - class PHPInterfaceExtension : public InterfaceExtension - { - public: - /** - * Default constructor - */ - PHPInterfaceExtension(); - - /** - * Destructor - */ - virtual ~PHPInterfaceExtension(); - - /** - * return the name of the extension - */ - virtual const std::string& getExtensionName() {return extensionName;} - - /** - * return the QName of schema elemant for this implementation extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#PHPInterface") - */ - virtual const std::string& getExtensionTypeQName() {return typeQName;} - - virtual tuscany::sca::model::Interface* getInterface( - tuscany::sca::model::Composite* composite, - commonj::sdo::DataObjectPtr scdlInterface); - - private: - static const std::string extensionName; - static const std::string typeQName; - - }; - - - } // End namespace php - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_php_phpinterfaceextension_h - diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPServiceProxy.cpp b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPServiceProxy.cpp deleted file mode 100644 index 4b66c42a5b..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPServiceProxy.cpp +++ /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$ */ - -#include "tuscany/sca/php/PHPServiceProxy.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/model/ServiceBinding.h" -#include "tuscany/sca/php/model/PHPReferenceBinding.h" - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace php - { - - // ============================================ - // Constructor: Create a proxy from a reference - // ============================================ - PHPServiceProxy::PHPServiceProxy(Reference* reference) - : ServiceProxy(reference) - { - logentry(); - - // Get the service wrapper - PHPReferenceBinding* referenceBinding = (PHPReferenceBinding*)reference->getBinding(); - serviceWrapper = referenceBinding->getTargetServiceBinding()->getServiceWrapper(); - } - - // ========================================== - // Constructor: Create a proxy from a service - // ========================================== - PHPServiceProxy::PHPServiceProxy(Service* service) - : ServiceProxy(NULL) - { - logentry(); - - // Get the service wrapper - serviceWrapper = service->getBinding()->getServiceWrapper(); - } - - // ========== - // Destructor - // ========== - PHPServiceProxy::~PHPServiceProxy() - { - logentry(); - } - - // ===================================================== - // invokeService: invoke the service wired to this proxy - // ===================================================== - void PHPServiceProxy::invokeService(Operation& operation) - { - logentry(); - - // Invoke the service - serviceWrapper->invoke(operation); - } - } // End namespace php - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPServiceProxy.h b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPServiceProxy.h deleted file mode 100644 index bddb262617..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPServiceProxy.h +++ /dev/null @@ -1,83 +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_phpserviceproxy_h -#define tuscany_sca_php_phpserviceproxy_h - -#include "tuscany/sca/php/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" - - -namespace tuscany -{ - namespace sca - { - namespace php - { - - /** - * Holds a proxy for a given reference from a component implemented in PHP. - */ - class PHPServiceProxy : 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. - */ - PHPServiceProxy(tuscany::sca::model::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. - */ - PHPServiceProxy(tuscany::sca::model::Service* service); - - /** - * Destructor. - */ - virtual ~PHPServiceProxy(); - - /** - * Invoke the wired service. - */ - virtual void invokeService(Operation& operation); - - private: - - /** - * The target service wrapper - */ - ServiceWrapper* serviceWrapper; - }; - - } // End namespace php - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_php_phpserviceproxy_h diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp deleted file mode 100644 index 8c92be0d83..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp +++ /dev/null @@ -1,505 +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$ */ - -#ifdef WIN32 - -// some strangeness in the build that causes -// WinSock.h and WinSock2.h to be included leading to redefinitions -#define _WINSOCKAPI_ - -// sdo.cpp also includes the math libraries and causes redeclarations -// of all the math functions -#define _INC_MATH - -#endif //WIN32 - -#include -#include - -#include - - -#include "tuscany/sca/php/PHPServiceWrapper.h" -#include "tuscany/sca/php/PHPServiceProxy.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/Exceptions.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 "sca.h" -#include "php_sdo_int.h" - -using namespace std; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace php - { - - int embedSAPIInitializeCount = 0; - - // Global callbacks used by the PHP engine - - // Callback for SAPI error - void php_sapi_error(int type, const char *error_msg, ...) - { - logwarning("PHP sapi error: %s", error_msg); - //TODO - do something sensible with this output - zend_bailout(); - } - - // Callback for log messages - void php_log_message(char *message) - { - loginfo("PHP log: %s", message); - //TODO - do something sensible with this output - } - - // Callback for unbuffered writes (echo, print etc.) - int php_ub_write(const char *str, unsigned int str_length TSRMLS_DC) - { - logentry(); - loginfo("PHP Output: %s", str); - //TODO - do something sensible with this output - 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) - { - logentry(); - - char buffer[2048]; - int len; - - len = snprintf(buffer, 2048, "Error in file %s on line %d: ", error_filename, error_lineno); - vsnprintf(buffer + len, (2048 - len), format, args); - logwarning("PHP error: %s", buffer); - //TODO - do something sensible with this output - zend_bailout(); - } - - - // =========== - // Constructor - // =========== - PHPServiceWrapper::PHPServiceWrapper(Service* service) - : ServiceWrapper(service) - { - logentry(); - - 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"; - throwException(SystemConfigurationException, msg.c_str()); - } - - loginfo("Module: %s", impl->getModule().c_str()); - loginfo("Class: %s", impl->getClass().c_str()); - } - - // ========== - // Destructor - // ========== - PHPServiceWrapper::~PHPServiceWrapper() - { - logentry(); - } - - - // ====================================================================== - // invoke: wrapper call to service with setting the component context - // ====================================================================== - void PHPServiceWrapper::invoke(Operation& operation) - { - zval z_func_name, retval, z_component_name, z_class_name, z_operation_name, z_arg_array; - zval *params[5]; - - logentry(); - - // set the current component in the SCA runtime - // so that other things can get at it thorugh this - // static class - SCARuntime* runtime = SCARuntime::getCurrentRuntime(); - runtime->setCurrentComponent(component); - - try - { - // get the component type information - PHPImplementation* impl = (PHPImplementation*)component->getType(); - - // get the directory containing the component type - const string &compositeDir = impl->getComposite()->getRoot(); - - // get some useful information that will be used later - // when we construct the wrapper script - string componentName = component->getName(); - string className = impl->getClass(); - string operationName = operation.getName(); - loginfo("Component %s class %s operation: %s", - componentName.c_str(), - className.c_str(), - operationName.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.sapi_error = php_sapi_error; - - // would normally use the following macro before the embeded call - // but we need to take account of multiple nested calls - // and ZTS threading safety is not behaving itself - // PHP_EMBED_START_BLOCK(/* argc */ 0, /* argv */ NULL) - // ===================================================================== - { -#ifdef ZTS - static void ***tsrm_ls; - loginfo("ZTS enabled"); - - printf("tsrm_ls = %x, embedSAPIInitializeCount = %d\n", - tsrm_ls, embedSAPIInitializeCount); -#endif - - if ( embedSAPIInitializeCount == 0 ) - { - embedSAPIInitializeCount = 1; - - php_embed_init(0, NULL PTSRMLS_CC); - - // load up the sca module that provides the interface between - // C++ and user space PHP - zend_first_try { - zend_startup_module(&sca_module_entry); - } zend_end_try(); - } else { - embedSAPIInitializeCount++; - } - - zend_try { - // set error handler - zend_error_cb = php_error_cb; - - /* - * Open the include files - */ - // includeFile("SCA/SCA.php" TSRMLS_CC); - // includeFile("SCA/Bindings/tuscany/SCA_TuscanyWrapper.php" TSRMLS_CC); - - /* Instantiate a SCA_Tuscany (mediator) object, and - * set its operation property - */ - zval z_tuscany_mediator; - zval *pz_mediator = &z_tuscany_mediator; - INIT_ZVAL(z_tuscany_mediator); - zend_class_entry *ce_mediator = - zend_fetch_class("SCA_Tuscany", sizeof("SCA_Tuscany") - 1, 0 TSRMLS_CC); - object_init_ex(pz_mediator, ce_mediator); - z_tuscany_mediator.value.obj.handlers->add_ref(pz_mediator TSRMLS_CC); - - zend_update_property_long(ce_mediator, pz_mediator, - "operation", sizeof("operation") - 1, (long)&operation TSRMLS_CC); - - /* get the class info loaded up */ - zend_eval_string("include 'SCA/SCA.php';", - NULL, "Include SCA" TSRMLS_CC); - zend_eval_string("include 'SCA/Bindings/tuscany/SCA_TuscanyWrapper.php';", - NULL, "Include SCA_TuscanyWrapper" TSRMLS_CC); - - /* Now instantiate an SCA_TuscanyWrapper object and call its constructor */ - zval z_tuscany_wrapper; - zval *pz_tuscany_wrapper = &z_tuscany_wrapper; - INIT_ZVAL(z_tuscany_wrapper); - object_init_ex(pz_tuscany_wrapper, - zend_fetch_class("SCA_TuscanyWrapper", sizeof("SCA_TuscanyWrapper") - 1, 0 TSRMLS_CC)); - z_tuscany_wrapper.value.obj.handlers->add_ref(pz_tuscany_wrapper TSRMLS_CC); - - ZVAL_STRING(&z_func_name, "__construct", 1); - ZVAL_STRING(&z_component_name, (char *)componentName.c_str(), 1); - if( &className != NULL && className.size() > 0) { - ZVAL_STRING(&z_class_name, (char *)className.c_str(), 1); - } else { - ZVAL_NULL(&z_class_name); - } - ZVAL_STRING(&z_operation_name, (char *)operationName.c_str(), 1); - - array_init(&z_arg_array); - - // get the parameters from the operation structure - for(unsigned int i = 0; i < operation.getNParms(); i++) - { - const Operation::Parameter& parm = operation.getParameter(i); - //printf("Arg %d type %d\n", i, parm.getType()); - switch(parm.getType()) - { - case Operation::BOOL: - { - add_next_index_bool(&z_arg_array, (int)*(bool*)parm.getValue() ); - break; - } - case Operation::SHORT: - case Operation::USHORT: - case Operation::LONG: - case Operation::ULONG: - { - add_next_index_long(&z_arg_array, *(long*)parm.getValue() ); - break; - } - case Operation::FLOAT: - { - add_next_index_double(&z_arg_array,( double)*(float*)parm.getValue() ); - break; - } - case Operation::DOUBLE: - case Operation::LONGDOUBLE: - { - add_next_index_double(&z_arg_array, *(double*)parm.getValue() ); - break; - } - case Operation::CHARS: - { - add_next_index_string(&z_arg_array, *(char**)parm.getValue(), 1 ); - break; - } - case Operation::STRING: - { - add_next_index_string(&z_arg_array, (char*)(*(string*)parm.getValue()).c_str(), 1 ); - break; - } - case Operation::DATAOBJECT: - { - // convert the tuscany SDO into a PHP SDO - - // create the object - zval *sdo; - ALLOC_INIT_ZVAL(sdo); - sdo_do_new(sdo, *(DataObjectPtr*)parm.getValue() TSRMLS_CC); - - // add it to the arg array - add_next_index_zval(&z_arg_array, sdo); - break; - } - default: - { - char *class_name; - char *space; - class_name = get_active_class_name(&space TSRMLS_CC); - php_error(E_ERROR, - "%s%s%s(): Argument type %d not supported", - class_name, - space, - get_active_function_name(TSRMLS_C), - parm.getType()); - } - } - } - - params[0] = &z_tuscany_mediator; - params[1] = &z_component_name; - params[2] = &z_class_name; - params[3] = &z_operation_name; - params[4] = &z_arg_array; - - call_user_function(EG(function_table), - &pz_tuscany_wrapper, - &z_func_name, - &retval, - 5, - params TSRMLS_CC); - - zval_dtor(&z_func_name); - zval_dtor(&z_component_name); - zval_dtor(&z_class_name); - zval_dtor(&z_operation_name); - zval_dtor(&z_arg_array); - - string script; - script = "include '" + compositeDir + "/" + impl->getModule() + ".php';"; - loginfo("Script: %s", script.c_str()); - - // call the dynamically created script - // I'm not trapping the return value here - // as it seems to prevent any kind of output - // being produced. Needs investigation. - //zval retval; - zend_eval_string((char *) script.c_str(), - NULL, //&retval, - "Include module" TSRMLS_CC); - - loginfo(">>>> About to call SCA_TuscanyWrapper->invoke()"); - - /* Now call SCA_TuscanyWrapper->invoke() ... */ - ZVAL_STRING(&z_func_name, "invoke", 1); - call_user_function(EG(function_table), - &pz_tuscany_wrapper, &z_func_name, - &retval, 0, NULL TSRMLS_CC); - - loginfo("<<<< Return from SCA_TuscanyWrapper->invoke()"); - - zval_dtor(&z_func_name); - - /* ... and copy the return value into the operation */ - switch(Z_TYPE(retval)) - { - case IS_NULL: - { - //printf("NULL response"); - break; - } - case IS_BOOL: - { - bool *newBool = new bool; - *newBool = ZEND_TRUTH(Z_BVAL(retval)); - operation.setReturnValue(newBool); - break; - } - case IS_LONG: - { - long *newLong = new long; - *newLong = Z_LVAL(retval); - operation.setReturnValue(newLong); - break; - } - case IS_DOUBLE: - { - //double *newDouble = new double; - float *newDouble = new float; - *newDouble = (float)Z_DVAL(retval); - operation.setReturnValue(newDouble); - break; - } - case IS_STRING: - { - string newString (Z_STRVAL(retval)); - operation.setReturnValue(&newString); - break; - } - case IS_OBJECT: - { - // convert the PHP SDO into a Tuscany SDO - DataObjectPtr sdo = sdo_do_get(&retval TSRMLS_CC); - operation.setReturnValue(&sdo); - break; - } - default: - { - char *class_name; - char *space; - class_name = get_active_class_name(&space TSRMLS_CC); - php_error(E_ERROR, - "%s%s%s(): Input argument type %d not supported on invoke", - class_name, - space, - get_active_function_name(TSRMLS_C), - Z_TYPE(retval)); - } - } - } zend_catch { - /* int exit_status = EG(exit_status); */ - } - zend_end_try(); - - if ( embedSAPIInitializeCount == 1 ) - { - php_embed_shutdown(TSRMLS_C); - loginfo("Engine shutdown"); - } - else - { - embedSAPIInitializeCount--; - } - } - // ===================================================================== - } - catch (...) - { - runtime->unsetCurrentComponent(); - throw; - } - runtime->unsetCurrentComponent(); - - } - - // ====================================================================== - // getServiceWrapper: create a wrapper for the target ComponentService - // ====================================================================== - PHPServiceWrapper* PHPServiceWrapper::getServiceWrapper(Service* service) - { - logentry(); - PHPServiceWrapper* serviceWrapper = 0; - - // --------------------------------- - // Create an instance of the wrapper - // --------------------------------- - serviceWrapper = new PHPServiceWrapper(service); - if (!serviceWrapper) - { - string msg = "Could not create new PHPServiceWrapper"; - throwException(SystemConfigurationException, msg.c_str()); - } - - return serviceWrapper; - } - - /* Not used at the moment - * Can find the include file and execute it, - * but doesn't make the contents available - */ - void PHPServiceWrapper::includeFile(char *includeFileName TSRMLS_DC) - { - zend_file_handle include_file_handle; - - include_file_handle.type = ZEND_HANDLE_FP; - include_file_handle.filename = includeFileName; - include_file_handle.opened_path = NULL; - include_file_handle.free_filename = 0; - if (!(include_file_handle.handle.fp = php_fopen_with_path( - include_file_handle.filename, "rb", PG(include_path), - &include_file_handle.opened_path TSRMLS_CC))) { - php_error(E_ERROR, - "Could not open %s", include_file_handle.filename); - return; - } - php_execute_script(&include_file_handle TSRMLS_CC); - } - - } // End namespace php - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.h b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.h deleted file mode 100644 index be20f34217..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.h +++ /dev/null @@ -1,112 +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 "tuscany/sca/php/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 - -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(tuscany::sca::model::Service* service); - - /** - * Constructor. - * @param target The component service to which this wrapper refers. - */ - PHPServiceWrapper(tuscany::sca::model::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: - - /** - * Utility method to execute a script on the include_path. - */ - static void includeFile(char *includeFileName TSRMLS_DC); - - /** - * The component to which this wrapper refers. - */ - tuscany::sca::model::Component* component; - - /** - * Set to true if the service is remotable. - */ - bool remotable; - - /** - * A pointer to the interface which the service exposes. - */ - tuscany::sca::model::Interface* interf; - - }; - - } // End namespace php - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_php_phpservicewrapper_h diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/export.h b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/export.h deleted file mode 100644 index 11a9519361..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/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_php_export_h -#define tuscany_sca_php_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 // tuscany_sca_export_h diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.cpp b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.cpp deleted file mode 100644 index 63f1672ec5..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.cpp +++ /dev/null @@ -1,85 +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" - -using namespace std; -using namespace tuscany::sca::model; - -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(); - } - - PHPImplementation::~PHPImplementation() - { - logentry(); - } - - void PHPImplementation::initializeComponent(Component* component) - { - logentry(); - 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++; - } - - // 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++; - } - } - - } // End namespace php - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.h b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.h deleted file mode 100644 index 78e678dff5..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPImplementation.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_php_model_phpimplementation_h -#define tuscany_sca_php_model_phpimplementation_h - -#include - -#include "tuscany/sca/model/ComponentType.h" - - -namespace tuscany -{ - namespace sca - { - namespace php - { - /** - * Holds information about an SCA implementation written in PHP - */ - class PHPImplementation : public tuscany::sca::model::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(tuscany::sca::model::Composite* composite, const std::string& module, const std::string& className); - - /** - * Destructor - */ - virtual ~PHPImplementation(); - - /** - * Initialize a component of this type. - * @param component The component to initialize. - */ - virtual void initializeComponent(tuscany::sca::model::Component* component); - - /** - * Returns the name of the module. - * @return The name of the module. - */ - const std::string& getModule() const { return module; } - - /** - * Get the name of the class. - * @return The class name if specified. - */ - const std::string& getClass() const { return className; } - - private: - - /** - * Name of the module. - */ - std::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. - */ - std::string className; - }; - - } // End namespace php - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_php_model_phpimplementation_h diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.cpp b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.cpp deleted file mode 100644 index cbea3f2b71..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.cpp +++ /dev/null @@ -1,53 +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/export.h" -#include "tuscany/sca/php/model/PHPInterface.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace php - { - const string PHPInterface::typeQName("http://www.osoa.org/xmlns/sca/1.0#PHPInterface"); - - // Constructor - PHPInterface::PHPInterface( - bool remotable, - bool conversational) - : Interface(remotable, conversational) - { - logentry(); - } - - PHPInterface::~PHPInterface() - { - logentry(); - } - - } // End namespace php - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.h b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.h deleted file mode 100644 index 9a4f658eb0..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.h +++ /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$ */ - - -#ifndef tuscany_sca_php_model_phpinterface_h -#define tuscany_sca_php_model_phpinterface_h - -#include - -#include "tuscany/sca/php/export.h" -#include "tuscany/sca/model/Interface.h" - -namespace tuscany -{ - namespace sca - { - namespace php - { - /** - * Holds information about an interface described using a PHP - * header file. - */ - class PHPInterface : public tuscany::sca::model::Interface - { - - public: - /** - * Constuctor. - * @param scope The scope of the interface (stateless or composite). - * @param remotable True if the interface is remotable. - */ - PHPInterface( - bool remotable, - bool conversational); - - /** - * Destructor. - */ - virtual ~PHPInterface(); - - /** - * return the QName of the schema type for this interface type - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#interface.cpp") - */ - const std::string& getInterfaceTypeQName() { return typeQName; }; - - /** - * The QName of the schema type for this interface type. - */ - SCA_PHP_API static const std::string typeQName; - - }; - - } // End namespace php - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_php_model_phpinterface_h - diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPReferenceBinding.cpp b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPReferenceBinding.cpp deleted file mode 100644 index 919d4c8646..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPReferenceBinding.cpp +++ /dev/null @@ -1,61 +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/PHPReferenceBinding.h" -#include "tuscany/sca/php/PHPServiceProxy.h" - -using namespace std; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace php - { - - // Constructor - PHPReferenceBinding::PHPReferenceBinding(Reference* reference) - : ReferenceBinding(reference, ""), serviceProxy(NULL) - { - } - - // Destructor - PHPReferenceBinding::~PHPReferenceBinding() - { - } - - ServiceProxy* PHPReferenceBinding::getServiceProxy() - { - return serviceProxy; - } - - void PHPReferenceBinding::configure(ServiceBinding* binding) - { - setTargetServiceBinding(binding); - - serviceProxy = new PHPServiceProxy(getReference()); - } - - } // End namespace - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPReferenceBinding.h b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPReferenceBinding.h deleted file mode 100644 index 45b422da2c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPReferenceBinding.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_php_model_phpreferencebinding_h -#define tuscany_sca_php_model_phpreferencebinding_h - -#include - -#include "tuscany/sca/model/ReferenceBinding.h" - - -namespace tuscany -{ - namespace sca - { - namespace php - { - /** - * Information about a PHP service binding for service or a reference. - */ - class PHPReferenceBinding : public tuscany::sca::model::ReferenceBinding - { - public: - - /** - * Constructor. - */ - PHPReferenceBinding(tuscany::sca::model::Reference* reference); - - /** - * Destructor. - */ - virtual ~PHPReferenceBinding(); - - /** - * Returns the type of binding. - */ - virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#PHPImplementationBinding"; }; - - /** - * Create a proxy representing the reference to the - * client component. - */ - virtual ServiceProxy* getServiceProxy(); - - /** - * Configure this binding from a service binding. - */ - virtual void configure(tuscany::sca::model::ServiceBinding* serviceBinding); - - private: - - /** - * The proxy representing the reference to the client - * component. - */ - ServiceProxy* serviceProxy; - }; - - } // End namespace php - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_php_model_phpreferencebinding_h diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.cpp b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.cpp deleted file mode 100644 index 4d18424ae2..0000000000 --- a/sca-cpp/trunk/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" - -using namespace std; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace php - { - - // Constructor - PHPServiceBinding::PHPServiceBinding(Service* service) - : ServiceBinding(service, "") - { - logentry(); - serviceWrapper = PHPServiceWrapper::getServiceWrapper(service); - } - - // Destructor - PHPServiceBinding::~PHPServiceBinding() - { - logentry(); - } - - ServiceWrapper* PHPServiceBinding::getServiceWrapper() - { - logentry(); - return (ServiceWrapper*)serviceWrapper; - } - - } // End namespace php - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.h b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/model/PHPServiceBinding.h deleted file mode 100644 index ef3d6b1604..0000000000 --- a/sca-cpp/trunk/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 - -#include "tuscany/sca/model/ServiceBinding.h" - - -namespace tuscany -{ - namespace sca - { - namespace php - { - /** - * Information about a PHP service binding for service or a reference. - */ - class PHPServiceBinding : public tuscany::sca::model::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(tuscany::sca::model::Service* service); - - /** - * Destructor. - */ - virtual ~PHPServiceBinding(); - - /** - * Returns the type of binding. - */ - virtual std::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/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/php_sca.h b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/php_sca.h deleted file mode 100644 index 8aea8dadb2..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/php_sca.h +++ /dev/null @@ -1,132 +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. - */ - -/* $ Id: $ */ - -#ifndef PHP_SCA_H -#define PHP_SCA_H - -#include "tuscany/sca/core/Operation.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include
          - -#ifdef HAVE_SCA - -#include
          -#include
          -#include -#include -#ifdef __cplusplus -} // extern "C" -#endif -#ifdef __cplusplus -extern "C" { -#endif - - -//extern zend_module_entry sca_module_entry; -#define phpext_sca_ptr &sca_module_entry - -#ifdef PHP_WIN32 -#define PHP_SCA_API __declspec(dllexport) -#else -#define PHP_SCA_API -#endif - -PHP_MINIT_FUNCTION(sca); -PHP_MSHUTDOWN_FUNCTION(sca); -PHP_MINFO_FUNCTION(sca); - -#ifdef ZTS -#include "TSRM/TSRM.h" -#endif - -#define FREE_RESOURCE(resource) zend_list_delete(Z_LVAL_P(resource)) - -#define PROP_GET_LONG(name) Z_LVAL_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) -#define PROP_SET_LONG(name, l) zend_update_property_long(_this_ce, _this_zval, #name, strlen(#name), l TSRMLS_CC) - -#define PROP_GET_DOUBLE(name) Z_DVAL_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) -#define PROP_SET_DOUBLE(name, d) zend_update_property_double(_this_ce, _this_zval, #name, strlen(#name), d TSRMLS_CC) - -#define PROP_GET_STRING(name) Z_STRVAL_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) -#define PROP_GET_STRLEN(name) Z_STRLEN_P(zend_read_property(_this_ce, _this_zval, #name, strlen(#name), 1 TSRMLS_CC)) -#define PROP_SET_STRING(name, s) zend_update_property_string(_this_ce, _this_zval, #name, strlen(#name), s TSRMLS_CC) -#define PROP_SET_STRINGL(name, s, l) zend_update_property_string(_this_ce, _this_zval, #name, strlen(#name), s, l TSRMLS_CC) - - -PHP_METHOD(SCA_Tuscany, __construct); -#if (PHP_MAJOR_VERSION >= 5) -ZEND_BEGIN_ARG_INFO_EX(SCA_Tuscany____construct_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) -ZEND_END_ARG_INFO() -#else /* PHP 4.x */ -#define SCA_Tuscany____construct_args NULL -#endif - -PHP_METHOD(SCA_Tuscany, invoke); -#if (PHP_MAJOR_VERSION >= 5) -ZEND_BEGIN_ARG_INFO_EX(SCA_Tuscany__invoke_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 4) - ZEND_ARG_INFO(0, component_name) - ZEND_ARG_INFO(0, reference_name) - ZEND_ARG_INFO(0, method_name) -#if (PHP_MINOR_VERSION > 0) - ZEND_ARG_ARRAY_INFO(0, arguments, 1) -#else - ZEND_ARG_INFO(0, arguments) -#endif -ZEND_END_ARG_INFO() -#else /* PHP 4.x */ -#define SCA_Tuscany__invoke_args NULL -#endif - -PHP_METHOD(SCA_Tuscany, getArgArray); -#if (PHP_MAJOR_VERSION >= 5) -ZEND_BEGIN_ARG_INFO_EX(SCA_Tuscany__getArgArray_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) -ZEND_END_ARG_INFO() -#else /* PHP 4.x */ -#define SCA_Tuscany__getArgArray_args NULL -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - - - -#endif /* PHP_HAVE_SCA */ - -#endif /* PHP_SCA_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/sca.cpp b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/sca.cpp deleted file mode 100644 index 4078226f63..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/sca.cpp +++ /dev/null @@ -1,517 +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. - */ - -/* $ Id: $ */ - -#ifdef WIN32 - -// some strangeness in the build that causes -// WinSock.h and WinSock2.h to be included leading to redefinitions -#define _WINSOCKAPI_ - -#endif //WIN32 - -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/php/PHPServiceProxy.h" -#include "commonj/sdo/RefCountingPointer.h" - -using namespace std; -using namespace tuscany::sca; -using namespace tuscany::sca::model; -using namespace tuscany::sca::php; -using namespace commonj::sdo; - -#define HAVE_SCA 1 - - -#include "php_sca.h" -#include "sca.h" - -#if HAVE_SCA - -#include "php_sdo.h" -#include "php_sdo_int.h" -/* {{{ Class definitions */ - -/* {{{ Class SCA_Tuscany */ - -static zend_class_entry * SCA_Tuscany_ce_ptr = NULL; - -/* {{{ Methods */ - -/* {{{ proto void __construct(int operation_handle) - */ -PHP_METHOD(SCA_Tuscany, __construct) -{ - zval *_this_zval = getThis(); - zend_class_entry *_this_ce = Z_OBJCE_P(_this_zval); - - long operation_handle = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &operation_handle) == FAILURE) { - return; - } - - if (!operation_handle) { - php_error(E_ERROR, "SCA_Tuscany ctor called with NULL operation"); - } - - PROP_SET_LONG(operation, operation_handle); -} -/* }}} __construct */ - -/* {{{ proto int invoke(string component_name, string reference_name, string method_name, array arguments) - Invoke a Tuscany component */ -PHP_METHOD(SCA_Tuscany, invoke) -{ - //zval * _this_zval = NULL; - const char * component_name = NULL; - int component_name_len = 0; - const char * reference_name = NULL; - int reference_name_len = 0; - const char * method_name = NULL; - int method_name_len = 0; - zval * arguments = NULL; - HashTable * arguments_hash = NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sssa/", - &component_name, &component_name_len, - &reference_name, &reference_name_len, - &method_name, &method_name_len, - &arguments) == FAILURE) { - return; - } - - arguments_hash = HASH_OF(arguments); - - // find the correct service proxy - SCARuntime* runtime = SCARuntime::getCurrentRuntime(); - Component* component = runtime->getCurrentComponent(); - Reference* ref = component->findReference(reference_name); - if(!ref) { - char *class_name; - char *space; - class_name = get_active_class_name(&space TSRMLS_CC); - php_error(E_ERROR, - "%s%s%s(): Can't find reference %s", - class_name, - space, - get_active_function_name(TSRMLS_C), - reference_name); - return; - } - - ReferenceBinding* refBinding = ref->getBinding(); - PHPServiceProxy *serviceProxy = (PHPServiceProxy*) refBinding->getServiceProxy(); - - // construct an operation structure - Operation operation(method_name); - - // add the parameters to the operation - for ( zend_hash_internal_pointer_reset(arguments_hash); - zend_hash_has_more_elements(arguments_hash) == SUCCESS; - zend_hash_move_forward(arguments_hash) ) - { - zval **data; - - if ( zend_hash_get_current_data(arguments_hash, - (void**)&data ) == FAILURE ) - { - continue; - } - - char *hashKey; - uint hashKeyLength; - ulong hashIndex; - int type; - - type = zend_hash_get_current_key_ex(arguments_hash, - &hashKey, - &hashKeyLength, - &hashIndex, - 0, - NULL); - - switch(Z_TYPE_PP(data)) - { - case IS_NULL: - { - //printf("NULL argument"); - break; - } - case IS_BOOL: - { - convert_to_boolean(*data); - bool *newBool = new bool; - *newBool = ZEND_TRUTH(Z_BVAL_PP(data)); - operation.addParameter(newBool); - break; - } - case IS_LONG: - { - convert_to_long(*data); - long *newLong = new long; - *newLong = Z_LVAL_PP(data); - operation.addParameter(newLong); - break; - } - case IS_DOUBLE: - { - //convert_to_double(*data); - //double *newDouble = new double; - convert_to_double(*data); - float *newDouble = new float; - *newDouble = (float)Z_DVAL_PP(data); - operation.addParameter(newDouble); - break; - } - case IS_STRING: - { - convert_to_string(*data); - string newString (Z_STRVAL_PP(data)); - operation.addParameter(&newString); - break; - } - case IS_OBJECT: - { - // convert the PHP SDO into a Tuscany SDO - DataObjectPtr sdo = sdo_do_get(*data TSRMLS_CC); - operation.addParameter(&sdo); - break; - } - default: - { - char *class_name; - char *space; - class_name = get_active_class_name(&space TSRMLS_CC); - php_error(E_ERROR, - "%s%s%s(): Input argument type %d not supported on invoke", - class_name, - space, - get_active_function_name(TSRMLS_C), - Z_TYPE_PP(data)); - } - } - } - - // call the proxy - serviceProxy->invokeService(operation); - - switch(operation.getReturnType()) - { - case Operation::BOOL: - { - ZVAL_BOOL(return_value, *(bool*)operation.getReturnValue()); - break; - } - case Operation::SHORT: - case Operation::USHORT: - case Operation::LONG: - case Operation::ULONG: - { - ZVAL_LONG(return_value, *(long*)operation.getReturnValue()); - break; - } - case Operation::FLOAT: - case Operation::DOUBLE: - case Operation::LONGDOUBLE: - { - ZVAL_DOUBLE(return_value, (double)*(float*)operation.getReturnValue()); - break; - } - case Operation::CHARS: - { - ZVAL_STRING(return_value, (char*)operation.getReturnValue(), 1); - break; - } - case Operation::STRING: - { - ZVAL_STRING(return_value, (char*)((string*)operation.getReturnValue())->c_str(), 1); - break; - } - case Operation::VOID_TYPE: - { - // do nothing - break; - } - case Operation::DATAOBJECT: - { - // convert the tuscany SDO into a PHP SDO - sdo_do_new(return_value, *(DataObjectPtr*)operation.getReturnValue() TSRMLS_CC); - break; - } - default: - { - char *class_name; - char *space; - class_name = get_active_class_name(&space TSRMLS_CC); - php_error(E_ERROR, - "%s%s%s(): Response type %d not supported on invoke", - class_name, - space, - get_active_function_name(TSRMLS_C), - operation.getReturnType()); - } - } - -} -/* }}} invoke */ - -/* {{{ proto array getArgArray() - return the arguments for the operation as an array */ -PHP_METHOD(SCA_Tuscany, getArgArray) -{ - zval * _this_zval = getThis(); - zend_class_entry *_this_ce = Z_OBJCE_P(_this_zval); - - if (ZEND_NUM_ARGS() > 0) { - WRONG_PARAM_COUNT; - } - - array_init(return_value); - - // get the operation object from the object properties - Operation *operation = (Operation *)PROP_GET_LONG(operation); - - // get the parameters from the operation structure - for(unsigned int i = 0; i < operation->getNParms(); i++) - { - const Operation::Parameter& parm = operation->getParameter(i); - //printf("Arg %d type %d\n", i, parm.getType()); - switch(parm.getType()) - { - case Operation::BOOL: - { - add_next_index_bool(return_value,(int)*(bool*)parm.getValue() ); - break; - } - case Operation::SHORT: - case Operation::USHORT: - case Operation::LONG: - case Operation::ULONG: - { - add_next_index_long(return_value,*(long*)parm.getValue() ); - break; - } - case Operation::FLOAT: - { - add_next_index_double(return_value,(double)*(float*)parm.getValue() ); - break; - } - case Operation::DOUBLE: - case Operation::LONGDOUBLE: - { - add_next_index_double(return_value,*(double*)parm.getValue() ); - break; - } - case Operation::CHARS: - { - add_next_index_string(return_value,*(char**)parm.getValue(), 1 ); - break; - } - case Operation::STRING: - { - add_next_index_string(return_value,(char*)(*(string*)parm.getValue()).c_str(), 1 ); - break; - } - case Operation::DATAOBJECT: - { - // convert the tuscany SDO into a PHP SDO - - // create the object - zval *sdo; - ALLOC_INIT_ZVAL(sdo); - sdo_do_new(sdo, *(DataObjectPtr*)parm.getValue() TSRMLS_CC); - - // add it to the arg array - add_next_index_zval(return_value, sdo); - break; - } - default: - { - char *class_name; - char *space; - class_name = get_active_class_name(&space TSRMLS_CC); - php_error(E_ERROR, - "%s%s%s(): Argument type %d not supported", - class_name, - space, - get_active_function_name(TSRMLS_C), - parm.getType()); - } - } - } -} -/* }}} getArgArray */ - -static zend_function_entry SCA_Tuscany_methods[] = { - PHP_ME(SCA_Tuscany, __construct, SCA_Tuscany____construct_args, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(SCA_Tuscany, invoke, SCA_Tuscany__invoke_args, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(SCA_Tuscany, getArgArray, SCA_Tuscany__getArgArray_args, ZEND_ACC_PUBLIC) - { NULL, NULL, NULL } -}; - -/* }}} Methods */ - -static void class_init_SCA_Tuscany(TSRMLS_D) -{ - zend_class_entry ce; - - INIT_CLASS_ENTRY(ce, "SCA_Tuscany", SCA_Tuscany_methods); - SCA_Tuscany_ce_ptr = zend_register_internal_class(&ce TSRMLS_CC); - - /* {{{ Property registration */ - - zend_declare_property_null(SCA_Tuscany_ce_ptr, - "operation", sizeof("operation") -1, - ZEND_ACC_PUBLIC TSRMLS_CC); - - /* }}} Property registration */ - -} - -/* }}} Class SCA_Tuscany */ - -/* }}} Class definitions*/ - -/* {{{ sca_functions[] */ -function_entry sca_functions[] = { - { NULL, NULL, NULL } -}; -/* }}} */ - -/* {{{ cross-extension dependencies */ - -#if ZEND_EXTENSION_API_NO >= 220050617 -static zend_module_dep sca_deps[] = { - ZEND_MOD_REQUIRED("sdo") - {NULL, NULL, NULL, 0} -}; -#endif -/* }}} */ - -/* {{{ sca_module_entry */ -zend_module_entry sca_module_entry = { -#if ZEND_EXTENSION_API_NO >= 220050617 - STANDARD_MODULE_HEADER_EX, NULL, - sca_deps, -#else - STANDARD_MODULE_HEADER, -#endif - - "sca", - sca_functions, - PHP_MINIT(sca), /* Replace with NULL if there is nothing to do at php startup */ - PHP_MSHUTDOWN(sca), /* Replace with NULL if there is nothing to do at php shutdown */ - NULL, /* Replace with NULL if there is nothing to do at request start */ - NULL, /* Replace with NULL if there is nothing to do at request end */ - PHP_MINFO(sca), - "0.0.1", - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_SCA -extern "C" { -ZEND_GET_MODULE(sca) -} // extern "C" -#endif - - -/* {{{ PHP_MINIT_FUNCTION */ -PHP_MINIT_FUNCTION(sca) -{ - /* We use the SDO extension for reference because it is a prereq */ - zend_module_entry *req_module_entry; - char *req_module_name = "libxml"; - if (zend_hash_find(&module_registry, req_module_name, strlen(req_module_name)+1, (void**)&req_module_entry) == SUCCESS) { - if (req_module_entry->zend_debug != ZEND_DEBUG || - req_module_entry->zts != USING_ZTS || - req_module_entry->zend_api != ZEND_MODULE_API_NO) { - php_error(E_ERROR, - "Cannot initialize module sca.\nModule sca compiled with module API=%d, debug=%d, thread-safety=%d\nModule %n compiled with module API=%d, debug=%d, thread-safety=%d\nThese options need to match", - req_module_name, - ZEND_MODULE_API_NO, ZEND_DEBUG, USING_ZTS, - req_module_entry->zend_api, req_module_entry->zend_debug, req_module_entry->zts); - return FAILURE; - } - } else { - /* The dependency checker should already have found this, but to be on the safe side ... */ - php_error (E_ERROR, - "Cannot load module sca because required module %n is not loaded", - req_module_name); - return FAILURE; - } - - class_init_SCA_Tuscany(TSRMLS_C); - - return SUCCESS; -} -/* }}} */ - - -/* {{{ PHP_MSHUTDOWN_FUNCTION */ -PHP_MSHUTDOWN_FUNCTION(sca) -{ - /* - * There is some corruption going on at shutdown. - * The following hack eliminates the symptom, but there's probably still - * an underlying problem. - */ - free(SCA_Tuscany_ce_ptr->name); - SCA_Tuscany_ce_ptr->name = NULL; - destroy_zend_class(&SCA_Tuscany_ce_ptr); - SCA_Tuscany_ce_ptr = NULL; - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION */ -PHP_MINFO_FUNCTION(sca) -{ - php_info_print_box_start(0); - php_printf("

          SCA Extension

          \n"); - php_printf("

          Version 0.0.1alpha (2007-01-15)

          \n"); - php_printf("

          Authors:

          \n"); - php_printf("

          Simon Laws <slaws@php.net> (lead)

          \n"); - php_printf("

          Caroline Maynard <cem@php.net> (lead)

          \n"); - php_info_print_box_end(); - php_info_print_table_start(); - php_info_print_table_header(2, "SCA", "enabled"); - php_info_print_table_row(2, "SCA Version", "0.0.1"); - php_info_print_table_end(); - -} -/* }}} */ - -/* Other functions not directly related to implementing the - SCA_Tuscany extension */ - -#endif /* HAVE_SCA */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/sca.h b/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/sca.h deleted file mode 100644 index 5bbc9001dc..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/src/tuscany/sca/php/sca.h +++ /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. - */ - -/* $ Id: $ */ - -#ifndef SCA_H -#define SCA_H - -#include "tuscany/sca/core/Operation.h" - -#include
          - -#ifdef __cplusplus -extern "C" { -#endif - -extern zend_module_entry sca_module_entry; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif /* SCA_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/sca-cpp/trunk/runtime/extensions/php/xsd/sca-implementation-php.xsd b/sca-cpp/trunk/runtime/extensions/php/xsd/sca-implementation-php.xsd deleted file mode 100644 index c40d63799a..0000000000 --- a/sca-cpp/trunk/runtime/extensions/php/xsd/sca-implementation-php.xsd +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/python/Makefile.am b/sca-cpp/trunk/runtime/extensions/python/Makefile.am deleted file mode 100644 index 83e70b4b94..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/python/src/Makefile.am b/sca-cpp/trunk/runtime/extensions/python/src/Makefile.am deleted file mode 100644 index 15d75f8c42..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/Makefile.am +++ /dev/null @@ -1,63 +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 - -pydir=$(prefix)/extensions/python/lib -py_DATA = tuscany/sca/python/sca_proxy.py -EXTRA_DIST = tuscany/sca/python/sca_proxy.py - -rootdir=$(prefix)/extensions/python - -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} - -moduledir=$(prefix)/extensions/python/module -extension = libtuscany_sca_python$(libsuffix) - -install-exec-hook: - test -z $(moduledir) || $(mkdir_p) $(moduledir); - -rm -f $(moduledir)/$(extension) - $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) - -rm -f $(libdir)/sca.so - $(LN_S) $(libdir)/libtuscany_sca_python$(libsuffix) $(libdir)/sca.so diff --git a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.cpp b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.cpp deleted file mode 100644 index 0274ffc774..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.cpp +++ /dev/null @@ -1,76 +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" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - -extern "C" -{ -#if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) -#endif - void tuscany_sca_python_initialize() - { - tuscany::sca::python::PythonExtension::initialize(); - } -} - -namespace tuscany -{ - namespace sca - { - namespace python - { - // =================================================================== - // Constructor for the PythonExtension class. - // =================================================================== - PythonExtension::PythonExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the PythonExtension class. - // =================================================================== - PythonExtension::~PythonExtension() - { - logentry(); - } - - void PythonExtension::initialize() - { - logentry(); - SCARuntime* runtime = SCARuntime::getCurrentRuntime(); - runtime->registerImplementationExtension(new PythonImplementationExtension()); - runtime->registerInterfaceExtension(new PythonInterfaceExtension()); - } - - } // End namespace python - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.h b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonExtension.h deleted file mode 100644 index 783f37a228..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.cpp b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.cpp deleted file mode 100644 index 84cc34c6a4..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.cpp +++ /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$ */ - - -#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" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace python - { - // =================================================================== - // Constructor for the PythonImplementationExtension class. - // =================================================================== - PythonImplementationExtension::PythonImplementationExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the PythonImplementationExtension class. - // =================================================================== - PythonImplementationExtension::~PythonImplementationExtension() - { - logentry(); - } - - 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) - { - logentry(); - - 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; - } - - } // End namespace python - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.h b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.h deleted file mode 100644 index c94925c3fc..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonImplementationExtension.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_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 std::string& getExtensionName() {return extensionName;} - - /** - * return the QName of schema elemant for this implementation extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#implementation.python") - */ - virtual const std::string& getExtensionTypeQName() {return typeQName;} - - virtual tuscany::sca::model::ComponentType* getImplementation( - tuscany::sca::model::Composite* composite, - commonj::sdo::DataObjectPtr scdlImplementation); - - private: - static const std::string extensionName; - static const std::string typeQName; - - }; - - - } // End namespace python - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_python_pythonimplementationextension_h - diff --git a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.cpp b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.cpp deleted file mode 100644 index 1d5e3b6361..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.cpp +++ /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$ */ - -#include "tuscany/sca/python/PythonInterfaceExtension.h" -#include "tuscany/sca/python/model/PythonInterface.h" -#include "tuscany/sca/util/Logging.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace python - { - // =================================================================== - // Constructor for the PythonInterfaceExtension class. - // =================================================================== - PythonInterfaceExtension::PythonInterfaceExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the PythonInterfaceExtension class. - // =================================================================== - PythonInterfaceExtension::~PythonInterfaceExtension() - { - logentry(); - } - - 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) - { - logentry(); - - // 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/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.h b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.h deleted file mode 100644 index 803d94743d..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonInterfaceExtension.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_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 std::string& getExtensionName() {return extensionName;} - - /** - * return the QName of schema elemant for this implementation extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#PythonInterface") - */ - virtual const std::string& getExtensionTypeQName() {return typeQName;} - - virtual tuscany::sca::model::Interface* getInterface( - tuscany::sca::model::Composite* composite, - commonj::sdo::DataObjectPtr scdlInterface); - - private: - static const std::string extensionName; - static const std::string typeQName; - - }; - - - } // End namespace python - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_python_pythoninterfaceextension_h - diff --git a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.cpp b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.cpp deleted file mode 100644 index 9282bb953c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.cpp +++ /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$ */ - -#include "tuscany/sca/python/PythonServiceProxy.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/model/ServiceBinding.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(); - - // Get the service wrapper - PythonReferenceBinding* referenceBinding = (PythonReferenceBinding*)reference->getBinding(); - serviceWrapper = referenceBinding->getTargetServiceBinding()->getServiceWrapper(); - } - - // ========================================== - // Constructor: Create a proxy from a service - // ========================================== - PythonServiceProxy::PythonServiceProxy(Service* service) - : ServiceProxy(NULL) - { - logentry(); - - // Get the service wrapper - serviceWrapper = service->getBinding()->getServiceWrapper(); - } - - // ========== - // Destructor - // ========== - PythonServiceProxy::~PythonServiceProxy() - { - logentry(); - } - - // ===================================================== - // invokeService: invoke the service wired to this proxy - // ===================================================== - void PythonServiceProxy::invokeService(Operation& operation) - { - logentry(); - - // Invoke the service - serviceWrapper->invoke(operation); - } - } // End namespace python - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.h b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.h deleted file mode 100644 index 64f856f51d..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.h +++ /dev/null @@ -1,83 +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 "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" - - -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(tuscany::sca::model::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(tuscany::sca::model::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/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp deleted file mode 100644 index cb876827bd..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp +++ /dev/null @@ -1,1095 +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 "commonj/sdo/SDO.h" - -#include "tuscany/sca/python/PythonServiceWrapper.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/Exceptions.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" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - -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("PyObject %s: %s", name, PyString_AsString(pObjRepr)); - Py_DECREF(pObjRepr); - - PyObject* pObjDir = PyObject_Dir(pObj); - PyObject* pObjDirRepr = PyObject_Repr(pObjDir); - loginfo("PyObject dir(%s): %s", name, PyString_AsString(pObjDirRepr)); - Py_DECREF(pObjDirRepr); - Py_DECREF(pObjDir); - } - - // =========== - // Constructor - // =========== - PythonServiceWrapper::PythonServiceWrapper(Service* service) - : ServiceWrapper(service) - { - logentry(); - - 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"; - throwException(SystemConfigurationException, msg.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(); - if(impl->getModulePath().size() > 0) - { - path += "/" + impl->getModulePath(); - } - - loginfo("Module: %s", impl->getModule().c_str()); - loginfo("Path: %s", path.c_str()); - loginfo("Class: %s", impl->getClass().c_str()); - - 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() + " on path " + path; - throwException(SystemConfigurationException, msg.c_str()); - } - printPyObject("pythonModule",pythonModule); - } - - // ========== - // Destructor - // ========== - PythonServiceWrapper::~PythonServiceWrapper() - { - logentry(); - - Py_XDECREF(pythonClassInstance); - Py_XDECREF(pythonModule); - Py_Finalize(); - } - - // ====================================================================== - // newInstance: create a new class instance - // ====================================================================== - PyObject* PythonServiceWrapper::newInstance() - { - logentry(); - - 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"; - throwException(SystemConfigurationException, 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"; - throwException(ServiceInvocationException, msg.c_str()); - } - Py_XDECREF(pClass); - } - } - return pClassInstance; - } - - // ====================================================================== - // getInstance: get a class instance for this scope - // ====================================================================== - PyObject* PythonServiceWrapper::getInstance() - { - logentry(); - - PythonImplementation::Scope scope = implementation->getScope(); - if (scope == PythonImplementation::COMPOSITE) - { - if (!pythonClassInstance) - { - pythonClassInstance = newInstance(); - } - return pythonClassInstance; - } - else // (scope == PythonImplementation::STATELESS) - { - return newInstance(); - } - } - - // ====================================================================== - // releaseImplementation: release the implementation for this scope - // ====================================================================== - void PythonServiceWrapper::releaseInstance() - { - logentry(); - - 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; - } - } - } - - // ====================================================================== - // invoke: wrapper call to service with setting the component context - // ====================================================================== - void PythonServiceWrapper::invoke(Operation& operation) - { - logentry(); - - SCARuntime* runtime = SCARuntime::getCurrentRuntime(); - runtime->setCurrentComponent(component); - - - // Load the references & properties into the module - addReferences(pythonModule); - addProperties(pythonModule); - - try - { - loginfo("Operation: %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 - string msg = "Python module or class instance has not been created"; - throwException(ServiceInvocationException, msg.c_str()); - } - - if (pFunc && PyCallable_Check(pFunc)) - { - PyObject* pArgs = PyTuple_New(operation.getNParms()); - PyObject* pKeywordsDict = PyDict_New(); - PyObject* pValue = NULL; - - // Load up the xml.etree.ElementTree module for dealing with SDO params and return values - PyObject* elementTreeModuleName = PyString_FromString("xml.etree.ElementTree"); - PyObject* elementTreeModule = PyImport_Import(elementTreeModuleName); - - if(elementTreeModule == NULL) - { - // pre-Python2.5? - try to get an installed elementtree package - elementTreeModuleName = PyString_FromString("elementtree.ElementTree"); - elementTreeModule = PyImport_Import(elementTreeModuleName); - } - if(elementTreeModule == NULL) - { - // Still null - throw a warning but carry on - user may not need XML - logwarning("Could not load Python ElementTree module - is it installed? SDO and XML will not be supported"); - } - - 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; - } - case Operation::DATAOBJECT: - { - if(elementTreeModule != NULL) - { - DataObjectPtr dob = *(DataObjectPtr*)parm.getValue(); - - // Convert a DataObject to a xml.etree.ElementTree Element object - Composite* composite = component->getComposite(); - XMLHelperPtr xmlHelper = composite->getXMLHelper(); - char* str = xmlHelper->save( - dob, - dob->getType().getURI(), - dob->getType().getName()); - - loginfo("Converting SDO DataObject to Python ElementTree: %s", str); - - // Get the xml.etree.ElementTree.XML function - PyObject* elementTreeXMLFunc = PyObject_GetAttrString(elementTreeModule, "XML"); - - // Call the XML() function with the XML string - pValue = PyObject_CallFunction(elementTreeXMLFunc, "s", str); - - Py_DECREF(elementTreeXMLFunc); - } - else - { - throwException(ServiceDataException, "Could not convert SDO DataObject to Python ElementTree as ElementTree module could not be loaded"); - } - break; - } - default: - throwException(ServiceDataException, "Operation parameter type not supported"); - } - - if (!pValue) - { - Py_DECREF(pArgs); - - if(PyErr_Occurred()) - { - PyErr_Print(); - } - - string msg = "Error converting parameter into Python type"; - throwException(ServiceDataException, msg.c_str()); - - } - //printPyObject("Param value", pValue); - - // If we have a param name, put it in the keyword args - if(parm.hasName()) - { - PyDict_SetItemString(pKeywordsDict, parm.getName().c_str(), pValue); - Py_DECREF(pValue); - } - else - { - /* pValue reference stolen here: */ - PyTuple_SetItem(pArgs, i, pValue); - } - } - - // Resize the args to the correct length - _PyTuple_Resize(&pArgs, operation.getNParms() - PyDict_Size(pKeywordsDict)); - - loginfo("Calling python func with %d args and %d keyword args", PyTuple_Size(pArgs), PyDict_Size(pKeywordsDict)); - - pValue = PyObject_Call(pFunc, pArgs, pKeywordsDict); - //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("Int return value: %d", PyInt_AsLong(pValue)); - *data = PyInt_AsLong(pValue); - } - else - { - loginfo("Long return value: %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("Bool return value: %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("Float return value: %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("String return value: %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 - string* stringData = new string; - *stringData = *data; - operation.setReturnValue(stringData); - } - } - } - else - { - PyObject* pIsElement = Py_False; - - if(elementTreeModule != NULL) - { - // Get the xml.etree.ElementTree.iselement function - PyObject* elementTreeIsElementFunc = PyObject_GetAttrString(elementTreeModule, "iselement"); - - // Call the iselement() function with pValue to check it - pIsElement = PyObject_CallFunction(elementTreeIsElementFunc, "O", pValue); - Py_DECREF(elementTreeIsElementFunc); - } - - if(PyObject_IsTrue(pIsElement) == 1) - { - // pValue is an xml.etree.ElementTree.Element - convert to SDO - PyObject* elementTreeToStringFunc = PyObject_GetAttrString(elementTreeModule, "tostring"); - PyObject* pElemString = PyObject_CallFunction(elementTreeToStringFunc, "O", pValue); - char* data = PyString_AsString(pElemString); - - loginfo("Converting Python ElementTree to SDO DataObject: %s", data); - - Composite* composite = component->getComposite(); - XMLHelperPtr xmlHelper = composite->getXMLHelper(); - XMLDocumentPtr xmlDoc = xmlHelper->load(data); - DataObjectPtr* dataObjectData = new DataObjectPtr; - if (xmlDoc != NULL) - { - *dataObjectData = xmlDoc->getRootDataObject(); - } - else - { - *dataObjectData = NULL; - } - - if (*dataObjectData != NULL) - { - operation.setReturnValue(dataObjectData); - } - else - { - string msg = "xml.etree.ElementTree.Element could not be converted to a DataObject"; - throwException(ServiceDataException, msg.c_str()); - } - - Py_DECREF(elementTreeToStringFunc); - Py_DECREF(pElemString); - } - else - { - PyObject* valueRepr = PyObject_Repr(pValue); - PyObject* valueType = PyObject_Type(pValue); - PyObject* valueTypeRepr = PyObject_Repr(valueType); - loginfo("Return value of unknown type (%s) has repr: %s", PyString_AsString(valueTypeRepr), PyString_AsString(valueRepr)); - Py_DECREF(valueTypeRepr); - Py_DECREF(valueType); - Py_DECREF(valueRepr); - } - - Py_DECREF(pIsElement); - } - - Py_DECREF(elementTreeModule); - Py_DECREF(elementTreeModuleName); - Py_DECREF(pValue); - } - else - { - Py_DECREF(pFunc); - Py_XDECREF(elementTreeModule); - Py_XDECREF(elementTreeModuleName); - - string msg = "Error whilst calling Python function "+operation.getName()+": "; - if(PyErr_Occurred()) - { - PyObject *pErrorType, *pErrorValue, *pErrorTraceback; - PyErr_Fetch(&pErrorType, &pErrorValue, &pErrorTraceback); - - if (pErrorType != NULL && pErrorValue != NULL) - { - PyObject* pErrorTypeStr = PyObject_Str(pErrorType); - PyObject* pErrorValueStr = PyObject_Str(pErrorValue); - msg += PyString_AsString(pErrorTypeStr); - msg += " : "; - msg += PyString_AsString(pErrorValueStr); - Py_DECREF(pErrorTypeStr); - Py_DECREF(pErrorValueStr); - } - else - { - msg += "No Python Error information provided"; - } - Py_XDECREF(pErrorType); - Py_XDECREF(pErrorValue); - Py_XDECREF(pErrorTraceback); - - PyErr_Print(); - } - - throwException(ServiceInvocationException, msg.c_str()); - } - } - else - { - if (PyErr_Occurred()) - { - PyErr_Print(); - } - string msg = "Cannot find the operation named " + operation.getName() + " in the Python module"; - throwException(ServiceInvocationException, msg.c_str()); - } - Py_XDECREF(pFunc); - - } - catch (...) - { - releaseInstance(); - runtime->unsetCurrentComponent(); - throw; - } - releaseInstance(); - runtime->unsetCurrentComponent(); - } - - - // ========================================================================== - // Add any properties into the loaded implementation module as Python objects - // ========================================================================== - void PythonServiceWrapper::addProperties(PyObject* module) - { - logentry(); - - // Set all the configured properties - DataObjectPtr properties = component->getProperties(); - PropertyList pl = properties->getInstanceProperties(); - - for (unsigned 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::IntType: - { - property = PyInt_FromLong(properties->getInt(pl[i])); - break; - } - case Type::DoubleType: - case Type::FloatType: - { - property = PyFloat_FromDouble(properties->getDouble(pl[i])); - break; - } - case Type::DataObjectType: - { - // 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, - data->getType().getURI(), - data->getType().getName()); - - loginfo("Converting SDO DataObject to Python ElementTree: %s", serializedData.c_str()); - - // Get the xml.etree.ElementTree.XML function - PyObject* elementTreeModuleName = PyString_FromString("xml.etree.ElementTree"); - PyObject* elementTreeModule = PyImport_Import(elementTreeModuleName); - PyObject* elementTreeXMLFunc = PyObject_GetAttrString(elementTreeModule, "XML"); - - // Call the XML() function with the XML string - property = PyObject_CallFunction(elementTreeXMLFunc, "s", serializedData.c_str()); - - Py_DECREF(elementTreeXMLFunc); - Py_DECREF(elementTreeModule); - Py_DECREF(elementTreeModuleName); - 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("Added property named %s with type %s and value %s to python module", propName.c_str(), pl[i].getType().getName(), propValue.c_str()); - } - else - { - logwarning("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) - { - logentry(); - - // 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"; - logwarning(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("Successfully added sca_proxy_class instance as %s to pythonModule", referenceName.c_str()); - } - else - { - logwarning("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/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.h b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.h deleted file mode 100644 index fbf75b3223..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.h +++ /dev/null @@ -1,142 +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 - - -// 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 - -#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" - - -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(tuscany::sca::model::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. - */ - tuscany::sca::model::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/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/export.h b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/export.h deleted file mode 100644 index b608a50711..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp deleted file mode 100644 index 235468eca9..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp +++ /dev/null @@ -1,131 +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/ServiceType.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/util/Utils.h" - -using namespace std; -using namespace tuscany::sca::model; - -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(); - - // Create a default service for this componentType - ServiceType* defaultServiceType = new ServiceType(this, "", NULL, NULL); - addServiceType(defaultServiceType); - } - - PythonImplementation::~PythonImplementation() - { - logentry(); - } - - /** - * Overrides the findReferenceType method in ComponentType. - * This allows us to create references without needing a componentType file. - */ - ReferenceType* PythonImplementation::findReferenceType(const string& referenceName) - { - logentry(); - - ReferenceType* refType = ComponentType::findReferenceType(referenceName); - if(!refType) - { - // The reference has not yet been created - try creating it - refType = new ReferenceType(this, referenceName, NULL, NULL, ReferenceType::ONE_ONE); - addReferenceType(refType); - } - - return refType; - } - - /** - * Overrides the findPropertyType method in ComponentType. - * This allows us to create properties without needing a componentType file. - */ - const commonj::sdo::Property* PythonImplementation::findPropertyType(const string& propertyName) - { - logentry(); - - const commonj::sdo::Property* prop = ComponentType::findPropertyType(propertyName); - if(!prop) - { - ComponentType::addPropertyType(propertyName, "http://www.w3.org/2001/XMLSchema#string", false, NULL); - // Just added it so it should now be available - prop = ComponentType::findPropertyType(propertyName); - loginfo("Added string property named %s to Python component", propertyName.c_str()); - } - - return prop; - } - - void PythonImplementation::initializeComponent(Component* component) - { - logentry(); - 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++; - } - } - - } // End namespace python - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h deleted file mode 100644 index 75b14529bf..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h +++ /dev/null @@ -1,145 +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 - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/model/ComponentType.h" - - -namespace tuscany -{ - namespace sca - { - namespace python - { - /** - * Holds information about an SCA implementation written in Python - */ - class PythonImplementation : public tuscany::sca::model::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(tuscany::sca::model::Composite* composite, - const std::string& module, const std::string& modulePath, const std::string& className, - Scope scope); - - /** - * Destructor - */ - virtual ~PythonImplementation(); - - /** - * Initialize a component of this type. - * @param component The component to initialize. - */ - virtual void initializeComponent(tuscany::sca::model::Component* component); - - /** - * Override the ComponentType::findReferenceType method - * to allow Python components to be defined without requiring - * a componentType side-file - */ - virtual tuscany::sca::model::ReferenceType* findReferenceType(const std::string& referenceName); - - /** - * Override the ComponentType::findPropertyType method - * to allow Python components to be defined without requiring - * a componentType side-file - */ - virtual const commonj::sdo::Property* findPropertyType(const std::string& propertyName); - - - /** - * Returns the name of the module. - * @return The name of the module. - */ - const std::string& getModule() const { return module; } - - /** - * Get the header path. - * @return The pathe element of the header. - */ - const std::string& getModulePath() const { return modulePath; } - - /** - * Get the name of the class. - * @return The class name if specified. - */ - const std::string& getClass() const { return className; } - - /** - * Returns the implementation scope - */ - Scope getScope() const { return scope; } - - private: - - /** - * Name of the module. - */ - std::string module; - - /** - * Path to the module. - */ - std::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. - */ - std::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/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.cpp b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.cpp deleted file mode 100644 index 3c30f363b8..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.cpp +++ /dev/null @@ -1,53 +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" - -using namespace std; - -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(); - } - - PythonInterface::~PythonInterface() - { - logentry(); - } - - } // End namespace python - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.h b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.h deleted file mode 100644 index cfc2ca8914..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.h +++ /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$ */ - - -#ifndef tuscany_sca_python_model_pythoninterface_h -#define tuscany_sca_python_model_pythoninterface_h - -#include - -#include "tuscany/sca/python/export.h" -#include "tuscany/sca/model/Interface.h" - -namespace tuscany -{ - namespace sca - { - namespace python - { - /** - * Holds information about an interface described using a Python - * header file. - */ - class PythonInterface : public tuscany::sca::model::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 std::string& getInterfaceTypeQName() { return typeQName; }; - - /** - * The QName of the schema type for this interface type. - */ - SCA_PYTHON_API static const std::string typeQName; - - }; - - } // End namespace python - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_python_model_pythoninterface_h - diff --git a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.cpp b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.cpp deleted file mode 100644 index 958a3a86ac..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.cpp +++ /dev/null @@ -1,61 +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" - -using namespace std; -using namespace tuscany::sca::model; - -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) - { - setTargetServiceBinding(binding); - - serviceProxy = new PythonServiceProxy(getReference()); - } - - } // End namespace python - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.h b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.h deleted file mode 100644 index 65028f4613..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.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_pythonreferencebinding_h -#define tuscany_sca_python_model_pythonreferencebinding_h - -#include - -#include "tuscany/sca/model/ReferenceBinding.h" - - -namespace tuscany -{ - namespace sca - { - namespace python - { - /** - * Information about a Python service binding for service or a reference. - */ - class PythonReferenceBinding : public tuscany::sca::model::ReferenceBinding - { - public: - - /** - * Constructor. - */ - PythonReferenceBinding(tuscany::sca::model::Reference* reference); - - /** - * Destructor. - */ - virtual ~PythonReferenceBinding(); - - /** - * Returns the type of binding. - */ - virtual std::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(tuscany::sca::model::ServiceBinding* serviceBinding); - - private: - - /** - * The proxy representing the reference to the client - * component. - */ - ServiceProxy* serviceProxy; - }; - - } // End namespace python - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_python_model_pythonreferencebinding_h diff --git a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.cpp b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.cpp deleted file mode 100644 index 061aeb7515..0000000000 --- a/sca-cpp/trunk/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" - -using namespace std; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace python - { - - // Constructor - PythonServiceBinding::PythonServiceBinding(Service* service) - : ServiceBinding(service, "") - { - logentry(); - serviceWrapper = new PythonServiceWrapper(service); - } - - // Destructor - PythonServiceBinding::~PythonServiceBinding() - { - logentry(); - } - - ServiceWrapper* PythonServiceBinding::getServiceWrapper() - { - logentry(); - return (ServiceWrapper*)serviceWrapper; - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.h b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.h deleted file mode 100644 index 9a803cdced..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.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_python_model_pythonservicebinding_h -#define tuscany_sca_python_model_pythonservicebinding_h - -#include - -#include "tuscany/sca/model/ServiceBinding.h" - -namespace tuscany -{ - namespace sca - { - namespace python - { - /** - * Information about a Python service binding for service or a reference. - */ - class PythonServiceBinding : public tuscany::sca::model::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(tuscany::sca::model::Service* service); - - /** - * Destructor. - */ - virtual ~PythonServiceBinding(); - - /** - * Returns the type of binding. - */ - virtual std::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/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp deleted file mode 100644 index dc2c7bfe22..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp +++ /dev/null @@ -1,540 +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 -#include - -// undefine _DEBUG so Python does not need it's debug dll -#ifdef _DEBUG -#undef _DEBUG -#define _SCA_PYTHON_DEBUG -#endif -#include -#ifdef _SCA_PYTHON_DEBUG -#define _DEBUG -#endif - -#include "commonj/sdo/SDO.h" - -#include "PythonServiceProxy.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/Exceptions.h" -#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 std; -using namespace commonj::sdo; -using namespace tuscany::sca; -using namespace tuscany::sca::model; - -static PyObject* scaError; - -/** -* Prints out PyObject and dir(PyObject) -* for debugging purposes -*/ -static void printPyObject(char* prefix, char* name, PyObject* pObj) -{ - PyObject* pObjRepr = PyObject_Repr(pObj); - PyTypeObject* type = pObj->ob_type; - loginfo("%s printPyObject (%s) %s = %s", prefix, type->tp_name, name, PyString_AsString(pObjRepr)); - Py_XDECREF(pObjRepr); - - if(pObj != NULL) - { - PyObject* pObjDir = PyObject_Dir(pObj); - PyObject* pObjDirRepr = PyObject_Repr(pObjDir); - loginfo("%s printPyObject dir(%s): %s", prefix, name, PyString_AsString(pObjDirRepr)); - Py_DECREF(pObjDirRepr); - Py_DECREF(pObjDir); - } -} - -static PyObject* sca_locateservice(PyObject *self, PyObject *args) -{ - logentry(); - - // 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(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 tuscany::sca::python::PythonServiceProxy* getServiceProxy(PyObject *args) -{ - logentry(); - - tuscany::sca::python::PythonServiceProxy* serviceProxy = NULL; - SCARuntime* runtime = SCARuntime::getCurrentRuntime(); - - // 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("Service/Reference name is %s", name.c_str()); - } - else - { - string msg = "Service/Reference name has not been set"; - logwarning(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 = "Could not find the reference: "+name; - logwarning(msg.c_str()); - PyErr_SetString(scaError, msg.c_str()); - - return NULL; - } - - ReferenceBinding* refBinding = ref->getBinding(); - serviceProxy = (tuscany::sca::python::PythonServiceProxy*) refBinding->getServiceProxy(); - } - else - { - Component* component = runtime->getDefaultComponent(); - Composite* composite = (Composite*)component->getType(); - Service* service = composite->findComponentService(name); - - if(!service) - { - string msg = "Could not find service: "+name; - logwarning(msg.c_str()); - PyErr_SetString(scaError, msg.c_str()); - return NULL; - } - - serviceProxy = new tuscany::sca::python::PythonServiceProxy(service); - } - - return serviceProxy; -} - - -static PyObject* sca_invoke(PyObject *self, PyObject *args) -{ - logentry(); - - tuscany::sca::python::PythonServiceProxy* pythonServiceProxy = getServiceProxy(args); - if(!pythonServiceProxy) - { - return NULL; - } - - // Get the component from the reference or service provided - Component* component = NULL; - SCARuntime* runtime = SCARuntime::getCurrentRuntime(); - - PyObject* isReference = PyTuple_GetItem(args, 1); - if(PyObject_IsTrue(isReference)) - { - component = runtime->getCurrentComponent(); - } - else - { - component = runtime->getDefaultComponent(); - } - - // 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("sca_invoke Operation name: %s", operationName.c_str()); - } - else - { - string msg = "Operation name has not been set"; - logwarning(msg.c_str()); - PyErr_SetString(scaError, msg.c_str()); - return NULL; - } - - // Create the Operation object - Operation operation(operationName.c_str()); - - // Load up the xml.etree.ElementTree module for dealing with SDO params and return values - PyObject* elementTreeModuleName = PyString_FromString("xml.etree.ElementTree"); - PyObject* elementTreeModule = PyImport_Import(elementTreeModuleName); - - if(elementTreeModule == NULL) - { - // pre-Python2.5? - try to get an installed elementtree package - elementTreeModuleName = PyString_FromString("elementtree.ElementTree"); - elementTreeModule = PyImport_Import(elementTreeModuleName); - } - if(elementTreeModule == NULL) - { - // Still null - throw a warning but carry on - user may not need XML - logwarning("Could not load Python ElementTree module - is it installed? SDO and XML will not be supported"); - } - - // Parameters are the fourth argument - PyObject* paramTuple = PyTuple_GetItem(args, 3); - unsigned int numberOfArgs = (unsigned int) PyTuple_Size(paramTuple); - loginfo("sca_invoke %d arg parameters supplied", numberOfArgs); - - // Keyword parameters (AKA named arguments) are the fifth argument - PyObject* keywordParamDict = PyTuple_GetItem(args, 4); - loginfo("sca_invoke %d keyword parameters supplied", PyDict_Size(keywordParamDict)); - - PyObject* paramKeys = PyDict_Keys(keywordParamDict); - - // Go through all the supplied parameters (args and keyword args) - for(unsigned int i=0; i < (numberOfArgs + PyList_Size(paramKeys)); i++) - { - string* paramName; - PyObject* param; - - if(i < PyTuple_Size(paramTuple)) - { - param = PyTuple_GetItem(paramTuple, i); - paramName = new string(); - } - else - { - PyObject* key = PyList_GetItem(paramKeys, i-numberOfArgs); - param = PyDict_GetItem(keywordParamDict, key); - paramName = new string(PyString_AsString(key)); - } - - if(PyInt_Check(param)) - { - loginfo("Int param %d %s: %d", i, (*paramName).c_str(), PyInt_AsLong(param)); - long* intData = new long; - *intData = PyInt_AsLong(param); - operation.addParameter(*paramName, intData); - } - else if(PyBool_Check(param)) - { - loginfo("Bool param %d %s: %d", i, (*paramName).c_str(), (param == Py_True)); - bool* boolData = new bool; - *boolData = (param == Py_True); - operation.addParameter(*paramName, boolData); - } - else if(PyLong_Check(param)) - { - loginfo("Long param %d %s: %l", i, (*paramName).c_str(), PyLong_AsLong(param)); - long* longData = new long; - *longData = PyLong_AsLong(param); - operation.addParameter(*paramName, longData); - } - else if(PyFloat_Check(param)) - { - loginfo("Float param %d %s: %f", i, (*paramName).c_str(), PyFloat_AsDouble(param)); - double* doubleData = new double; - *doubleData = PyFloat_AsDouble(param); - operation.addParameter(*paramName, doubleData); - } - else if(PyString_Check(param)) - { - loginfo("String param %d %s: %s", i, (*paramName).c_str(), PyString_AsString(param)); - const char** stringData = new const char*; - *stringData = PyString_AsString(param); - operation.addParameter(*paramName, stringData); - } - else - { - PyObject* pIsElement = Py_False; - if(elementTreeModule != NULL) - { - // Get the xml.etree.ElementTree.iselement function - PyObject* elementTreeIsElementFunc = PyObject_GetAttrString(elementTreeModule, "iselement"); - - // Call the iselement() function with pValue to check it - pIsElement = PyObject_CallFunction(elementTreeIsElementFunc, "O", param); - } - - if(PyObject_IsTrue(pIsElement) == 1) - { - // pValue is an xml.etree.ElementTree.Element - convert to SDO - PyObject* elementTreeToStringFunc = PyObject_GetAttrString(elementTreeModule, "tostring"); - PyObject* pElemString = PyObject_CallFunction(elementTreeToStringFunc, "O", param); - char* data = PyString_AsString(pElemString); - loginfo("SDO param %d %s: %s", i, (*paramName).c_str(), data); - - loginfo("Converting Python ElementTree to SDO DataObject: %s", data); - - Composite* composite = component->getComposite(); - XMLHelperPtr xmlHelper = composite->getXMLHelper(); - XMLDocumentPtr xmlDoc = xmlHelper->load(data); - - DataObjectPtr* dataObjectData = new DataObjectPtr; - if (xmlDoc != NULL) - { - *dataObjectData = xmlDoc->getRootDataObject(); - } - else - { - *dataObjectData = NULL; - } - if (*dataObjectData != NULL) - { - operation.addParameter(*paramName, dataObjectData); - } - else - { - string msg = "xml.etree.ElementTree.Element could not be converted to a DataObject"; - logerror(msg.c_str()); - PyErr_SetString(scaError, msg.c_str()); - return NULL; - } - Py_DECREF(elementTreeToStringFunc); - Py_DECREF(pElemString); - } - 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(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(TuscanyRuntimeException& ex) - { - string msg = "Exception whilst invoking the "; - msg += operationName.c_str(); - msg += " operation on an SCA service/reference: "; - msg += ex.getEClassName(); - msg += ": "; - msg += ex.getMessageText(); - logwarning(msg.c_str()); - PyErr_SetString(scaError, msg.c_str()); - return NULL; - } - catch(...) - { - string msg = "Exception whilst invoking the "; - msg += operationName.c_str(); - msg += " operation on an SCA service/reference"; - - logwarning(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; - } - case Operation::DATAOBJECT: - { - if(elementTreeModule != NULL) - { - DataObjectPtr dob = *(DataObjectPtr*)operation.getReturnValue(); - - // Convert a DataObject to a xml.etree.ElementTree Element object - Composite* composite = component->getComposite(); - XMLHelperPtr xmlHelper = composite->getXMLHelper(); - char* str = xmlHelper->save( - dob, - dob->getType().getURI(), - dob->getType().getName()); - - loginfo("Converting SDO DataObject to Python ElementTree: %s", str); - - // Get the xml.etree.ElementTree.XML function - PyObject* elementTreeXMLFunc = PyObject_GetAttrString(elementTreeModule, "XML"); - - // Call the XML() function with the XML string - returnValue = PyObject_CallFunction(elementTreeXMLFunc, "s", str); - - Py_DECREF(elementTreeXMLFunc); - } - else - { - logwarning("Could not convert SDO DataObject to Python ElementTree as ElementTree module could not be loaded. Returning NONE"); - Py_INCREF(Py_None); - returnValue = Py_None; - } - break; - } - default: - { - Py_INCREF(Py_None); - returnValue = Py_None; - } - - } - - Py_XDECREF(elementTreeModuleName); - Py_XDECREF(elementTreeModule); - - return returnValue; -} -static PyMethodDef ModuleMethods[] = -{ - {"locateservice", (PyCFunction) sca_locateservice, METH_VARARGS, "Locates an SCA service & returns an sca_proxy_class instance"}, - {"invoke", (PyCFunction) sca_invoke, METH_VARARGS, "Invoke an operation on an SCA service or reference"}, - {NULL, NULL, 0, NULL} /* Sentinel */ -}; - -PyMODINIT_FUNC initsca(void) -{ - logentry(); - - // 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); -} diff --git a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/sca_proxy.py b/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/sca_proxy.py deleted file mode 100644 index 92a224275e..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/src/tuscany/sca/python/sca_proxy.py +++ /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. -# -# -# -# -# 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): - # Pass the args and keywords in to the invoke method as arguments - return sca.invoke(self.sca_proxy_name, self.sca_proxy_is_reference, operationName, args, kwargs) - - return invokeFunction - - def __getattr__(self, operationName): - return self.invoke(operationName) - - def __str__(self): - return '' - - def __repr__(self): - return '' - diff --git a/sca-cpp/trunk/runtime/extensions/python/xsd/sca-implementation-python.xsd b/sca-cpp/trunk/runtime/extensions/python/xsd/sca-implementation-python.xsd deleted file mode 100644 index 5730e66116..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/xsd/sca-implementation-python.xsd +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/python/xsd/sca-interface-python.xsd b/sca-cpp/trunk/runtime/extensions/python/xsd/sca-interface-python.xsd deleted file mode 100644 index 1ce24b7249..0000000000 --- a/sca-cpp/trunk/runtime/extensions/python/xsd/sca-interface-python.xsd +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/rest/Makefile.am b/sca-cpp/trunk/runtime/extensions/rest/Makefile.am deleted file mode 100644 index 742a8152ad..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -SUBDIRS = interface reference service -datadir=$(prefix)/extensions/rest - -nobase_data_DATA = xsd/*.xsd - -EXTRA_DIST = xsd \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/rest/interface/Makefile.am b/sca-cpp/trunk/runtime/extensions/rest/interface/Makefile.am deleted file mode 100644 index f963effea2..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/interface/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = src \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/rest/interface/src/Makefile.am b/sca-cpp/trunk/runtime/extensions/rest/interface/src/Makefile.am deleted file mode 100644 index a2b7ac74e4..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/interface/src/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -libdir=$(prefix)/extensions/rest/interface/lib -lib_LTLIBRARIES = libtuscany_sca_rest_interface.la - -noinst_HEADERS = tuscany/sca/rest/*.h tuscany/sca/rest/model/*.h - -libtuscany_sca_rest_interface_la_SOURCES = \ -tuscany/sca/rest/RESTInterfaceExtension.cpp \ -tuscany/sca/rest/model/RESTInterface.cpp - -libtuscany_sca_rest_interface_la_LIBADD = \ - -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \ - -L$(top_builddir)/runtime/core/src -ltuscany_sca - -INCLUDES = -I$(top_builddir)/runtime/core/src \ - -I${TUSCANY_SDOCPP}/include - -moduledir=$(prefix)/extensions/rest/interface/module -extension = libtuscany_sca_rest_interface$(libsuffix) - -install-exec-hook: - test -z $(moduledir) || $(mkdir_p) $(moduledir); - -rm -f $(moduledir)/$(extension) - $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/RESTInterfaceExtension.cpp b/sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/RESTInterfaceExtension.cpp deleted file mode 100644 index c69febf39a..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/RESTInterfaceExtension.cpp +++ /dev/null @@ -1,85 +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/rest/RESTInterfaceExtension.h" -#include "tuscany/sca/rest/model/RESTInterface.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/SCARuntime.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - -extern "C" -{ -#if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) -#endif - void tuscany_sca_rest_interface_initialize() - { - tuscany::sca::rest::RESTInterfaceExtension::initialize(); - } -} - -namespace tuscany -{ - namespace sca - { - namespace rest - { - // =================================================================== - // Constructor for the RESTInterfaceExtension class. - // =================================================================== - RESTInterfaceExtension::RESTInterfaceExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the RESTInterfaceExtension class. - // =================================================================== - RESTInterfaceExtension::~RESTInterfaceExtension() - { - logentry(); - } - - const string RESTInterfaceExtension::extensionName("rest"); - const string RESTInterfaceExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#RESTInterface"); - - // =================================================================== - // loadModelElement - load the info from interface.rest - // =================================================================== - tuscany::sca::model::Interface* RESTInterfaceExtension::getInterface(Composite* composite, DataObjectPtr scdlInterface) - { - logentry(); - - return new RESTInterface(); - } - - void RESTInterfaceExtension::initialize() - { - logentry(); - SCARuntime::getCurrentRuntime()->registerInterfaceExtension(new RESTInterfaceExtension()); - } - - } // End namespace rest - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/RESTInterfaceExtension.h b/sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/RESTInterfaceExtension.h deleted file mode 100644 index de61ee5751..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/RESTInterfaceExtension.h +++ /dev/null @@ -1,76 +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_rest_restinterfaceextension_h -#define tuscany_sca_rest_restinterfaceextension_h - -#include "tuscany/sca/extension/InterfaceExtension.h" - -namespace tuscany -{ - namespace sca - { - namespace rest - { - - class RESTInterfaceExtension : public InterfaceExtension - { - public: - /** - * Default constructor - */ - RESTInterfaceExtension(); - - /** - * Destructor - */ - virtual ~RESTInterfaceExtension(); - - /** - * return the name of the extension - */ - virtual const std::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.rest") - */ - virtual const std::string& getExtensionTypeQName() {return typeQName;} - - virtual tuscany::sca::model::Interface* getInterface( - tuscany::sca::model::Composite* composite, - commonj::sdo::DataObjectPtr scdlInterface); - - static void initialize(); - - private: - static const std::string extensionName; - static const std::string typeQName; - - }; - - - } // End namespace rest - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_rest_restinterfaceextension_h - diff --git a/sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/exportinterface.h b/sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/exportinterface.h deleted file mode 100644 index f3636f0d39..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/exportinterface.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_rest_exportinterface_h -#define tuscany_sca_rest_exportinterface_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) - -#ifdef TUSCANY_SCA_REST_INTERFACE_EXPORTS -#define SCA_REST_INTERFACE_API __declspec(dllexport) -#else -#define SCA_REST_INTERFACE_API __declspec(dllimport) -#endif - -#else -#define SCA_REST_INTERFACE_API -#endif - -#endif // tuscany_sca_rest_exportinterface_h diff --git a/sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/model/RESTInterface.cpp b/sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/model/RESTInterface.cpp deleted file mode 100644 index 34feda2049..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/model/RESTInterface.cpp +++ /dev/null @@ -1,51 +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/rest/model/RESTInterface.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace rest - { - - const string RESTInterface::typeQName("http://www.osoa.org/xmlns/sca/1.0#RESTInterface"); - - // Constructor - RESTInterface::RESTInterface() - : Interface(true, false) - { - logentry(); - } - - RESTInterface::~RESTInterface() - { - logentry(); - } - - } // End namespace rest - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/model/RESTInterface.h b/sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/model/RESTInterface.h deleted file mode 100644 index 88aacecc16..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/interface/src/tuscany/sca/rest/model/RESTInterface.h +++ /dev/null @@ -1,80 +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_rest_model_restinterface_h -#define tuscany_sca_rest_model_restinterface_h - -#include - -#include "tuscany/sca/model/Interface.h" -#include "tuscany/sca/rest/exportinterface.h" - - -namespace tuscany -{ - namespace sca - { - namespace rest - { - /** - * Holds information about a REST interface - */ - class RESTInterface : public tuscany::sca::model::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. - */ - RESTInterface(); - - /** - * Destructor. - */ - virtual ~RESTInterface(); - - /** - * return the QName of the schema type for this interface type - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#interface.rest") - */ - virtual const std::string& getInterfaceTypeQName() { return typeQName; }; - - /** - * The QName of the schema type for this interface type. - */ - SCA_REST_INTERFACE_API static const std::string typeQName; - - private: - - }; - - } // End namespace rest - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_rest_model_restinterface_h - diff --git a/sca-cpp/trunk/runtime/extensions/rest/reference/Makefile.am b/sca-cpp/trunk/runtime/extensions/rest/reference/Makefile.am deleted file mode 100644 index 2a0247f16f..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/reference/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = curl \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/rest/reference/curl/Makefile.am b/sca-cpp/trunk/runtime/extensions/rest/reference/curl/Makefile.am deleted file mode 100644 index f963effea2..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/reference/curl/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = src \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/Makefile.am b/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/Makefile.am deleted file mode 100644 index f6e6c28b55..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -libdir=$(prefix)/extensions/rest/reference/lib -lib_LTLIBRARIES = libtuscany_sca_rest_reference.la - -noinst_HEADERS = tuscany/sca/rest/*.h tuscany/sca/rest/model/*.h - -libtuscany_sca_rest_reference_la_SOURCES = \ -tuscany/sca/rest/RESTServiceBindingExtension.cpp \ -tuscany/sca/rest/model/RESTServiceBinding.cpp \ -tuscany/sca/rest/RESTServiceWrapper.cpp - -libtuscany_sca_rest_reference_la_LIBADD = \ - -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \ - -L$(top_builddir)/runtime/core/src -ltuscany_sca \ - -L$(top_builddir)/runtime/extensions/rest/interface/src -ltuscany_sca_rest_interface \ - -L${CURL_LIB} -lcurl - -INCLUDES = -I$(top_builddir)/runtime/core/src \ - -I$(top_builddir)/runtime/extensions/rest/interface/src \ - -I${TUSCANY_SDOCPP}/include \ - -I${CURL_INCLUDE} - -moduledir=$(prefix)/extensions/rest/reference/module -extension = libtuscany_sca_rest_reference$(libsuffix) - -install-exec-hook: - test -z $(moduledir) || $(mkdir_p) $(moduledir); - -rm -f $(moduledir)/$(extension) - $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceBindingExtension.cpp b/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceBindingExtension.cpp deleted file mode 100644 index f8eb9ad05c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceBindingExtension.cpp +++ /dev/null @@ -1,89 +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. -*/ - -#include "RESTServiceBindingExtension.h" -#include "model/RESTServiceBinding.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/core/SCARuntime.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - - -extern "C" -{ -#if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) -#endif - void tuscany_sca_rest_reference_initialize() - { - tuscany::sca::rest::RESTServiceBindingExtension::initialize(); - } -} - - -namespace tuscany -{ - namespace sca - { - namespace rest - { - // =================================================================== - // Constructor for the RESTServiceBinding class. - // =================================================================== - RESTServiceBindingExtension::RESTServiceBindingExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the RESTServiceBindingExtension class. - // =================================================================== - RESTServiceBindingExtension::~RESTServiceBindingExtension() - { - logentry(); - } - - const string RESTServiceBindingExtension::extensionName("rest"); - const string RESTServiceBindingExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#RESTBinding"); - - - // =================================================================== - // loadModelElement - load the info from binding.rest - // =================================================================== - ServiceBinding* RESTServiceBindingExtension::getServiceBinding(Composite *composite, Service* service, DataObjectPtr scdlBinding) - { - string uri = scdlBinding->getCString("uri"); - - RESTServiceBinding* serviceBinding = new RESTServiceBinding(service, uri); - - return serviceBinding; - } - - void RESTServiceBindingExtension::initialize() - { - logentry(); - SCARuntime::getCurrentRuntime()->registerServiceBindingExtension(new RESTServiceBindingExtension()); - } - - } // End namespace rest - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceBindingExtension.h b/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceBindingExtension.h deleted file mode 100644 index ad1d861d95..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceBindingExtension.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. - */ - -#ifndef tuscany_sca_extension_rest_restservicebindingextension_h -#define tuscany_sca_extension_rest_restservicebindingextension_h - -#include "tuscany/sca/extension/ServiceBindingExtension.h" - -namespace tuscany -{ - namespace sca - { - namespace rest - { - - class RESTServiceBindingExtension : public ServiceBindingExtension - { - public: - /** - * Default constructor - */ - RESTServiceBindingExtension(); - - /** - * Destructor - */ - virtual ~RESTServiceBindingExtension(); - - /** - * return the name of the extension - */ - virtual const std::string& getExtensionName() {return extensionName;} - - /** - * return the QName of schema elemant for this implementation extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.rest") - */ - virtual const std::string& getExtensionTypeQName() {return typeQName;} - - virtual tuscany::sca::model::ServiceBinding* getServiceBinding( - tuscany::sca::model::Composite* composite, - tuscany::sca::model::Service* service, - commonj::sdo::DataObjectPtr scdlBinding); - - static void initialize(); - - private: - static const std::string extensionName; - static const std::string typeQName; - - }; - - - } // End namespace rest - } // End namespace sca -} // End namespace tuscany - -#endif //tuscany_sca_extension_rest_restservicebindingextension_h - diff --git a/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.cpp b/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.cpp deleted file mode 100644 index e28e7976e8..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.cpp +++ /dev/null @@ -1,1225 +0,0 @@ -/* - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Rev$ $Date$ */ -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4091) -#endif - -#include -#include -#include - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/util/SDOUtils.h" -#include "RESTServiceWrapper.h" -#include "tuscany/sca/core/Operation.h" -#include "tuscany/sca/core/SCARuntime.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 "tuscany/sca/model/CompositeReference.h" -#include "model/RESTServiceBinding.h" -#include "tuscany/sca/rest/model/RESTInterface.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; -using namespace tuscany::sca::util; - -namespace tuscany -{ - namespace sca - { - namespace rest - { - - class ResponseChunk { - public: - ResponseChunk() : memory(NULL), size(0) - { - } - - ~ResponseChunk() - { - if (memory) - { - free(memory); - } - } - - char *memory; - int size; - }; - - class RequestChunk { - public: - RequestChunk() : memory(NULL), size(0), read(0) - { - } - - ~RequestChunk() - { - } - - const char *memory; - int size; - int read; - }; - - class HeaderChunk { - public: - HeaderChunk() : location("") - { - } - - ~HeaderChunk() - { - } - - string location; - }; - - size_t write_callback(void *ptr, size_t size, size_t nmemb, void *data) - { - int realsize = size * nmemb; - ResponseChunk *mem = (ResponseChunk *)data; - - if (mem->memory != NULL) - { - mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1); - } - else - { - mem->memory = (char *)malloc(mem->size + realsize + 1); - } - memcpy(&(mem->memory[mem->size]), ptr, realsize); - mem->size += realsize; - mem->memory[mem->size] = 0; - return realsize; - } - - static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *data) - { - int realsize = size * nmemb; - RequestChunk *mem = (RequestChunk *)data; - - if (realsize > mem->size - mem->read) - { - realsize = mem->size - mem->read; - } - if (realsize != 0) - { - memcpy(ptr, &(mem->memory[mem->read]), realsize); - mem->read += realsize; - } - return realsize; - } - - size_t header_callback(void *ptr, size_t size, size_t nmemb, void *data) - { - int realsize = size * nmemb; - HeaderChunk* mem = (HeaderChunk*)data; - - char* str = new char[realsize + 1]; - memcpy(str, ptr, realsize); - str[realsize] = 0; - - if (strlen(str) > 10 && !strncmp(str, "Location: ", 10)) - { - string s = &str[10]; - mem->location = s.substr(0,s.find_last_not_of("\r\n")+1); - } - - delete str; - - return realsize; - } - - bool RESTServiceWrapper::initialized = false; - - RESTServiceWrapper::RESTServiceWrapper(Service* service) : ServiceWrapper(service) - { - logentry(); - - DataFactoryPtr dataFactory = service->getComponent()->getComposite()->getDataFactory(); - try { - const Type& tempType = dataFactory->getType("http://tempuri.org", "RootType"); - } catch (SDORuntimeException&) - { - dataFactory->addType("http://tempuri.org", "RootType", false, false, false); - dataFactory->addType("http://tempuri.org", "Wrapper", false, true, false); - dataFactory->addPropertyToType( - "http://tempuri.org", "RootType", - "Wrapper", - "http://tempuri.org", "Wrapper", - false, false, true); - dataFactory->addType("http://tempuri.org", "Part", false, true, false); - dataFactory->addPropertyToType( - "http://tempuri.org", "RootType", - "Part", - "http://tempuri.org", "Part", - false, false, true); - } - - if (!initialized) - { - curl_global_init(CURL_GLOBAL_ALL); - initialized = true; - } - } - - RESTServiceWrapper::~RESTServiceWrapper() - { - } - - /// - /// This method will be called when a service call needs to be made. - /// - void RESTServiceWrapper::invoke(Operation& operation) - { - logentry(); - - const string& operationName = operation.getName(); - - loginfo("Service: %s, operation: %s", getService()->getType()->getName().c_str() , operationName.c_str()); - - for (unsigned int i=0; igetComponent(); - Composite* composite = compositeReference->getComposite(); - XMLHelperPtr xmlHelper = composite->getXMLHelper(); - - // Get the REST binding - RESTServiceBinding* binding = (RESTServiceBinding *)service->getBinding(); - Interface* iface = service->getType()->getInterface(); - - // Init the curl session - CURL *curl_handle = curl_easy_init(); - - RequestChunk requestChunk; - ResponseChunk responseChunk; - HeaderChunk headerChunk; - - // Some servers don't like requests that are made without a user-agent - curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "libcurl-agent/1.0"); - - // Get the operation name - string opName = operation.getName(); - - // If we have a REST interface, the operation name translates to an HTTP verb - if (iface != NULL && iface->getInterfaceTypeQName() == RESTInterface::typeQName) - { - - // HTTP GET - if (opName == "retrieve") - { - // Build the request URL - bool firstParm = 0; - string uri; - if (operation.getNParms() !=0) - { - - // If the first parameter is a URI, then we'll use it, - // otherwise we'll use the binding URI - ostringstream s0; - writeParameter(xmlHelper, s0, operation.getParameter(0)); - string p0 = s0.str(); - if (p0.find("://") != string::npos) - { - firstParm = 1; - uri = p0; - } - else - { - uri = getBindingURI(); - } - } - else - { - uri = getBindingURI(); - } - // Add the parameters to the end of the URI - ostringstream os; - if (uri[uri.length()-1] == '?') - { - // If the URI ends with a "?" then we use the query - // form param=value& - os << uri; - for (unsigned int i = firstParm; i < operation.getNParms(); i++) - { - Operation::Parameter param = operation.getParameter(i); - - if(param.hasName()) - { - os << param.getName() << "="; - } - else - { - // No name - use "param1", etc - os << "param" << (i + 1) << "="; - } - writeParameter(xmlHelper, os, param); - if (i < operation.getNParms()-1) - os << "&"; - } - } - else - { - // Add the parameters in the form - // value1 / value2 / value3 - os << uri; - for (unsigned int i = firstParm; i < operation.getNParms(); i++) - { - os << "/"; - writeParameter(xmlHelper, os, operation.getParameter(i)); - } - } - - string url = os.str(); - //loginfo("RESTServiceWrapper: HTTP GET %s", url.c_str()); - curl_easy_setopt(curl_handle, CURLOPT_URL, url.c_str()); - - // Send all data to this function - curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_callback); - - // Pass our 'chunk' struct to the callback function - curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&responseChunk); - - // Send all headers to this function - curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, header_callback); - - // Pass our 'chunk' struct to the callback function - curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, (void *)&headerChunk); - - // Perform the HTTP GET - CURLcode rc = curl_easy_perform(curl_handle); - - if (rc) - { - throwException(ServiceInvocationException, curl_easy_strerror(rc)); - } - - // Get the output data out of the returned document - long httprc; - curl_easy_getinfo (curl_handle, CURLINFO_RESPONSE_CODE, &httprc); - - string responsePayload = ""; - if (responseChunk.memory) - { - responsePayload = string((const char*)responseChunk.memory, responseChunk.size); - } - - if (httprc == 200) - { - if (responsePayload != "") - { - //TODO Remove this workaround once SDO supports loading of open top level content - // The workaround is to wrap the open content in a wrapper element - string xmldecl; - string xml; - Utils::rTokeniseString("?>", responsePayload, xmldecl, xml); - string part = "\n"; - part += "\n"; - part += xml; - part += "\n"; - - setReturn(xmlHelper, part, operation); - } - else - { - throwException(ServiceInvocationException, "Failed to retrieve resource, empty response"); - } - } - else - { - ostringstream msg; - msg << "Failed to retrieve REST resource, HTTP code: " << httprc; - if (responsePayload != "") - { - msg << ", payload: " << responsePayload; - } - throwException(ServiceInvocationException, msg.str().c_str()); - } - } - else if (opName == "create") - { - // HTTP POST - - // Set the target URL - string url = getBindingURI(); - curl_easy_setopt(curl_handle, CURLOPT_URL, url.c_str()); - - // Create the input payload - ostringstream spayload; - writeParameter(xmlHelper, spayload, operation.getParameter(0)); - const string& requestPayload = spayload.str(); - requestChunk.memory = requestPayload.c_str(); - requestChunk.size = requestPayload.size(); - - curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDSIZE, requestChunk.size); - - // Read all data using this function - curl_easy_setopt(curl_handle, CURLOPT_READFUNCTION, read_callback); - - // Pass our 'chunk' struct to the callback function - curl_easy_setopt(curl_handle, CURLOPT_READDATA, (void *)&requestChunk); - - // Send all data to this function - curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_callback); - - // Pass our 'chunk' struct to the callback function - curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&responseChunk); - - // Send all headers to this function - curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, header_callback); - - // Pass our 'chunk' struct to the callback function - curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, (void *)&headerChunk); - - // Configure headers - curl_slist *requestHeaders = NULL; - requestHeaders = curl_slist_append(requestHeaders, "Expect:"); - requestHeaders = curl_slist_append(requestHeaders, "Content-Type: text/xml"); - curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, requestHeaders); - - // Perform the HTTP POST - curl_easy_setopt(curl_handle, CURLOPT_POST, true); - CURLcode rc = curl_easy_perform(curl_handle); - - curl_slist_free_all(requestHeaders); - - if (rc) - { - throwException(ServiceInvocationException, curl_easy_strerror(rc)); - } - - // Get the output and location of the created resource - string responsePayload = ""; - if (responseChunk.memory) - { - responsePayload = string((const char*)responseChunk.memory, responseChunk.size); - } - - long httprc; - curl_easy_getinfo (curl_handle, CURLINFO_RESPONSE_CODE, &httprc); - if (httprc == 201) - { - string* location = new string; - *location = headerChunk.location; - operation.setReturnValue(location); - } - else - { - ostringstream msg; - msg << "Failed to create REST resource, HTTP code: " << httprc; - if (responsePayload != "") - { - msg << ", payload: " << responsePayload; - } - throwException(ServiceInvocationException, msg.str().c_str()); - } - } - else if (opName == "update") - { - // HTTP PUT - - // Build the request URL - bool firstParm = 0; - string uri; - if (operation.getNParms() > 1) - { - - // If the first parameter is a URI, then we'll use it, - // otherwise we'll use the binding URI - ostringstream s0; - writeParameter(xmlHelper, s0, operation.getParameter(0)); - string p0 = s0.str(); - if (p0.find("://") != string::npos) - { - firstParm = 1; - uri = p0; - } - else - { - uri = getBindingURI(); - } - } - else - { - uri = getBindingURI(); - } - // Add the parameters to the end of the URI - ostringstream os; - if (uri[uri.length()-1] == '?') - { - // If the URI ends with a "?" then we use the query - // form param=value& - os << uri; - for (unsigned int i = firstParm; i < operation.getNParms()-1; i++) - { - Operation::Parameter param = operation.getParameter(i); - if(param.hasName()) - { - os << param.getName() << "="; - } - else - { - // No name - use "param1", etc - os << "param" << (i + 1) << "="; - } - writeParameter(xmlHelper, os, param); - if (i < operation.getNParms()-1) - os << "&"; - } - } - else - { - // Add the parameters in the form - // value1 / value2 / value3 - os << uri; - for (unsigned int i = firstParm; i < operation.getNParms()-1; i++) - { - os << "/"; - writeParameter(xmlHelper, os, operation.getParameter(i)); - } - } - - string url = os.str(); - curl_easy_setopt(curl_handle, CURLOPT_URL, url.c_str()); - - // Create the input payload - ostringstream spayload; - writeParameter(xmlHelper, spayload, operation.getParameter(operation.getNParms()-1)); - const string& requestPayload = spayload.str(); - requestChunk.memory = requestPayload.c_str(); - requestChunk.size = requestPayload.size(); - - // Read all data using this function - curl_easy_setopt(curl_handle, CURLOPT_READFUNCTION, read_callback); - - // Pass our 'chunk' struct to the callback function - curl_easy_setopt(curl_handle, CURLOPT_READDATA, (void *)&requestChunk); - - // Send all data to this function - curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_callback); - - // Pass our 'chunk' struct to the callback function - curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&responseChunk); - - // Send all headers to this function - curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, header_callback); - - // Pass our 'chunk' struct to the callback function - curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, (void *)&headerChunk); - - // Configure headers - curl_slist *requestHeaders = NULL; - requestHeaders = curl_slist_append(requestHeaders, "Expect:"); - requestHeaders = curl_slist_append(requestHeaders, "Content-Type: text/xml"); - curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, requestHeaders); - - // Perform the HTTP PUT - curl_easy_setopt(curl_handle, CURLOPT_PUT, true); - curl_easy_setopt(curl_handle, CURLOPT_UPLOAD, true) ; - long size = (long)requestChunk.size; - curl_easy_setopt(curl_handle, CURLOPT_INFILESIZE, size); - - CURLcode rc = curl_easy_perform(curl_handle); - - curl_slist_free_all(requestHeaders); - - if (rc) - { - throwException(ServiceInvocationException, curl_easy_strerror(rc)); - } - - // Get the output and location of the created resource - string responsePayload = ""; - if (responseChunk.memory) - { - responsePayload = string((const char*)responseChunk.memory, responseChunk.size); - } - - long httprc; - curl_easy_getinfo (curl_handle, CURLINFO_RESPONSE_CODE, &httprc); - if (httprc != 200) - { - ostringstream msg; - msg << "Failed to update REST resource, HTTP code: " << httprc; - if (responsePayload != "") - { - msg << ", payload: " << responsePayload; - } - throwException(ServiceInvocationException, msg.str().c_str()); - } - } - else if (opName == "delete") - { - // HTTP DELETE - - // Build the request URL - bool firstParm = 0; - string uri; - if (operation.getNParms() !=0) - { - - // If the first parameter is a URI, then we'll use it, - // otherwise we'll use the binding URI - ostringstream s0; - writeParameter(xmlHelper, s0, operation.getParameter(0)); - string p0 = s0.str(); - if (p0.find("://") != string::npos) - { - firstParm = 1; - uri = p0; - } - else - { - uri = getBindingURI(); - } - } - else - { - uri = getBindingURI(); - } - // Add the parameters to the end of the URI - ostringstream os; - if (uri[uri.length()-1] == '?') - { - // If the URI ends with a "?" then we use the query - // form param=value& - os << uri; - for (unsigned int i = firstParm; i < operation.getNParms(); i++) - { - Operation::Parameter param = operation.getParameter(i); - - if(param.hasName()) - { - os << param.getName() << "="; - } - else - { - // No name - use "param1", etc - os << "param" << (i + 1) << "="; - } - writeParameter(xmlHelper, os, param); - if (i < operation.getNParms()-1) - os << "&"; - } - } - else - { - // Add the parameters in the form - // value1 / value2 / value3 - os << uri; - for (unsigned int i = firstParm; i < operation.getNParms(); i++) - { - os << "/"; - writeParameter(xmlHelper, os, operation.getParameter(i)); - } - } - - string url = os.str(); - curl_easy_setopt(curl_handle, CURLOPT_URL, url.c_str()); - - // Send all data to this function - curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_callback); - - // Pass our 'chunk' struct to the callback function - curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&responseChunk); - - // Send all headers to this function - curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, header_callback); - - // Pass our 'chunk' struct to the callback function - curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, (void *)&headerChunk); - - // Perform the HTTP DELETE - curl_easy_setopt(curl_handle, CURLOPT_CUSTOMREQUEST, "DELETE"); - CURLcode rc = curl_easy_perform(curl_handle); - if (rc) - { - throwException(ServiceInvocationException, curl_easy_strerror(rc)); - } - - // Get the output data out of the returned document - string responsePayload = ""; - if (responseChunk.memory) - { - responsePayload = string((const char*)responseChunk.memory, responseChunk.size); - } - - long httprc; - curl_easy_getinfo (curl_handle, CURLINFO_RESPONSE_CODE, &httprc); - if (httprc != 200) - { - ostringstream msg; - msg << "Failed to delete REST resource, HTTP code: " << httprc; - if (responsePayload != "") - { - msg << ", payload: " << responsePayload; - } - throwException(ServiceInvocationException, msg.str().c_str()); - } - } - else - { - string msg = "Unknown REST verb: " + opName; - throwException(ServiceInvocationException, msg.c_str()); - } - } - else - { - // Not a REST interface, XML / HTTP command style - curl_slist *requestHeaders = NULL; - struct curl_httppost *formpost = NULL; - ostringstream spayload; - string requestPayload; - string url; - - // If the request contains complex content then we'll use - // a POST, otherwise we use a GET with a query string - bool complexContent = false; - for (unsigned int i=0; i", responsePayload, xmldecl, xml); - string part = "\n"; - part += "\n"; - part += xml; - part += "\n"; - - setReturn(xmlHelper, part, operation); - } - } - - // Cleanup curl session - curl_easy_cleanup(curl_handle); - } - - - const string RESTServiceWrapper::getBindingURI() - { - string bindingURI = ""; - - // Get the binding URI configured on the top level component - Service* service = getService(); - CompositeReference* compositeReference = (CompositeReference*)service->getComponent(); - SCARuntime* runtime = SCARuntime::getCurrentRuntime(); - Component* component = runtime->getDefaultComponent(); - Reference* reference = component->findReference(compositeReference->getName()); - if (reference != NULL) - { - ReferenceBinding* binding = reference->getBinding(); - if (binding != NULL && binding->getURI() != "") - { - bindingURI = binding->getURI(); - } - } - if (bindingURI == "") - { - // Get the binding URI configured on the binding - RESTServiceBinding* binding = (RESTServiceBinding *)service->getBinding(); - bindingURI = binding->getURI(); - } - if (bindingURI != "") - { - - // Prepend the default base URI if the URI is not absolute - if (bindingURI.find("://") == string::npos) - { - bindingURI = runtime->getDefaultBaseURI() + string("/rest/") + bindingURI; - } - } - return bindingURI; - } - - - void RESTServiceWrapper::writeParameter(XMLHelperPtr xmlHelper, ostringstream& os, const Operation::Parameter& parm) - { - logentry(); - - switch(parm.getType()) - { - case Operation::BOOL: - { - os << *(bool*)parm.getValue(); - break; - } - case Operation::SHORT: - { - os << *(short*)parm.getValue(); - break; - } - case Operation::INT: - { - os << *(long*)parm.getValue(); - break; - } - case Operation::LONG: - { - os << *(long*)parm.getValue(); - break; - } - case Operation::USHORT: - { - os << *(short*)parm.getValue(); - break; - } - case Operation::UINT: - { - os << *(long*)parm.getValue(); - break; - } - case Operation::ULONG: - { - os << *(long*)parm.getValue(); - break; - } - case Operation::FLOAT: - { - os << *(float*)parm.getValue(); - break; - } - case Operation::DOUBLE: - { - os << *(long double*)parm.getValue(); - break; - } - case Operation::LONGDOUBLE: - { - os << *(long double*)parm.getValue(); - break; - } - case Operation::CHARS: - { - os << *(char**)parm.getValue(); - break; - } - case Operation::STRING: - { - os << (*(string*)parm.getValue()).c_str(); - break; - } - case Operation::DATAOBJECT: - { - DataObjectPtr dob = *(DataObjectPtr*)parm.getValue(); - XMLDocumentPtr doc = xmlHelper->createDocument(dob, NULL, NULL); - xmlHelper->save(doc, os); - break; - } - default: - { - break; - } - } - } - - void RESTServiceWrapper::setReturn(XMLHelperPtr xmlHelper, string& payload, - Operation& operation) - { - logentry(); - - //TODO Remove this workaround once SDO supports loading of open top level content - // The workaround is to wrap the open content in a wrapper element - string xmldecl; - string xml; - Utils::rTokeniseString("?>", payload, xmldecl, xml); - string body = "\n"; - body += "\n"; - body += xml; - body += "\n"; - - // Convert the body to an SDO DataObject - DataObjectPtr outputWrapperDataObject = NULL; - XMLDocumentPtr theXMLDocument = xmlHelper->load(body.c_str(), NULL); - if (theXMLDocument != 0) - { - outputWrapperDataObject = theXMLDocument->getRootDataObject(); - } - if(!outputWrapperDataObject) - { - ostringstream msg; - msg << "Could not convert received document to SDO: " << body; - throwException(ServiceDataException, msg.str().c_str()); - } - - // Get the body part - DataObjectPtr outputDataObject = NULL; - PropertyList bpl = outputWrapperDataObject->getInstanceProperties(); - if (bpl.size()!=0) - { - if (bpl[0].isMany()) - { - DataObjectList& parts = outputWrapperDataObject->getList((unsigned int)0); - outputDataObject = parts[0]; - } - else - { - outputDataObject = outputWrapperDataObject->getDataObject(bpl[0]); - } - } - if (outputDataObject == NULL) - { - ostringstream msg; - msg << "Could not convert body part to SDO: " << body; - throwException(ServiceDataException, msg.str().c_str()); - } - - 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; - } - 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::IntType: - { - long* intData = new long; - *intData = outputDataObject->getInt(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: - { - if (!strcmp(pl[0].getType().getURI(), SDOUtils::sdoURI) && - !strcmp(pl[0].getType().getName(), "OpenDataObject")) { - - /* - * This code deals with xsd:any element parameters - * Get each element as a DataObject and add in to the parameter list - */ - DataObjectList& dataObjectList = outputDataObject->getList(pl[i]); - - for(unsigned 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* dataObjectData = new DataObjectPtr; - *dataObjectData = sequence->getDataObjectValue(0); - if(!*dataObjectData) - { - loginfo("Null DataObject return value"); - } - else - { - (*dataObjectData)->detach(); - } - operation.setReturnValue(dataObjectData); - } - } - else - { - // Empty content, add an empty string - loginfo("Null OpenDataObject return value"); - string *stringData = new string(""); - operation.setReturnValue(stringData); - } - } - } - } - else { - DataObjectPtr* dataObjectData = new DataObjectPtr; - *dataObjectData = outputDataObject->getDataObject(pl[i]); - if(!*dataObjectData) - { - loginfo("Null SDO DataObject return value"); - } - else - { - (*dataObjectData)->detach(); - } - operation.setReturnValue(dataObjectData); - } - } - break; - default: - { - ostringstream msg; - msg << "Unsupported result type: " << pl[i].getTypeEnum(); - throwException(ServiceDataException, msg.str().c_str()); - } - } - } - - } // End namespace rest - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.h b/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.h deleted file mode 100644 index 42e136a5d4..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_extension_rest_restservicewrapper_h -#define tuscany_sca_extension_rest_restservicewrapper_h - -#include - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/core/Operation.h" -#include "tuscany/sca/model/Service.h" - - -namespace tuscany -{ - namespace sca - { - - namespace rest - { - - class RESTServiceWrapper : public ServiceWrapper - { - public: - - /** - * Constructor. - * @param target The service wrapper represents a Web service. - */ - RESTServiceWrapper(tuscany::sca::model::Service* service); - - /** - * Destructor - */ - virtual ~RESTServiceWrapper(); - - /** - * 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); - - private: - - /** - * Used to track initialization of the CURL library - */ - static bool initialized; - - /** - * Get the configured binding URI - */ - const std::string getBindingURI(); - - /** - * Write a parameter into a URL - */ - void writeParameter(commonj::sdo::XMLHelperPtr xmlHelper, std::ostringstream& os, const Operation::Parameter& parm); - - /** - * Set the return value on the given operation - */ - void setReturn(commonj::sdo::XMLHelperPtr xmlHelper, std::string& payload, Operation& operation); - - }; - } // End namespace rest - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_rest_restservicewrapper_h diff --git a/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/model/RESTServiceBinding.cpp b/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/model/RESTServiceBinding.cpp deleted file mode 100644 index 72701bfa65..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/model/RESTServiceBinding.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/rest/model/RESTServiceBinding.h" -#include "tuscany/sca/core/ServiceWrapper.h" -#include "tuscany/sca/rest/RESTServiceWrapper.h" - -using namespace std; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace rest - { - - // Constructor - RESTServiceBinding::RESTServiceBinding(Service* service, const string& uri) - : ServiceBinding(service, uri) - { - logentry(); - - serviceWrapper = new RESTServiceWrapper(service); - } - - // Destructor - RESTServiceBinding::~RESTServiceBinding() - { - logentry(); - } - - ServiceWrapper* RESTServiceBinding::getServiceWrapper() - { - logentry(); - - return serviceWrapper; - } - - } // End namespace rest - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/model/RESTServiceBinding.h b/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/model/RESTServiceBinding.h deleted file mode 100644 index d19bcdacf5..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/model/RESTServiceBinding.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_extension_rest_model_restservicebinding_h -#define tuscany_sca_extension_rest_model_restservicebinding_h - -#include - -#include "tuscany/sca/model/ServiceBinding.h" -#include "tuscany/sca/model/Service.h" - -namespace tuscany -{ - namespace sca - { - namespace rest - { - /** - * Information about a REST binding for a service or a reference. - */ - class RESTServiceBinding : public tuscany::sca::model::ServiceBinding - { - public: - - /** - * Constructor. - * @param uri The uri of the binding. - */ - RESTServiceBinding(tuscany::sca::model::Service* service, const std::string& uri); - - /** - * Destructor. - */ - virtual ~RESTServiceBinding(); - - /** - * Returns the type of binding. - */ - virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#RESTBinding"; }; - - /** - * 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 rest - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_rest_model_restservicebinding_h diff --git a/sca-cpp/trunk/runtime/extensions/rest/service/Makefile.am b/sca-cpp/trunk/runtime/extensions/rest/service/Makefile.am deleted file mode 100644 index 2ecfda6c6c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/service/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = httpd \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/Makefile.am b/sca-cpp/trunk/runtime/extensions/rest/service/httpd/Makefile.am deleted file mode 100644 index f963effea2..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = src \ No newline at end of file diff --git a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/Makefile.am b/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/Makefile.am deleted file mode 100644 index e5b3ce85bd..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -libdir=$(prefix)/extensions/rest/service/lib -lib_LTLIBRARIES = \ -libtuscany_sca_rest_service.la \ -libtuscany_sca_mod_rest.la - -noinst_HEADERS = \ -tuscany/sca/rest/*.h \ -tuscany/sca/rest/model/*.h - -libtuscany_sca_rest_service_la_SOURCES = \ -tuscany/sca/rest/RESTReferenceBindingExtension.cpp \ -tuscany/sca/rest/model/RESTReferenceBinding.cpp \ -tuscany/sca/rest/RESTServiceProxy.cpp - -libtuscany_sca_rest_service_la_LIBADD = \ - -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \ - -L$(top_builddir)/runtime/core/src -ltuscany_sca \ - -L$(top_builddir)/runtime/extensions/rest/interface/src -ltuscany_sca_rest_interface - -rootdir=$(prefix)/extensions/rest/service - -libtuscany_sca_mod_rest_la_SOURCES = \ -tuscany/sca/rest/ModREST.cpp - -libtuscany_sca_mod_rest_la_LIBADD = \ - -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \ - -L$(top_builddir)/runtime/core/src -ltuscany_sca \ - -L$(top_builddir)/runtime/extensions/rest/service/httpd/src -ltuscany_sca_rest_service \ - -L$(top_builddir)/runtime/extensions/rest/interface/src -ltuscany_sca_rest_interface - -INCLUDES = -I$(top_builddir)/runtime/core/src \ - -I$(top_builddir)/runtime/extensions/rest/interface/src \ - -I${TUSCANY_SDOCPP}/include \ - -I${HTTPD_INCLUDE} -I${APR_INCLUDE} - -moduledir=$(prefix)/extensions/rest/service/module -extension = libtuscany_sca_rest_service$(libsuffix) - -install-exec-hook: - test -z $(moduledir) || $(mkdir_p) $(moduledir); - -rm -f $(moduledir)/$(extension) - $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp b/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp deleted file mode 100644 index 4a63991515..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp +++ /dev/null @@ -1,1372 +0,0 @@ -/* - * Copyright 2006 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "apr_strings.h" -#include "apr_fnmatch.h" -#include "apr_lib.h" - -#define APR_WANT_STRFUNC -#include "apr_want.h" -#include "ap_config.h" -#include "httpd.h" - -// This section removes the windows/httpd build error "strtoul_is_not_a_portable_function_use_strtol_instead" -#if defined(WIN32) || defined (_WINDOWS) -#ifdef strtoul -#undef strtoul -#endif -#define strtoul strtoul -#endif - -#include "http_config.h" -#include "http_core.h" -#include "http_request.h" -#include "http_protocol.h" -#include "http_log.h" -#include "http_main.h" -#include "util_script.h" -#include "util_md5.h" - -#include "mod_core.h" - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/util/Logging.h" -#include "RESTServiceProxy.h" -#include "model/RESTReferenceBinding.h" -#include "tuscany/sca/rest/model/RESTInterface.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/WSDLMessagePart.h" -#include "tuscany/sca/model/WSDLInterface.h" -#include "tuscany/sca/model/Interface.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/util/Utils.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca; -using namespace tuscany::sca::model; -using namespace tuscany::sca::util; - - -extern "C" -{ - extern module AP_MODULE_DECLARE_DATA sca_rest_module; -} - -namespace tuscany -{ - namespace sca - { - namespace rest - { - - typedef struct rest_server_config_rec - { - char * home; - } rest_server_config_rec_t; - - typedef struct rest_dir_config_rec - { - char * root; - char * path; - char * base_uri; - char * component; - } rest_dir_config_rec_t; - - CompositeService* initializeSCARuntime(const char* home, const char* root, - const char* path, const char* baseURI, const char *component, const char* service); - - DataObjectPtr createPayload(DataFactoryPtr dataFactory, - Operation& operation, const WSDLOperation& wsdlOperation); - - void addPart(XMLHelperPtr xmlHelper, string& payload, Operation& operation); - - int logHeaders(void* request, const char* key, const char* value); - - /** - * Initialize the SCA runtime - */ - CompositeService* initializeSCARuntime(const char* home, const char* root, - const char* path, const char* baseURI, const char *component, const char* service) - { - logentry(); - loginfo("Home: %s", home); - loginfo("Root: %s", root); - loginfo("Path: %s", path); - loginfo("Base URI: %s", baseURI); - loginfo("Component: %s", component); - loginfo("Service: %s", service); - - try - { - SCARuntime* runtime = SCARuntime::initializeSharedRuntime(home, root, path, baseURI); - - string componentName; - if (strlen(component)) - { - componentName = component; - } - else - { - componentName = runtime->getDefaultComponentName(); - } - string serviceName = service; - - loginfo("Resolving composite: %s, service: %s", componentName.c_str(), serviceName.c_str()); - Component* compositeComponent = runtime->getSystem()->findComponent(componentName); - if (compositeComponent == NULL) - { - string msg = "Component not found " + componentName; - throwException(SystemConfigurationException, msg.c_str()); - } - runtime->setDefaultComponent(compositeComponent); - - Composite* composite = (Composite*)compositeComponent->getType(); - CompositeService* compositeService = (CompositeService*)composite->findComponent(serviceName); - if (compositeService == NULL) - { - string msg = "Composite service not found " + serviceName; - throwException(SystemConfigurationException, msg.c_str()); - } - - return compositeService; - } - catch(TuscanyRuntimeException &ex) - { - ostringstream msg; - msg << ex; - logerror("Failed to initialize SCA runtime: %s", msg.str().c_str()); - throw; - } - } - - bool printRequest = false; - - int logHeaders(void* request, const char* key, const char* value) - { - loginfo("Header key: %s, value: %s", key, value); - if (printRequest) - { - ap_rprintf((request_rec*)request, "
          Header key: %s, value: %s", key, value); - } - return 1; - } - - int rest_handler(request_rec *request) - { - logentry(); - - if (strcmp(request->handler, "sca_rest_module")) - { - return DECLINED; - } - - try { - - // Set up the read policy - int rc = ap_setup_client_block(request, REQUEST_CHUNKED_DECHUNK); - if (rc != OK) - { - return rc; - } - ap_should_client_block(request); - if (request->read_chunked == true && request->remaining == 0) - { - request->chunked = true; - } - - apr_table_setn(request->headers_out, "Connection", "close"); - - if (printRequest) - { - // Set the content type - ap_set_content_type(request, "text/html"); - - // Send the response document - ap_rputs("

          Tuscany Mod_rest works!", request); - } - - rest_server_config_rec_t* server_conf = (rest_server_config_rec_t*)ap_get_module_config(request->server->module_config, &sca_rest_module); - loginfo("Tuscany home: %s", server_conf->home); - if (printRequest) - { - ap_rprintf(request, "

          Tuscany home: %s", server_conf->home); - } - - rest_dir_config_rec_t* dir_conf = (rest_dir_config_rec_t*)ap_get_module_config(request->per_dir_config, &sca_rest_module); - loginfo("Tuscany root: %s", dir_conf->root); - if (printRequest) - { - ap_rprintf(request, "

          Tuscany root: %s", dir_conf->root); - } - loginfo("Tuscany path: %s", dir_conf->path); - if (printRequest) - { - ap_rprintf(request, "

          Tuscany path: %s", dir_conf->path); - } - loginfo("SCA component: %s", dir_conf->component); - if (printRequest) - { - ap_rprintf(request, "

          SCA component: %s", dir_conf->component); - } - - if (request->protocol) - { - loginfo("Protocol: %s", request->protocol); - if (printRequest) - { - ap_rprintf(request, "

          Protocol: %s", request->protocol); - } - } - - if (request->method) - { - loginfo("HTTP method: %s", request->method); - if (printRequest) - { - ap_rprintf(request, "

          HTTP method: %s", request->method); - } - } - - loginfo("HTTP method number: %d", request->method_number); - if (printRequest) - { - ap_rprintf(request, "

          HTTP method number: %d", request->method_number); - } - - const char* content_type = apr_table_get(request->headers_in, "Content-Type"); - if (content_type) - { - loginfo("Content type: %s", content_type); - if (printRequest) - { - ap_rprintf(request, "

          Content type: %s", content_type); - } - } - else - { - content_type = "text/plain"; - } - - if (request->content_encoding) - { - loginfo("Content encoding: %s", request->content_encoding); - if (printRequest) - { - ap_rprintf(request, "

          Content encoding: %s", request->content_encoding); - } - } - - if (printRequest) - { - ap_rputs("

          ", request); - } - apr_table_do(logHeaders, request, request->headers_in, NULL); - - if (request->uri) - { - loginfo("URI: %s", request->uri); - if (printRequest) - { - ap_rprintf(request, "

          URI: %s", request->uri); - } - } - - if (request->path_info) - { - loginfo("Path info: %s", request->path_info); - if (printRequest) - { - ap_rprintf(request, "

          Path info: %s", request->path_info); - } - } - - if (request->args) - { - loginfo("Args: %s", request->args); - if (printRequest) - { - ap_rprintf(request, "

          Args: %s", request->args); - } - } - - if (printRequest) - { - ap_rputs("", request); - } - - // Extract the service and component names from the HTTP URI path - string path; - if (strlen(request->path_info) != 0 && *(request->path_info) == '/') - { - path = request->path_info + 1; - } - else - { - path = request->path_info; - } - string uri; - - string component; - string service; - if (strlen(dir_conf->component)) - { - // The path only specifies the service, the component name - // is configured in the directory/location configured - component = dir_conf->component; - Utils::tokeniseString("/", path, service, uri); - } - else - { - // The path must be in the form component / service - string path2; - Utils::tokeniseString("/", path, component, path2); - Utils::tokeniseString("/", path2, service, uri); - } - - loginfo("Component name: %s", component.c_str()); - loginfo("Service name: %s", service.c_str()); - - // Initialize the SCA runtime - CompositeService* compositeService = initializeSCARuntime( - server_conf->home, dir_conf->root, dir_conf->path, dir_conf->base_uri, component.c_str(), service.c_str()); - - if(!compositeService) - { - throwException(SystemConfigurationException, - "Failed to initialize SCA runtime, could not initialize CompositeService"); - } - - Composite* composite = compositeService->getComposite(); - DataFactoryPtr dataFactory = composite->getDataFactory(); - if (dataFactory == 0) - { - throwException(SystemConfigurationException, - "Failed to initialize SCA runtime, could not get DataFactory"); - } - XMLHelperPtr xmlHelper = composite->getXMLHelper(); - - // Get the REST binding - Reference* reference = compositeService->getReference(); - RESTReferenceBinding* binding = (RESTReferenceBinding*)reference->getBinding(); - - // Get the REST proxy - RESTServiceProxy* proxy = (RESTServiceProxy*)binding->getServiceProxy(); - - // Get the component interface - Interface* iface = reference->getType()->getInterface(); - - if (request->method_number == M_GET) - { - // Handle an HTTP GET - - // Determine the operation to invoke - WSDLOperation wsdlOperation; - string wsdlNamespace = ""; - string op_name = ""; - string uriArgs = ""; - if (iface != NULL) - { - // If we have a REST interface, the operation name is "retrieve" - if (iface->getInterfaceTypeQName() == RESTInterface::typeQName) - { - op_name = "retrieve"; - uriArgs = uri; - } - else if (iface->getInterfaceTypeQName() == WSDLInterface::typeQName) - { - // we have a WSDL interface, the operation name is part of the URI - Utils::tokeniseString("/", uri, op_name, uriArgs); - - // look for the WSDL operation definition - WSDLInterface* wsdlInterface = (WSDLInterface*)iface; - wsdlNamespace = wsdlInterface->getNamespaceURI(); - - if (wsdlNamespace != "") - { - WSDLDefinition* wsdl = composite->findWSDLDefinition(wsdlNamespace); - if (wsdl == 0) - { - string msg = "WSDL not found for: " + wsdlNamespace; - throwException(SystemConfigurationException, msg.c_str()); - } - try - { - wsdlOperation = wsdl->findOperation(wsdlInterface->getName(), op_name.c_str()); - } - catch(SystemConfigurationException&) - { - throw; - } - - if (!wsdlOperation.isDocumentStyle() || !wsdlOperation.isWrappedStyle()) - { - throwException(ServiceInvocationException, - "Only wrapped document style WSDL operations are currentlysupported"); - } - } - } - } - else - { - Utils::tokeniseString("/", uri, op_name, uriArgs); - } - - // Create a default document literal wrapped WSDL operation - if (wsdlNamespace == "") - { - WSDLMessagePart inPart(op_name, "", "http://tempuri.org"); - WSDLMessagePart outPart((op_name+"Response"), "", "http://tempuri.org"); - 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.setInputEncoded(false); - wsdlOperation.setOutputEncoded(false); - wsdlOperation.setInputMessagePart(op_name, inPart); - wsdlOperation.setOutputMessagePart((op_name+"Response"), outPart); - } - - // Create the input DataObject - Operation operation(op_name.c_str()); - - // Parse the args part of the URI - if (uriArgs != "") - { - string args = uriArgs; - for (; args != ""; ) - { - string param; - string next; - Utils::tokeniseString("/", args, param, next); - if (param != "") - { - string* data = new string; - *data = param; - operation.addParameter(data); - } - args = next; - } - } - - // Parse the query string - if (request->args) - { - string query = request->args; - for (; query != ""; ) - { - string param; - string next; - Utils::tokeniseString("&", query, param, next); - if (param != "") - { - string n; - string* data = new string; - Utils::tokeniseString("=", param, n, *data); - operation.addParameter(data); - } - query = next; - } - } - DataObjectPtr inputDataObject = createPayload(dataFactory, operation, wsdlOperation); - - // Dispatch to the REST proxy - DataObjectPtr outputDataObject = proxy->invoke(wsdlOperation, inputDataObject); - - // Send the output DataObject - if (iface!=NULL && - iface->getInterfaceTypeQName() == RESTInterface::typeQName) - { - if (outputDataObject == NULL) - { - throwException(ServiceInvocationException, "Null output from REST create operation"); - } - else - { - - // Pure REST, send the response document - XMLHelperPtr xm = HelperProvider::getXMLHelper(dataFactory); - DataObjectList& l = outputDataObject->getList("return"); - if (l.size() != 0) - { - DataObjectPtr resourceDataObject = l[0]; - XMLDocumentPtr doc = xm->createDocument( - resourceDataObject, - resourceDataObject->getType().getURI(), - resourceDataObject->getType().getName()); - char* str = xm->save(doc); - - // Calculate an Etag hash for the response - char* etag = ap_md5(request->pool, (const unsigned char*)str); - - // Handle a conditional GET, if the etag matches the etag - // sent by the client, we don't need to send the whole response - const char* match = apr_table_get(request->headers_in, "If-None-Match"); - if (match != NULL && !strcmp(etag, match)) - { - loginfo("REST resource matches ETag, sending HTTP 304 response code"); - request->status = HTTP_NOT_MODIFIED; - } - else - { - loginfo("Sending response: %s", str); - ap_set_content_type(request, "text/xml"); - apr_table_setn(request->headers_out, "ETag", etag); - - // Send an Etag header to allow caching and - // conditional gets - apr_table_setn(request->headers_out, "ETag", etag); - - ap_rputs(str, request); - } - } - else - { - loginfo("REST resource not found, sending HTTP 404 response code"); - request->status = HTTP_NOT_FOUND; - - return OK; - } - } - } - else - { - // Command style, send the response wrapper element - - if (outputDataObject == NULL) - { - loginfo("Sending empty response"); - //request->status = HTTP_NO_CONTENT; - } - else - { - XMLHelperPtr xm = HelperProvider::getXMLHelper(dataFactory); - DataObjectList& l = outputDataObject->getList("return"); - if (l.size() != 0) - { - DataObjectPtr resultDataObject = l[0]; - XMLDocumentPtr doc = xm->createDocument( - resultDataObject, - resultDataObject->getType().getURI(), - resultDataObject->getType().getName()); - char* str = xm->save(doc); - - loginfo("Sending response: %s", str); - ap_set_content_type(request, "text/xml"); - ap_rputs(str, request); - } - else - { - loginfo("Sending empty response"); - //request->status = HTTP_NO_CONTENT; - } - } - } - - return OK; - } - else if (request->method_number == M_POST) - { - // Handle an HTTP POST - - // Determine the operation to invoke - WSDLOperation wsdlOperation; - string wsdlNamespace = ""; - string op_name = ""; - string uriArgs = ""; - if (iface != NULL) - { - // If we have a REST interface, the operation name is "create" - if (iface->getInterfaceTypeQName() == RESTInterface::typeQName) - { - op_name = "create"; - } - else if (iface->getInterfaceTypeQName() == WSDLInterface::typeQName) - { - // we have a WSDL interface, the operation name is part of the URI - Utils::tokeniseString("/", uri, op_name, uriArgs); - - // look for the WSDL operation definition - WSDLInterface* wsdlInterface = (WSDLInterface*)iface; - wsdlNamespace = wsdlInterface->getNamespaceURI(); - - if (wsdlNamespace != "") - { - WSDLDefinition* wsdl = composite->findWSDLDefinition(wsdlNamespace); - if (wsdl == 0) - { - string msg = "WSDL not found for: " + wsdlNamespace; - throwException(SystemConfigurationException, msg.c_str()); - } - try - { - wsdlOperation = wsdl->findOperation(wsdlInterface->getName(), op_name.c_str()); - } - catch(SystemConfigurationException&) - { - throw; - } - - if (!wsdlOperation.isDocumentStyle() || !wsdlOperation.isWrappedStyle()) - { - throwException(ServiceInvocationException, - "Only wrapped document style WSDL operations are currentlysupported"); - } - } - } - } - else - { - Utils::tokeniseString("/", uri, op_name, uriArgs); - } - - // Create a default document literal wrapped WSDL operation - if (wsdlNamespace == "") - { - WSDLMessagePart inPart(op_name, "", "http://tempuri.org"); - WSDLMessagePart outPart((op_name+"Response"), "", "http://tempuri.org"); - 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.setInputEncoded(false); - wsdlOperation.setOutputEncoded(false); - wsdlOperation.setInputMessagePart(op_name, inPart); - wsdlOperation.setOutputMessagePart((op_name+"Response"), outPart); - } - - // Create the input DataObject - Operation operation(op_name.c_str()); - - // Parse the args part of the URI - if (uriArgs != "") - { - string args = uriArgs; - for (; args != ""; ) - { - string param; - string next; - Utils::tokeniseString("/", args, param, next); - if (param != "") - { - string* data = new string; - *data = param; - operation.addParameter(data); - } - args = next; - } - } - - // Parse the query string - if (request->args) - { - string query = request->args; - for (; query != ""; ) - { - string param; - string next; - Utils::tokeniseString("&", query, param, next); - if (param != "") - { - string n; - string* data = new string; - Utils::tokeniseString("=", param, n, *data); - operation.addParameter(data); - } - query = next; - } - } - - // Read the POST input - ostringstream sinput; - char buffer[2049]; - for ( ; ; ) - { - int size = ap_get_client_block(request, buffer, 2048); - if (size > 0) - { - buffer[size] = '\0'; - sinput << buffer; - } - else if (size == 0) - { - break; - } - else if (size < 0) - { - throwException(ServiceInvocationException, "Error reading POST input"); - } - } - string input = sinput.str(); - - string contentType = content_type; - if (contentType.find("multipart/form-data") == 0) - { - // This is a multipart POST, extract each part from the - // POST body - string begin; - string boundary; - Utils::tokeniseString("boundary=", contentType, begin, boundary); - - for (;;) - { - // Read each part - string part; - string next; - Utils::tokeniseString(boundary, input, part, next); - input = next; - - // Skip first and last empty parts - if (part.length() == 0 || part == "--") - continue; - - // Read headers - bool xml = false; - int empty = -1; - for (;;) - { - string header; - Utils::tokeniseString("\r\n", part, header, next); - part = next; - if (header == "") - { - // Two empty lines signal the beginning of the content - empty++; - if (empty == 1) - break; - } - else - { - empty = 0; - - // Detect XML content - if (header == "Content-Type: text/xml") - xml = true; - } - } - - // Read the part content - if (part.length()) - { - // Strip the trailer - string value; - Utils::tokeniseString("\r\n--", part, value, next); - - if (xml) - { - // Add an XML parameter to the operation - addPart(xmlHelper, value, operation); - } - else - { - // Add a text parameter to the operation - string* stringData = new string; - *stringData = value; - operation.addParameter(stringData); - } - } - - // Read till the end of the POST body - if (input.length() == 0) - break; - } - } - else - { - // The POST body represents a single part - addPart(xmlHelper, input, operation); - } - - DataObjectPtr inputDataObject = createPayload(dataFactory, operation, wsdlOperation); - - // Dispatch to the REST proxy - DataObjectPtr outputDataObject = proxy->invoke(wsdlOperation, inputDataObject); - - // Send the response back to the client - if (iface!=NULL && - iface->getInterfaceTypeQName() == RESTInterface::typeQName) - { - // Pure REST, send the location of the created resource - - if (outputDataObject == NULL) - { - throwException(ServiceInvocationException, "Null output from REST create operation"); - } - - string location = ""; - - DataObjectList& l = outputDataObject->getList("return"); - if (l.size()) - { - location = l.getCString(0); - } - - if (location == "") - { - loginfo("No resource location, sending HTTP 400 response code"); - request->status = HTTP_BAD_REQUEST; - - return OK; - } - - string locuri = request->uri; - locuri += '/'; - locuri += location; - - const char* loc = ap_construct_url(request->pool, locuri.c_str(), request); - loginfo("Sending resource location: %s", loc); - apr_table_setn(request->headers_out, "Location", loc); - apr_table_setn(request->headers_out, "Content-Location", loc); - request->status = HTTP_CREATED; - - // Send the created resource entity back to the client - ap_set_content_type(request, "text/xml"); - ap_rputs(input.c_str(), request); - - } - else - { - // Command style, send the response element - - if (outputDataObject == NULL) - { - loginfo("Sending empty response"); - //request->status = HTTP_NO_CONTENT; - } - else - { - XMLHelperPtr xm = HelperProvider::getXMLHelper(dataFactory); - DataObjectList& l = outputDataObject->getList("return"); - if (l.size() != 0) - { - DataObjectPtr resultDataObject = l[0]; - XMLDocumentPtr doc = xm->createDocument( - resultDataObject, - resultDataObject->getType().getURI(), - resultDataObject->getType().getName()); - char* str = xm->save(doc); - - loginfo("Sending response: %s", str); - ap_set_content_type(request, "text/xml"); - ap_rputs(str, request); - } - else - { - loginfo("Sending empty response"); - //request->status = HTTP_NO_CONTENT; - } - } - } - - return OK; - } - else if (request->method_number == M_PUT) - { - - // Handle an HTTP PUT - - // Determine the operation to invoke - WSDLOperation wsdlOperation; - string wsdlNamespace = ""; - string op_name = "update"; - string uriArgs = uri; - - // Create a default document literal wrapped WSDL operation - WSDLMessagePart inputPart(op_name, "", "http://tempuri.org"); - WSDLMessagePart outputPart((op_name+"Response"), "", "http://tempuri.org"); - 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.setInputEncoded(false); - wsdlOperation.setOutputEncoded(false); - wsdlOperation.setInputMessagePart(op_name, inputPart); - wsdlOperation.setOutputMessagePart((op_name+"Response"), outputPart); - - // Create the input DataObject - Operation operation(op_name.c_str()); - - // Parse the args part of the URI - if (uriArgs != "") - { - string args = uriArgs; - for (; args != ""; ) - { - string param; - string next; - Utils::tokeniseString("/", args, param, next); - if (param != "") - { - string* data = new string; - *data = param; - operation.addParameter(data); - } - args = next; - } - } - - // Parse the query string - if (request->args) - { - string query = request->args; - for (; query != ""; ) - { - string param; - string next; - Utils::tokeniseString("&", query, param, next); - if (param != "") - { - string n; - string* data = new string; - Utils::tokeniseString("=", param, n, *data); - operation.addParameter(data); - } - query = next; - } - } - - // Read the PUT input - ostringstream sinput; - char buffer[2049]; - for ( ; ; ) - { - int size = ap_get_client_block(request, buffer, 2048); - if (size > 0) - { - buffer[size] = '\0'; - sinput << buffer; - } - else if (size == 0) - { - break; - } - else if (size < 0) - { - throwException(ServiceInvocationException, "Error reading PUT input"); - } - } - string input = sinput.str(); - addPart(xmlHelper, input, operation); - - DataObjectPtr inputDataObject = createPayload(dataFactory, operation, wsdlOperation); - - // Dispatch to the REST proxy - DataObjectPtr outputDataObject = proxy->invoke(wsdlOperation, inputDataObject); - - // Empty response - //request->status = HTTP_NO_CONTENT; - return OK; - } - else if (request->method_number == M_DELETE) - { - - // Determine the operation to invoke - WSDLOperation wsdlOperation; - string wsdlNamespace = ""; - string op_name = "delete"; - string uriArgs = uri; - - // Create a default document literal wrapped WSDL operation - WSDLMessagePart inPart(op_name, "", "http://tempuri.org"); - WSDLMessagePart outPart((op_name+"Response"), "", "http://tempuri.org"); - 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.setInputEncoded(false); - wsdlOperation.setOutputEncoded(false); - wsdlOperation.setInputMessagePart(op_name, inPart); - wsdlOperation.setOutputMessagePart((op_name+"Response"), outPart); - - // Create the input DataObject - Operation operation(op_name.c_str()); - - // Parse the args part of the URI - if (uriArgs != "") - { - string args = uriArgs; - for (; args != ""; ) - { - string param; - string next; - Utils::tokeniseString("/", args, param, next); - if (param != "") - { - string* data = new string; - *data = param; - operation.addParameter(data); - } - args = next; - } - } - - // Parse the query string - if (request->args) - { - string query = request->args; - for (; query != ""; ) - { - string param; - string next; - Utils::tokeniseString("&", query, param, next); - if (param != "") - { - string n; - string* data = new string; - Utils::tokeniseString("=", param, n, *data); - operation.addParameter(data); - } - query = next; - } - } - - DataObjectPtr inputDataObject = createPayload(dataFactory, operation, wsdlOperation); - - // Dispatch to the REST proxy - DataObjectPtr outputDataObject = proxy->invoke(wsdlOperation, inputDataObject); - - // Empty response - //request->status = HTTP_NO_CONTENT; - return OK; - } - else - { - if (request->method) - { - logerror("Unsupported HTTP method: %s", request->method); - } - else - { - logerror("Unsupported HTTP method: %d", request->method_number); - } - return HTTP_NOT_IMPLEMENTED; - } - } - catch(TuscanyRuntimeException& ex) - { - ostringstream msg; - msg << ex; - logerror("Failed to process REST request: %s", msg.str().c_str()); - return HTTP_INTERNAL_SERVER_ERROR; - } - } - - DataObjectPtr createPayload(DataFactoryPtr dataFactory, Operation& operation, const WSDLOperation& wsdlOperation) - { - logentry(); - - DataObjectPtr inputDataObject; - string inputTypeUri; - string inputTypeName; - try - { - // Since its Document wrapped, there will only be one part - std::list partList = wsdlOperation.getInputMessagePartNames(); - const WSDLMessagePart &inputMessage = - wsdlOperation.getInputMessagePart(partList.front()); - inputTypeName = inputMessage.getPartType(); - inputTypeUri = inputMessage.getPartUri(); - - // Create the input wrapper - const Type& rootType = dataFactory->getType(inputTypeUri.c_str(), "RootType"); - const Property& prop = rootType.getProperty(inputTypeName.c_str()); - const Type& inputType = prop.getType(); - inputDataObject = dataFactory->create(inputType); - } - catch (SDORuntimeException&) - { - try - { - // Create the input wrapper - const Type& inputType = - dataFactory->getType(inputTypeUri.c_str(), inputTypeName.c_str()); - inputDataObject = dataFactory->create(inputType); - } - catch (SDORuntimeException&) - { - - // The input wrapper type is not known, create an open DataObject - inputDataObject = dataFactory->create("http://tempuri.org", "Wrapper"); - } - } - - // 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::STRING: - { - l.append((*(string*)parm.getValue()).c_str()); - break; - } - case Operation::DATAOBJECT: - { - l.append(*(DataObjectPtr*)parm.getValue()); - break; - } - default: - { - break; - } - } - } - } - } - else { - - // Each parameter in the operation should be a property on the request dataobject - for (unsigned int i=0; isetCString(i, (*(string*)parm.getValue()).c_str()); - break; - } - case Operation::DATAOBJECT: - { - inputDataObject->setDataObject(i, *(DataObjectPtr*)parm.getValue()); - break; - } - default: - { - break; - } - } - } - } - - return inputDataObject; - } - - void addPart(XMLHelperPtr xmlHelper, string& payload, Operation& operation) - { - logentry(); - - - //TODO Remove this workaround once SDO supports loading of open top level content - // The workaround is to wrap the open content in a wrapper element - string xmldecl; - string xml; - Utils::rTokeniseString("?>", payload, xmldecl, xml); - string body = "\n"; - body += "\n"; - body += xml; - body += "\n"; - - // Convert the body to an SDO DataObject - DataObjectPtr inputWrapperDataObject = NULL; - XMLDocumentPtr theXMLDocument = xmlHelper->load(body.c_str(), NULL); - if (theXMLDocument != 0) - { - inputWrapperDataObject = theXMLDocument->getRootDataObject(); - } - if(!inputWrapperDataObject) - { - ostringstream msg; - msg << "Could not convert received document to SDO: " << body; - throwException(ServiceDataException, msg.str().c_str()); - } - - // Get the body part - DataObjectPtr inputDataObject = NULL; - PropertyList bpl = inputWrapperDataObject->getInstanceProperties(); - if (bpl.size()!=0) - { - if (bpl[0].isMany()) - { - DataObjectList& parts = inputWrapperDataObject->getList((unsigned int)0); - inputDataObject = parts[0]; - } - else - { - inputDataObject = inputWrapperDataObject->getDataObject(bpl[0]); - } - } - if (inputDataObject == NULL) - { - ostringstream msg; - msg << "Could not convert received document to SDO: " << body; - throwException(ServiceDataException, msg.str().c_str()); - } - - DataObjectPtr* dataObjectData = new DataObjectPtr; - *dataObjectData = inputDataObject; - (*dataObjectData)->detach(); - operation.addParameter(dataObjectData); - } - - const char *rest_set_home(cmd_parms *cmd, void *dummy, - const char *arg) - { - rest_server_config_rec_t *conf = (rest_server_config_rec_t*)ap_get_module_config( - cmd->server->module_config, &sca_rest_module); - conf->home = apr_pstrdup(cmd->pool, arg); - return NULL; - } - - const char *rest_set_path(cmd_parms *cmd, void *c, - const char *arg) - { - rest_dir_config_rec_t *conf = (rest_dir_config_rec_t*)c; - conf->path = apr_pstrdup(cmd->pool, arg); - return NULL; - } - - const char *rest_set_root(cmd_parms *cmd, void *c, - const char *arg) - { - rest_dir_config_rec_t *conf = (rest_dir_config_rec_t*)c; - conf->root = apr_pstrdup(cmd->pool, arg); - return NULL; - } - - const char *rest_set_base_uri(cmd_parms *cmd, void *c, - const char *arg) - { - rest_dir_config_rec_t *conf = (rest_dir_config_rec_t*)c; - conf->base_uri = apr_pstrdup(cmd->pool, arg); - return NULL; - } - - const char *rest_set_component(cmd_parms *cmd, void *c, - const char *arg) - { - rest_dir_config_rec_t *conf = (rest_dir_config_rec_t*)c; - conf->component = apr_pstrdup(cmd->pool, arg); - return NULL; - } - - const command_rec rest_module_cmds[] = - { - AP_INIT_TAKE1("TuscanyHome", (const char*(*)())tuscany::sca::rest::rest_set_home, NULL, RSRC_CONF, - "Tuscany home directory"), - AP_INIT_TAKE1("TuscanyPath", (const char*(*)())tuscany::sca::rest::rest_set_path, NULL, ACCESS_CONF, - "Tuscany SCA composite search path"), - AP_INIT_TAKE1("TuscanyRoot", (const char*(*)())tuscany::sca::rest::rest_set_root, NULL, ACCESS_CONF, - "Tuscany root SCA configuration path"), - AP_INIT_TAKE1("TuscanyBaseURI", (const char*(*)())tuscany::sca::rest::rest_set_base_uri, NULL, ACCESS_CONF, - "Tuscany SCA system base URI"), - AP_INIT_TAKE1("TuscanyComponent", (const char*(*)())tuscany::sca::rest::rest_set_component, NULL, ACCESS_CONF, - "SCA component name"), - {NULL} - }; - - int rest_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, - server_rec *s) - { - return OK; - } - - void rest_child_init(apr_pool_t* p, server_rec* svr_rec) - { - rest_server_config_rec_t *conf = (rest_server_config_rec_t*)ap_get_module_config( - svr_rec->module_config, &sca_rest_module); - - if(false) - { - fprintf(stderr, "[Tuscany] Due to one or more errors mod_rest loading" - " failed. Causing apache2 to stop loading\n"); - exit(APEXIT_CHILDFATAL); - } - } - - void register_hooks(apr_pool_t *p) - { - ap_hook_handler(rest_handler, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_post_config(rest_init, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_child_init(rest_child_init, NULL, NULL, APR_HOOK_MIDDLE); - } - - void *rest_create_dir_config(apr_pool_t *p, char *dirspec) - { - rest_dir_config_rec_t* conf = (rest_dir_config_rec_t* )apr_palloc(p, sizeof(*conf)); - conf->path = ""; - conf->root = ""; - conf->base_uri = ""; - conf->component = ""; - return conf; - } - - void* rest_create_server_config(apr_pool_t *p, server_rec *s) - { - rest_server_config_rec_t* conf = (rest_server_config_rec_t* )apr_palloc(p, sizeof(*conf)); - conf->home = ""; - return conf; - } - - } // End namespace rest - } // End namespace sca -} // End namespace tuscany - -extern "C" -{ - - module AP_MODULE_DECLARE_DATA sca_rest_module = - { - STANDARD20_MODULE_STUFF, - tuscany::sca::rest::rest_create_dir_config, /* dir config */ - NULL, /* dir merger --- default is to override */ - tuscany::sca::rest::rest_create_server_config, /* server config */ - NULL, /* merge server config */ - tuscany::sca::rest::rest_module_cmds, /* command table */ - tuscany::sca::rest::register_hooks /* register_hooks */ - }; - -} diff --git a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.cpp b/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.cpp deleted file mode 100644 index 18720f42f5..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.cpp +++ /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. -*/ - -#include "RESTReferenceBindingExtension.h" -#include "model/RESTReferenceBinding.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/core/SCARuntime.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - -extern "C" -{ -#if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) -#endif - void tuscany_sca_rest_service_initialize() - { - tuscany::sca::rest::RESTReferenceBindingExtension::initialize(); - } -} - -namespace tuscany -{ - namespace sca - { - namespace rest - { - // =================================================================== - // Constructor for the RESTReferenceBinding class. - // =================================================================== - RESTReferenceBindingExtension::RESTReferenceBindingExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the RESTReferenceBindingExtension class. - // =================================================================== - RESTReferenceBindingExtension::~RESTReferenceBindingExtension() - { - logentry(); - } - - const string RESTReferenceBindingExtension::extensionName("rest"); - const string RESTReferenceBindingExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#RESTBinding"); - - // =================================================================== - // loadModelElement - load the info from binding.rest - // =================================================================== - ReferenceBinding* RESTReferenceBindingExtension::getReferenceBinding(Composite *composite, Reference* reference, DataObjectPtr scdlBinding) - { - string uri = scdlBinding->getCString("uri"); - - RESTReferenceBinding* referenceBinding = new RESTReferenceBinding(reference, uri); - - return referenceBinding; - } - - void RESTReferenceBindingExtension::initialize() - { - logentry(); - SCARuntime::getCurrentRuntime()->registerReferenceBindingExtension(new RESTReferenceBindingExtension()); - } - - } // End namespace rest - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.h b/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.h deleted file mode 100644 index 0d9e41841b..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTReferenceBindingExtension.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. - */ - -#ifndef tuscany_sca_extension_rest_restreferencebindingextension_h -#define tuscany_sca_extension_rest_restreferencebindingextension_h - -#include "tuscany/sca/extension/ReferenceBindingExtension.h" - -namespace tuscany -{ - namespace sca - { - namespace rest - { - - class RESTReferenceBindingExtension : public ReferenceBindingExtension - { - public: - /** - * Default constructor - */ - RESTReferenceBindingExtension(); - - /** - * Destructor - */ - virtual ~RESTReferenceBindingExtension(); - - /** - * return the name of the extension - */ - virtual const std::string& getExtensionName() {return extensionName;} - - /** - * return the QName of schema elemant for this implementation extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.rest") - */ - virtual const std::string& getExtensionTypeQName() {return typeQName;} - - virtual tuscany::sca::model::ReferenceBinding* getReferenceBinding( - tuscany::sca::model::Composite* composite, - tuscany::sca::model::Reference *reference, - commonj::sdo::DataObjectPtr scdlBinding); - - static void initialize(); - - private: - static const std::string extensionName; - static const std::string typeQName; - - }; - - - } // End namespace rest - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_rest_restreferencebindingextension_h - diff --git a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp b/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp deleted file mode 100644 index 95affe6202..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp +++ /dev/null @@ -1,567 +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 "commonj/sdo/SDO.h" - -#include "RESTServiceProxy.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/util/SDOUtils.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 "tuscany/sca/model/WSDLMessagePart.h" -#include "model/RESTReferenceBinding.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; -using namespace tuscany::sca::util; - -namespace tuscany -{ - namespace sca - { - namespace rest - { - - // ============================ - // Constructor: Create a proxy - // ============================ - RESTServiceProxy::RESTServiceProxy(Reference* reference) - : ServiceProxy(reference) - { - logentry(); - - // Get the target service wrapper - RESTReferenceBinding* referenceBinding = (RESTReferenceBinding*)reference->getBinding(); - serviceWrapper = referenceBinding->getTargetServiceBinding()->getServiceWrapper(); - - DataFactoryPtr dataFactory = reference->getComponent()->getComposite()->getDataFactory(); - try { - const Type& tempType = dataFactory->getType("http://tempuri.org", "RootType"); - } catch (SDORuntimeException&) - { - dataFactory->addType("http://tempuri.org", "RootType", false, false, false); - dataFactory->addType("http://tempuri.org", "Wrapper", false, true, false); - dataFactory->addPropertyToType( - "http://tempuri.org", "RootType", - "Wrapper", - "http://tempuri.org", "Wrapper", - false, false, true); - dataFactory->addType("http://tempuri.org", "Part", false, true, false); - dataFactory->addPropertyToType( - "http://tempuri.org", "RootType", - "Part", - "http://tempuri.org", "Part", - false, false, true); - } - } - - // ========== - // Destructor - // ========== - RESTServiceProxy::~RESTServiceProxy() - { - logentry(); - } - - /// - /// This method will be called to process an operation invocation. - /// - DataObjectPtr RESTServiceProxy::invoke(const WSDLOperation& wsdlOperation, DataObjectPtr inputDataObject) - { - logentry(); - - Reference* reference = getReference(); - Component* component = reference->getComponent(); - Composite* composite = component ->getComposite(); - - RESTReferenceBinding* referenceBinding = (RESTReferenceBinding*)reference->getBinding(); - DataFactoryPtr dataFactoryPtr = reference->getComponent()->getComposite()->getDataFactory(); - - // Since its Document wrapped, there will only be one message part - std::list partList = wsdlOperation.getOutputMessagePartNames(); - const WSDLMessagePart &part = wsdlOperation.getOutputMessagePart(partList.front()); - const char* outputTypeURI = part.getPartUri().c_str(); - const char* outputTypeName = part.getPartName().c_str(); - - loginfo("WSDLOperation input message Type: %s#%s", - wsdlOperation.getInputMessageUri().c_str(), - wsdlOperation.getInputMessageName().c_str()); - loginfo("WSDLOperation output part Type: %s#%s", - outputTypeURI, - outputTypeName); - - // Create new Operation object and set parameters and return value - Operation operation(wsdlOperation.getOperationName().c_str()); - - try - { - - // 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*; - *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::IntType: - { - long* intData = new long; - *intData = inputDataObject->getInt(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 (pl[i].isMany()) - { - DataObjectList& l = inputDataObject->getList(pl[i]); - stringData = new string(l.getCString(0)); - } - else - { - 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: - { - if (!strcmp(pl[i].getType().getURI(), SDOUtils::sdoURI) && - !strcmp(pl[i].getType().getName(), "OpenDataObject")) { - - /* - * 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* dataObjectData =new DataObjectPtr; - *dataObjectData = sequence->getDataObjectValue(0); - if(!*dataObjectData) - { - loginfo("Null DataObject parameter named %s", name); - } - else - { - (*dataObjectData)->detach(); - } - operation.addParameter(dataObjectData); - } - } - else - { - // Empty content, add an empty string - loginfo("Empty OpenDataObject parameter named %s[%d]", name, j); - string* stringData = new string(""); - operation.addParameter(stringData); - } - } - } - } - else { - DataObjectPtr* dataObjectData = new DataObjectPtr; - if (pl[i].isMany()) - { - DataObjectList& l = inputDataObject->getList((unsigned int)i); - *dataObjectData = l[0]; - } - else - { - *dataObjectData = inputDataObject->getDataObject(pl[i]); - } - if(!*dataObjectData) - { - loginfo("Null DataObject parameter named %s", name); - } - else - { - (*dataObjectData)->detach(); - } - operation.addParameter(dataObjectData); - } - } - break; - default: - { - ostringstream msg; - msg << "Unsupported param type: " << pl[i].getTypeEnum(); - throwException(SystemConfigurationException, msg.str().c_str()); - } - } - } - - // 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&) - { - try - { - - // Create the output wrapper - const Type& outputType = dataFactoryPtr->getType(outputTypeURI, outputTypeName); - outputDataObject = dataFactoryPtr->create(outputType); - } - catch (SDORuntimeException&) - { - // The output wrapper type is not known, create an open DataObject - outputDataObject = dataFactoryPtr->create("http://tempuri.org", "Wrapper"); - } - } - - setOutputData(operation, outputDataObject, dataFactoryPtr); - - return outputDataObject; - } - catch(SDORuntimeException& ex) - { - throwException(ServiceInvocationException, ex); - } - catch(TuscanyRuntimeException& ex) - { - throw; - } - } - - - void RESTServiceProxy::setOutputData(Operation& operation, DataObjectPtr outputDataObject, DataFactoryPtr dataFactoryPtr) - { - logentry(); - - // 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: - { - break; - } - } - } - else - { - loginfo("No return values 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->setInt(pl[i], *(int*)operation.getReturnValue()); - break; - } - case Operation::LONG: - { - outputDataObject->setInt(pl[i], *(long*)operation.getReturnValue()); - break; - } - case Operation::USHORT: - { - outputDataObject->setInt(pl[i], *(unsigned short*)operation.getReturnValue()); - break; - } - case Operation::UINT: - { - outputDataObject->setInt(pl[i], *(unsigned int*)operation.getReturnValue()); - break; - } - case Operation::ULONG: - { - outputDataObject->setInt(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("Null return value, 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("Null return value, leaving property %s unset", pl[i].getName()); - } - - break; - } - default: - { - break; - } - } - } - } - } - - } // End namespace rest - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.h b/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.h deleted file mode 100644 index 387add3f35..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_extension_rest_restserviceproxy_h -#define tuscany_sca_extension_rest_restserviceproxy_h - -#include "commonj/sdo/SDO.h" - -#include "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" -#include "tuscany/sca/model/WSDLOperation.h" -#include "model/RESTReferenceBinding.h" - - -namespace tuscany -{ - namespace sca - { - namespace rest - { - - /** - * 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 RESTServiceProxy : 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. - */ - RESTServiceProxy(tuscany::sca::model::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. - */ - RESTServiceProxy(tuscany::sca::model::Service* service); - - /** - * Destructor. - */ - virtual ~RESTServiceProxy(); - - /** - * Invoke the specified operation - */ - SCA_REST_SERVICE_API commonj::sdo::DataObjectPtr invoke( - const tuscany::sca::model::WSDLOperation& wsdlOperation, - commonj::sdo::DataObjectPtr inputDataObject); - - private: - - void setOutputData(Operation& operation, - commonj::sdo::DataObjectPtr outputDataObject, commonj::sdo::DataFactoryPtr dataFactoryPtr); - - /** - * The target service wrapper - */ - ServiceWrapper* serviceWrapper; - - }; - - } // End namespace rest - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_rest_restserviceproxy_h diff --git a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/export.h b/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/export.h deleted file mode 100644 index 802218a2fe..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/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_rest_service_export_h -#define tuscany_sca_rest_service_export_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) - -#ifdef TUSCANY_SCA_REST_SERVICE_EXPORTS -#define SCA_REST_SERVICE_API __declspec(dllexport) -#else -#define SCA_REST_SERVICE_API __declspec(dllimport) -#endif - -#else -#define SCA_REST_SERVICE_API -#endif - -#endif // tuscany_sca_rest_service_export_h diff --git a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.cpp b/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.cpp deleted file mode 100644 index 877ee01178..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/rest/model/RESTReferenceBinding.h" -#include "tuscany/sca/core/ServiceProxy.h" -#include "tuscany/sca/rest/RESTServiceProxy.h" - -using namespace std; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace rest - { - - // Constructor - RESTReferenceBinding::RESTReferenceBinding(Reference* reference, const string& uri) - : ReferenceBinding(reference, uri) - { - logentry(); - } - - // Destructor - RESTReferenceBinding::~RESTReferenceBinding() - { - logentry(); - } - - void RESTReferenceBinding::configure(ServiceBinding *binding) - { - logentry(); - - setTargetServiceBinding(binding); - - serviceProxy = new RESTServiceProxy(getReference()); - } - - ServiceProxy* RESTReferenceBinding::getServiceProxy() - { - logentry(); - - return serviceProxy; - } - - } // End namespace rest - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.h b/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.h deleted file mode 100644 index 22fc04c356..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/model/RESTReferenceBinding.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_extension_rest_model_restreferencebinding_h -#define tuscany_sca_extension_rest_model_restreferencebinding_h - -#include - -#include "tuscany/sca/model/ReferenceBinding.h" - -namespace tuscany -{ - namespace sca - { - namespace rest - { - /** - * Information about a web service binding for service or a reference. - */ - class RESTReferenceBinding : public tuscany::sca::model::ReferenceBinding - { - public: - - /** - * Constructor. - * @param uri The uri of the binding. - */ - RESTReferenceBinding(tuscany::sca::model::Reference* reference, const std::string& uri); - - /** - * Destructor. - */ - virtual ~RESTReferenceBinding(); - - /** - * Returns the type of binding. - */ - virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#RESTBinding"; }; - - /** - * Configure this binding from a service binding. - */ - virtual void configure(tuscany::sca::model::ServiceBinding* serviceBinding); - - /** - * Create a proxy representing the reference to the - * client component. - */ - virtual ServiceProxy* getServiceProxy(); - - private: - - /** - * The proxy representing the reference to the client - * component. - */ - ServiceProxy* serviceProxy; - }; - - } // End namespace rest - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_rest_model_restreferencebinding_h diff --git a/sca-cpp/trunk/runtime/extensions/rest/xsd/sca-binding-rest.xsd b/sca-cpp/trunk/runtime/extensions/rest/xsd/sca-binding-rest.xsd deleted file mode 100644 index ace4c54a39..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/xsd/sca-binding-rest.xsd +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/rest/xsd/sca-interface-rest.xsd b/sca-cpp/trunk/runtime/extensions/rest/xsd/sca-interface-rest.xsd deleted file mode 100644 index 30422ab038..0000000000 --- a/sca-cpp/trunk/runtime/extensions/rest/xsd/sca-interface-rest.xsd +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/ruby/Makefile.am b/sca-cpp/trunk/runtime/extensions/ruby/Makefile.am deleted file mode 100644 index 08ba2f553f..0000000000 --- a/sca-cpp/trunk/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 extension - -datadir=$(prefix)/extensions/ruby - -nobase_data_DATA = xsd/*.xsd - -EXTRA_DIST = xsd diff --git a/sca-cpp/trunk/runtime/extensions/ruby/extension/Makefile.am b/sca-cpp/trunk/runtime/extensions/ruby/extension/Makefile.am deleted file mode 100644 index 41ce75925b..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/extension/Makefile.am +++ /dev/null @@ -1,34 +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 = - -libdir=$(prefix)/extensions/ruby/lib -BUILT_SOURCES = extension_build - -EXTRA_DIST = src - -extension_build: src/Extension.cpp src/extconf.rb - cd src; ruby extconf.rb; make - touch extension_build - -clean: - cd src;make clean - rm -f extension_build - -install-exec-hook: - cp src/tuscany_sca_ruby.* $(libdir) - diff --git a/sca-cpp/trunk/runtime/extensions/ruby/extension/src/Extension.cpp b/sca-cpp/trunk/runtime/extensions/ruby/extension/src/Extension.cpp deleted file mode 100644 index 458700e5f1..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/extension/src/Extension.cpp +++ /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. - */ - -/* $Rev$ $Date$ */ - -#if defined(WIN32) || defined (_WINDOWS) -#define SCA_RUBYEXTENSION_API __declspec(dllexport) -#else -#define SCA_RUBYEXTENSION_API -#endif - -#include "tuscany/sca/ruby/Ruby.h" -#include "tuscany/sca/ruby/RubyCompositeContext.h" - -extern "C" -{ - - // Implement the Sca::locateService module function - SCA_RUBYEXTENSION_API VALUE tuscany_sca_ruby_locateService(VALUE module, VALUE value) - { - // Locate the service - const char* serviceName = rb_string_value_cstr(&value); - return tuscany::sca::ruby::RubyCompositeContext::locateService(serviceName); - } - - // Initialize the Ruby extension - SCA_RUBYEXTENSION_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_RUBYEXTENSION_API void Init_libtuscany_sca_ruby() - { - Init_tuscany_sca_ruby(); - } -} diff --git a/sca-cpp/trunk/runtime/extensions/ruby/extension/src/extconf.rb b/sca-cpp/trunk/runtime/extensions/ruby/extension/src/extconf.rb deleted file mode 100644 index 9c41843d63..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/extension/src/extconf.rb +++ /dev/null @@ -1,25 +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. -# - - require 'mkmf' - CONFIG["CC"] = "g++" - $CPPFLAGS << " -I../../src " - $LIBPATH << "../../src/.libs" - $LIBS << " -ltuscany_sca_ruby_lang " - create_makefile 'tuscany_sca_ruby' diff --git a/sca-cpp/trunk/runtime/extensions/ruby/src/Makefile.am b/sca-cpp/trunk/runtime/extensions/ruby/src/Makefile.am deleted file mode 100644 index d9310440b9..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/src/Makefile.am +++ /dev/null @@ -1,53 +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_lang.la - -install-exec-hook: - -rootdir=$(prefix)/extensions/ruby - -noinst_HEADERS = \ -tuscany/sca/ruby/*.h \ -tuscany/sca/ruby/model/*.h - -libtuscany_sca_ruby_lang_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_lang_la_LIBADD = -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \ - -L$(top_builddir)/runtime/core/src -ltuscany_sca \ - -L${RUBY_LIB} -lruby -lpthread - -INCLUDES = -Imodel -I$(top_builddir)/runtime/core/src \ - -I${TUSCANY_SDOCPP}/include \ - -I${RUBY_INCLUDE} - -moduledir=$(prefix)/extensions/ruby/module -extension = libtuscany_sca_ruby_lang$(libsuffix) - -install-exec-hook: - test -z $(moduledir) || $(mkdir_p) $(moduledir); - -rm -f $(moduledir)/$(extension) - $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/Ruby.h b/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/Ruby.h deleted file mode 100644 index a6b8ee8ffa..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.cpp b/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.cpp deleted file mode 100644 index 5554ac6756..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.cpp +++ /dev/null @@ -1,70 +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" -#include "tuscany/sca/ruby/RubyCompositeContext.h" - -using namespace std; -using namespace tuscany::sca::model; - - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - - VALUE RubyCompositeContext::locateService(const char* serviceName) - { - // Get the default component - Component* defaultComponent = tuscany::sca::SCARuntime::getCurrentRuntime()->getDefaultComponent(); - Composite* composite = (Composite*)defaultComponent->getType(); - - // Locate the service - 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 - tuscany::sca::ruby::RubyServiceProxy* serviceProxy = new tuscany::sca::ruby::RubyServiceProxy(service); - - // Return the Ruby proxy value object - return serviceProxy->getProxyValue(); - } - - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.h b/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.h deleted file mode 100644 index 2414b66fb1..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyCompositeContext.h +++ /dev/null @@ -1,50 +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_RubyCompositeContext_h -#define tuscany_sca_ruby_RubyCompositeContext_h - -#include "tuscany/sca/ruby/Ruby.h" -#include "tuscany/sca/ruby/export.h" - - - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - - class RubyCompositeContext - { - public: - SCA_RUBY_API static VALUE locateService(const char* serviceName); - - }; - - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_ruby_RubyCompositeContext_h - diff --git a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.cpp b/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.cpp deleted file mode 100644 index 5789517cfd..0000000000 --- a/sca-cpp/trunk/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" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - -extern "C" -{ -#if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) -#endif - void tuscany_sca_ruby_lang_initialize() - { - tuscany::sca::ruby::RubyExtension::initialize(); - } -} - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - // =================================================================== - // Constructor for the RubyExtension class. - // =================================================================== - RubyExtension::RubyExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the RubyExtension class. - // =================================================================== - RubyExtension::~RubyExtension() - { - logentry(); - } - - void RubyExtension::initialize() - { - logentry(); - SCARuntime::getCurrentRuntime()->registerImplementationExtension(new RubyImplementationExtension()); - } - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.h b/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyExtension.h deleted file mode 100644 index 232431ca1e..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.cpp b/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.cpp deleted file mode 100644 index aa416f139a..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.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/ruby/RubyImplementationExtension.h" -#include "tuscany/sca/ruby/model/RubyImplementation.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - // =================================================================== - // Constructor for the RubyImplementationExtension class. - // =================================================================== - RubyImplementationExtension::RubyImplementationExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the RubyImplementationExtension class. - // =================================================================== - RubyImplementationExtension::~RubyImplementationExtension() - { - logentry(); - } - - 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) - { - logentry(); - - 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; - } - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.h b/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.h deleted file mode 100644 index 79d9ed2dbe..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyImplementationExtension.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_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 std::string& getExtensionName() {return extensionName;} - - /** - * return the QName of schema elemant for this implementation extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#implementation.ruby") - */ - virtual const std::string& getExtensionTypeQName() {return typeQName;} - - virtual tuscany::sca::model::ComponentType* getImplementation( - tuscany::sca::model::Composite* composite, - commonj::sdo::DataObjectPtr scdlImplementation); - - private: - static const std::string extensionName; - static const std::string typeQName; - - }; - - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_ruby_rubyimplementationextension_h - diff --git a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp b/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp deleted file mode 100644 index d830cd92de..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp +++ /dev/null @@ -1,384 +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/ruby/RubyServiceProxy.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/core/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" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - -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(); - - // ---------------------- - // 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(); - } - - // ============================ - // Constructor: Create a proxy - // ============================ - RubyServiceProxy::RubyServiceProxy(Service* service) - : ServiceProxy(0) - { - logentry(); - - // ---------------------- - // Get the component - // ---------------------- - component = service->getComponent(); - string name = service->getType()->getName(); - - // Get the service wrapper - serviceWrapper = service->getBinding()->getServiceWrapper(); - - // Create the Ruby proxy - createProxy(); - } - - // ========== - // Destructor - // ========== - RubyServiceProxy::~RubyServiceProxy() - { - logentry(); - } - - void RubyServiceProxy::createProxy() - { - logentry(); - - // 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) - { - logentry(); - - // 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)); - - loginfo("Converting Ruby Rexml document to SDO DataObject: %s", str.c_str()); - - Composite* composite = getReference()->getComponent()->getComposite(); - commonj::sdo::XMLHelperPtr xmlHelper = composite->getXMLHelper(); - commonj::sdo::XMLDocumentPtr xmlDoc = xmlHelper->load(str.c_str()); - - DataObjectPtr dob; - if (xmlDoc != NULL) - { - dob = xmlDoc->getRootDataObject(); - } - if (dob != NULL) - { - DataObjectPtr* dataObjectData = new DataObjectPtr; - *dataObjectData = dob; - operation.addParameter(dataObjectData); - } - 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::XMLHelperPtr xmlHelper = composite->getXMLHelper(); - char* str = xmlHelper->save( - dob, - dob->getType().getURI(), - dob->getType().getName()); - - loginfo("Converting SDO DataObject to Ruby Rexml document: %s", str); - - VALUE vstr[1]; - vstr[0] = rb_str_new2(str); - - value = rb_class_new_instance(1, vstr, RubyImplementation::getXMLDocumentClass()); - break; - } - default: - { - value = Qnil; - break; - } - } - - 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/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.h b/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.h deleted file mode 100644 index e6c37cf1da..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.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 tuscany_sca_ruby_rubyserviceproxy_h -#define tuscany_sca_ruby_rubyserviceproxy_h - -#include "tuscany/sca/ruby/Ruby.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" - - -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(tuscany::sca::model::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(tuscany::sca::model::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 - */ - tuscany::sca::model::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/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp b/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp deleted file mode 100644 index db6bc07b7e..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp +++ /dev/null @@ -1,794 +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 "commonj/sdo/SDO.h" - -#include "tuscany/sca/ruby/RubyServiceWrapper.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/Exceptions.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" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - - class RubyServiceInvocation - { - public: - VALUE instance; - ID method; - int argc; - const VALUE* argv; - }; - } - } -} - -extern "C" -{ - - static VALUE safe_rb_funcall(VALUE value) - { - tuscany::sca::ruby::RubyServiceInvocation* call = (tuscany::sca::ruby::RubyServiceInvocation*)value; - if (call->argc == 0) - { - VALUE result = rb_funcall(call->instance, call->method, 0); - return result; - } - else - { - VALUE result = rb_funcall2(call->instance, call->method, call->argc, call->argv); - return result; - } - } - -} - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - - // =========== - // Constructor - // =========== - RubyServiceWrapper::RubyServiceWrapper(Service* service) - : ServiceWrapper(service) - { - logentry(); - - component = service->getComponent(); - implementation = (RubyImplementation*)component->getType(); - interf = service->getType()->getInterface(); - } - - // ========== - // Destructor - // ========== - RubyServiceWrapper::~RubyServiceWrapper() - { - logentry(); - } - - // ====================================================================== - // invoke: wrapper call to service with setting the component context - // ====================================================================== - void RubyServiceWrapper::invoke(Operation& operation) - { - logentry(); - - SCARuntime* runtime = SCARuntime::getCurrentRuntime(); - 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::XMLHelperPtr xmlHelper = composite->getXMLHelper(); - char* str = xmlHelper->save( - dob, - dob->getType().getURI(), - dob->getType().getName()); - - loginfo("Converting SDO DataObject to Ruby Rexml document: %s", str); - - VALUE vstr[1]; - vstr[0] = rb_str_new2(str); - - value = rb_class_new_instance(1, vstr, RubyImplementation::getXMLDocumentClass()); - break; - } - default: - { - ostringstream msg; - msg << "Operation parameter type not supported: " << parmType; - throwException(ServiceDataException, msg.str().c_str()); - } - } - - args[i] = value; - } - } - - - // Invoke the specified method - RubyServiceInvocation call; - call.instance = instance; - call.method = method; - call.argc = n; - call.argv = args; - int error = 0; - VALUE result = rb_protect(safe_rb_funcall, (VALUE)&call, &error); - if (error) - { - // Convert a Ruby error to a C++ exception - VALUE lasterr = rb_gv_get("$!"); - ostringstream msg; - - // class - VALUE klass = rb_class_path(CLASS_OF(lasterr)); - msg << "Ruby Exception " << RSTRING(klass)->ptr << ": "; - - // message - VALUE message = rb_obj_as_string(lasterr); - msg << RSTRING(message)->ptr << endl; - - // backtrace - if(!NIL_P(ruby_errinfo)) { - VALUE ary = rb_funcall(ruby_errinfo, rb_intern("backtrace"), 0); - int c; - for (c=0; clen; c++) { - msg << "from " << RSTRING(RARRAY(ary)->ptr[c])->ptr << endl; - } - } - throwException(ServiceInvocationException, msg.str().c_str()); - } - - // 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)); - - loginfo("Converting Ruby Rexml document to SDO DataObject: %s", str.c_str()); - - Composite* composite = component->getComposite(); - commonj::sdo::XMLHelperPtr xmlHelper = composite->getXMLHelper(); - commonj::sdo::XMLDocumentPtr xmlDoc = xmlHelper->load(str.c_str()); - - DataObjectPtr* dataObjectData = new DataObjectPtr; - if (xmlDoc != NULL) - { - *dataObjectData = xmlDoc->getRootDataObject(); - } - else - { - *dataObjectData = NULL; - } - if (*dataObjectData != NULL) - { - operation.setReturnValue(dataObjectData); - } - else - { - string msg = "Document could not be converted to a DataObject"; - throwException(ServiceDataException, msg.c_str()); - } - } - else - { - string msg = "Ruby type not supported: " + resultType; - throwException(ServiceDataException, msg.c_str()); - } - break; - } - default: - { - string msg = "Ruby type not supported: " + resultType; - throwException(ServiceDataException, msg.c_str()); - } - } - - } - catch (...) - { - runtime->unsetCurrentComponent(); - throw; - } - - runtime->unsetCurrentComponent(); - } - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.h b/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.h deleted file mode 100644 index 2526084a72..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.h +++ /dev/null @@ -1,94 +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/ruby/export.h" -#include "tuscany/sca/ruby/Ruby.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" - - -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(tuscany::sca::model::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. - */ - tuscany::sca::model::Component* component; - - /** - * A pointer to the interface which the service exposes. - */ - tuscany::sca::model::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/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/export.h b/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/export.h deleted file mode 100644 index 5db72a1ebe..0000000000 --- a/sca-cpp/trunk/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_LANG_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/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.cpp b/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.cpp deleted file mode 100644 index fa30642318..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.cpp +++ /dev/null @@ -1,171 +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" - -using namespace std; -using namespace tuscany::sca::model; - -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() - { - } - - VALUE RubyImplementation::getXMLDocumentClass() - { - logentry(); - - // 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; - } - - return xmlDocumentClass; - } - - void RubyImplementation::loadClass() - { - logentry(); - - // Ensure xmlDocumentClass is initialized - getXMLDocumentClass(); - - ID to_s = rb_intern("to_s"); - VALUE xstr = rb_funcall(xmlDocumentClass, to_s, 0); - loginfo("Got Ruby Rexml class: %s", rb_string_value_cstr(&xstr)); - - // Load the specified Ruby script - if (script != "") - { - // Convert any windows slashes \ in the root path to unix slashes / - 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/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.h b/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.h deleted file mode 100644 index c7bc851635..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyImplementation.h +++ /dev/null @@ -1,136 +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 - -#include "tuscany/sca/ruby/Ruby.h" -#include "tuscany/sca/model/ComponentType.h" - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - /** - * Holds information about an SCA implementation written in Ruby - */ - class RubyImplementation : public tuscany::sca::model::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(tuscany::sca::model::Composite* composite, - const std::string& module, const std::string& className, const std::string& script); - - /** - * Destructor - */ - virtual ~RubyImplementation(); - - /** - * Initialize a component of this type. - * @param component The component to initialize. - */ - virtual void initializeComponent(tuscany::sca::model::Component* component); - - /** - * Returns the name of the Ruby module. - * @return The name of the Ruby module. - */ - const std::string& getModule() const { return module; } - - /** - * Returns the name of Ruby class. - * @return Name of the Ruby class. - */ - const std::string& getClass() const { return className; } - - /** - * Returns the path of the Ruby script. - * @return The path of the Ruby script. - */ - const std::string& getScript() const { return script; } - - /** - * Returns the Ruby implementation class - */ - VALUE getImplementationClass() const { return implementationClass; } - - /** - * Returns the Ruby REXML::Document class - */ - static VALUE getXMLDocumentClass(); - - private: - - /** - * Load the Ruby implementation class - */ - void loadClass(); - - /** - * Name of the Ruby module. - */ - std::string module; - - /** - * Name of the Ruby class. - */ - std::string className; - - /** - * Path of the Ruby script. - */ - std::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/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.cpp b/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.cpp deleted file mode 100644 index 3187c07973..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.cpp +++ /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. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/ruby/model/RubyReferenceBinding.h" -#include "tuscany/sca/ruby/RubyServiceProxy.h" - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - - // Constructor - RubyReferenceBinding::RubyReferenceBinding(Reference* reference) - : ReferenceBinding(reference, ""), serviceProxy(NULL) - { - } - - // Destructor - RubyReferenceBinding::~RubyReferenceBinding() - { - } - - ServiceProxy* RubyReferenceBinding::getServiceProxy() - { - return serviceProxy; - } - - void RubyReferenceBinding::configure(ServiceBinding* binding) - { - setTargetServiceBinding(binding); - - serviceProxy = new RubyServiceProxy(getReference()); - } - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.h b/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.h deleted file mode 100644 index 72d39b5639..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyReferenceBinding.h +++ /dev/null @@ -1,83 +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 - -#include "tuscany/sca/model/ReferenceBinding.h" - - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - /** - * Information about a Ruby service binding for service or a reference. - */ - class RubyReferenceBinding : public tuscany::sca::model::ReferenceBinding - { - public: - - /** - * Constructor. - */ - RubyReferenceBinding(tuscany::sca::model::Reference* reference); - - /** - * Destructor. - */ - virtual ~RubyReferenceBinding(); - - /** - * Returns the type of binding. - */ - virtual std::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(tuscany::sca::model::ServiceBinding* serviceBinding); - - private: - - /** - * The proxy representing the reference to the client - * component. - */ - ServiceProxy* serviceProxy; - }; - - } // End namespace ruby - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_ruby_model_rubyreferencebinding_h diff --git a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.cpp b/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.cpp deleted file mode 100644 index 163f8a9d8b..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.cpp +++ /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. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/ruby/model/RubyServiceBinding.h" -#include "tuscany/sca/ruby/RubyServiceWrapper.h" - -using namespace tuscany::sca::model; - -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/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.h b/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.h deleted file mode 100644 index b772daf712..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/src/tuscany/sca/ruby/model/RubyServiceBinding.h +++ /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$ */ - - -#ifndef tuscany_sca_ruby_model_rubyservicebinding_h -#define tuscany_sca_ruby_model_rubyservicebinding_h - -#include - -#include "tuscany/sca/model/ServiceBinding.h" - -namespace tuscany -{ - namespace sca - { - namespace ruby - { - /** - * Information about a Ruby service binding for service or a reference. - */ - class RubyServiceBinding : public tuscany::sca::model::ServiceBinding - { - public: - - /** - * Constructor. - */ - RubyServiceBinding(tuscany::sca::model::Service* service); - - /** - * Destructor. - */ - virtual ~RubyServiceBinding(); - - /** - * Returns the type of binding. - */ - virtual std::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/sca-cpp/trunk/runtime/extensions/ruby/xsd/sca-implementation-ruby.xsd b/sca-cpp/trunk/runtime/extensions/ruby/xsd/sca-implementation-ruby.xsd deleted file mode 100644 index 5772019a4f..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ruby/xsd/sca-implementation-ruby.xsd +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/sca/Makefile.am b/sca-cpp/trunk/runtime/extensions/sca/Makefile.am deleted file mode 100644 index 50dfb45557..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/sca/reference/Makefile.am b/sca-cpp/trunk/runtime/extensions/sca/reference/Makefile.am deleted file mode 100644 index 2b9491ec1c..0000000000 --- a/sca-cpp/trunk/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 = src diff --git a/sca-cpp/trunk/runtime/extensions/sca/reference/src/Makefile.am b/sca-cpp/trunk/runtime/extensions/sca/reference/src/Makefile.am deleted file mode 100644 index d5fdf775ca..0000000000 --- a/sca-cpp/trunk/runtime/extensions/sca/reference/src/Makefile.am +++ /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. - -libdir=$(prefix)/extensions/sca/reference/lib -lib_LTLIBRARIES = libtuscany_sca_binding_reference.la - -noinst_HEADERS = \ -tuscany/sca/binding/*.h \ -tuscany/sca/binding/model/*.h - -libtuscany_sca_binding_reference_la_SOURCES = \ -tuscany/sca/binding/SCAServiceBindingExtension.cpp \ -tuscany/sca/binding/model/SCAServiceBinding.cpp - -libtuscany_sca_binding_reference_la_LIBADD = \ - -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo -ltuscany_sdo_axiom \ - -L$(top_builddir)/runtime/core/src -ltuscany_sca - -INCLUDES = -I$(top_builddir)/runtime/core/src \ - -I${TUSCANY_SDOCPP}/include - -moduledir=$(prefix)/extensions/sca/reference/module -extension = libtuscany_sca_binding_reference$(libsuffix) - -install-exec-hook: - test -z $(moduledir) || $(mkdir_p) $(moduledir); - -rm -f $(moduledir)/$(extension) - $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp b/sca-cpp/trunk/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp deleted file mode 100644 index 7d70f595cc..0000000000 --- a/sca-cpp/trunk/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.cpp +++ /dev/null @@ -1,103 +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 "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/core/Exceptions.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - -extern "C" -{ -#if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) -#endif - void tuscany_sca_binding_reference_initialize() - { - tuscany::sca::binding::SCAServiceBindingExtension::initialize(); - } -} - - -namespace tuscany -{ - namespace sca - { - namespace binding - { - // =================================================================== - // Constructor for the SCAServiceBinding class. - // =================================================================== - SCAServiceBindingExtension::SCAServiceBindingExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the SCAServiceBindingExtension class. - // =================================================================== - SCAServiceBindingExtension::~SCAServiceBindingExtension() - { - logentry(); - } - - const string SCAServiceBindingExtension::extensionName("sca"); - const string SCAServiceBindingExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#SCABinding"); - - - // =================================================================== - // loadModelElement - load the info from binding.ws - // =================================================================== - ServiceBinding* SCAServiceBindingExtension::getServiceBinding(Composite *composite, Service* service, DataObjectPtr scdlBinding) - { - logentry(); - - SCARuntime* runtime = SCARuntime::getCurrentRuntime(); - - ServiceBindingExtension* bindingExtension = NULL; // runtime->getServiceBindingExtension("http://www.osoa.org/xmlns/sca/1.0#RESTBinding"); - if (bindingExtension == NULL) - { - bindingExtension = runtime->getServiceBindingExtension("http://www.osoa.org/xmlns/sca/1.0#WebServiceBinding"); - if (bindingExtension == NULL) - { - logerror("SCA default binding requires the REST or WS binding to be available"); - - string message = "SCA default binding requires the REST or WS binding to be available"; - throwException(SystemConfigurationException, message.c_str()); - } - } - - return bindingExtension->getServiceBinding(composite, service, scdlBinding); - } - - void SCAServiceBindingExtension::initialize() - { - logentry(); - SCARuntime::getCurrentRuntime()->registerServiceBindingExtension(new SCAServiceBindingExtension()); - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.h b/sca-cpp/trunk/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.h deleted file mode 100644 index 389541061a..0000000000 --- a/sca-cpp/trunk/runtime/extensions/sca/reference/src/tuscany/sca/binding/SCAServiceBindingExtension.h +++ /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$ */ - -#ifndef tuscany_sca_extension_binding_scaservicebindingextension_h -#define tuscany_sca_extension_binding_scaservicebindingextension_h - -#include "tuscany/sca/extension/ServiceBindingExtension.h" - -namespace tuscany -{ - namespace sca - { - namespace binding - { - - class SCAServiceBindingExtension : public ServiceBindingExtension - { - public: - /** - * Default constructor - */ - SCAServiceBindingExtension(); - - /** - * Destructor - */ - virtual ~SCAServiceBindingExtension(); - - /** - * return the name of the extension - */ - virtual const std::string& getExtensionName() {return extensionName;} - - /** - * return the QName of schema elemant for this implementation extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.ws") - */ - virtual const std::string& getExtensionTypeQName() {return typeQName;} - - virtual tuscany::sca::model::ServiceBinding* getServiceBinding( - tuscany::sca::model::Composite* composite, - tuscany::sca::model::Service* service, - commonj::sdo::DataObjectPtr scdlBinding); - - static void initialize(); - - private: - static const std::string extensionName; - static const std::string typeQName; - - }; - - - } // End namespace binding - } // End namespace sca -} // End namespace tuscany - -#endif //tuscany_sca_extension_binding_scaservicebindingextension_h - diff --git a/sca-cpp/trunk/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.cpp b/sca-cpp/trunk/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.cpp deleted file mode 100644 index 3b5564a765..0000000000 --- a/sca-cpp/trunk/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.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/core/Exceptions.h" -#include "tuscany/sca/binding/model/SCAServiceBinding.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace binding - { - - // Constructor - SCAServiceBinding::SCAServiceBinding(Composite* composite, Service* service, const string& uri, DataObjectPtr scdlBinding) - : ServiceBinding(service, uri) - { - } - - // Destructor - SCAServiceBinding::~SCAServiceBinding() - { - } - - ServiceWrapper* SCAServiceBinding::getServiceWrapper() - { - logentry(); - - throwException(SystemConfigurationException, "Not supported"); - } - - } // End namespace binding - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.h b/sca-cpp/trunk/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.h deleted file mode 100644 index d73a10f202..0000000000 --- a/sca-cpp/trunk/runtime/extensions/sca/reference/src/tuscany/sca/binding/model/SCAServiceBinding.h +++ /dev/null @@ -1,76 +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 - -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/model/ServiceBinding.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Service.h" - - -namespace tuscany -{ - namespace sca - { - namespace binding - { - /** - * Information about an SCA service binding for service or a reference. - */ - class SCAServiceBinding : public tuscany::sca::model::ServiceBinding - { - public: - - /** - * Constructor. - * @param uri The uri of the binding. - */ - SCAServiceBinding(tuscany::sca::model::Composite* composite, tuscany::sca::model::Service* service, const std::string& uri, commonj::sdo::DataObjectPtr scdlBinding); - - /** - * Destructor. - */ - virtual ~SCAServiceBinding(); - - /** - * Returns the type of binding. - */ - virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#SCABinding"; }; - - /** - * Create a service wrapper handling the interaction - * with the service configured with this binding. - */ - virtual tuscany::sca::ServiceWrapper* getServiceWrapper(); - - private: - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_ws_model_wsservicebinding_h diff --git a/sca-cpp/trunk/runtime/extensions/sca/service/Makefile.am b/sca-cpp/trunk/runtime/extensions/sca/service/Makefile.am deleted file mode 100644 index 2b9491ec1c..0000000000 --- a/sca-cpp/trunk/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 = src diff --git a/sca-cpp/trunk/runtime/extensions/sca/service/src/Makefile.am b/sca-cpp/trunk/runtime/extensions/sca/service/src/Makefile.am deleted file mode 100644 index 1136dba677..0000000000 --- a/sca-cpp/trunk/runtime/extensions/sca/service/src/Makefile.am +++ /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. - -libdir=$(prefix)/extensions/sca/service/lib -lib_LTLIBRARIES = libtuscany_sca_binding_service.la - -noinst_HEADERS = \ -tuscany/sca/binding/*.h \ -tuscany/sca/binding/model/*.h - -libtuscany_sca_binding_service_la_SOURCES = \ -tuscany/sca/binding/SCAReferenceBindingExtension.cpp \ -tuscany/sca/binding/model/SCAReferenceBinding.cpp - -libtuscany_sca_binding_service_la_LIBADD = \ - -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo -ltuscany_sdo_axiom \ - -L$(top_builddir)/runtime/core/src -ltuscany_sca - -INCLUDES = -I$(top_builddir)/runtime/core/src \ - -I${TUSCANY_SDOCPP}/include - -moduledir=$(prefix)/extensions/sca/service/module -extension = libtuscany_sca_binding_service$(libsuffix) - -install-exec-hook: - test -z $(moduledir) || $(mkdir_p) $(moduledir); - -rm -f $(moduledir)/$(extension) - $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp b/sca-cpp/trunk/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp deleted file mode 100644 index 789d8794df..0000000000 --- a/sca-cpp/trunk/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.cpp +++ /dev/null @@ -1,103 +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" -#include "tuscany/sca/core/Exceptions.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - -extern "C" -{ -#if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) -#endif - void tuscany_sca_binding_service_initialize() - { - tuscany::sca::binding::SCAReferenceBindingExtension::initialize(); - } -} - -namespace tuscany -{ - namespace sca - { - namespace binding - { - // =================================================================== - // Constructor for the SCAReferenceBinding class. - // =================================================================== - SCAReferenceBindingExtension::SCAReferenceBindingExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the SCAReferenceBindingExtension class. - // =================================================================== - SCAReferenceBindingExtension::~SCAReferenceBindingExtension() - { - logentry(); - } - - const string SCAReferenceBindingExtension::extensionName("sca"); - const string SCAReferenceBindingExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#SCABinding"); - - // =================================================================== - // loadModelElement - load the info from binding.ws - // =================================================================== - ReferenceBinding* SCAReferenceBindingExtension::getReferenceBinding(Composite *composite, Reference* reference, DataObjectPtr scdlBinding) - { - logentry(); - - SCARuntime* runtime = SCARuntime::getCurrentRuntime(); - - ReferenceBindingExtension* bindingExtension = NULL; // runtime->getReferenceBindingExtension("http://www.osoa.org/xmlns/sca/1.0#RESTBinding"); - if (bindingExtension == NULL) - { - bindingExtension = runtime->getReferenceBindingExtension("http://www.osoa.org/xmlns/sca/1.0#WebServiceBinding"); - if (bindingExtension == NULL) - { - logerror("SCA default binding requires the REST or WS binding to be available"); - - string message = "SCA default binding requires the REST or WS binding to be available"; - throwException(SystemConfigurationException, message.c_str()); - } - } - - return bindingExtension->getReferenceBinding(composite, reference, scdlBinding); - } - - void SCAReferenceBindingExtension::initialize() - { - logentry(); - SCARuntime::getCurrentRuntime()->registerReferenceBindingExtension(new SCAReferenceBindingExtension()); - } - - } // End namespace binding - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.h b/sca-cpp/trunk/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.h deleted file mode 100644 index 8cde2fbef4..0000000000 --- a/sca-cpp/trunk/runtime/extensions/sca/service/src/tuscany/sca/binding/SCAReferenceBindingExtension.h +++ /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$ */ - -#ifndef tuscany_sca_extension_binding_scareferencebindingextension_h -#define tuscany_sca_extension_binding_scareferencebindingextension_h - -#include "tuscany/sca/extension/ReferenceBindingExtension.h" - -namespace tuscany -{ - namespace sca - { - namespace binding - { - - class SCAReferenceBindingExtension : public ReferenceBindingExtension - { - public: - /** - * Default constructor - */ - SCAReferenceBindingExtension(); - - /** - * Destructor - */ - virtual ~SCAReferenceBindingExtension(); - - /** - * return the name of the extension - */ - virtual const std::string& getExtensionName() {return extensionName;} - - /** - * return the QName of schema elemant for this implementation extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.ws") - */ - virtual const std::string& getExtensionTypeQName() {return typeQName;} - - virtual tuscany::sca::model::ReferenceBinding* getReferenceBinding( - tuscany::sca::model::Composite* composite, - tuscany::sca::model::Reference *reference, - commonj::sdo::DataObjectPtr scdlBinding); - - static void initialize(); - - private: - static const std::string extensionName; - static const std::string typeQName; - - }; - - - } // End namespace binding - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_binding_scareferencebindingextension_h - diff --git a/sca-cpp/trunk/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp b/sca-cpp/trunk/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp deleted file mode 100644 index b8eaaaa1f9..0000000000 --- a/sca-cpp/trunk/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.cpp +++ /dev/null @@ -1,66 +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/Exceptions.h" -#include "tuscany/sca/binding/model/SCAReferenceBinding.h" -#include "tuscany/sca/core/ServiceProxy.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace binding - { - - // Constructor - SCAReferenceBinding::SCAReferenceBinding(Composite* composite, Reference* reference, const string& uri, DataObjectPtr scdlBinding) - : ReferenceBinding(reference, uri) - { - } - - // Destructor - SCAReferenceBinding::~SCAReferenceBinding() - { - } - - ServiceProxy* SCAReferenceBinding::getServiceProxy() - { - throwException(SystemConfigurationException, "Not supported"); - } - - void SCAReferenceBinding::configure(ServiceBinding* serviceBinding) - { - throwException(SystemConfigurationException, "Not supported"); - } - - void SCAReferenceBinding::configure(const std::string& uri) - { - throwException(SystemConfigurationException, "Not supported"); - } - - } // End namespace binding - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.h b/sca-cpp/trunk/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.h deleted file mode 100644 index f3e699e2ee..0000000000 --- a/sca-cpp/trunk/runtime/extensions/sca/service/src/tuscany/sca/binding/model/SCAReferenceBinding.h +++ /dev/null @@ -1,85 +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 - -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/ReferenceBinding.h" -#include "tuscany/sca/model/ServiceBinding.h" -#include "tuscany/sca/core/ServiceProxy.h" - -namespace tuscany -{ - namespace sca - { - namespace binding - { - /** - * Information about a web service binding for service or a reference. - */ - class SCAReferenceBinding : public tuscany::sca::model::ReferenceBinding - { - public: - - /** - * Constructor. - * @param uri The uri of the binding. - */ - SCAReferenceBinding(tuscany::sca::model::Composite* composite, tuscany::sca::model::Reference* reference, const std::string&uri, commonj::sdo::DataObjectPtr scdlBinding); - - /** - * Destructor. - */ - virtual ~SCAReferenceBinding(); - - /** - * Returns the type of binding. - */ - virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#SCABinding"; }; - - /** - * Create a proxy representing the reference to the - * client component. - */ - virtual tuscany::sca::ServiceProxy* getServiceProxy(); - - /** - * Configure this binding from a service binding. - */ - virtual void configure(tuscany::sca::model::ServiceBinding* serviceBinding); - - /** - * Configure this binding from a URI. - */ - virtual void configure(const std::string& uri); - - private: - - }; - - } // End namespace binding - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_binding_model_scareferencebinding_h diff --git a/sca-cpp/trunk/runtime/extensions/sca/xsd/sca-binding-sca.xsd b/sca-cpp/trunk/runtime/extensions/sca/xsd/sca-binding-sca.xsd deleted file mode 100644 index 6ec18bd992..0000000000 --- a/sca-cpp/trunk/runtime/extensions/sca/xsd/sca-binding-sca.xsd +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/ws/Makefile.am b/sca-cpp/trunk/runtime/extensions/ws/Makefile.am deleted file mode 100644 index 806786ce04..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/ws/reference/Makefile.am b/sca-cpp/trunk/runtime/extensions/ws/reference/Makefile.am deleted file mode 100644 index 18e9ba89b9..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/Makefile.am b/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/Makefile.am deleted file mode 100644 index 2b9491ec1c..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/Makefile.am b/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/Makefile.am deleted file mode 100644 index fbf304f8c2..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/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/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 - -moduledir=$(prefix)/extensions/ws/reference/module -extension = libtuscany_sca_ws_reference$(libsuffix) - -install-exec-hook: - test -z $(moduledir) || $(mkdir_p) $(moduledir); - -rm -f $(moduledir)/$(extension) - $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.cpp b/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.cpp deleted file mode 100644 index fa55c049b7..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.cpp +++ /dev/null @@ -1,820 +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 - -#include "Axis2Client.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/util/SDOUtils.h" -#include "model/WSServiceBinding.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/core/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 "tuscany/sca/model/WSDLMessagePart.h" - -using namespace std; -using namespace commonj::sdo; -using namespace commonj::sdo_axiom; -using namespace tuscany::sca::model; -using namespace tuscany::sca::util; - - -namespace tuscany -{ - namespace sca - { - namespace ws - { - - Axis2Client::Axis2Client(CompositeReference* compositeReference) - : compositeReference(compositeReference) - { - logentry(); - } - - Axis2Client::~Axis2Client() - { - logentry(); - } - - void Axis2Client::invoke(tuscany::sca::Operation& operation) - { - logentry(); - - // Initialize Axis2 stuff - axis2_env_t *env = axis2_env_create_all("tuscany_ws_reference.log",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) - { - string msg = "WSDL not found for " + wsdlNamespace; - throwException(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&) - { - 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) - { - string msg = "WSDL not found for " + wsdlNamespace; - throwException(SystemConfigurationException, msg.c_str()); - } - - try - { - wsdlOperation = wsdl->findOperation(wsdlInterface->getName(), operationName); - } - catch(SystemConfigurationException&) - { - throw; - } - } - } - } - - if (wsdlNamespace == "") - { - - // Create a default document literal wrapped WSDL operation - WSDLMessagePart inputPart(operationName, "", "http://tempuri.org"); - WSDLMessagePart outputPart((operationName+"Response"), "", "http://tempuri.org"); - 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.setInputEncoded(false); - wsdlOperation.setOutputEncoded(false); - wsdlOperation.setInputMessagePart(operationName, inputPart); - wsdlOperation.setOutputMessagePart((operationName+"Response"), outputPart); - } - else if (!wsdlOperation.isDocumentStyle() || !wsdlOperation.isWrappedStyle()) - { - throwException(ServiceInvocationException, - "Only wrapped document style WSDL operations are currentlysupported"); - } - - // The URI specified in the binding overrides the address specified in - // the WSDL - axis2_char_t* address; - - // Get the URI configured on the top level component - string bindingURI = ""; - SCARuntime* runtime = SCARuntime::getCurrentRuntime(); - Component* component = runtime->getDefaultComponent(); - Reference* reference = component->findReference(compositeReference->getName()); - if (reference != NULL) - { - ReferenceBinding* referenceBinding = reference->getBinding(); - if (referenceBinding != NULL && referenceBinding->getURI() != "") - { - bindingURI = referenceBinding->getURI(); - } - } - if (bindingURI == "") - { - // Get the URI configured on the binding - if (binding->getURI() != "") - { - bindingURI = binding->getURI(); - } - } - if (bindingURI != "") - { - // Prepend the default base URI if the URI is not absolute - if (bindingURI.find("://") == string::npos) - { - bindingURI = runtime->getDefaultBaseURI() + string("/axis2/services/") + bindingURI; - } - address = (axis2_char_t*)bindingURI.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(); - - // 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); - AXIS2_OPTIONS_SET_XML_PARSER_RESET(options, env, AXIS2_FALSE); - - loginfo("WS SOAP action: %s", soap_action); - loginfo("WS Endpoint address: %s", address); - if(soap_version == AXIOM_SOAP11) - { - // Only set the SOAP action when using SOAP1.1 - AXIS2_OPTIONS_SET_SOAP_ACTION(options, env, soap_action); - loginfo("Set soap version: 1.1"); - } - else if(soap_version == AXIOM_SOAP12) - { - loginfo("Set soap version: 1.2"); - } - else - { - loginfo("Set soap version: unset"); - } - /* Create service client */ - - axis2_char_t* client_home = AXIS2_GETENV("AXIS2C_HOME"); - if (!client_home) - { - throwException(SystemConfigurationException, "AXIS2C_HOME not set"); - } - axis2_svc_client_t* svc_client = axis2_svc_client_create(env, client_home); - if (!svc_client) - { - ostringstream msg; - msg << "Axis2 svc_client_create failed, error: " << env->error->error_number << - ", " << AXIS2_ERROR_GET_MESSAGE(env->error); - throwException(SystemConfigurationException, msg.str().c_str()); - } - - /* Set service client options */ - AXIS2_SVC_CLIENT_SET_OPTIONS(svc_client, env, options); - - /* Engage addressing module */ - AXIS2_SVC_CLIENT_ENGAGE_MODULE(svc_client, env, AXIS2_MODULE_ADDRESSING); - - loginfo("Sending WS request"); - /* 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); - - // Set return value - now need to detach the node from the Axiom document - // for clean-up - axiom_document_t *document = AXIOM_NODE_GET_DOCUMENT(ret_node, env); - if (document) - { - AXIOM_DOCUMENT_BUILD_ALL (document, env); - } - AXIOM_NODE_DETACH (ret_node, env); - } - else - { - ostringstream msg; - msg << "Axis2 client_send_received failed, error: " << env->error->error_number << - ", " << AXIS2_ERROR_GET_MESSAGE(env->error); - throwException(ServiceInvocationException, msg.str().c_str()); - } - - if (svc_client) - { - AXIS2_SVC_CLIENT_FREE(svc_client, env); - svc_client = NULL; - } - - if(env) - { - axis2_env_free((axis2_env_t *) env); - env = NULL; - } - loginfo("Freed env"); - - } - - axiom_node_t* Axis2Client::createPayload(Operation& operation, - const WSDLOperation& wsdlOperation, - axis2_env_t* env) - { - logentry(); - - axiom_node_t* request_node = NULL; - - // 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; - string inputTypeUri; - string inputTypeName; - - try - { - // Since its Document wrapped, there will only be one part - std::list partList = wsdlOperation.getInputMessagePartNames(); - const WSDLMessagePart &inputMessage = - wsdlOperation.getInputMessagePart(partList.front()); - inputTypeName = inputMessage.getPartType(); - inputTypeUri = inputMessage.getPartUri(); - - // Create the input wrapper - const Type& rootType = dataFactory->getType(inputTypeUri.c_str(), "RootType"); - const Property& prop = rootType.getProperty(inputTypeName.c_str()); - const Type& inputType = prop.getType(); - inputDataObject = dataFactory->create(inputType); - } - catch (SDORuntimeException&) - { - try - { - // Create the input wrapper - const Type& inputType = - dataFactory->getType(inputTypeUri.c_str(), inputTypeName.c_str()); - inputDataObject = dataFactory->create(inputType); - } - catch (SDORuntimeException&) - { - - // The input wrapper type is not known, create an open DataObject - //inputDataObject = dataFactory->create("http://tempuri.org", "Wrapper"); - inputDataObject = dataFactory->create(SDOUtils::sdoURI, "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 (unsigned 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: - { - ostringstream msg; - msg << "Unsupported parameter type: " << parm.getType(); - throwException(ServiceDataException, msg.str().c_str()); - } - } - } - } - } - else { - - // Each parameter in the operation should be a property on the request dataobject - for (unsigned int i=0; isetBoolean(i, *(bool*)parm.getValue()); - break; - } - case Operation::SHORT: - { - inputDataObject->setShort(i, *(short*)parm.getValue()); - break; - } - case Operation::INT: - { - inputDataObject->setInt(i, *(int*)parm.getValue()); - break; - } - case Operation::LONG: - { - inputDataObject->setLong(i, *(long*)parm.getValue()); - break; - } - case Operation::USHORT: - { - inputDataObject->setInt(i, *(unsigned short*)parm.getValue()); - break; - } - case Operation::UINT: - { - inputDataObject->setInt(i, *(unsigned int*)parm.getValue()); - break; - } - case Operation::ULONG: - { - inputDataObject->setInt(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: - ostringstream msg; - msg << "Unsupported parameter type: " << parm.getType(); - throwException(ServiceDataException, msg.str().c_str()); - } - } - } - - // Create the Axiom object from the request dataobject - AxiomHelper* axiomHelper = AxiomHelper::getHelper(); - request_node = axiomHelper->toAxiomNode(inputDataObject, - inputTypeUri.c_str(), inputTypeName.c_str()); - AxiomHelper::releaseHelper(axiomHelper); - - char* str = AXIOM_NODE_TO_STRING(request_node, env); - loginfo("Sending Axis2 OM: %s ", str); - - return request_node; - - } - - void Axis2Client::setReturn(axiom_node_t* ret_node, - Operation& operation, - const WSDLOperation& wsdlOperation, - axis2_env_t* env) - { - logentry(); - - 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) - { - loginfo("Received Axis2 OM: %s ", str); - } - - // Convert the SOAP body to an SDO DataObject - AxiomHelper* axiomHelper = AxiomHelper::getHelper(); - DataObjectPtr outputBodyDataObject = axiomHelper->toSdo(body, dataFactory); - AxiomHelper::releaseHelper(axiomHelper); - - if(!outputBodyDataObject) - { - string msg = "Could not convert Axis2 OM node to SDO"; - throwException(ServiceInvocationException, msg.c_str()); - } - else - { - ostringstream os; - os << outputBodyDataObject; - loginfo("Converted Axis2 OM node to SDO: %s", os.str().c_str()); - } - - XMLHelperPtr xmlHelper = compositeReference->getComposite()->getXMLHelper(); - - // 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) - { - string msg = "Could not convert Axis2 body part to SDO"; - throwException(ServiceInvocationException, msg.c_str()); - } - - PropertyList pl = outputDataObject->getType().getProperties(); - if (pl.size() == 0) - { - if (outputDataObject->getType().isOpenType() && outputDataObject->getType().isDataObjectType()) - { - SequencePtr sequence = outputDataObject->getSequence(); - if (sequence != NULL && 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 *dataObjectData = new DataObjectPtr; - *dataObjectData = sequence->getDataObjectValue(0); - if(!*dataObjectData) - { - loginfo("Null DataObject return value"); - } - else - { - (*dataObjectData)->detach(); - } - operation.setReturnValue(dataObjectData); - } - } - } - } - else - { - const Property* p = &pl[0]; - - switch(pl[0].getTypeEnum()) - { - case Type::BooleanType: - { - bool* boolData = new bool; - *boolData = outputDataObject->getBoolean(pl[0]); - operation.setReturnValue(boolData); - } - break; - case Type::ByteType: - { - char* byteData = new char; - *byteData = outputDataObject->getByte(pl[0]); - operation.setReturnValue(byteData); - } - break; - case Type::BytesType: - { - int len = outputDataObject->getLength(pl[0]); - char** bytesData = new char*; - *bytesData = new char[len+1]; - int bytesWritten = outputDataObject->getBytes(pl[0], *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[0]); - operation.setReturnValue(charData); - } - break; - case Type::DoubleType: - { - long double* doubleData = new long double; - *doubleData = outputDataObject->getDouble(pl[0]); - operation.setReturnValue(doubleData); - } - break; - case Type::FloatType: - { - float* floatData = new float; - *floatData = outputDataObject->getFloat(pl[0]); - operation.setReturnValue(floatData); - } - break; - case Type::IntType: - { - long* intData = new long; - *intData = outputDataObject->getInt(pl[0]); - operation.setReturnValue(intData); - } - break; - case Type::ShortType: - { - short* shortData = new short; - *shortData = outputDataObject->getShort(pl[0]); - operation.setReturnValue(shortData); - } - break; - case Type::StringType: - { - string* stringData = new string(outputDataObject->getCString(pl[0])); - operation.setReturnValue(stringData); - } - break; - case Type::DataObjectType: - { - if (!strcmp(pl[0].getType().getURI(), SDOUtils::sdoURI) && - !strcmp(pl[0].getType().getName(), "OpenDataObject")) { - - /* - * This code deals with xsd:any element parameters - */ - - DataObjectList& dataObjectList = outputDataObject->getList(pl[0]); - - for(unsigned 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 *dataObjectData = new DataObjectPtr; - *dataObjectData = sequence->getDataObjectValue(0); - if(!*dataObjectData) - { - loginfo("Null DataObject return value"); - } - else - { - (*dataObjectData)->detach(); - } - operation.setReturnValue(dataObjectData); - } - } - else - { - // Empty content, add an empty string - loginfo("Null OpenDataObject return value"); - string *stringData = new string(""); - operation.setReturnValue(stringData); - } - } - } - } - else { - DataObjectPtr* dataObjectData = new DataObjectPtr; - *dataObjectData = outputDataObject->getDataObject(pl[0]); - if(!*dataObjectData) - { - loginfo("Null DataObject return value"); - } - else - { - (*dataObjectData)->detach(); - } - operation.setReturnValue(dataObjectData); - } - } - break; - default: - { - ostringstream msg; - msg << "Unsupported result type: " << pl[0].getTypeEnum(); - throwException(SystemConfigurationException, msg.str().c_str()); - } - } - } - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.h b/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.h deleted file mode 100644 index 397440dd5d..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.h +++ /dev/null @@ -1,65 +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" - - -namespace tuscany -{ - namespace sca - { - namespace ws - { - - class Axis2Client - { - public: - Axis2Client(tuscany::sca::model::CompositeReference* compositeReference); - virtual ~Axis2Client(); - - virtual void invoke(Operation& operation); - - private: - tuscany::sca::model::CompositeReference* compositeReference; - - axiom_node_t* createPayload(Operation& operation, - const tuscany::sca::model::WSDLOperation& wsdlOp, - axis2_env_t* env); - - void setReturn(axiom_node_t* returnNode, - Operation& operation, - const tuscany::sca::model::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/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.cpp b/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.cpp deleted file mode 100644 index 53d6075bbd..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.cpp +++ /dev/null @@ -1,118 +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" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; - -extern "C" -{ -#if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) -#endif - void tuscany_sca_ws_reference_initialize() - { - tuscany::sca::ws::WSServiceBindingExtension::initialize(); - } -} - - -namespace tuscany -{ - namespace sca - { - namespace ws - { - // =================================================================== - // Constructor for the WSServiceBinding class. - // =================================================================== - WSServiceBindingExtension::WSServiceBindingExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the WSServiceBindingExtension class. - // =================================================================== - WSServiceBindingExtension::~WSServiceBindingExtension() - { - logentry(); - } - - 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) - { - logentry(); - - string uri = scdlBinding->getCString("uri"); - string endpoint; - try - { - endpoint = scdlBinding->getCString("endpoint"); - } - catch (SDORuntimeException&) - { - endpoint = ""; - } - string version; - try - { - commonj::sdo::DataObjectList& soap = scdlBinding->getList("soapbinding"); - if (soap.size()!=0) - { - version = soap.getCString(0); - } - else - { - version = ""; - } - } - catch (SDORuntimeException&) - { - version = ""; - } - - WSServiceBinding* serviceBinding = new WSServiceBinding(service, uri, endpoint, version); - - return serviceBinding; - } - - void WSServiceBindingExtension::initialize() - { - logentry(); - SCARuntime::getCurrentRuntime()->registerServiceBindingExtension(new WSServiceBindingExtension()); - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.h b/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.h deleted file mode 100644 index 68dd657657..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceBindingExtension.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_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 std::string& getExtensionName() {return extensionName;} - - /** - * return the QName of schema elemant for this implementation extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.ws") - */ - virtual const std::string& getExtensionTypeQName() {return typeQName;} - - virtual tuscany::sca::model::ServiceBinding* getServiceBinding( - tuscany::sca::model::Composite* composite, - tuscany::sca::model::Service* service, - commonj::sdo::DataObjectPtr scdlBinding); - - static void initialize(); - - private: - static const std::string extensionName; - static const std::string typeQName; - - }; - - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany - -#endif //tuscany_sca_extension_ws_wsservicebindingextension_h - diff --git a/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.cpp b/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.cpp deleted file mode 100644 index 4adcd5b4ff..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.cpp +++ /dev/null @@ -1,131 +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 "commonj/sdo/SDO.h" - -#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" - -using namespace std; -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) - { - logentry(); - - // 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&) - { - 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); - } - - try { - const Type& tempType = dataFactory->getType("http://tempuri.org", "RootType"); - } catch (SDORuntimeException&) - { - dataFactory->addType("http://tempuri.org", "RootType", false, false, false); - dataFactory->addType("http://tempuri.org", "Wrapper", false, true, false); - dataFactory->addPropertyToType( - "http://tempuri.org", "RootType", - "Wrapper", - "http://tempuri.org", "Wrapper", - false, false, true); - dataFactory->addType("http://tempuri.org", "Part", false, true, false); - dataFactory->addPropertyToType( - "http://tempuri.org", "RootType", - "Part", - "http://tempuri.org", "Part", - false, false, true); - } - } - - WSServiceWrapper::~WSServiceWrapper() - { - logentry(); - } - - /// - /// This method will be called when a web service call needs to be made. - /// - void WSServiceWrapper::invoke(Operation& operation) - { - logentry(); - - const string& operationName = operation.getName(); - - loginfo("Service: %s, operation: %s", getService()->getType()->getName().c_str() , operationName.c_str()); - - for (unsigned int i=0; igetComponent(); - - Axis2Client client(compositeReference); - client.invoke(operation); - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany - - - diff --git a/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.h b/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.h deleted file mode 100644 index f7aebbb575..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/WSServiceWrapper.h +++ /dev/null @@ -1,65 +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" - - -namespace tuscany -{ - namespace sca - { - - namespace ws - { - - class WSServiceWrapper : public ServiceWrapper - { - public: - - /** - * Constructor. - * @param target The service wrapper represents a Web service. - */ - WSServiceWrapper(tuscany::sca::model::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/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/export.h b/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/export.h deleted file mode 100644 index d0e708f1a1..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/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_ws_reference_export_h -#define tuscany_sca_ws_reference_export_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) - -#ifdef TUSCANY_SCA_WS_REFERENCE_EXPORTS -#define SCA_WS_REFERENCE_API __declspec(dllexport) -#else -#define SCA_WS_REFERENCE_API __declspec(dllimport) -#endif - -#else -#define SCA_WS_REFERENCE_API -#endif - -#endif // tuscany_sca_ws_reference_export_h diff --git a/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.cpp b/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.cpp deleted file mode 100644 index 26d8dffc45..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.cpp +++ /dev/null @@ -1,144 +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" - -using namespace std; -using namespace tuscany::sca::model; - -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) - { - logentry(); - - parseEndpoint(); - - serviceWrapper = new WSServiceWrapper(service); - } - - void WSServiceBinding::parseEndpoint() - { - logentry(); - - // 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() - { - logentry(); - } - - ServiceWrapper* WSServiceBinding::getServiceWrapper() - { - logentry(); - - return serviceWrapper; - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.h b/sca-cpp/trunk/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/model/WSServiceBinding.h deleted file mode 100644 index 3c8c5eb12d..0000000000 --- a/sca-cpp/trunk/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 - -#include "tuscany/sca/ws/export.h" -#include "tuscany/sca/model/ServiceBinding.h" -#include "tuscany/sca/model/Service.h" - -namespace tuscany -{ - namespace sca - { - namespace ws - { - /** - * Information about a web service binding for service or a reference. - */ - class WSServiceBinding : public tuscany::sca::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") - */ - SCA_WS_REFERENCE_API WSServiceBinding(tuscany::sca::model::Service* service, const std::string& uri, const std::string& endpoint, const std::string& version); - - /** - * Destructor. - */ - SCA_WS_REFERENCE_API virtual ~WSServiceBinding(); - - /** - * Returns the type of binding. - */ - virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#WebServiceBinding"; }; - - /** - * Create a wrapper for the service configured by this - * binding. - */ - SCA_WS_REFERENCE_API virtual ServiceWrapper* getServiceWrapper(); - - /** - * Return the part of the endpoint definition describing the wsdl - * namespace. - * @return The wsdl namespace. - */ - std::string getWSDLNamespaceURL() const { return wsdlNamespaceURL; }; - - /** - * Return the service part of the endpoint definition. - * @return The service to use. - */ - std::string getServiceName() const { return serviceName; }; - - /** - * Return the endpoint name part of the endpoint definition. - * @return The endpoint name to use. - */ - std::string getEndpointName() const { return endpointName; }; - - /** - * Return the SOAP version. - * @return The SOAP version to use. - */ - std::string getSOAPVersion() const { return soapVersion; }; - - private: - - /** - * Parse the endpoint specification. - */ - void parseEndpoint(); - - /** - * The full endpoint string. - */ - std::string endpoint; - - /** - * Namespace from the endpoint. - */ - std::string wsdlNamespaceURL; - - /** - * Service name from the endpoint. - */ - std::string serviceName; - - /** - * WSDL Endpoint name. - */ - std::string endpointName; - - /** - * SOAP version. - */ - std::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/sca-cpp/trunk/runtime/extensions/ws/service/Makefile.am b/sca-cpp/trunk/runtime/extensions/ws/service/Makefile.am deleted file mode 100644 index 18e9ba89b9..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/Makefile.am b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/Makefile.am deleted file mode 100644 index feadf9e317..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/Makefile.am b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/Makefile.am deleted file mode 100644 index 88f7fc1a9e..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/Makefile.am +++ /dev/null @@ -1,94 +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${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 - -servicedir=$(rootdir)/services/tuscany -service_DATA = services.xml - -modulesdir=$(rootdir)/modules/tuscany -modules_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 $(modulesdir); 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 - -moduledir=$(prefix)/extensions/ws/service/module -extension = libtuscany_sca_ws_service$(libsuffix) - -install-exec-hook: - test -z $(moduledir) || $(mkdir_p) $(moduledir); - -rm -f $(moduledir)/$(extension) - $(LN_S) $(libdir)/$(extension) $(moduledir)/$(extension) diff --git a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/axis2.xml b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/axis2.xml deleted file mode 100644 index 641085466e..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/deploy.bat b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/deploy.bat deleted file mode 100644 index 6493e1cec9..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/deploy.bat +++ /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/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/deploy.sh b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/deploy.sh deleted file mode 100755 index ffe571b0ee..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/module.xml b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/module.xml deleted file mode 100644 index 97d4d43a86..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/module.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/services.xml b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/services.xml deleted file mode 100644 index 335d4d96be..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/services.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - tuscany_sca_ws_service - - - diff --git a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Dispatcher.cpp b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Dispatcher.cpp deleted file mode 100644 index b6d2ac9225..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Dispatcher.cpp +++ /dev/null @@ -1,177 +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 - -#include "tuscany/sca/util/Logging.h" - -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) - { - loginfo("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) - { - loginfo("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/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2DispatcherModule.cpp b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2DispatcherModule.cpp deleted file mode 100644 index 0dc8f3358a..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Service.cpp b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Service.cpp deleted file mode 100644 index 9f1207dce8..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Service.cpp +++ /dev/null @@ -1,553 +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 "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/util/Logging.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/WSDLMessagePart.h" -#include "tuscany/sca/model/WSDLInterface.h" -#include "tuscany/sca/model/Interface.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/util/Utils.h" -#include "Axis2Utils.h" - -using namespace std; -using namespace commonj::sdo; -using namespace commonj::sdo_axiom; -using namespace tuscany::sca; -using namespace tuscany::sca::model; -using namespace tuscany::sca::util; - -namespace tuscany -{ - namespace sca - { - namespace ws - { - - int AXIS2_CALL - Axis2Service_free(axis2_svc_skeleton_t *svc_skeleton, - const axis2_env_t *env); - - 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->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 SCA runtime - */ - CompositeService* initializeSCARuntime(const char*home, const char* root, - const char* path, const char* baseURI, const char *component, const char* service) - { - logentry(); - loginfo("Home: %s", home); - loginfo("Root: %s", root); - loginfo("Path: %s", path); - loginfo("Base URI: %s", baseURI); - loginfo("Component: %s", component); - loginfo("Service: %s", service); - - try - { - SCARuntime* runtime = SCARuntime::initializeSharedRuntime(home, root, path, baseURI); - - string componentName; - if (strlen(component)) - { - componentName = component; - } - else - { - componentName = runtime->getDefaultComponentName(); - } - string serviceName = service; - - loginfo("Resolving composite: %s, service: %s", componentName.c_str(), serviceName.c_str()); - Component* compositeComponent = runtime->getSystem()->findComponent(componentName); - if (compositeComponent == NULL) - { - string msg = "Component not found " + componentName; - throwException(SystemConfigurationException, msg.c_str()); - } - runtime->setDefaultComponent(compositeComponent); - - Composite* composite = (Composite*)compositeComponent->getType(); - CompositeService* compositeService = (CompositeService*)composite->findComponent(serviceName); - if (compositeService == NULL) - { - string msg = "Composite service not found " + serviceName; - throwException(SystemConfigurationException, msg.c_str()); - } - - return compositeService; - } - catch(TuscanyRuntimeException &ex) - { - ostringstream msg; - msg << ex; - logerror("Failed to initialize SCA runtime: %s", msg.str().c_str()); - throw; - } - } - - - /* - * 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) - { - logentry(); - - try - { - 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 *addr = AXIS2_ENDPOINT_REF_GET_ADDRESS(endpoint_ref, env); - if (addr) - { - // REST request, the op name is the last segment of the path - string raddress = addr; - string path; - string query; - Utils::tokeniseString("?", raddress, path, query); - string uri; - Utils::rTokeniseString("/", path, uri, op_name); - } - } - } - else - { - // SOAP request - // Get 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 != "") - { - CompositeService* compositeService; - - // Get the Tuscany home, system root, path and composite service name from the Axis2 - // service parameters - char* homeParam = Axis2Utils::getAxisServiceParameterValue(env, msg_ctx, "TuscanyHome"); - if (homeParam == NULL) - homeParam = ""; - - char* rootParam = Axis2Utils::getAxisServiceParameterValue(env, msg_ctx, "TuscanyRoot"); - if (rootParam == NULL) - rootParam = ""; - - char* pathParam = Axis2Utils::getAxisServiceParameterValue(env, msg_ctx, "TuscanyPath"); - if (pathParam == NULL) - pathParam = ""; - - char* baseURIParam = Axis2Utils::getAxisServiceParameterValue(env, msg_ctx, "TuscanyBaseURI"); - if (baseURIParam == NULL) - baseURIParam = ""; - - char* serviceParam = Axis2Utils::getAxisServiceParameterValue(env, msg_ctx, "TuscanyService"); - if (serviceParam != NULL) - { - loginfo("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); - - compositeService = initializeSCARuntime(homeParam, rootParam, pathParam, baseURIParam, component.c_str(), service.c_str()); - } - else { - - // Use the default home, 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); - string address = AXIS2_ENDPOINT_REF_GET_ADDRESS(endpoint_ref, env); - - axis2_bool_t isrest = AXIS2_MSG_CTX_GET_DOING_REST(msg_ctx, env); - string path; - if (isrest) - { - string op; - Utils::rTokeniseString("/", address, path, op); - } - else - { - path = address; - } - - string path2; - string service; - Utils::rTokeniseString("/", path, path2, service); - - string path3; - string component; - Utils::rTokeniseString("/", path2, path3, component); - if (component == "services") - { - component = ""; - } - - loginfo("System root: %s, component name: %s, service name: %s, operation name: %s", - rootParam, component.c_str(), service.c_str(), op_name.c_str()); - - compositeService = initializeSCARuntime(homeParam, rootParam, pathParam, baseURIParam, component.c_str(), service.c_str()); - } - - if(!compositeService) - { - throwException(SystemConfigurationException, - "Failed to initialize SCA runtime, could not initialize CompositeService"); - } - - DataFactoryPtr dataFactory = compositeService->getComposite()->getDataFactory(); - if (dataFactory == 0) - { - throwException(SystemConfigurationException, - "Failed to initialize SCA runtime, could not get DataFactory"); - } - - // Get the WS binding and the WSDL operation - Composite* composite = compositeService->getComposite(); - Reference* reference = compositeService->getReference(); - WSReferenceBinding* binding = (WSReferenceBinding*)reference->getBinding(); - WSDLOperation wsdlOperation; - - // First use the WSDL definition specified in the binding - string wsdlNamespace = binding->getWSDLNamespaceURL(); - if (wsdlNamespace != "") - { - WSDLDefinition* wsdlDefinition = composite->findWSDLDefinition(wsdlNamespace); - if (wsdlDefinition == 0) - { - string msg = "WSDL not found for: " + wsdlNamespace; - throwException(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&) - { - throw; - } - - } - else - { - // Then use the WSDL definition specified in the WSDL interface, if any - 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) - { - string msg = "WSDL not found for: " + wsdlNamespace; - throwException(SystemConfigurationException, msg.c_str()); - } - - try - { - wsdlOperation = wsdl->findOperation(wsdlInterface->getName(), op_name.c_str()); - } - catch(SystemConfigurationException&) - { - throw; - } - } - } - } - - // No WSDL definition was specified in the binding or interface - // Create a default document literal wrapped WSDL operation - if (wsdlNamespace == "") - { - WSDLMessagePart inPart(op_name, "", "http://tempuri.org"); - WSDLMessagePart outPart((op_name+"Response"), "", "http://tempuri.org"); - 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.setInputEncoded(false); - wsdlOperation.setOutputEncoded(false); - wsdlOperation.setInputMessagePart(op_name, inPart); - wsdlOperation.setOutputMessagePart((op_name+"Response"), outPart); - } - else if (!wsdlOperation.isDocumentStyle() || !wsdlOperation.isWrappedStyle()) - { - throwException(ServiceInvocationException, - "Only wrapped document style WSDL operations are currentlysupported"); - } - - // 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) - { - loginfo("Received request Axis2 OM: %s", str); - } - - // Convert the SOAP body to an SDO DataObject - DataObjectPtr inputBodyDataObject = NULL; - DataObjectPtr inputDataObject = NULL; - - AxiomHelper* axiomHelper = AxiomHelper::getHelper(); - - try - { - inputBodyDataObject = axiomHelper->toSdo(body, dataFactory); - if(!inputBodyDataObject) - { - string msg = "Could not convert request Axis2 OM to SDO"; - throwException(ServiceInvocationException, msg.c_str()); - } - else - { - ostringstream os; - os << inputBodyDataObject; - loginfo("Converted Axis2 OM node to SDO: %s", os.str().c_str()); - } - - // Get the first body part representing the doc-lit-wrapped wrapper element - 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) - { - string msg = "Could not convert Axis2 body part to SDO"; - throwException(ServiceInvocationException, msg.c_str()); - } - } - catch(SDORuntimeException &ex) - { - throwException(ServiceDataException, ex); - } - - // Dispatch to the WS proxy - WSServiceProxy* proxy = (WSServiceProxy*)binding->getServiceProxy(); - - DataObjectPtr outputDataObject = proxy->invoke(wsdlOperation, inputDataObject); - - if(!outputDataObject) - { - return 0; - } - - try - { - std::list partList = - wsdlOperation.getOutputMessagePartNames(); - const WSDLMessagePart &outPart = - wsdlOperation.getOutputMessagePart(partList.front()); - // Convert the output DataObject to an Axiom node - axiom_node_t* outputNode = - axiomHelper->toAxiomNode(outputDataObject, - outPart.getPartUri().c_str(), - outPart.getPartName().c_str()); - - AxiomHelper::releaseHelper(axiomHelper); - - str = AXIOM_NODE_TO_STRING(outputNode, env); - if (str) - { - loginfo("Sending response Axis2 OM : %s", str); - } - - return outputNode; - } - catch(SDORuntimeException &ex) - { - throwException(ServiceDataException, ex); - } - } - } - } - } - - string msg = "Invalid parameters in Axis2 request OM"; - throwException(ServiceInvocationException, msg.c_str()); - - } - catch(TuscanyRuntimeException& ex) - { - ostringstream msg; - msg << ex; - logerror("Failed to process Web service invocation: %s", msg.str().c_str()); - } - return 0; - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany - -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 = tuscany::sca::ws::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/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.cpp b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.cpp deleted file mode 100644 index 09c3862590..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.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$ */ - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#pragma warning(disable: 4091) -#endif - -#include -#include - -#include "tuscany/sca/util/Logging.h" -#include "Axis2Utils.h" - -using namespace tuscany::sca; -using namespace tuscany::sca::ws; - -namespace tuscany -{ - namespace sca - { - namespace ws - { - - char* Axis2Utils::getAxisServiceParameterValue(const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx, char* parameterName) - { - logentry(); - - 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; - - 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) - { - logwarning("Axis parameter %s cannot be found", parameterName); - } - else - { - paramValue = (char*) AXIS2_PARAM_GET_VALUE(param, env); - } - - return paramValue; - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany - diff --git a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.h b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Utils.h deleted file mode 100644 index 4e8b069010..0000000000 --- a/sca-cpp/trunk/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/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.cpp b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.cpp deleted file mode 100644 index 24a7552bc4..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.cpp +++ /dev/null @@ -1,119 +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" - -using namespace std; -using namespace tuscany::sca::model; -using namespace commonj::sdo; - -extern "C" -{ -#if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) -#endif - void tuscany_sca_ws_service_initialize() - { - tuscany::sca::ws::WSReferenceBindingExtension::initialize(); - } -} - -namespace tuscany -{ - namespace sca - { - namespace ws - { - // =================================================================== - // Constructor for the WSReferenceBinding class. - // =================================================================== - WSReferenceBindingExtension::WSReferenceBindingExtension() - { - logentry(); - } - - // =================================================================== - // Destructor for the WSReferenceBindingExtension class. - // =================================================================== - WSReferenceBindingExtension::~WSReferenceBindingExtension() - { - logentry(); - } - - 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) - { - logentry(); - - string uri = scdlBinding->getCString("uri"); - - string endpoint; - try - { - endpoint = scdlBinding->getCString("endpoint"); - } - catch (SDORuntimeException&) - { - endpoint = ""; - } - - string version; - try - { - commonj::sdo::DataObjectList& soap = scdlBinding->getList("soapbinding"); - if (soap.size()!=0) - { - version = soap.getCString(0); - } - else - { - version = ""; - } - } - catch (SDORuntimeException&) - { - version = ""; - } - - WSReferenceBinding* serviceBinding = new WSReferenceBinding(reference, uri, endpoint, version); - - return serviceBinding; - } - - void WSReferenceBindingExtension::initialize() - { - logentry(); - SCARuntime::getCurrentRuntime()->registerReferenceBindingExtension(new WSReferenceBindingExtension()); - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.h b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.h deleted file mode 100644 index 712e7d2646..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSReferenceBindingExtension.h +++ /dev/null @@ -1,76 +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 std::string& getExtensionName() {return extensionName;} - - /** - * return the QName of schema elemant for this implementation extension - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#binding.ws") - */ - virtual const std::string& getExtensionTypeQName() {return typeQName;} - - virtual tuscany::sca::model::ReferenceBinding* getReferenceBinding( - tuscany::sca::model::Composite* composite, - tuscany::sca::model::Reference *reference, commonj::sdo::DataObjectPtr scdlBinding); - - static void initialize(); - - private: - static const std::string extensionName; - static const std::string typeQName; - - }; - - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_ws_wsreferencebindingextension_h - diff --git a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp deleted file mode 100644 index bea4168984..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp +++ /dev/null @@ -1,579 +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 "commonj/sdo/SDO.h" - -#include "WSServiceProxy.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/util/SDOUtils.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" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::model; -using namespace tuscany::sca::util; - -namespace tuscany -{ - namespace sca - { - namespace ws - { - - // ============================ - // Constructor: Create a proxy - // ============================ - WSServiceProxy::WSServiceProxy(Reference* reference) - : ServiceProxy(reference) - { - logentry(); - - // 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&) - { - - // 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); - } - - try { - const Type& tempType = dataFactory->getType("http://tempuri.org", "RootType"); - } catch (SDORuntimeException&) - { - dataFactory->addType("http://tempuri.org", "RootType", false, false, false); - dataFactory->addType("http://tempuri.org", "Wrapper", false, true, false); - dataFactory->addPropertyToType( - "http://tempuri.org", "RootType", - "Wrapper", - "http://tempuri.org", "Wrapper", - false, false, true); - dataFactory->addType("http://tempuri.org", "Part", false, true, false); - dataFactory->addPropertyToType( - "http://tempuri.org", "RootType", - "Part", - "http://tempuri.org", "Part", - false, false, true); - } - } - - // ========== - // Destructor - // ========== - WSServiceProxy::~WSServiceProxy() - { - logentry(); - } - - /// - /// This method will be called to process an operation invocation. - /// - DataObjectPtr WSServiceProxy::invoke(const WSDLOperation& wsdlOperation, DataObjectPtr inputDataObject) - { - logentry(); - - Reference* reference = getReference(); - Component* component = reference->getComponent(); - Composite* composite = component ->getComposite(); - - WSReferenceBinding* referenceBinding = (WSReferenceBinding*)reference->getBinding(); - DataFactoryPtr dataFactoryPtr = reference->getComponent()->getComposite()->getDataFactory(); - - // Since its Document wrapped, there will only be one message part - std::list partList = wsdlOperation.getOutputMessagePartNames(); - const WSDLMessagePart &part = wsdlOperation.getOutputMessagePart(partList.front()); - const char* outputTypeURI = part.getPartUri().c_str(); - const char* outputTypeName = part.getPartName().c_str(); - - loginfo("WSDLOperation input message Type: %s#%s", - wsdlOperation.getInputMessageUri().c_str(), - wsdlOperation.getInputMessageName().c_str()); - loginfo("WSDLOperation outputType: %s#%s", - outputTypeURI, - outputTypeName); - - try - { - - // 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(unsigned 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*; - *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::IntType: - { - long* intData = new long; - *intData = inputDataObject->getInt(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: - { - if (!strcmp(pl[i].getType().getURI(), SDOUtils::sdoURI) && - !strcmp(pl[i].getType().getName(), "OpenDataObject")) { - - /* - * 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(unsigned 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* dataObjectData = new DataObjectPtr; - *dataObjectData = sequence->getDataObjectValue(0); - if(!*dataObjectData) - { - loginfo("Null DataObject parameter named %s", name); - } - else - { - (*dataObjectData)->detach(); - } - operation.addParameter(dataObjectData); - } - } - else - { - // Empty content, add an empty string - loginfo("Empty OpenDataObject parameter named %s[%d]", name, j); - string* stringData = new string(""); - operation.addParameter(stringData); - } - } - } - } - else { - DataObjectPtr* dataObjectData = new DataObjectPtr; - *dataObjectData = inputDataObject->getDataObject(pl[i]); - if(!*dataObjectData) - { - loginfo("Null DataObject parameter named %s", name); - } - else - { - (*dataObjectData)->detach(); - } - operation.addParameter(dataObjectData); - } - } - break; - default: - { - ostringstream msg; - msg << "Unsupported param type: " << pl[i].getTypeEnum(); - throwException(SystemConfigurationException, msg.str().c_str()); - } - } - } - - // 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&) - { - try - { - // Create the output wrapper - const Type& outputType = dataFactoryPtr->getType(outputTypeURI, outputTypeName); - outputDataObject = dataFactoryPtr->create(outputType); - } - catch (SDORuntimeException&) - { - // The output wrapper type is not known, create an open DataObject - //outputDataObject = dataFactoryPtr->create("http://tempuri.org", "Wrapper"); - outputDataObject = dataFactoryPtr->create(SDOUtils::sdoURI, "OpenDataObject"); - } - } - - setOutputData(operation, outputDataObject, dataFactoryPtr); - - return outputDataObject; - - } - catch(SDORuntimeException& ex) - { - throwException(ServiceInvocationException, ex); - } - catch(TuscanyRuntimeException&) - { - throw; - } - } - - - void WSServiceProxy::setOutputData(Operation& operation, DataObjectPtr outputDataObject, DataFactoryPtr dataFactoryPtr) - { - logentry(); - - // 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: - { - // One way operation, no return value - break; - } - } - } - else - { - loginfo("No return values defined"); - } - } - else { - - // Should only be one return value.. This goes through all return values - for(unsigned 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->setInt(pl[i], *(int*)operation.getReturnValue()); - break; - } - case Operation::LONG: - { - outputDataObject->setInt(pl[i], *(long*)operation.getReturnValue()); - break; - } - case Operation::USHORT: - { - outputDataObject->setInt(pl[i], *(unsigned short*)operation.getReturnValue()); - break; - } - case Operation::UINT: - { - outputDataObject->setInt(pl[i], *(unsigned int*)operation.getReturnValue()); - break; - } - case Operation::ULONG: - { - outputDataObject->setInt(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("Null return value, 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("Null return value, leaving property %s unset", pl[i].getName()); - } - - break; - } - default: - { - // One way operation, no return value - break; - } - } - } - } - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.h b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.h deleted file mode 100644 index 4d57514688..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.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_extension_ws_wsserviceproxy_h -#define tuscany_sca_extension_ws_wsserviceproxy_h - -#include "commonj/sdo/SDO.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" - - -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(tuscany::sca::model::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(tuscany::sca::model::Service* service); - - /** - * Destructor. - */ - virtual ~WSServiceProxy(); - - /** - * Invoke the specified operation - */ - commonj::sdo::DataObjectPtr invoke(const tuscany::sca::model::WSDLOperation& wsdlOperation, - commonj::sdo::DataObjectPtr inputDataObject); - - private: - - void setOutputData(Operation& operation, - commonj::sdo::DataObjectPtr outputDataObject, commonj::sdo::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/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/export.h b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/export.h deleted file mode 100644 index e52adf4db0..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/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_ws_service_export_h -#define tuscany_sca_ws_service_export_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) - -#ifdef TUSCANY_SCA_WS_SERVICE_EXPORTS -#define SCA_WS_SERVICE_API __declspec(dllexport) -#else -#define SCA_WS_SERVICE_API __declspec(dllimport) -#endif - -#else -#define SCA_WS_SERVICE_API -#endif - -#endif // tuscany_sca_ws_service_export_h diff --git a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.cpp b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.cpp deleted file mode 100644 index 4f170ebf52..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.cpp +++ /dev/null @@ -1,151 +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" - -using namespace std; -using namespace tuscany::sca::model; - -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) - { - logentry(); - - parseEndpoint(); - } - - void WSReferenceBinding::parseEndpoint() - { - logentry(); - - // 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() - { - logentry(); - } - - void WSReferenceBinding::configure(ServiceBinding *binding) - { - logentry(); - - setTargetServiceBinding(binding); - - serviceProxy = new WSServiceProxy(getReference()); - } - - ServiceProxy* WSReferenceBinding::getServiceProxy() - { - logentry(); - - return serviceProxy; - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.h b/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.h deleted file mode 100644 index 14f17dbc3c..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/model/WSReferenceBinding.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_extension_ws_model_wsreferencebinding_h -#define tuscany_sca_extension_ws_model_wsreferencebinding_h - -#include - -#include "tuscany/sca/ws/export.h" -#include "tuscany/sca/model/ReferenceBinding.h" - - -namespace tuscany -{ - namespace sca - { - namespace ws - { - /** - * Information about a web service binding for service or a reference. - */ - class WSReferenceBinding : public tuscany::sca::model::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") - */ - SCA_WS_SERVICE_API WSReferenceBinding(tuscany::sca::model::Reference* reference, - const std::string&uri, const std::string& endpoint, const std::string& version); - - /** - * Destructor. - */ - SCA_WS_SERVICE_API virtual ~WSReferenceBinding(); - - /** - * Returns the type of binding. - */ - virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#WebServiceBinding"; }; - - /** - * Configure this binding from a service binding. - */ - SCA_WS_SERVICE_API virtual void configure(tuscany::sca::model::ServiceBinding* serviceBinding); - - /** - * Create a proxy representing the reference to the - * client component. - */ - SCA_WS_SERVICE_API virtual ServiceProxy* getServiceProxy(); - - /** - * Return the part of the endpoint definition describing the wsdl - * namespace. - * @return The wsdl namespace. - */ - std::string getWSDLNamespaceURL() const { return wsdlNamespaceURL; }; - - /** - * Return the service part of the endpoint definition. - * @return The service to use. - */ - std::string getServiceName() const { return serviceName; }; - - /** - * Return the endpoint name part of the endpoint definition. - * @return The endpoint name to use. - */ - std::string getEndpointName() const { return endpointName; }; - - /** - * Return the SOAP version. - * @return The SOAP version to use. - */ - std::string getSOAPVersion() const { return soapVersion; }; - - private: - - /** - * Parse the endpoint specification. - */ - void parseEndpoint(); - - /** - * The full endpoint string. - */ - std::string endpoint; - - /** - * Namespace from the endpoint. - */ - std::string wsdlNamespaceURL; - - /** - * Service name from the endpoint. - */ - std::string serviceName; - - /** - * Endpoint name from the endpoint. - */ - std::string endpointName; - - /** - * SOAP version. - */ - std::string soapVersion; - - /** - * The proxy representing the reference to the client - * component. - */ - ServiceProxy* serviceProxy; - }; - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_extension_ws_model_wsreferencebinding_h diff --git a/sca-cpp/trunk/runtime/extensions/ws/xsd/sca-binding-webservice.xsd b/sca-cpp/trunk/runtime/extensions/ws/xsd/sca-binding-webservice.xsd deleted file mode 100644 index 680dd809a8..0000000000 --- a/sca-cpp/trunk/runtime/extensions/ws/xsd/sca-binding-webservice.xsd +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/AUTHORS b/sca-cpp/trunk/samples/AUTHORS deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/sca-cpp/trunk/samples/AlertAggregator/AlertAggregatorSCADiagram.png b/sca-cpp/trunk/samples/AlertAggregator/AlertAggregatorSCADiagram.png deleted file mode 100644 index 4672a5e22e..0000000000 Binary files a/sca-cpp/trunk/samples/AlertAggregator/AlertAggregatorSCADiagram.png and /dev/null differ diff --git a/sca-cpp/trunk/samples/AlertAggregator/Makefile.am b/sca-cpp/trunk/samples/AlertAggregator/Makefile.am deleted file mode 100644 index 0b39db277d..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/Makefile.am +++ /dev/null @@ -1,21 +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. - -deploydir=$(prefix)/AlertAggregator/deploy -SUBDIRS = sample.alerter sample.display httpserver -EXTRA_DIST = *.composite *.xml README.html -deploy_DATA = *.composite *.xml diff --git a/sca-cpp/trunk/samples/AlertAggregator/README b/sca-cpp/trunk/samples/AlertAggregator/README deleted file mode 100644 index e605168052..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/README +++ /dev/null @@ -1,38 +0,0 @@ -Tuscany SCA for C++ Samples - Alert Aggregator Sample -===================================================== - -This is a sample that shows how a Web 2.0-style application can be built using -SCA. The Alert Aggregator Sample aggregates various data sources and presents -a unified view of data from these sources, served as XML and displayed via a -web page - -There are three sub-directories in this workspace: - - sample.alerter - This contains the source code and SCDL artifacts for the Alert - Aggregator. Includes components to retrieve emails from POP servers and - to retrieve items from RSS/Atom feeds, a component that aggregates these - alerts and a component that manages the configuration of which POP accounts - and which RSS feeds to read. - - - sample.display - Contains a single SCA component that provides a HTML display of the - Alert Aggregator data - - - httpserver - Configuration files and scripts to run the sample under Apache HTTPD. Also - includes the HTML file that calls the HTMLDisplay component - - -Additionally, there is the sample.alerter.app.composite file. This -describes the configuration of the Alerter and Display composites deployed to the -SCA runtime. - -This sample requires the following Tuscany extensions: -Python -REST service -REST reference - -It also requires the Python FeedParser library, available from http://feedparser.org/ - - - diff --git a/sca-cpp/trunk/samples/AlertAggregator/README.html b/sca-cpp/trunk/samples/AlertAggregator/README.html deleted file mode 100644 index 69d5434527..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/README.html +++ /dev/null @@ -1,263 +0,0 @@ - - - - - - - - - - - - Tuscany SCA Native Samples - Alert Aggregator Sample - - - -

          -
          -
          -

          Tuscany SCA Native Samples - Alert Aggregator Sample

          - -

          This is a more complex sample that shows how Tuscany and SCA can be used to - develop and run mash-up style web applications.

          -

          The Alert Aggregator sample aggregates items of information from various data - sources into a series of "alerts" that are displayed in an - automatically updating web page. Alert sources can currently include RSS/Atom - news feeds and POP3/IMAP email

          -

          The Alert Aggregator sample requires the following extensions: -

          - Please follow the documentation to ensure you have these extensions built and installed - on your system -

          -

          Additionally, the Alert Aggregator sample requires the Python FeedParser library, available from - http://feedparser.org. Please download and - install the library by following the documentation.

          -

          There are three sub-projects in this workspace: -

            -
          • sample.alerter
            - This contains the source code and SCDL artifacts for the SCA components - implementing the Alert Aggregator configuration and alert retrieval. -
          • -
          • sample.display
            - This contains the source code and SCDL artifacts for the SCA components - implementing the display and storage of the retrieved alerts. -
          • -
          • httpserver
            - This contains a minimal configuration for the Apache HTTP server used - to host the services as well as scripts to start and stop the server. -
          • -
          - Additionally, there is the sample.alerter.app.composite file. This - describes the configuration of the SCA composites deployed to the SCA - runtime.

          -

          The following SCA diagram shows the different components and composites and how the - wiring between them is specified. Not all of these components are currently - implemented in this sample.

          - Alert Aggregator SCA Diagram -
          - - - - -
          -

          Building the Alert Aggregator sample on Linux and Mac OS X

          -

          If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>/samples - go directly to Running the sample on Linux and Mac OS X.

          -
            -
          1. The following environment variables are required: -
              -
            • TUSCANY_SCACPP=<path to installed Tuscany SCA>
            • -
            • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
            • -
            -
          2. -
          3. As the Alert Aggregator sample is based on Python scripts, a specific compilation step is not necessary - - only deployment is required. Deploy the Python samples only with the following command sequence: -
              -
            • cd <tuscany_sca_install_dir>/samples
            • -
            • ./configure --enable-python --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
            • -
            • make install
            • -
            - NOTE: If you don't provide the --prefix configure option, it will by default install into - /usr/local/tuscany/sca/samples/AlertAggregator
          4. -
          -
          - -
          -

          Running the Alert Aggregator sample on Linux and Mac OS X

          -
            -
          1. The Alert Aggregator sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
          2. -
          3. The Alert Aggregator sample requires the Python FeedParser library, available from - http://feedparser.org. Please download and - install the library by following the documentation.
          4. -
          5. Start the Apache HTTPD server: -
              -
            1. The following environment variables are required: -
                -
              • TUSCANY_SCACPP=<path to installed Tuscany SCA>
              • -
              • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
              • -
              • PYTHON_LIB=<path to the Python library>
                - Note: If you are using a default installation of Python 2.5 this is usually /usr/lib
              • -
              -
            2. -
            3. cd <tuscany_sca_install_dir>/samples/AlertAggregator/deploy/httpserver
            4. -
            5. ./startserver.sh
              - NOTE: Depending on your installation of Apache HTTPD you may need to log in as root before following - these steps. If so, you may also need to uncomment the User and Group directives in the - <tuscany_sca_install_dir>/samples/AlertAggregator/deploy/httpserver/conf/httpd.conf file - and set these to the appropriate username and group that the server should run as
            6. -
            -
          6. -
          7. Run the client from your web browser: -
              -
            1. Point your browser at http://localhost:9090/index.html
              - NOTE: If plain text is diplayed by your browser, rather than a rendered web page, you may need - to uncomment the LoadModule mime_module directive in the - <tuscany_sca_install_dir>/samples/AlertAggregator/deploy/httpserver/conf/httpd.conf file. Set the correct path to - the mod_mime.so library and restart the server
            2. -
            3. You should see the Alert Aggregator web interface that allows you to: -
                -
              • Read new alerts
              • -
              • Update alerts from all sources
              • -
              • Update alerts from a specific source
              • -
              • Edit the configuration of a data source
              • -
              • Add a new RSS/Atom or POP email data source
              • -
              • Remove a specific data source and all associated alerts
              • -
              -
            4. -
            -
          8. -
          -
          - -
          -

          Building the Alert Aggregator sample on Windows

          -

          If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

          -
            -
          1. The following environment variables are required: -
              -
            • TUSCANY_SCACPP=<path to installed Tuscany SCA> -
            • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
          2. - -
          3. As this sample is based on Ruby scripts, a specific compilation step is not necessary - - only deployment is required. Deploy the sample with the following commands: -
              -
            • cd <tuscany_sca_install_dir>\samples\AlertAggregator
            • -
            • deploy.bat
            • -
            -
          4. -
          -
          - -
          -

          Running the Alert Aggregator sample on Windows

          -
            - -
          1. The Alert Aggregator sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
          2. -
          3. The Alert Aggregator sample requires the Python FeedParser library, available from - http://feedparser.org. Please download and - install the library by following the documentation.
          4. -
          5. Start the Apache HTTPD server: -
              -
            1. The following environment variables are required: -
                -
              • TUSCANY_SCACPP=<path to installed Tuscany SCA>
              • -
              • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
              • -
              • HTTPD_HOME=<path to installed Apache HTTPD server>
              • -
              -
            2. -
            3. cd <tuscany_sca_install_dir>\samples\AlertAggregator\deploy\httpserver
            4. -
            5. startserver.bat
            6. -
            -
          6. -
          7. Run the client from your web browser: -
              -
            1. Point your browser at http://localhost:9090/index.html
              - NOTE: If plain text is diplayed by your browser, rather than a rendered web page, you may need - to uncomment the LoadModule mime_module directive in the - <tuscany_sca_install_dir>\samples\AlertAggregator\deploy\httpserver\conf\httpd.conf file. Set the correct path to - the mod_mime.so library (e.g. C:\Apache2.2\modules\mod_mime.so) and restart the server
            2. -
            3. You should see the Alert Aggregator web interface that allows you to: -
                -
              • Read new alerts
              • -
              • Update alerts from all sources
              • -
              • Update alerts from a specific source
              • -
              • Edit the configuration of a data source
              • -
              • Add a new RSS/Atom or POP email data source
              • -
              • Remove a specific data source and all associated alerts
              • -
              -
            4. -
            -
          8. -
          -
          - - - -
          -

          Getting Help

          - -

          The first place to look is at the Tuscany SCA FAQ at - http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

          - -

          Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

          - -
          -
          -
          - - - - diff --git a/sca-cpp/trunk/samples/AlertAggregator/config.xml b/sca-cpp/trunk/samples/AlertAggregator/config.xml deleted file mode 100644 index 0b33cb7911..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/config.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - BBC News - http://news.bbc.co.uk/ - 2007-02-07T17:11:16 - http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml - - - Engadget - http://www.engadget.com - 2007-02-07T17:11:14 - http://www.engadget.com/rss.xml - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/README b/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/README deleted file mode 100644 index 207e6394e1..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/README +++ /dev/null @@ -1,33 +0,0 @@ -Alert Aggregator - PHP Display Component -======================================== - -This httpserver configuration includes a PHP implementation of the display -component that replaces the python component in sample.display. - -The HTTPD configuration created by the startserver scrips relies on the -PHP_HOME environment variable in order to install PHP in Apache as follows: - -LoadModule php5_module %PHP_HOME%\php5apache2.dll -AddType application/x-httpd-php .php -PHPIniDir %PHP_HOME% - -PHP must be configured to include the PHP SCA_SDO extension from PECL. -This provides the SCA and SDO support that the display component relies on. -Currently you must have the version from the AVOCET branch as changes have -been made here that this application requires. - -To run the AlertAggregator sample with the PHP component you must start the -original HTTP server, e.g., on windows - -> cd AlertAggregator\httpserver -> startserver.bat - -and then start the HTTPD server that servers the PHP part of the application, e.g., - -> cd AlertAggregator\httpserver.php -> startserver.bat - -then point your browser at - -http://localhost:9091/index.html - diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/conf/httpd.conf b/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/conf/httpd.conf deleted file mode 100644 index 92026c9717..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/conf/httpd.conf +++ /dev/null @@ -1,28 +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 is the main Apache HTTP server configuration file. It contains the -# configuration directives that give the server its instructions. -# See for detailed information. - -Listen 9091 - -# Generated by the startserver script -Include conf/base.conf - -# SCA rest module not required for the PHP part -# Include conf/tuscany_sca_mod_rest.conf diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/conf/mime.types b/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/conf/mime.types deleted file mode 100644 index 4279f51bca..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/conf/mime.types +++ /dev/null @@ -1,607 +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 file controls what Internet media types are sent to the client for -# given file extension(s). Sending the correct media type to the client -# is important so they know how to handle the content of the file. -# Extra types can either be added here or by using an AddType directive -# in your config files. For more information about Internet media types, -# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type -# registry is at . - -# MIME type Extensions -application/activemessage -application/andrew-inset ez -application/applefile -application/atom+xml atom -application/atomicmail -application/batch-smtp -application/beep+xml -application/cals-1840 -application/cnrp+xml -application/commonground -application/cpl+xml -application/cybercash -application/dca-rft -application/dec-dx -application/dvcs -application/edi-consent -application/edifact -application/edi-x12 -application/eshop -application/font-tdpfr -application/http -application/hyperstudio -application/iges -application/index -application/index.cmd -application/index.obj -application/index.response -application/index.vnd -application/iotp -application/ipp -application/isup -application/mac-binhex40 hqx -application/mac-compactpro cpt -application/macwriteii -application/marc -application/mathematica -application/mathml+xml mathml -application/msword doc -application/news-message-id -application/news-transmission -application/ocsp-request -application/ocsp-response -application/octet-stream bin dms lha lzh exe class so dll dmg -application/oda oda -application/ogg ogg -application/parityfec -application/pdf pdf -application/pgp-encrypted -application/pgp-keys -application/pgp-signature -application/pkcs10 -application/pkcs7-mime -application/pkcs7-signature -application/pkix-cert -application/pkix-crl -application/pkixcmp -application/postscript ai eps ps -application/prs.alvestrand.titrax-sheet -application/prs.cww -application/prs.nprend -application/prs.plucker -application/qsig -application/rdf+xml rdf -application/reginfo+xml -application/remote-printing -application/riscos -application/rtf -application/sdp -application/set-payment -application/set-payment-initiation -application/set-registration -application/set-registration-initiation -application/sgml -application/sgml-open-catalog -application/sieve -application/slate -application/smil smi smil -application/srgs gram -application/srgs+xml grxml -application/timestamp-query -application/timestamp-reply -application/tve-trigger -application/vemmi -application/vnd.3gpp.pic-bw-large -application/vnd.3gpp.pic-bw-small -application/vnd.3gpp.pic-bw-var -application/vnd.3gpp.sms -application/vnd.3m.post-it-notes -application/vnd.accpac.simply.aso -application/vnd.accpac.simply.imp -application/vnd.acucobol -application/vnd.acucorp -application/vnd.adobe.xfdf -application/vnd.aether.imp -application/vnd.amiga.ami -application/vnd.anser-web-certificate-issue-initiation -application/vnd.anser-web-funds-transfer-initiation -application/vnd.audiograph -application/vnd.blueice.multipass -application/vnd.bmi -application/vnd.businessobjects -application/vnd.canon-cpdl -application/vnd.canon-lips -application/vnd.cinderella -application/vnd.claymore -application/vnd.commerce-battelle -application/vnd.commonspace -application/vnd.contact.cmsg -application/vnd.cosmocaller -application/vnd.criticaltools.wbs+xml -application/vnd.ctc-posml -application/vnd.cups-postscript -application/vnd.cups-raster -application/vnd.cups-raw -application/vnd.curl -application/vnd.cybank -application/vnd.data-vision.rdz -application/vnd.dna -application/vnd.dpgraph -application/vnd.dreamfactory -application/vnd.dxr -application/vnd.ecdis-update -application/vnd.ecowin.chart -application/vnd.ecowin.filerequest -application/vnd.ecowin.fileupdate -application/vnd.ecowin.series -application/vnd.ecowin.seriesrequest -application/vnd.ecowin.seriesupdate -application/vnd.enliven -application/vnd.epson.esf -application/vnd.epson.msf -application/vnd.epson.quickanime -application/vnd.epson.salt -application/vnd.epson.ssf -application/vnd.ericsson.quickcall -application/vnd.eudora.data -application/vnd.fdf -application/vnd.ffsns -application/vnd.fints -application/vnd.flographit -application/vnd.framemaker -application/vnd.fsc.weblaunch -application/vnd.fujitsu.oasys -application/vnd.fujitsu.oasys2 -application/vnd.fujitsu.oasys3 -application/vnd.fujitsu.oasysgp -application/vnd.fujitsu.oasysprs -application/vnd.fujixerox.ddd -application/vnd.fujixerox.docuworks -application/vnd.fujixerox.docuworks.binder -application/vnd.fut-misnet -application/vnd.grafeq -application/vnd.groove-account -application/vnd.groove-help -application/vnd.groove-identity-message -application/vnd.groove-injector -application/vnd.groove-tool-message -application/vnd.groove-tool-template -application/vnd.groove-vcard -application/vnd.hbci -application/vnd.hhe.lesson-player -application/vnd.hp-hpgl -application/vnd.hp-hpid -application/vnd.hp-hps -application/vnd.hp-pcl -application/vnd.hp-pclxl -application/vnd.httphone -application/vnd.hzn-3d-crossword -application/vnd.ibm.afplinedata -application/vnd.ibm.electronic-media -application/vnd.ibm.minipay -application/vnd.ibm.modcap -application/vnd.ibm.rights-management -application/vnd.ibm.secure-container -application/vnd.informix-visionary -application/vnd.intercon.formnet -application/vnd.intertrust.digibox -application/vnd.intertrust.nncp -application/vnd.intu.qbo -application/vnd.intu.qfx -application/vnd.irepository.package+xml -application/vnd.is-xpr -application/vnd.japannet-directory-service -application/vnd.japannet-jpnstore-wakeup -application/vnd.japannet-payment-wakeup -application/vnd.japannet-registration -application/vnd.japannet-registration-wakeup -application/vnd.japannet-setstore-wakeup -application/vnd.japannet-verification -application/vnd.japannet-verification-wakeup -application/vnd.jisp -application/vnd.kde.karbon -application/vnd.kde.kchart -application/vnd.kde.kformula -application/vnd.kde.kivio -application/vnd.kde.kontour -application/vnd.kde.kpresenter -application/vnd.kde.kspread -application/vnd.kde.kword -application/vnd.kenameaapp -application/vnd.koan -application/vnd.liberty-request+xml -application/vnd.llamagraphics.life-balance.desktop -application/vnd.llamagraphics.life-balance.exchange+xml -application/vnd.lotus-1-2-3 -application/vnd.lotus-approach -application/vnd.lotus-freelance -application/vnd.lotus-notes -application/vnd.lotus-organizer -application/vnd.lotus-screencam -application/vnd.lotus-wordpro -application/vnd.mcd -application/vnd.mediastation.cdkey -application/vnd.meridian-slingshot -application/vnd.micrografx.flo -application/vnd.micrografx.igx -application/vnd.mif mif -application/vnd.minisoft-hp3000-save -application/vnd.mitsubishi.misty-guard.trustweb -application/vnd.mobius.daf -application/vnd.mobius.dis -application/vnd.mobius.mbk -application/vnd.mobius.mqy -application/vnd.mobius.msl -application/vnd.mobius.plc -application/vnd.mobius.txf -application/vnd.mophun.application -application/vnd.mophun.certificate -application/vnd.motorola.flexsuite -application/vnd.motorola.flexsuite.adsi -application/vnd.motorola.flexsuite.fis -application/vnd.motorola.flexsuite.gotap -application/vnd.motorola.flexsuite.kmr -application/vnd.motorola.flexsuite.ttc -application/vnd.motorola.flexsuite.wem -application/vnd.mozilla.xul+xml xul -application/vnd.ms-artgalry -application/vnd.ms-asf -application/vnd.ms-excel xls -application/vnd.ms-lrm -application/vnd.ms-powerpoint ppt -application/vnd.ms-project -application/vnd.ms-tnef -application/vnd.ms-works -application/vnd.ms-wpl -application/vnd.mseq -application/vnd.msign -application/vnd.music-niff -application/vnd.musician -application/vnd.netfpx -application/vnd.noblenet-directory -application/vnd.noblenet-sealer -application/vnd.noblenet-web -application/vnd.novadigm.edm -application/vnd.novadigm.edx -application/vnd.novadigm.ext -application/vnd.obn -application/vnd.osa.netdeploy -application/vnd.palm -application/vnd.pg.format -application/vnd.pg.osasli -application/vnd.powerbuilder6 -application/vnd.powerbuilder6-s -application/vnd.powerbuilder7 -application/vnd.powerbuilder7-s -application/vnd.powerbuilder75 -application/vnd.powerbuilder75-s -application/vnd.previewsystems.box -application/vnd.publishare-delta-tree -application/vnd.pvi.ptid1 -application/vnd.pwg-multiplexed -application/vnd.pwg-xhtml-print+xml -application/vnd.quark.quarkxpress -application/vnd.rapid -application/vnd.s3sms -application/vnd.sealed.net -application/vnd.seemail -application/vnd.shana.informed.formdata -application/vnd.shana.informed.formtemplate -application/vnd.shana.informed.interchange -application/vnd.shana.informed.package -application/vnd.smaf -application/vnd.sss-cod -application/vnd.sss-dtf -application/vnd.sss-ntf -application/vnd.street-stream -application/vnd.svd -application/vnd.swiftview-ics -application/vnd.triscape.mxs -application/vnd.trueapp -application/vnd.truedoc -application/vnd.ufdl -application/vnd.uplanet.alert -application/vnd.uplanet.alert-wbxml -application/vnd.uplanet.bearer-choice -application/vnd.uplanet.bearer-choice-wbxml -application/vnd.uplanet.cacheop -application/vnd.uplanet.cacheop-wbxml -application/vnd.uplanet.channel -application/vnd.uplanet.channel-wbxml -application/vnd.uplanet.list -application/vnd.uplanet.list-wbxml -application/vnd.uplanet.listcmd -application/vnd.uplanet.listcmd-wbxml -application/vnd.uplanet.signal -application/vnd.vcx -application/vnd.vectorworks -application/vnd.vidsoft.vidconference -application/vnd.visio -application/vnd.visionary -application/vnd.vividence.scriptfile -application/vnd.vsf -application/vnd.wap.sic -application/vnd.wap.slc -application/vnd.wap.wbxml wbxml -application/vnd.wap.wmlc wmlc -application/vnd.wap.wmlscriptc wmlsc -application/vnd.webturbo -application/vnd.wrq-hp3000-labelled -application/vnd.wt.stf -application/vnd.wv.csp+wbxml -application/vnd.xara -application/vnd.xfdl -application/vnd.yamaha.hv-dic -application/vnd.yamaha.hv-script -application/vnd.yamaha.hv-voice -application/vnd.yellowriver-custom-menu -application/voicexml+xml vxml -application/watcherinfo+xml -application/whoispp-query -application/whoispp-response -application/wita -application/wordperfect5.1 -application/x-bcpio bcpio -application/x-cdlink vcd -application/x-chess-pgn pgn -application/x-compress -application/x-cpio cpio -application/x-csh csh -application/x-director dcr dir dxr -application/x-dvi dvi -application/x-futuresplash spl -application/x-gtar gtar -application/x-gzip -application/x-hdf hdf -application/x-javascript js -application/x-koan skp skd skt skm -application/x-latex latex -application/x-netcdf nc cdf -application/x-sh sh -application/x-shar shar -application/x-shockwave-flash swf -application/x-stuffit sit -application/x-sv4cpio sv4cpio -application/x-sv4crc sv4crc -application/x-tar tar -application/x-tcl tcl -application/x-tex tex -application/x-texinfo texinfo texi -application/x-troff t tr roff -application/x-troff-man man -application/x-troff-me me -application/x-troff-ms ms -application/x-ustar ustar -application/x-wais-source src -application/x400-bp -application/xhtml+xml xhtml xht -application/xslt+xml xslt -application/xml xml xsl -application/xml-dtd dtd -application/xml-external-parsed-entity -application/zip zip -audio/32kadpcm -audio/amr -audio/amr-wb -audio/basic au snd -audio/cn -audio/dat12 -audio/dsr-es201108 -audio/dvi4 -audio/evrc -audio/evrc0 -audio/g722 -audio/g.722.1 -audio/g723 -audio/g726-16 -audio/g726-24 -audio/g726-32 -audio/g726-40 -audio/g728 -audio/g729 -audio/g729D -audio/g729E -audio/gsm -audio/gsm-efr -audio/l8 -audio/l16 -audio/l20 -audio/l24 -audio/lpc -audio/midi mid midi kar -audio/mpa -audio/mpa-robust -audio/mp4a-latm -audio/mpeg mpga mp2 mp3 -audio/parityfec -audio/pcma -audio/pcmu -audio/prs.sid -audio/qcelp -audio/red -audio/smv -audio/smv0 -audio/telephone-event -audio/tone -audio/vdvi -audio/vnd.3gpp.iufp -audio/vnd.cisco.nse -audio/vnd.cns.anp1 -audio/vnd.cns.inf1 -audio/vnd.digital-winds -audio/vnd.everad.plj -audio/vnd.lucent.voice -audio/vnd.nortel.vbk -audio/vnd.nuera.ecelp4800 -audio/vnd.nuera.ecelp7470 -audio/vnd.nuera.ecelp9600 -audio/vnd.octel.sbc -audio/vnd.qcelp -audio/vnd.rhetorex.32kadpcm -audio/vnd.vmx.cvsd -audio/x-aiff aif aiff aifc -audio/x-alaw-basic -audio/x-mpegurl m3u -audio/x-pn-realaudio ram ra -audio/x-pn-realaudio-plugin -application/vnd.rn-realmedia rm -audio/x-wav wav -chemical/x-pdb pdb -chemical/x-xyz xyz -image/bmp bmp -image/cgm cgm -image/g3fax -image/gif gif -image/ief ief -image/jpeg jpeg jpg jpe -image/naplps -image/png png -image/prs.btif -image/prs.pti -image/svg+xml svg -image/t38 -image/tiff tiff tif -image/tiff-fx -image/vnd.cns.inf2 -image/vnd.djvu djvu djv -image/vnd.dwg -image/vnd.dxf -image/vnd.fastbidsheet -image/vnd.fpx -image/vnd.fst -image/vnd.fujixerox.edmics-mmr -image/vnd.fujixerox.edmics-rlc -image/vnd.globalgraphics.pgb -image/vnd.mix -image/vnd.ms-modi -image/vnd.net-fpx -image/vnd.svf -image/vnd.wap.wbmp wbmp -image/vnd.xiff -image/x-cmu-raster ras -image/x-icon ico -image/x-portable-anymap pnm -image/x-portable-bitmap pbm -image/x-portable-graymap pgm -image/x-portable-pixmap ppm -image/x-rgb rgb -image/x-xbitmap xbm -image/x-xpixmap xpm -image/x-xwindowdump xwd -message/delivery-status -message/disposition-notification -message/external-body -message/http -message/news -message/partial -message/rfc822 -message/s-http -message/sip -message/sipfrag -model/iges igs iges -model/mesh msh mesh silo -model/vnd.dwf -model/vnd.flatland.3dml -model/vnd.gdl -model/vnd.gs-gdl -model/vnd.gtw -model/vnd.mts -model/vnd.parasolid.transmit.binary -model/vnd.parasolid.transmit.text -model/vnd.vtu -model/vrml wrl vrml -multipart/alternative -multipart/appledouble -multipart/byteranges -multipart/digest -multipart/encrypted -multipart/form-data -multipart/header-set -multipart/mixed -multipart/parallel -multipart/related -multipart/report -multipart/signed -multipart/voice-message -text/calendar ics ifb -text/css css -text/directory -text/enriched -text/html html htm -text/parityfec -text/plain asc txt -text/prs.lines.tag -text/rfc822-headers -text/richtext rtx -text/rtf rtf -text/sgml sgml sgm -text/t140 -text/tab-separated-values tsv -text/uri-list -text/vnd.abc -text/vnd.curl -text/vnd.dmclientscript -text/vnd.fly -text/vnd.fmi.flexstor -text/vnd.in3d.3dml -text/vnd.in3d.spot -text/vnd.iptc.nitf -text/vnd.iptc.newsml -text/vnd.latex-z -text/vnd.motorola.reflex -text/vnd.ms-mediapackage -text/vnd.net2phone.commcenter.command -text/vnd.sun.j2me.app-descriptor -text/vnd.wap.si -text/vnd.wap.sl -text/vnd.wap.wml wml -text/vnd.wap.wmlscript wmls -text/x-setext etx -text/xml -text/xml-external-parsed-entity -video/bmpeg -video/bt656 -video/celb -video/dv -video/h261 -video/h263 -video/h263-1998 -video/h263-2000 -video/jpeg -video/mp1s -video/mp2p -video/mp2t -video/mp4v-es -video/mpv -video/mpeg mpeg mpg mpe -video/nv -video/parityfec -video/pointer -video/quicktime qt mov -video/smpte292m -video/vnd.fvt -video/vnd.motorola.video -video/vnd.motorola.videop -video/vnd.mpegurl mxu m4u -video/vnd.nokia.interleaved-multimedia -video/vnd.objectvideo -video/vnd.vivo -video/x-msvideo avi -video/x-sgi-movie movie -x-conference/x-cooltalk ice diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/AlertDisplay.php b/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/AlertDisplay.php deleted file mode 100644 index 2b9eb916a0..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/AlertDisplay.php +++ /dev/null @@ -1,204 +0,0 @@ - -loadFile("./Cached_Alerts.xml"); - $cached_alerts = $doc->getRootDataObject(); - - // Use the alertService reference - $new_alerts = $this->alert_service->getAllNewAlerts(); - - foreach($new_alerts->alert as $alert){ - $new_alert = $cached_alerts->createDataObject('alert'); - $new_alert->title = $alert->title; - $new_alert->summary = $alert->summary; - $new_alert->address = $alert->address; - $new_alert->date = $alert->date; - $new_alert->sourceid = $alert->sourceid; - $new_alert->unread = true; - } - - $return_table = ""; - $alert_id_number = 0; - foreach($cached_alerts->alert as $alert){ - $alert->id = "alert_" . $alert_id_number; - $title = substr($alert->title,0,80); - $summary = substr($alert->summary,0,40); - $unread_string = $alert->unread ? "unread_title" : "read_title"; - $return_row = << - - - -ALERTROW; - $return_table = $return_table . $return_row; - $alert_id_number += 1; - } - $return_table = $return_table . "
          - $title - - $summary ... - - $alert->date -
          "; - - // as php is one shot we have to save away the alerts we want to cache - $xmldas->saveFile($doc, "./Cached_Alerts.xml"); - - return $return_table; - } - - /** - * @param string $alert_id - * @return string - */ - public function readAlert($alert_id) - { - $xmldas = SDO_DAS_XML::create("./Alerter.xsd"); - $doc = $xmldas->loadFile("./Cached_Alerts.xml"); - $cached_alerts = $doc->getRootDataObject(); - - $return_summary = ""; - - foreach($cached_alerts->alert as $alert){ -SCA::$logger->log($alert->id . " vs " . $alert_id ); - if (strcmp($alert->id,$alert_id) == 0){ - SCA::$logger->log("Match"); - $alert->unread = false; - $return_summary = "
          " . $alert->summary . "
          "; - } - } - - // as php is one shot we have to save away the alerts we want to cache - $xmldas->saveFile($doc, "./Cached_Alerts.xml"); - - return $return_summary; - } - - /** - * @return string - */ - public function getAlertSourcesHTMLTable() - { - # Use the alertService reference - $alert_sources = $this->alert_service->getAlertSources(); - -// some debug -//ob_start(); -//print_r( $alert_sources ); -//$debug = ob_get_contents(); -//ob_end_clean(); -//SCA::$logger->log($debug); - - $return_table = "\n"; - - foreach ($alert_sources->source as $alert_source){ - $source_id = $alert_source->id; - $return_row = << - - - - - - - -SOURCEROW; - $return_table = $return_table . $return_row; - } - - $return_table = $return_table . "
          -   $alert_source->name -
          \n"; - return $return_table; - } - - /** - * @param integer $source_id - * @return string - */ - public function deleteAlertSource($source_id){ - # Use the alertService reference - $this->alertService->removeAlertSource($source_id); - - //TODO - } - - /** - * @param source $alert_source http://tuscany.apache.org/samples/alerter - */ - public function addAlertSource($alert_source){ - # Use the alertService reference - $this->alertService->addAlertSource($alert_source); - } - - /** - * @param source $alert_source http://tuscany.apache.org/samples/alerter - */ - public function updateAlertSource($alert_source){ - # Use the alertService reference - $this->alertService->updateAlertSource($alert_source); - } -} -?> - - - diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/Alerter.xsd b/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/Alerter.xsd deleted file mode 100644 index 58b9982d38..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/Alerter.xsd +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/Cached_Alerts.xml b/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/Cached_Alerts.xml deleted file mode 100644 index 03901c804c..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/Cached_Alerts.xml +++ /dev/null @@ -1,214 +0,0 @@ - - -Polymer Vision's Readius rollable display gets face timeFiled under: Cellphones, DisplaysTalk about a long time coming, as what is now Polymer Vision has seemed to finally put all the pieces together and produce an actual working product from the idea envisioned by Philips around two years ago. We knew the spinoff was looking to commercialize the product later this year, but after nearly 24 months of coming up empty, a bit of understandable skepticism begins to seep through. Nevertheless, the firm's rollable, pocket-friendly "Cellular-Book" was out and showing its stuff at 3GSM, proving that there's at least something there to put on store shelves. Although the unit on display was indeed a standalone device -- sporting 16 shades of grey, USB, "10-days" of battery life, 4GB of internal storage, and GPRS, EDGE, and DVB-H connectivity just like we'd heard -- Polymer Vision is actually hoping to integrate its e-paper technology into mobile handset displays in the near future. Sadly, there still didn't seem to be any hints of a release date for the nifty pocket reader, but be sure to click on through for the very long awaited pictures of the Readius in action.[Via Slashdot]Continue reading Polymer Vision's Readius rollable display gets face time Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92945682/
          2007-02-19T15:54:00
          Sirius and XM set to merge?Filed under: Portable Audio -Well, we can't exactly say that we didn't see this one coming, but for the deal to actually get inked would indeed be something special. According to the New York Post, Sirius and XM are all set to announce a merger deal after hammering out details all weekend long. Of course, it was noted that the somewhat shaky agreement "could fall apart at any time," and interestingly enough, both companies purportedly spent the majority of their (and their lawyers) time ironing out the good stuff while leaving "regulatory concerns" on the back burner. Unfortunately, those very issues could be insurmountable hurdles, as the typically stubborn FCC certainly has played hard ball with each company before, and having one overriding satellite provider with no competition in sight is ripe for monopoly arguments. Regardless, you won't find us complaining about a little Howard just a few channels down from Oprah, or a dash of MLB just a dozen notches from the NFL, but considering that gaining that oh-so-critical regulatory approval "could take up to 15 months," we wouldn't count on your lineup changing anytime soon no matter what. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92940034/
          2007-02-19T15:24:00
          Sony's Cybershot DSC-W80: their latest 7.2 megapixel camera?Filed under: Digital Cameras -Out of the gates early for PMA (Photo Marketing Association) 2007, we've got rumors of the latest Sony Cybershot, the DSC-W80. The cam's already made its appearance on a few German and Dutch web sites and certainly makes sense as the successor to the 7.2 megapixel W70 launched at last year's show. However, instead of 8 megapixels like you might expect, we're still talking that same 7.2-megapixel, 1/2.5-inch CCD (which won't help improve the high rates of noise above ISO 200 any), 3x optical zoom, and 2.5-inch LCD. Other than a new ISO 3200 sensitivity and slightly larger chassis -- up from 89 x 57 x 23-mm to 91 x 58 x 23-mm -- there isn't anything new on the surface to report. No one's sayin' but perhaps they've added some optical image stabilization to bring these in-line with most other compact shooters in this range. We've also got rumors of a new Cybershot DSC-W60 and Cybershot DSC-W90 -- both unannounced and both said to work with a new SPK-SA underwater case (pictured after the break). The W80 is expected to hit in April for around 280/$368. As to the rest... well, the PMA show starts March 8th so we'll know soon enough. [Via Let's Go Digital, thanks David]Continue reading Sony's Cybershot DSC-W80: their latest 7.2 megapixel camera? Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92929558/
          2007-02-19T14:42:00
          Gresso's Symphonia MP3 players for the nouveau richeFiled under: Portable AudioHow do you make a splash in the already saturated MP3 player market? Well, there's always limited-edition pink, or how 'bout a $4,000+ luxury player which touts "craftsmanship" (not sound quality or user experience) as its primary forte? Naturally, we're talking about Gresso, the Russian outfit already infamous for their luxury cellphones. Their new Symphonia audio players all measure in at 39 x 39 x 10.5-mm making them just a touch bigger than the iRiver S7 and iPod shuffle. Each features a RAZR-esque laser-etched keypad, built-in FM tuner, and 1GB of flash memory for your MP3, WMA, ASF and OGG files. In fact, the four models only differ in materials which range from ancient hardwoods to 18 carat gold. Expected in Q2 with too-beaucoup pricing in the area of $4,000 to $6,000. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92922919/
          2007-02-19T14:22:00
          Earth Trek's USB Tape DispenserFiled under: Misc. Gadgets, Peripherals -Ours is not to question why, only to accept the inevitable convergence of USB and pretty much everything else within the vicinity of our PCs. Meet the newly announced 4-port USB 2.0 hub and tape dispenser from Hong Kong's Earth Trek. It comes in large and small versions and can naturally be affixed with your very own logo for some good ol' corporate schwag. Sorry, these devices are not USB powered -- but if you're the type who finds it overly taxing to dispense tape, then maybe you should be looking into a bionic suit. "Coming soon" in several color options for an undisclosed price. - -[Via Akihabara News] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92922925/
          2007-02-19T14:02:00
          The do-it-yourself SSD adapterFiled under: Storage - If you can't afford the real deal, then prepare to get your jank on with this, the not-so-poor-man's solid state disk. The SDB25SD from GeekStuff4U can host up to 4x SD (not SDHC) cards for a maximum capacity of 8GB. Just slip the four cards into the 2.5-inch sled which then slots-in to any available IDE connector where -- presumably -- the total capacity is presented as a single disk volume... who knows? So how much would you pay for something like this: $50, $40, or maybe $20? Try $258.50 and you have to provide the SD flash. Word to the wise: SSD prices are dropping fast -- you'll pay about the same price for a full 16GB SSD card if you can hold on until June or so.[Via Akihabara News] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92910485/
          2007-02-19T13:32:00
          Sharp's EM ONE: a dual-sliding Pocket PC with HSDPA and WiFiFiled under: Handhelds, Wireless -Check it W-Zero3, Sharp just one-upped your azz with their new EM ONE handheld. This Windows Mobile 5.0 Pocket PC device brings 3.6Mbps HSDPA and 802.11b/g data to the game along with hot dual-sliding action under that 4.1-inch touch-screen display. Unlike Samsung's F520 dual-slider which combines a QWERTY and numeric keypad for making calls, Sharp's slab is a data-only device so they combine the QWERTY with a side-sliding navigation pad for scooting around the 800 x 480 pixel display. However, Sharp's EM ONE comes heavy on the chub at 140x70x18.9-mm compared to the F520's 105x54x17.4-mm or even Nokia's N800 which is about the same length and width but much thinner at 145x75x12.7-mm. The whole kit comes powered by a Marvell 520MHz PXA270 processor and nVidia GoForce 5500 graphics along with 512MB/128MB flash/SDRAM memory and miniSD expansion. The display boasts a rather anemic 65k color palette (albeit, the same as the N800) for viewing integrated 1-Seg mobile TV and WMV videos with WMA and MP3 audio playback supported by a pair of built-in stereo speakers. Rounding out the specs are Bluetooth 1.2, a 1.3 megapixel CMOS camera, stylus, and a 4-hour battery. On sale in Japan starting March 31st for 95,000 (about $797) without contract or 39,800 ($332) with 2-year commitment.Gallery: Sharp's EM ONE: a dual-sliding PocketPC with HSDPA and WiFi[Via Impress] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92903979/
          2007-02-19T13:02:00
          Leaders condemn India train blastIndia and Pakistan say a train bombing that killed at least 66 people will not disrupt their peace process.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6375749.stm
          2007-02-19T13:27:07
          At least 30 die in Iraq attacksA number of attacks in Iraq leave at least 30 dead, despite a security operation across the country.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6374909.stm
          2007-02-19T16:20:31
          Priest jailed for exorcism deathA Romanian priest who caused the death of a nun during an exorcism ritual is jailed for 14 years.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/europe/6376211.stm
          2007-02-19T16:29:36
          Czech-Polish OK for US missilesCzech and Polish leaders back a US plan to install missile defence facilities on their territory.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/europe/6376137.stm
          2007-02-19T15:02:36
          Mexico holds mine tragedy vigilMexico marks the anniversary of a blast that killed 65 miners, most of whose bodies have not been found.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6376267.stm
          2007-02-19T15:47:12
          'Anti-terror force' for SomaliaSomalia's government sets up a joint police and military unit to counter attacks by suspected Islamists.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/6375699.stm
          2007-02-19T12:33:12
          Row threatens Nigerian allianceTwo top Nigerian presidential candidates swap insults, casting doubt on the alliance between their two parties.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/6376521.stm
          2007-02-19T15:53:07
          Colombian foreign minister quitsColombia's foreign minister resigns after the arrest of her brother on suspicion of links with paramilitary groups.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6376359.stm
          2007-02-19T15:40:03
          Wrangling hits Airbus restructureAirbus shelves a key decision on a major overhaul of the business, amid strife between its European partners.
          http://news.bbc.co.uk/go/rss/-/1/hi/business/6375517.stm
          2007-02-19T13:04:02
          Nepal king 'takes responsibility'Nepal's King Gyanendra publicly accepts responsibility for "success and failure" under his period of direct rule.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6375207.stm
          2007-02-19T14:11:40
          More than 20 die in Iraq attacksA number of attacks in Iraq leave more than 20 dead, despite a security operation across the country.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6374909.stm
          2007-02-19T17:05:24
          Sling's upcoming SlingLink Turbo leaked?Filed under: Home Entertainment, Networking -When you're slinging media across the home, there's no such thing as "too much bandwidth," and it looks like Sling Media is beefing up its SlingLink line of home wiring network products with the SlingLink Turbo. The new device ups the bandwidth from 14Mbps to 85Mbps, and while the original SlingLinks were primarily designed for a single Slingbox connection, the Turbo vision should be able to handle more general purpose home media networking tasks. The SlingLink Turbo was spotted by a SlingCommunity member on Amazon.com, with an expected ship date of February 27th 2007 for $149. The device is interoperable with existing PowerLine adapters, and has four Ethernet ports beyond the PowerLine link. As far as rumors go, this one looks pretty legit, but with a February 27th date on the books, we should know exactly how legit before too terribly long.[Thanks TieGuy] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93021486/
          2007-02-19T20:55:00
          It's official: XM and Sirius plan to tie the knot - It's been more than two years since we first reported that XM and Sirius were in talks to merge, and although the New York Post may have jumped the gun a bit way back then, it was certainly on the money today, as the two satellite radio pioneers have just issued a joint press release stating their intention to become life partners. In the proposed $13 billion deal -- which they'd like to go down by the end of the year but which still must pass rather daunting regulatory scrutiny and opposition from such heavyweights as the National Association of Broadcasters -- investors would get 4.6 shares of Sirius stock for each share of XM, with current Sirius CEO Mel Karmazin and XM Chairman Gary Parsons retaining those roles, respectively, in the combined entity (whose name has yet to be decided). As you might imagine, the companies are already trying to spin this as a big win for everyone from Martha Stewart on down, arguing that consumers will end up benefiting from more programming choices and better hardware, manufacturers and retailers will see increased sales, and of course shareholders would gain value through the economies of scale and elimination of redundancies realized from a merger. The new pals also took an opportunity to sneak in a mention about the growing number of choices consumers have for receiving audio content, from old school AM/FM to internet radio to the the still-nascent technologies of cellphone streaming and HD radio, clearly hoping to sway public opinion on that whole anti-trust thing. Still, keep in mind that the FCC is gonna be taking a long, hard look at this one -- in fact, current regulations would need to be changed in order for the merger to gain approval -- so don't get your celebratin' started just yet. Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93011139/
          2007-02-19T20:30:00
          Details emerge on Sony's DSC-W90, W200 digital camerasFiled under: Digital CamerasThe big PMA 07 trade show is still weeks away, but we seem to be already getting a pretty good idea of what Sony will be showing off, first with word of its 7.2 megapixel DSC-W80 getting out earlier today, and now with details on two additional models appearing on SonyCenter.lu's discussion forums before not-so-mysteriously disappearing. Thankfully, good 'ol Google Cache has preserved all the relevant information so you won't have to wait until March to satisfy your curiosity. Apart from the difference in megapixels, with 12 on the W200 and 8 on the W90, the two cameras appear to be virtually identical, each boasting a 3x optical zoom, 2.5-inch LCD, Carl Zeiss Vario-Tessar optics, Sony's trademark SteadyShot and Face Recognition features, ISO settings up to 3200 and, perhaps most notable, HDMI outputs. Unfortunately, there's no pics of either camera, although they'll apparently be similar in design to the W55 (pictured here), only with a "finer," "more beautiful" case. There's also no word on price or availability, although that should be revealed at the official PMA launch next month.[Thanks, Rashid] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93004352/
          2007-02-19T19:48:00
          What tech would the Presidents rock in 2007?Filed under: Features, Misc. Gadgets - Sure, Washington had his dentures, Lincoln his ironclads and Jefferson his swivel chair, but what kind of kit would they be messing around with in 2007? In search of answers based on broad and most likely mis-guided and / or offensive stereotypes, we bring you the following list. Feel free to rip it to shreds in the comments, just make sure to keep it patriotic -- Big Brother is watching. Happy Presidents Day!#vistachart { border: 2px solid #333; border-collapse: collapse; } #vistachart td { padding: 3px; border: 1px solid #ccc; vertical-align: top; margin: 0; line-height: 1.3em; } #vistachart th { font-weight: bold; text-align: left; padding: 4px; background: #eee; } #vistachart th.mainth { border-bottom: 1px solid #333; font-size: 1.2em; } #vistachart td.red { background-color: #f08c85; } #vistachart td.green { background-color: #b3e2c4; - - - - Washington(rebel)Lincoln(uniter)Jefferson(hipster)Roosevelt(fearless) - - - OS - Linux (last night's build) - Mac OS X (with Vista in Parallels and Linux via Boot Camp) - Mac OS X - Vista (x64) - - - Computer - OQO (has an OLPC XO at home) - MBP - MacBook - Toughbook - - - Media player - Make Daisy - Sansa - iPod - Zune - - - HD format - HD DVD - LG BH100 hybrid player - Blu-ray - DivX + BitTorrent, dude - - - Carrier - T-Mobile - AT T - T-Mobile - VoIP over neighborFi - - - Console - Gamepark GP2X, SNES - Wii, Xbox 360, PS3 - Wii - PS3 - - - Vehicle - Homebrew biodiesel - Prius - Tesla Roadster - Segway - - - Phone - OpenMoko - 8525 - Sidekick 3 - Greenphone - - - Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92998051/
          2007-02-19T19:21:00
          Solar Technology's Freeloader saps power from USB, the SunFiled under: Misc. Gadgets, Peripherals -While it won't do your laptop any good, this new Freeloader gig from Solar Technology should be able to provide juice to just about every other gadget in your repertoire. The device contains its own li-ion rechargeable battery, which it can fill up from your laptop or desktop's power via USB, or using its 120mA crystalline solar cells. From there you've got a master cable and eleven adaptors to get the electricity into your phone, camera, PDA, GPS, gaming handheld or DAP. Solar Technology seems to have most of the big brands covered, and claims it can fuel an iPod for 18 hours, a mobile phone for 44 hours, PSP for 2.5 hours and a PDA for 22 hours -- not too shabby for the 6.5 ounce unit. Sure, we've seen plenty of similar chargers before, but the combination of device compatibility and relatively low price ( 30, about $59 US) makes this a decent option for those sun-drenched road warriors out there. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92990699/
          2007-02-19T18:54:00
          Sony's 1/1.8-inch high-speed CMOS sensor outputs 60fpsFiled under: Digital CamerasThankfully, it looks like Sony has come through yet again, and while it wasn't exactly in the timeliest of manners, the high-speed CMOS sensor that it promised would deliver 60fps of video output is finally upon us. The 1/1.8-inch IMX017CQE sensor boasts 6.4-megapixels of resolution and the uncanny ability to "output this resolution at 60 frames per second (a data rate of around 384 megapixels per second)." In layman's terms, this chip has the ability to capture full motion video and grab high-quality stills without dropping a single frame, giving users a seamless transition between the two. Additionally, the 1/1.8-inch size and its ability to deliver 300 frames per second at lower resolutions moves it a bit further from the pack, not to mention the 12-bit A/D converter for each column. No word just yet on when these video-centric chips will hit Sony's CyberShot lineup, but it's an awful lot closer to reality than the last time we caught wind of it. [Warning: PDF read link][Via DPReview] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92983675/
          2007-02-19T18:24:00
          Is "3X DVD" HD DVD's secret weapon against Blu-ray?Filed under: HDTV While the Blu-ray camp is busy claiming victory, recently HD DVD supporters seem to be circling the wagons around an old friend, the -- 'til now -- unused 3X DVD technology. HD DVD has always claimed it holds a price advantage over Blu-ray, by way of offering low cost upgrades for existing DVD manufacturing processes. The 3X DVD spec takes that a step further, while it's a part of the HD DVD format and apparently only compatible with HD DVD players, the discs themselves are physically exactly the same as standard red-laser DVDs. Throw in a software upgrade to support high definition content, HD DVD's UDF 2.5 file structure and AACS and you have a way to deliver HDTV content on a 9.4 GB DVD. By using newer encoding technologies like MPEG-4 and VC-1 and/or lowering the resolution to say, 720p, full length movies easily fit on a standard DVD. Eclipse Data Technologies, a supplier of HD DVD mastering equipment just announced it is offering free upgrades to its customers in order to support 3X DVD manufacturing. This was followed today by DCA Inc. announcing it has mastered the first 3X DVD disc, and that several manufacturers are looking at it as a possible low cost path into HD video. 3X DVD's potential to allow for noticeably lower-priced HD content to come to market is definitely there, but it still remains to be seen if this, like combo DVD/HD DVDs and Total Hi-Def discs will find a home and support in the marketplace. Read - First 3X DVD-ROM Disc Cut with DCA Equipment Read - Eclipse Provides Free HD DVD Upgrade to Replication Facilities Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/92975896/
          2007-02-19T17:54:00
          Leaders condemn India train blastIndia and Pakistan say a train bombing that killed at least 66 people will not disrupt their peace process.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6375749.stm
          2007-02-19T18:39:31
          Iran, Russia in nuclear plant rowTehran denies Russian claims it is late on payments for work on a nuclear reactor in southern Iran.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6375477.stm
          2007-02-19T18:33:05
          Colombian foreign minister quitsColombia's foreign minister resigns after the arrest of her brother on suspicion of links with paramilitary groups.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6376359.stm
          2007-02-19T18:39:55
          Five US troops die in Iraq raidsFive US soldiers die in two attacks in Iraq on a day violence claims more than 25 lives across the country.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6374909.stm
          2007-02-19T20:24:32
          Iran hangs man for attack on busIran executes a man over a bomb attack which killed 11 members of its elite Revolutionary Guards last week.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6377101.stm
          2007-02-19T20:15:50
          Flood aid struggle in MozambiqueMozambique says it has the use of only one UN helicopter to help thousands of people displaced by severe floods.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/6377427.stm
          2007-02-19T21:57:46
          Manhunt for train fire suspectsPolice in India issue sketches of two men they believe got off a train minutes before a deadly bomb attack.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6377471.stm
          2007-02-20T07:32:59
          Miami baby sets premature recordA baby believed to have spent the shortest time in her mother's womb is set to leave hospital in the US.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6377639.stm
          2007-02-20T08:14:18
          Nato troops raid Karadzic homesNato troops in Bosnia search the homes of the children of indicted war criminal Radovan Karadzic.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/europe/6377711.stm
          2007-02-20T08:19:29
          Cheney ready for US-Japan talksUS Vice-President Dick Cheney arrives in Tokyo to discuss regional security issues and Iraq.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/asia-pacific/6377649.stm
          2007-02-20T08:25:12
          LG's 17-inch W1PRO EXPRESS DUAL laptop packs DVB-T, VistaFiled under: LaptopsIf you've been eying a Vista-equipped laptop to treat yourself after all that chocolate you dutifully resisted last week, you might as well get a TV tuner built right in. LG Electronics' latest 17-inch behemoth packs a silver / black enclosure, integrated DVB-T tuner, and your choice of Intel Core 2 Duo processors to boot. Under the hood you'll find a WSXGA+ display, support for 5.1 Dolby Digital audio, dual 1.2-watt stereo speakers, ATI's Mobility Radeon X1600 graphics set, Bluetooth 2.0, WiFi, and of course, Windows Vista Home Premium pre-installed. While the W1PRO EXPRESS DUAL isn't exactly the lightest machine out there, it weighs in at a respectable 6.8-pounds and shouldn't make a half bad media-centric portable, but considering the nearly $2,600 pricetag LG has slapped on it, bargain hunters needn't look here long.[Via Gizmag] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93370051/
          2007-02-20T15:38:00
          GlobalTop intros GPS HUD Speed MeterFiled under: GPS, TransportationIt's practically a foregone conclusion that eying your handy GPS unit a bit too much whilst cruising down the freeway can indeed put you and your fellow motorists in peril, and while robotic turn-by-turn voiceovers do quell the staring fits somewhat, we still tend to rely a tad too much on sheer visuals. GlobalTop is hoping to make the roads a safer place to navigate with its forthcoming GPS HUD Speed Meter, which will supposedly makes its debut at CeBIT. This Bluetooth-enabled device purportedly "displays your speed and other navigational info, like direction, onto your car's windshield," and also enables handsfree communications with your BT-equipped cellphone. Moreover, the speed meter can be setup to alert the driver when exceeding a user-set limit, and while you may not be familiar with the brand, it's reportedly a spinoff of f-tech, which bodes fairly well for us actually seeing this thing beyond the Photoshop stage. As expected, there's no pricing or availability deets surfacing just yet, but all that should change come next month.[Via NaviGadget] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93355876/
          2007-02-20T15:08:00
          Cylo's 3style jog wheel / mouse spins it upFiled under: PeripheralsWhile we've seen more than a few folks get a little mod-happy when it comes to crafting their own mousing devices, Cylo Technology is offering up an apparently well thought-out device that should have audio / video editors going wild. If you feel more comfortable spinning a jog wheel than you ever have manually moving a cursor, the "three-dimensional" 3style mouse is right down your alley, as the hybrid input peripheral handles the typical X and Y axes as well as giving users the ability to scroll in any direction with a simple spin. Utilizing a ball bearing pad, the knob can spin freely with just a nudge, and can interpret Z-axis data as well as offering up right-click functionality by squeezing the edges. While some may envision faint similarities to the iMac's hockey puck mouse of days past, this rendition could probably last a bit more than 30 seconds before becoming destined for the trash bin. Nevertheless, the 3style mouse can be used wirelessly as well as in a wired form, and can purportedly work seamlessly with any application that supports a scroll wheel or jog dial, but we'll have to wait until this thing actually hits store shelves before testing out these bold claims ourselves. Click on through for a live demonstration.[Via HackedGadgets]Continue reading Cylo's 3style jog wheel / mouse spins it up Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93350237/
          2007-02-20T14:42:00
          Segway's RMP platform for nerdy robotsFiled under: Robots, TransportationWhat do you do when your overly hyped Human Transporter skids off the plateau of human interest only to be pummeled by archaic transportation laws? Why, start building mobility solutions for robots, of course. We've already seen a few lazy robots riding Segways around the lab; soon enough, we'll be seeing a lot more what with the Segway RMP (Robotic Mobility Platform) now launched in Japan. The RMP is meant to provide a quick and easy transportation underpinning for new domestic and military robots. RMPs range in price from 6,037,500 to 1,376,550 ($50,000 to about $11,500) and vary by maximum load, speed, size, max angle of climb, and battery capacity. Let the robot crusades begin! Via Robot Watch] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93336617/
          2007-02-20T14:12:00
          Century's Dolphin waterproof MP3 playerFiled under: Cellphones, Portable Audio - Wrap an MP3 player in a silicon tube held secure with cable-ties and what do you get? Well, if you're Japan's Century then you've got yourselves a waterproof MP3 player dubbed the Dolphin. Ok, the player does carry an IPX7 Ingress protection rating which means it really is waterproof (not just splash-proof) up to a depth of about 1 meter -- ideal for laps around the Coral Key Park Marine Preserve. Inside, the Dolphin packs 1GB of flash, USB 2.0, and support for MP3/WMA playback off 8-hour battery. Looks aside, at 12,800 (about $107) -- which includes a pair of unusually decent looking waterproof headphones -- it'll save you a healthy chunk-o-change compared to the $250 waterproof iPod shuffle we showed you last week. [Via Impress] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93336618/
          2007-02-20T13:52:00
          Sharp's AQUOS R-series of LCDs announcedFiled under: Displays, HDTV -Step aside AQOUS D-Series of LCDs, Sharp just unveiled their new flagship R-series of LCD panels for Japan. The new line-up ranges in size from 42- to 65-inches with each packing a 120Hz ASV LCD panel, 3x 1080p HDMI inputs, 1x DVI for that quick all-digital hook-up to your PC, and 2x Firewire for connecting your DV camera and one of Sharp's line-up of hi-def recorders including their new BD-HP1 Blu-ray recorder for on-the-quick dubbing. Just for kicks, Sharp also added their favorite new pet technology, IrSS (AKA, IrSimple) high-speed infrared for throwing up images from like-equipped cellphones and digital cameras. Of course, they also feature dual, integrated analog and digital tuners and 10/100Mbps Ethernet to access Japan's acTVila TV Internet service. The big, bad 65-inch LC-65RX1W (pictured above) mama of the bunch features a 450cd/m2 brightness, 3000:1 contrast ratio, 176-degree angle of visibility, while tipping the scales at 66kg (146-pounds) at just 9.6~12.4-cm (3.78~4.88-inches) thin. It's available March 10th in Japan for 1,000,000 or about $8,361. Expect the rest to hit no later than April with the 57-inch LC-57RX1W demanding 900,000 ($7,524), the 52-inch LC-52RX1W 650,000 ($5,434), the 46-inch LC-46RX1W 550,000 ($4,598), and the 42-inch LC-42RX1W 500,000 ($4,180). [Via Impress] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93330298/
          2007-02-20T13:22:00
          Sharp's BD-MPC70 Blu-ray theater in a boxFiled under: HDTV, Home Entertainment -We already caught their 2.1 channel home theater back at the CEDIA show in September. This time however, Sharp gets official with their new 7.1 Blu-ray in a box home theater kit. The BD-MPC70 pumps 175W across a full 7.1 channels of 8-ohm phallus with playback support for single-layer BD-R/RE media in addition to DVD video, DVD R/RW, DVD-RAM, music CDs, and CD-RW/-R discs. It delivers a 12bit/148.5MHz video DAC and 24bit/192kHz audio DAC with a healthy smattering of the ol' in and outs including 2x digital and 2x analog audio inputs and 1080p video output over HDMI. Available June 25th in Japan for 1,050,000 or about $8,779 whenever these come Stateside. [Via Impress] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93314228/
          2007-02-20T12:42:00
          Engadget Exclusive: Sony's 2007 Cybershot lineupFiled under: Digital Cameras - That's right, we've got 'em -- catalog shots for Sony's 2007 Cybershot line-up of digital cameras. Go ahead, check the new T20HDPR, T100, T20, H9, H7, G1 (pictured), W200, and W90 Cybershots -- you won't be sorry. All the new cams bring Sony's Super SteadyShot image stabilization and HD output to the show in addition to a hot mix of features spread out across the line; these include such notables as 802.11b/g WiFi with DLNA support, 2GB on-board memory for music playback, a 3-inch tilt-screen LCD, 3.5-inch (yes, 3.5-inch!) LCD, a couple of 15x optical zooms, face-detection technology, and BIONZ image processing -- good to know. Judging by the pics, we can expect a formal, pre-PMA show announcement from Sony on 27 February. Check the gallery below for all the details.Gallery: Engadget Exclusive: Sony's 2007 Cybershot lineup[Thanks, anonymous tipster] Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93308137/
          2007-02-20T12:07:00
          Woman plummets onto subway tracks while carelessly textingFiled under: Cellphones Granted, texting just might be bigger than Hollywood these days, but bigger than concern for one's own life? Apparently a Kawanishi woman was taking her well-being for granted during her daily route to work, as she collided with a man in a subway station whilst texting away at 8:30 in the morning. Subsequently, she plummeted a few feet down onto the subway tracks, only to be saved by a station worker who fearlessly hopped down to rescue her SMS-focused mind (and body, too) as the oncoming train screeched to a halt just 20 meters before running her over. Thankfully, the dame suffered just minor injuries in the fall, but an estimated 4,500 employees were blaming her for holding up their progress when clocking in late. Notably, there was no word on whether or not the phone was saved, or more importantly, whether or not the presumably urgent SMS ever got sent -- but considering this is the second case in a matter of days in which a human being nearly lost their life to a cellphone, we beg you: text responsibly, dear friends.[Via TokyoMango] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93274207/
          2007-02-20T10:27:00
          Iran defiant on nuclear programmeIran's president rejects calls to suspend uranium enrichment, a day before a UN deadline runs out.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6378289.stm
          2007-02-20T15:33:54
          Tobacco firm wins payout appealThe US supreme court throws out a ruling that Philip Morris must pay $79.5m to the widow of a dead smoker.
          http://news.bbc.co.uk/go/rss/-/1/hi/business/6379767.stm
          2007-02-20T15:48:25
          New footage of JFK's last momentsA previously unreleased film of John F Kennedy's motorcade shows new details of the final moments before his killing.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6378463.stm
          2007-02-20T11:04:18
          Heavy shelling in Somali capitalAt least 12 people are killed in the heaviest fighting in the Somali capital Mogadishu this year.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/6377941.stm
          2007-02-20T13:22:09
          Pakistan FM visits bomb survivorsPakistan's foreign minister, in India for peace talks, visits survivors of an attack on a cross-border train.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6379119.stm
          2007-02-20T14:41:38
          EU reaches emissions cuts dealEU environment ministers agree in principle to cut emissions by 20% by 2020, and seek a global 30% cut.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/europe/6377983.stm
          2007-02-20T13:45:47
          Most premature baby going homeA baby believed to have spent the shortest time in her mother's womb is set to leave hospital in the US.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6377639.stm
          2007-02-20T09:48:15
          Experts tackle the devil's tumourScientists meet to discuss ways of saving the Tasmanian devil, which is being ravaged by an unusual cancer.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/asia-pacific/6378279.stm
          2007-02-20T11:40:00
          Nato troops raid Karadzic homesNato troops in Bosnia search the homes of the children of indicted war criminal Radovan Karadzic.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/europe/6377711.stm
          2007-02-20T12:53:35
          Nigerian VP 'cannot be removed'A court rules President Olusegun Obasanjo cannot sack his deputy for joining an opposition party.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/6378625.stm
          2007-02-20T11:50:56
          Kenya's 'most wanted' shot deadPolice kill a man believed to be behind a string of murders and armed robberies in Nairobi.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/6378315.stm
          2007-02-20T11:09:37
          Salvador politicians found deadThe bodies of three politicians from El Salvador and their driver are found in a bullet-riddled car in Guatemala.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6378645.stm
          2007-02-20T11:48:56
          Philippines approves terror billThe Philippine Congress passes a controversial anti-terror bill aimed at tackling militants in the south.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/asia-pacific/6374875.stm
          2007-02-20T11:21:43
          Australia pulls plug on old bulbsAustralia plans to ditch traditional incandescent filament light bulbs in favour of a greener alternative.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/asia-pacific/6378161.stm
          2007-02-20T10:56:33
          Royal seeks to revive French bidFrance's Socialist candidate Segolene Royal tries to revive her presidential bid in a televised appearance.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/europe/6377503.stm
          2007-02-20T13:02:05
          Rape claim splits Iraq governmentAllegations Iraqi police raped a Sunni woman threaten to eclipse the government's new security drive in Baghdad.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6378821.stm
          2007-02-20T13:09:02
          US 'Iran attack plans' revealedUS contingency plans for possible air strikes on Iran include most of its military infrastructure, the BBC learns.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6376639.stm
          2007-02-20T10:28:34
          Gunman kills Pakistani ministerA Pakistani provincial government minister is shot dead as she prepares to address a political meeting.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6379169.stm
          2007-02-20T14:30:35
          Bird flu outbreak in Pakistan zooAn outbreak of the deadly H5N1 strain of bird flu kills four peacocks and a goose in an Islamabad zoo.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6378045.stm
          2007-02-20T09:34:56
          Canon EOS 40D rumors aboundFiled under: Digital CamerasIt all started with an EOS 40D splash page posted (and later pulled) from Canon's official Hong Kong web site. Now the 40D's specs are popping on digicam retail sites all over the Intertubes. Most interesting is the supposed spec sheet posted, pulled, and then extracted from a Belgian site by our tireless Engadget interns; here's what it says: 10.1 megapixel CMOS sensor measuring 22.5 x 15-mm, 5fps burst mode, integrated anti-dust cleaning system, 2.5-inch LCD, and sadly... DIGIC II (not III) image processing. It's that last bit of information which makes us a bit skeptical. Although the DIGIC II can be found in their full-frame 400D, the improved DIGIC III is already loosed thereby bringing the whole spec sheet into question. No worries, if Canon is ready to push the 40D out the door then it'll be soon. The big PMA show kicks off in just a few weeks. Now quit staring at that picture, it's not the 40D.[Via Digital Photography Blog] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93789980/
          2007-02-21T13:17:00
          Blackberry 8800 now on CingularFiled under: CellphonesStraighten your ties and button your suit jackets, RIM's promiscuous debutante -- the Blackberry 8800 -- is up and dancin' on on Cingular's website. $500 list, or $300 after $50 mail-in rebate and 2-year contract, the 8800 brings everything we expected: quad-band EDGE, GPS, microSD expansion, Bluetooth 2.0, push-to-talk support, and 5-hours talk / 24-days standby in a 0.55-inch device weighing just 4.73-ounces. 3G data? No. WiFi? Not this time. For that we'll have to hold tight for the anticipated mid-year launch of the 8820. [Thanks, President and everyone who sent this in] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93789982/
          2007-02-21T12:47:00
          Ubixon's Lubix Bluetooth stereo headsets: the magnets make the magicFiled under: Portable Audio -Here's an interesting twist to the Bluetooth headset from Ubixon -- the UBHS-LC1-3D and UBHS-NC1-3D. These Lubix headsets consist of two, magnetically held halves which can be separated and bunged into the ears or slung around the neck, connected for easy toting. They both simulated 3D sound and Bluetooth 2.0 with support for the A2DP, AVRCP, HSP, and HFP profiles. In other words, they support stereo Bluetooth audio while allowing you to control your like-profiled audio device from up to 10-meters away. They'll even work seamlessly (as seamless as Bluetooth gets anyway) with your cellphone although the LC1 does it a bit better (and bulkier) by flashing the caller's ID on that one-line LCD screen. The 28-gram LC1 delivers 10 hours of talk or 9 hours of music while the NC1 goes 6-hours or 5-hours in a lighter, 22-gram package. The LC1 hits Korea for 79,000KRW ($84) while the NC1 slips in at about 59,000KRW ($63). [Via AVING] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93781795/
          2007-02-21T11:47:00
          Cellphone-packing smoke detector dials for dangerFiled under: Cellphones, Misc. GadgetsWhile most smoke detectors will handle the basic job of detecting smoke just fine (providing you check that batt regularly), there's plenty of options out there for those wanting a little something extra, be it added style or additional functionality. Joining those other over-achieving smoke detectors is this new unit from Japanese manufacturer Keisoku Giken, which will automatically phone you at the first whiff of smoke to inform you of its impending demise. Unfortunately, you'll have to supply your own cellphone and service for it (it doesn't appear to support landlines), which makes the device's already hefty 16,800 yen price tag (about $140) even less of a bargain.[Via Textually.org] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93743515/
          2007-02-21T09:24:00
          TDK's Xa-10 mini flat panel speakersFiled under: Peripherals, Portable Audio -TDK just slipped NXT's crazy-thin SoundVu technology into your pocket. That's right, the 80 117 x 16-mm (3.15 x 4.6 x 0.63-inch) Xa-10 flat panel speaker brings a 1.2W x 2ch waft of breathy bass you might otherwise choose not to float from your trou. The speakers will accept USB power (or batteries) and a mini-stereo input when they hit Japan in March for just 2,980 or about $25. [Via Impress] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93727030/
          2007-02-21T08:02:00
          Lexar intros 300x UDMA CompactFlash cards, readersFiled under: Digital Cameras, StorageLexar has already given its SDHC cards a boost this year, and the company doesn't seem to be wasting any time bringing its CompactFlash offerings up to speed as well, today introducing a series of new 300x UDMA CompactFlash cards, as well as a pair of card readers to go along with 'em. Available in 2, 4, and 8GB varities, the cards are said to be 125% faster than the company's current CompactFlash cards, delivering a sustained write time of 45MB per second. To hit that top speed, however, you'll need to use them with a UDMA-enabled device, which are currently a rare breed, although Lexar says it expects "several" UDMA-enabled digital cameras to be announced later this year. In addition those mystery cameras, you'll also be able to get the most out of the cards using one of the two UDMA card readers Lexar's set to release this spring, available in your choice of FireWire or USB 2.0 models for $80 and $50 respectively. The cards themselves should also be released about the same time, although Lexar doesn't seem willing to spill the details on how much they're gonna cost just yet.Read - Photography Blog, Lexar Professional UDMA 300x Memory CardsRead - Photography Blog, Lexar UDMA Card Readers Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93699645/
          2007-02-21T06:31:00
          Fon wants you to help steal business from Starbucks and T-MobileFiled under: Wireless, Networking -Oh tricky, sneaky Fon. Fresh off their 10,000 Fonero giveaway, they're stepping up the ante with how they give away their loss-leader routers. Their newest campaign is sure to strike a chord with armchair entrepreneurs and Adbusters fans alike: if you live within the immediate vicinity of a Starbucks (read: WiFi range), Fon would like to send you one of their Foneros. Why? Because, if you recall, when you allow users to connect with your internet connection over your Fonero, Fon splits the profit with you -- $1 for every user (who pays $2 to use your connection). So for every $10 T-Mobile / Starbucks WiFi user you swipe, Fon gives you a buck; now, granted this still isn't a scheme for those paranoid about home network security, bandwidth usage, or nefarious hax0rs type with a spoofed MAC and a keen eye for easy hotspot access, but who knows, for those near Starbucks (yes, they'll be checking against known locations) it might even be worth it to buy a budget DSL line just to profit with Fon. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93662859/
          2007-02-21T05:01:00
          Vonage to become Vonage Wireless?Filed under: Cellphones, WirelessVoIP provider Vonage has already cut a deal with EarthLink to resell WiFi, presumably to go along with some sort of WiFi phone service, but could they have something way crazier (and more costly) on tap? BusinessWeek speculates that Vonage might be getting into the cellular game by launching an MVNO (Mobile Virtual Network Operator). It's not hard to imagine them offering something similar to T-Mobile's HotSpot @Home service, which lets you use a WiFi-enabled cellphone to make VoIP calls over WiFi and and then seamlessly switch over to cellular networks whenever you're outside WiFi range. The problem is that launching an MVNO is no small undertaking. ESPN shuttered MobileESPN last year after failing to attract more than a handful of subscribers, and Amp'd and Helio have spent hundreds of millions of dollars to carve out a slice of what is an incredibly competitive wireless market (Apple was working on an MVNO to accompany the launch of the iPhone, but scrapped the whole thing once it became obvious how difficult it would be to gain marketshare). Could they do it? Maybe, but not without spending a TON of money, which is why it's more likely that they'll introduce a more modest Voice over WiFi service.[Via GigaOm] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93658206/
          2007-02-21T04:25:00
          Desktop Digital Photo Cube shows photos on diminutive LCDFiled under: Displays, Misc. Gadgets -Here's one from the same folks who brought you the USB Sound Flash Drive, and while eNECESSITIES' Desktop Digital Photo Cube may not adorn your wall as fashionably as a digiframe might, this piece is made for conversation. Ready to perch atop your living room table or office desk, the cube sports a squint-inducing 1- x 1-inch color LCD display, power / brightness / skip buttons, USB 2.0 connectivity, and the ability to internally store "up to 30 digital photos" for cycling through on the built-in screen. Additionally, the "mood light" should set the tone for the upcoming photo, and those looking for the ultimate party favor can toss their own logo on here for an additional charge. Unfortunately, we're not quite sure just how this snapshot showin' block gets its juice, but those looking to snag 25 or more (sorry, non-bulk customers) can find out for themselves at $51.34 a pop.[Via Everything USB] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93640955/
          2007-02-21T03:42:00
          IEEE pushing 802.16m WiMAX to 1Gbps, hopes to converge with 4GFiled under: Cellphones, WirelessIf there's one thing that we'll never be satisfied with, it's finding out just how many nanoseconds we can shave off our download times from year to year, and thankfully, the IEEE seems to get that. While it has certainly taken its sweet time with 802.11n, the task force has already voted to make 100G the next Ethernet speed, and now it's pushing to make WiMAX implementations even quicker. Reportedly announced at 3GSM, the IEEE has began working on a new version of the 802.16 standard, dubbed 802.16m, which "could push data transfer speeds up to 1Gbps while maintaining backwards compatibility with existing WiMAX radios." Potentially more interesting than cheering for speed boosts is the group's outright assurance that this protocol will meet the ITU's requirements for 4G, insinuating that it should be the token choice for further 4G developments. Nevertheless, the increased bandwidth is supposedly needed due to convergence between VoIP and various forms of multimedia (IPTV, streaming video, digital downloads, etc.), and however true that may be, some skeptics are still understandably doubting the whole "backwards compatibility" aspect. Still, the IEEE hopes to have this together by "the end of 2009," but considering the team's less-than-stellar track record in the deadline department, we're not holding our collective breath.[Via DailyWireless] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93621068/
          2007-02-21T02:42:00
          GPS-enabled wind chimes sound off while geo-trackingFiled under: GPS -If you think the Dandellas were outlandish uses of GPS technology, here's one that comes mighty close to one-upping even those. The GPS-enabled wind chimes have DIY written all over them, and while the chimes themselves where purchased (after a failed attempt at creating his own, notably), basically everything else that makes the system tick was homegrown. Utilizing Mologogo, servos, circuit boards, and a good bit of coding, the GPS chimes emit their music whenever the tracked individual's cellphone moves in a user-selected path, essentially acting as an alert that someone's headed to their domicile. Of course, the actual options here are a tad limited (albeit very intriguing), but the foundation of the project could indeed be used for a much broader geo-tracking scenario. Regardless, we know there are folks out there eager to give this a whirl, and thankfully for you, everything you need to know (including the oh-so-critical code) is just a Read link away.[Via MAKE] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93596281/
          2007-02-21T01:42:00
          Sigma finally cops to a release date for its SD14 DSLRFiled under: Digital Cameras -Well it'll have been over six months between the time we first heard about it and when it actually hits store shelves, but we finally have a solid release date for the somewhat-anticipated, Foveon-packing Sigma SD14 DSLR. If it's possible for you to remember back that far, you may recall that Sigma attempted to drum up some interest in this 14 megapixel shooter with a teaser campaign in late August of last year, just before it was officially announced at Photokina 2006. The disappointment came a few months later when Sigma pushed back the SD14's street launch to March, citing some hardware issue that the company wouldn't disclose. And according to a press release on Sigma's website, the problem has indeed been addressed, with the camera scheduled to ship starting on the 6th of next month. Keep in mind, though, that this model isn't for the thrifty -- it's gonna cost you over $2,000 to get in on this action. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93572592/
          2007-02-21T00:42:00
          Quantum strikes again, charging iPhone touchscreen infringementFiled under: Cellphones, DisplaysIt's not just Apple's ubiquitous click-wheel that Quantum Research is bothering Apple about these days, Quantum is also fussing about the iPhone's touchscreen technology. "We will be looking very carefully at the iPhone," says Duncan Bryan, licensing director at QR. And wouldn't you know: "The description of the iPhone suggests it uses a rear-surface touch screen, and has proximity sensing which can tell if it is held to the ear. That's a QR capability." No formal lawsuit has been filed yet, but based on Apple's complete denial and counterclaims of QR's December 2005 click-wheel allegations, we're guessing it won't be backing down on this one anytime soon. Apparently this "charge transfer capacitive sensing" stuff has been licensed to Motorola and was invented by QR's founder and CEO Hal Philipp. Usually we'd be content to sit back and watch, but all these Apple-related lawsuits and copycats are getting a little tried -- remember those good old fashioned RIM / NTP days?[Via AppleInsider] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93553936/
          2007-02-20T23:42:00
          Motion Computing unveils RFID-reading C5 medical tablet PCFiled under: Tablet PCs, WirelessAlthough we sincerely hope your only encounter with a clinical assistant tablet PC comes by way of your occupation, it looks like Motion Computing is busting out a medically-focused device to help the dear LPNs keep things in order for the high-falutin' doctors. The C5 touts a vertically centered design, top-mounted carry handle, handwriting recognition, built-in digital camera for documenting wounds, time-stamp / voice-tag capabilities, and even an optional RFID reader to easily check patients in by scanning their wrist straps. Claiming to be the world's first device in the new mobile clinical assistant (MCA) category of PCs, it packs a 1.2GHz Intel Core Solo U1400 processor, Windows Vista Business or Windows XP Tablet PC Edition, a 10.4-inch XGA touchscreen, up to 1.5GB of DDR2 RAM, 30 / 60GB 1.8-inch hard drive options, 802.11a/b/g, Bluetooth, and a rechargeable Li-ion to boot. Furthermore, it weighs in at just 3.1-pounds, so toting this bad boy around the office shouldn't be too much of a burden, and the "durable, semi-sealed enclosure" shouldn't have any issues handling the daily mishaps of your average doctor's lounge. So if you've been looking for a way to digitize your office and get far, far away from those paper-filled drawers, we're sure your IT rep will be hitting you up soon to sneak a peek at this $2,199 tablet.[Via GottaBeMobile] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93548878/
          2007-02-20T23:08:00
          Prober P360 GPS / PMP handheld does it allFiled under: GPS -These fanciful all-in-one devices just don't seem to come Europe or North America's way very often, and unfortunately for most, Prober's P360 doesn't seem to be breaking that mold anytime soon. Packing a respectable mix of multimedia and GPS capabilities, this pocket-friendly device packs a 3.5-inch touchscreen display, 400MHz Samsung S3C2440A processor, 64MB of NAND Flash ROM, 64MB of SDRAM, WinCE 4.2 runnin' the show, a SiRF Star III chipset, and a built-in speaker to boot. Furthermore, you'll find a dual-mode map for wrapping your brain around POI locations, voice guidance, a rechargeable five-hour Li-ion battery, SD card slot, USB 1.1, wired remote / headphones, audio out, and the ability to play back WMV, WMA, and WAV files on the AV front, while handling a bevy of snapshot formats and even boasting a text viewer. Unfortunately, we've no idea how much the P360 will run folks who are lucky enough to acquire it in four to six weeks, but just know that most of the world will probably envy you.[Via NaviGadget] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93531504/
          2007-02-20T22:38:00
          Shredz64 project bringing Guitar Hero to the Commodore 64Filed under: Gaming We've already seen the Guitar Hero controller hooked up to a PC, but hardware hacker Toni has decided up the difficultly level even further, endeavoring to wire the ubiquitous plastic axe to his Commodore 64, complete with an all new "Guitar Hero-like" C64 game. While he's still quite a ways from fully realizing that goal, as the pic above and audio clip on the page linked below show, he is making considerable progress, with all of the guitar's buttons working, although the whammy bar, sadly, remains silent. Unfortunately, it's also been over a month since the last update on the project, so we can only hope that he hasn't given up on it -- there's undoubtedly countless C64s just waiting to be dusted off as soon as the DIY guide is ready.[Thanks, Joseph S] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93511887/
          2007-02-20T22:08:00
          Thrustmaster unveils bevy of Wiimote accessoriesFiled under: Gaming -If you can't penetrate the market early, you might as well arrive fashionably late with a tempting pricetag, right?. Apparently, Thrustmaster's trying to do just that with its latest barrage of Wiimote accessories, as the firm's charging (and non-charging) docking stations arrive a few months after JoyTech and Nyko's renditions, and the Wiimote sleeves are almost an afterthought at this point. Nevertheless, the T-Charge NW comes in black or white finishes, charges two AA cells via USB (four included), sports a blue status LED, and of course, neatly holds your dear Wiimote / nunchuck combo. The T-Care NW removes the charging functionality, but still manages to include a set of silicone protector sleeves for one Wiimote / nunchuck tandem, and if you're already set in the dock department, the controller covers are available all by their lonesome as well. Thrustmaster's lineup seems to hit all the main areas of concern, including price, as a set of sleeves will run you $9.99 while the T-Care NW and T-Charge NW demand $14.99 and $24.99, respectively. So if you're intrigued about these budget-friendly offerings and just adore high-resolution shots, head on over to Joystiq for a gallery of photos while you wait for these to land in April.[Via Joystiq] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93508830/
          2007-02-20T21:38:00
          Sony Cybershot G1 digital camera detailedFiled under: Digital CamerasThat batch of new Sony Cybershots let loose this morning was quite a bit to digest all at once, so we thought we'd take a minute to go over one of the more interesting of the still-to-be-officially-announced cameras in greater detail, namely, the Cybershot G1. Apart from that new (for Sony) model name, the camera's particularly notable for its big 3.5-inch (or possibly 3-inch) LCD and uncommonly spacious 2GB of internal memory. Though less unusual, the camera's other specs are also nothing to sneeze at, with a decent 6 megapixel resolution, 3x optical zoom, Carl Zeiss Vario-Tesar lens, built-in WiFi, and Sony's usual SteadyShot and Anti-Blur features. Still not clear, unfortunately, is the price, although as we mentioned earlier, that should be revealed by the end of the month. Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93489405/
          2007-02-20T21:08:00
          Magellan preps Maestro 4000, 4040, and 4050 GPS units for releaseFiled under: GPS -Magellan's been known to toss out GPS units three at a time before, and while the company hasn't come forward yet about its presumably forthcoming trio of navigation devices, we've got the skinny anyway. All three Maestro units will sport a 4.3-inch WQVGA touchscreen display, SiRF Star III chipset, and an in-car mounting kit, but the similarities basically end there. On the low-end, you'll find NAVTEQ maps for the 48 contiguous United States, QuickSpell, 1.6 million POIs, and a rechargeable battery with around three hours of juice. The 4040 steps it up by adding more detailed map coverage, 4.5 million POIs, text-to-speech / Bluetooth capabilities, and by playing nice with the real-time traffic add-on service. The flagship unit boasts all the capabilities of its lesser siblings, but also adds traffic functions right out of the box as well as voice recognition software. The Maestro 4000 / 4040 are each slated to land in "early April" for $449.99 / $599.99, respectively, while the high-end 4050 will demand a somewhat steep $799.99 for its niceties when it arrives in May.Read - Magellan Maestro 4000Read - Magellan Maestro 4040Read - Magellan Maestro 4050[Via GPSGazette] Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93486827/
          2007-02-20T20:38:00
          AMD's new consumer flagship proc, the X2 6000+Filed under: Desktops -The 90nm Athlon 64 X2 processor line looks close to its last breath with the X2 6000+, a 3GHz monstrosity designed as a consumer equivalent to the FX-74. The 6000+ is limited to single processor systems, none of those quad-core frivolities the FX-74 is known to partake in, but the chip can still suck down a maximum of 125 watts, and carries 1MB of L2 cache per core. Where the 6000+ processor really departs from its enthusiast sibling is the $464 pricetag, less than half the cost of a FX-74. The chip is a few months late -- it was slated for Q4 2006 originally -- and will be followed by an 89 watt version in the third quarter of this year, along with a slightly less beefy 5800+ edition, but then its quitsville for AMD's 90nm creations. 65nm here we come! Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93476480/
          2007-02-20T20:08:00
          ACCS GRAViTONUS gives quadriplegics tongue-controlled computer interfaceFiled under: Desktops, Misc. Gadgets -While other forms of alternative computing are certainly available, yet another group of researchers are touting their own rendition as a radical new way for quadriplegics to engage in computerized learning and entertainment. Dubbed the Alternative Computer Control System (ACCS) GRAViTONUS, the proposed hands-free system would enable folks who have suffered spinal cord injuries or other forms of paralysis to dictate basic computer functions entirely with their tongue. The prototype looks to be quite non-invasive, and when worn around one's head, can enable users to mouse around and navigate within applications by way of a precise tongue-controllable interface. Interestingly, it's even stated that the device won't hinder one's ability to drink, speak, or breathe, but we assume you'd have to give the mouthpiece a good washing after every use to avoid bacterial buildup. Nevertheless, the ACCS GRAViTONUS backers are now scouting VCs who'd like to get this creation to market, so if you've been looking for something intriguing to get wrapped up in, give these blokes a ring. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93458983/
          2007-02-20T19:38:00
          Hello Kitty embraces warming blankets, gets fired up via USBFiled under: Misc. Gadgets -If you think we were baffled after seeing Hello Kitty USB foot warmers, you probably can't imagine the speechlessness we all feel when seeing the USB-powered lap warmer. Considering that anyone who would actually toss out their hard-earned dollars on feline feet heaters would likely not have the will power to resist this mat, it's fairly to say to say that this is a must-have for hardcore fans braving the tail end of winter. No word on just how large this thing is, nor if poses any eruption capabilities like one of its siblings (clones?), but judging by the mat-to-USB-connector ratio, this kitty ought to warmly cover a litter or two at least. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93453293/
          2007-02-20T19:08:00
          Graffiti Research Lab's L.A.S.E.R. TagFiled under: Displays - Lessee here, we've got lasers, creative input devices, a "stick it to The Man" aesthetic and a Mooninite -- sounds like a successful night of hacking to us. Graffiti Research Lab and friends hacked together a high powered projector with some computer components and a camera to track the writings of a 60mW Green Laser on the side of a building in Rotterdam and project it as blue graffiti. The resulting art looks surprisingly good, and the perpetrators were kind enough to document the event, along with providing instructions for doing up your own version. It's hard to describe, so we recommend peeping the video after the break, or the better quality vids and pics over at the read link.[Thanks, Teferri]Continue reading Graffiti Research Lab's L.A.S.E.R. Tag Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93438390/
          2007-02-20T18:42:00
          Australia to phase out incandescent bulbs by 2010Filed under: HouseholdWhile some US cities like Raleigh are already planning steps to cut back on energy wastes by converting to more efficient lighting systems, it looks like the entire continent of Australia could be following suit. Claiming to be the "world's first" national government to phase out incandescent light bulbs in favor of the more "fuel-efficient, compact fluorescent bulb," environment minister Malcolm Turnbull is hoping to "cut Australia's greenhouse gas emissions by four million metric tonnes a year by 2015." Citing the "climate changes" the world is facing as a "global challenge," Turnbell also urged other nations to follow suit in making a difference, but didn't exactly open up his personal wallet to stock our households with those uber-pricey bulbs. Interestingly, some environmentalists feel that the bulk of greenhouse gas emissions come from government and business-related activities, which should presumably take priority over swapping out a country's light bulbs. Still, we've got no complaints with hooking homes up with LED / fluorescent options to help Mother Earth, but shouldn't Australia (and America, too) ink its name on the Kyoto Protocol before getting all high and mighty about saving the planet? Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93432534/
          2007-02-20T18:08:00
          Palm makes Treo 700wx official for VerizonFiled under: Cellphones, Handhelds -Palm and Verizon have made official today what we've known now for a while (as have Sprint and Alltel): 32MB of RAM in a Windows Mobile 5 device just doesn't really cut it. The Treo 700wx rights the 700w's wrongs with an extra 32MB of memory for a grand total of 64MB; otherwise, though, the device is all but identical to its older sibling, with Windows Mobile 6 sadly nowhere in sight. Get it now while it's hot at Verizon stores or online for a stiff $399 on 2-year contract after $100 rebate. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93414274/
          2007-02-20T17:40:00
          Powered bumpers defend your smart car when all else failsFiled under: Robots, Transportation -Smart cars are all well and good until you start to think of the horrible consequences if something should go wrong. Honestly, we're willing to take that risk just for the rewards of cruising along in a robotic car "platoon": saving gas, skipping traffic and perhaps getting in a bit of Gears of War while we're at it. Luckily, more judicious minds than ours are hard at work at the problem, and just might've discovered a way to keep smart car-filled roads from becoming riddled with the bodies of overly-optimistic bloggers. Alasdair Renfrew of Manchester University, UK, along with a couple of colleagues, has devised an extendable fender that can keep you safe and humming along the freeway, even when traditional wireless communications fail. The smart cars will traditionally be communicating with each other and roadside beacons wirelessly, and if one of those elements breaks down, the cars bust out powered bumpers to feel the car in front and navigate accordingly. That way, as long as the front car of a pack keeps to the speed limit and in its lane, the group should be fine -- and your Xbox session needn't be interrupted. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93410533/
          2007-02-20T17:08:00
          GoogleFi gives 360 addicts Xbox Live on the goFiled under: Gaming, Transportation, Wireless - Obviously, quite a few possibilities open up when your whole town is wired for WiFi, but we can't say we really pegged drive-by 360 play as one of them. Mountain View, CA residents Brandon Wirtz and Jake Ludington fixed up Brandon's Jeep with 23-inch Samsung LCD and an Xbox connected to Google WiFi via Jake's laptop. The total cost of wire-free 360 action is about $4000 if starting from scratch, but isn't that a small price to pay for the freedom to frag?[Via BBC News] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93394047/
          2007-02-20T16:38:00
          Cingular's BlackBerry 8800 unboxedFiled under: Cellphones -He got us those original BlackBerry 8800 shots, so we're guessing these unboxing pics of the phone here were no sweat for Boy Genius. We still can't claim to be crazy about the device, which launched last week, but we're sure plenty of suits will be glad to replace their aging CrackBerries with this fancy new QWERTY version. As a side note -- could Cingular's boxes be any more boring? Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93388948/
          2007-02-20T16:08:00
          Blair announces Iraq troops cutTony Blair says he hopes to cut the number of UK troops in Iraq from 7,100 to 5,000 within months.
          http://news.bbc.co.uk/go/rss/-/1/hi/uk_politics/6380933.stm
          2007-02-21T13:15:15
          Tehran dismisses threat of forceIran's top nuclear negotiator dismisses threats of force against it, as the UN prepares to make a crucial report.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6380879.stm
          2007-02-21T02:38:26
          Zimbabwe's police ban protestsZimbabwe police ban protests as Robert Mugabe marks his 83rd birthday by vowing to stay on as president.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/6382405.stm
          2007-02-21T11:35:20
          S Asia rivals sign nuclear pactIndia and Pakistan sign an agreement to reduce the risk of accidental nuclear conflict in the region.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6381261.stm
          2007-02-21T11:54:32
          Iraq PM sacks 'rape case' criticIraq's prime minister moves to put an end to disquiet about an alleged rape of a Sunni women by police.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6382119.stm
          2007-02-21T13:01:17
          Maoists walk out of Nepal campHundreds of former Maoist rebels walk out of a holding camp in Nepal, complaining of poor conditions.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6382093.stm
          2007-02-21T12:16:21
          Philippines army is 'in denial'A UN envoy says the Philippines army is in "almost total denial" about a wave of extra-judicial killings.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/asia-pacific/6381291.stm
          2007-02-21T05:15:15
          Stars raise $1.3m for ObamaCelebrities donate $1.3m to Democrat Barack Obama's presidential campaign at a lavish Beverly Hills fund-raiser.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6381375.stm
          2007-02-21T07:55:03
          Britney Spears 'back into rehab'Pop star Britney Spears is back in rehab, days after shaving her head, US media reports say.
          http://news.bbc.co.uk/go/rss/-/1/hi/entertainment/6380827.stm
          2007-02-21T09:02:53
          Football: Lille 0-1 Man UtdRyan Giggs' controversial late winner for Man Utd almost sparks a Champions League walk-out by Lille.
          http://news.bbc.co.uk/go/rss/-/sport1/hi/football/europe/6371329.stm
          2007-02-20T21:38:44
          UN backs peace force for SomaliaThe UN Security Council approves the deployment of an African peacekeeping force to tackle unrest in Somalia.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/6381189.stm
          2007-02-21T08:39:08
          Big Anglo American profits jumpMining giant Anglo American is to return $3bn to shareholders after reporting a 46% rise in annual profits.
          http://news.bbc.co.uk/go/rss/-/1/hi/business/6381739.stm
          2007-02-21T09:36:52
          US probes troops' neglect claimsThe US says it is reviewing the way its wounded soldiers are cared for at hospitals, after critical media reports.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6381453.stm
          2007-02-21T09:17:06
          No end to deadly Bolivian floodsUp to 340,000 people have been affected by continuing flooding in Bolivia, which has left 35 people dead.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6380331.stm
          2007-02-20T18:25:36
          Japan ups interest rates to 0.5%Japan's central bank shows signs of confidence in the country's economy, raising interest rates to 0.5%.
          http://news.bbc.co.uk/go/rss/-/1/hi/business/6381335.stm
          2007-02-21T08:07:26
          Prison demand for Poso suspectsIndonesia prosecutors seek 20 year jail terms for three men accused of beheading Christian schoolgirls.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/asia-pacific/6381511.stm
          2007-02-21T08:40:06
          Denmark to pull troops from IraqDenmark will withdraw its troops from Iraq by August, Danish Prime Minister Anders Fogh Rasmussen says.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6382675.stm
          2007-02-21T13:07:30
          Leaders discuss UN's Kosovo planSerbian and ethnic Albanian leaders are holding final talks in Vienna on the UN plan for Kosovo's future.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/europe/6380565.stm
          2007-02-21T11:48:45
          Iran 'swiftly seeks nuclear goal'Iran's president says he wants nuclear power as soon as possible, as critics in Iran urge him to accept UN demands.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6381477.stm
          2007-02-21T12:10:51
          Militant dies in Israeli ambushIsraeli undercover agents kill a commander of the militant Islamic Jihad group in the northern West Bank.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6381653.stm
          2007-02-21T08:49:42
          India eyes Scotch takeoverAn Indian businessman is set to complete a deal to buy Scottish whisky firm Whyte and Mackay for ?550m.
          http://news.bbc.co.uk/go/rss/-/1/hi/business/6381339.stm
          2007-02-21T13:04:47
          India boat capsize bodies foundRescue workers recover bodies of 15 children and three men from a school trip boat accident in India.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6381289.stm
          2007-02-21T04:57:46
          Blair announces Iraq troops cutTony Blair says he hopes to cut the number of UK troops in Iraq from 7,100 to 5,000 within months.
          http://news.bbc.co.uk/go/rss/-/1/hi/uk_politics/6380933.stm
          2007-02-21T13:44:46
          Fear as cyclone nears MozambiqueMozambique is on the highest level of alert as a cyclone with winds of up to 175km/h approaches.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/6383675.stm
          2007-02-21T17:06:58
          Italian PM faces coalition crisisItaly's Romano Prodi calls a special cabinet session after his fragile coalition loses a key foreign policy vote.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/6383051.stm
          2007-02-21T17:22:45
          Fujifilm's FinePix S5700Filed under: Digital Cameras - Another hot off the pre-PMA presses, Fujifilm's got their new FinePix S5600 followup ready to go, the S5700. It's got a 10x zoom, 7.1 megapixel sensor, 2.5-inch display, 1600 ISO setting, image stabilization, 27MB internal memory, and, you're not going to believe this, xD and SD support. Unfortunately it uses four AA cells instead of a nice Li-ion battery. No price just yet, but the black model lands (somewhere) at the end of March, with the silver following in April.Gallery: Fujifilm's FinePix S5700 Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94150403/
          2007-02-22T06:14:00
          Fujifilm's FinePix A820 and A900 for consumersFiled under: Digital Cameras - Just like Canon's new PMA-bound A Series cameras, Fujifilm's new A820 and A900 cameras don't really break a lot of new ground, but there sure is a lot more megapixel bang-for-buck going on here. For $180 and $200, respectively, the A820 brings 8 megapixels and the A900 goes for 9, while both camera have 4x zooms and 2.5-inch LCDs. Unfortunately, there doesn't seem to be any form of optical image stabilisation here, nor any of those much-hyped Face Recognition AF/AE features we've been seeing in other PMA offerings, but if all you're looking for is pixels and lots of 'em, you can't go far wrong with this pair of FinePix, which will be hitting shelves in March. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94137650/
          2007-02-22T05:46:00
          Canon's new PowerShot A570 and A560Filed under: Digital Cameras - Canon sure likes to yuk it up with the "A Series" puns. "A" for affordable, for the AA batteries you can stick in these things, for the "A" Team the cameras represent -- it's a real riot. Luckily, "affordable" doesn't have to mean "boring" anymore, and these two PowerShots include fancy 4x zooms, 7.1 megapixel CCDs, 2.5-inch LCDs and that DIGIC III processor for speedier operation, along with 1600 ISO and Face Detection. Sound familiar? You can have it all for a few more bucks, 1x less zoom and quite a bit more pocketability in the Digital ELPH series. What the A570 adds that the A560 and those ELPH cousins lack is optical image stabilisation. You can pick one up for $280, or if you don't mind the blur, grab an A560 for $230. Both will be out in March.Gallery: Canon's new PowerShot A570 and A560 Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94115873/
          2007-02-22T04:43:00
          Canon's compact PowerShot TX1 captures 7.1 megapixel stills and HD videoFiled under: Digital Cameras - Watch out, Sanyo, because your diminutive HD2 camcorder is about to face some very daunting competition from Canon. Like the recently announced Sanyo, the PowerShot TX1 packs a 7.1 megapixel CCD into a tiny little package capable of capturing 720p HD video as well -- but unlike the $700 HD2, Canon is hanging just a $500 pricetag on this model. Besides its one-two punch of high resolution stills and videos, this device offers a 10x optical zoom (with an optically-stabilized lens), a 115,000 pixel LCD, and ISO settings ranging from 80 to 1600. You're also getting the latest Digic image processor, advanced face detection and red eye reduction, Vista-compatibility, 14 shooting modes, and a so-called "Intelligent Orientation Sensor" to keep the display looking right no matter how you're holding the cam. No word so far on a release date, but with all this functionality at a very attractive price, you can probably expect the TX1 to fly off shelves when it finally makes its debut.Gallery: Canon's compact PowerShot TX1 captures 7.1 megapixel stills and HD video Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94113961/
          2007-02-22T04:25:00
          Canon debuts SD750 and SD1000 Digital ELPH camerasFiled under: Digital Cameras - Two new compact and fashionable PowerShot Digital ELPHs from big C, the SD750 and SD1000. Canon seems to be mostly focused on the looks here: we've never seen a growed-up digicam manufacturer be so proud of "Dynamic Dual-Tone Elegance," but there's decent stuff under the hood. Like most of the PMA-bound cameras we've spotted, these include Face Detection-based auto focus, auto exposure and red-eye correction. There's also the DIGIC III Image processor, and ISO as high as 1600, but everybody comes for the basics: 3x zoom, 7.1 megapixel CCD and a 2.5-inch LCD in each shooter. The $300 SD750 gets a bit fancy on form factor, but manages to be a mere 0.75-inches thick, while the 4.5 ounce SD1000 keeps the the classic ELPH look and also retails for $300. Both should be out in March, and include 32MB SD cards for good luck, though no mention is made of SDHC. Remember, it's fashion first for this line.Gallery: Canon debuts SD750 and SD1000 Digital ELPH cameras Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94113962/
          2007-02-22T04:23:00
          Canon's EOS-1D Mark III DSLR with live LCDFiled under: Digital Cameras - Canon's latest pro DSLR is officially here as of tonight: welcome the EOS-1D Mark III. This 10.1 megapixel shooter can fire 10fps in bursts of up to 110 large JPEGs or 30 RAW files with is dual DIGIC III processor. It also features a really friggin light sensitive APS-H size 28.1 x 18.7mm CMOS sensor with ISO modes up to 3200 (it's also got a "highly usable" just-in-case 6400 mode sure to kill image quality), but the real winner here is the 3-inch live LCD (with 5 and 10x magnification for locking that zoom). There's also a new WFT- E2A Wireless File Transmitter option for dumping to external storage and even GPS geotagging, the OSK-E3 Original Data Security Kit for file encryption and verification (if your images are just that valuable), the Speedlite 580EX II flash, and EF 16-35mm f/2.8L II USM lens. We don't yet have word on price or release date, but you know what they say about having to ask.Gallery: Canon's EOS-1D Mark III DSLR with live LCD Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94110286/
          2007-02-22T04:16:00
          S1Digital's impressive new lineup of Media CentersFiled under: Home Entertainment, Media PCsMedia Centers are so in now and that you have to really do something to make your black box stand out, and S1Digital's new lineup of media centers and servers does just that. Actually there are two series, the ProLine for professional installers and home automation companies and the Home Series for the rest of us. The Home Series includes the Platinum, Gold and Mighty editions, all running Core 2 Duo processors and Vista Home Premium. The Mighty is the size of a book and includes built in WiFi and DVD burner. Up next is the Gold, which is a more traditional size and adds up to 1TB of storage, HDMI, 2 ATSC and 2 NTSC tuners (sorry no CableCARD here), 7.1 audio and Viiv. The Platinum tops the Home Series, adding a quiet design an internal scaler and optional HD DVD or Blu-ray drive. But they don't stop there and are trying to join Niveus in the high end market with the ProLine Series, which of course does everything the Home series does, but with Vista Ultimate, rack mountable, a silent design and two-way control for all your favorite home automation systems like Crestron and AMX. As impressive as this lineup is, we are once again left wonder, where are the CableCARDs?Read: S1Digital Introduces the Home Series Line of Media CentersRead: S1Digital Sets a New Reference Standard with ProLine Series Media Centers Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94110287/
          2007-02-22T04:04:00
          Apple and Cisco settle! iPhone name to be used by bothFiled under: Cellphones - - -Here's one we didn't exactly see coming (at least not like this): Apple and Cisco have settled that "silly" lawsuit, with Apple agreeing to guarantee the exploration of "interoperability in the areas of security, and consumer and enterprise communications" according to the WSJ. We don't know exactly what that means, but it doesn't sound fantastic for Jobs, who we're sure wanted to have exclusivity over the name without cutting a partnership with Cisco, and didn't want to have to pay a red cent for it. But this does sound a lot like what Cisco wanted initially from Apple, and might possibly wind up in some kind of SIP / VoIP solution that allows iPhones and iPhones to communicate. Apparently both will make use of the trademark in the market (i.e. Apple's and Cisco's iPhones will both continue to be iPhones), and all's well that ends non-litigious.[Thanks, Nick and Jay] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94075975/
          2007-02-22T02:42:00
          Nintendo Wii beats up on the competition in power savingsFiled under: Gaming, Home Entertainment -So, the graphics might just be warmed over GameCube fare, but the Wii sure does take those wimpy specs and runs with 'em. A new showdown between the big three home consoles and a mid-range PC doesn't compare games or GPUs, but rather power consumption, and the Wii wins by a landslide. The watts don't just bleed during gameplay, DVD playback seems to require immense effort from the 360 and PS3, and even the consoles in "idle" mode consume about ten times the watts of the Wii. Of course, the consoles consume a minimal amount of power in standby, which is substantially more when the Wii's Connect24 service is on, but not quite a deal breaker, just about a $1 a month of power. So if you're looking to shave a few bucks off your power bill or do your treehuggin' duty to the environment, it looks like the choice is fairly obvious -- though you'll naturally have to look elsewhere than the Wii to get your video playback kicks.[Via Joystiq] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94066659/
          2007-02-22T02:09:00
          Frenzy Rumble transforming headphones: lamer it soundsFiled under: Misc. Gadgets, Portable Audio -You know, a Transformers movie was really its own reward, but all these transforming gadgets -- movie related and no -- are really making it all the more exciting, especially when we're talking completely superfluous fluff. Take these new Frenzy Rumble Earphones, for example. There's no reason you'd want 'em on your head, and there's no way they push out an adequate volume for desktop use when in that transformed state. A perfect blend of uselessness and inconvenience. You can get yours in July for about $37.[Thanks, Aaron D] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94046982/
          2007-02-22T01:14:00
          Bill Gates clamps down on daughter's internet timeFiled under: Desktops, Laptops, Tablet PCsSure, we've seen individuals getting their hand slapped (or worse) for browsing the internet a bit too often, but you'd assume that having a dad who envisioned the Redmond powerhouse and pays the bills by way of computing would be the perfect father figure for the computer-addicted. Apparently, that's not exactly so, as a recent Reuters report tells of Bill Gates himself clamping down on his 10-year old daughter's internet and gaming time. According to Bill, his oldest gal wasn't even into the 'net until this school year, where tablet PCs became a necessary tool, but now that she's found access to a never-ending supply of information, her habits have suddenly changed. She latched onto Viva Pi ata, purportedly playing for "two to three hours per day," after which her health started deteriorating and her chore accomplishments plummeted. Although we mention those last bits in jest, Mr. Gates slapped down a "45-minutes per day" law for non-school related computing tasks on the weekdays, and added just 15 minutes for weekends, probably garnering quite the evil eye and stirring up early thoughts of rebellion in his youngster. Seriously Bill, if you're that worried about daddy's little girl stumbling upon some form of cyber predator, there's always the parent-approved IM-Me, but throwing time restrictions on your own products is just a tad illogical, no?[Via BloggingStocks, thanks Randall] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94027868/
          2007-02-22T00:19:00
          Pentax busts out Hasselbladian 31.6 megapixel 645 DigitalFiled under: Digital Cameras - Pentax has apparently tapped Kodak to provide its 31.6 megapixel KAF-31600 medium format CCD for the upcoming 645 Digital, which would seem to be the company's highest resolution digital camera to date. So far all that's known from the pre-PMA announcement is that the 645 will sport both SD and CF slots, and will ship with a specially-built 55mm lens that's also compatible with 645-series SLR film cameras. We should find out more about this behemoth in early March -- although possibly not pricing and release info -- but one thing we can say for sure is that if it's priced anything like the Hasselblad H3D-31 whose sensor it shares, expect to pay out well into five figures.[Thanks, David N.] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94009335/
          2007-02-21T23:24:00
          Pentax pops out the Optio W30 and A30Filed under: Digital Cameras -There's some heated competition already for our PMA eyeballs, and Pentax sure wants a slice. They don't have anything terribly outstanding on the consumer end, but these W30 and A30 Optio shooters still do pretty well for themselves. The A30 (pictured) takes a pretty traditional approach to the compact genre, boosting the megapixels to 10 and offering up 2.5-inches of LCD. There's also ISO 3200 and some fancy gyro-based shake reduction, along with face recognition auto focus and auto exposure, all in a pretty dang compact SDHC-munching body. The W30 steps it back a bit, with a 7.1 megapixel CCD and mere digital shake reduction, but the rest of the specs are there, along with a waterproof and dustproof housing that can handle being up to three meters under water for two hours. No word on price or availability for either camera, but we're sure we'll be finding out soon enough. Peep the W30 after the break.[Thanks, David N]Read - Optio A30Read - Optio W30Continue reading Pentax pops out the Optio W30 and A30 Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/94000890/
          2007-02-21T23:09:00
          Xbox 360 Wireless Receiver for Windows now availableFiled under: Desktops, Gaming, Peripherals, Wireless -It sure took its own sweet time to make it to market -- we first saw this thing at E3 in 2006 -- but the Xbox 360 Wireless Receiver for Windows is finally available for purchase. The adapter lets you use your standard wireless 360 peripherals, such as the Xbox 360 Wireless Controller and Wireless Headset, with your Windows PC. That means Windows users, which have been enjoying the fruits of a USB 360 controller since before the console launched, can finally get in on some wireless action, and it'll only cost them $20 for the privilege. It also means that much more fun for upcoming Games for Windows titles such as Shadowrun, UNO and Halo 2, along with generic game controls and VoIP functionality. Microsoft is also releasing a $60 package which includes a receiver and a wireless controller. Both items should be available at retail now. Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93985665/
          2007-02-21T22:24:00
          Engadget Podcast 100 - 02.21.2007Engadget Podcast 100
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93966098/
          2007-02-21T21:49:00
          Switched On: What of the Wii-buked?Filed under: Features, Gaming -Each week Ross Rubin contributes Switched On, a column about technology, multimedia, and digital entertainment: - -Nintendo has been on an Apple-like hit parade since the disappointing market performance of the GameCube. The DS and DS Lite handily staved off highly touted competition from Sony. The PSP may have appealed to a different, if for now narrower, demographic, but units are units, and there's no escaping them when you're marketing a platform. -The launch of the Wii has been nothing but magic mushrooms from the hype around the controller to the E3 reception to late-night Wii Tennis face-offs between Conan and Serena Williams. Check out this apologetic fan comment on Amazon's product page: "Graphics might not be high definition, but it looks very close to the Xbox 360 and PS3 when not running in HD mode. And definitively better than the original Xbox and PS2." Better than the Xbox and PS2, eh? That's setting the sensor bar pretty low for a system that shipped six years after the PS2. -Yet, it's no suprise that the Wii has been highly sought. I thought it was the best consumer technology product of 2006. The Nintendo team has executed almost flawlessly, but the company has brushed aside criticisms regarding product shortages without so much as a flick from a Wiimote. Commenting earlier this month on the mayhem surrounding Sony's PlayStation 3's product launch shortages, Nintendo of America vice president of marketing and corporate affairs Perrin Kaplan noted that "we didn't have anyone in line that got shot waiting for our system. So there's one sign of the different approaches between our two companies."Continue reading Switched On: What of the Wii-buked? Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93966099/
          2007-02-21T21:34:00
          Sirius' and XM's merger presentation revealedFiled under: Portable Audio, Portable Video - Brace yourself: corporate speak ahead. We normally aren't in for all this "cost synergies" and "roadmap" hogwash that all the suits seem to get so hot for, but when it comes to a merger of two cutthroat competitors like this, we couldn't help but take a peek. Other than the technology improvements we mentioned, there isn't much talk about consumer benefits in here, and there's absolutely no mention of creating some sort of single satellite radio provider, just the power of combined resources. Most of the talk is directed at shareholders and those "synergies" that help out the bottom line -- to the tune of an estimated $3-7 billion in savings, though a $4 billion "flex" does seem to cast a bit of doubt on those numbers. The rest of the slides deal with plans for getting regulatory approval, which basically amount to arguing the case of intense competition from radio, iPods and other emerging wireless standards (see above). That said, XM and Sirius seem quite confident of success on the regulatory end of things, and look to have put a quite a bit of thought into it. Pending approval from the feds, along with respective shareholder go-ahead, XM and Sirius plan on sealing the deal by the end of 2007.Gallery: Sirius and XM's merger presentation revealed Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93959647/
          2007-02-21T21:12:00
          Art Lebedev intros Verbarius electronic clockFiled under: Misc. GadgetsArt Lebedev may be best known these days for its various display-ridden peripherals, and the delays and uncertainty surrounding each, but the prolific design firm's got plenty more on its plate, to which it's now added the Verbarius electronic clock. As you can see above, the clock does away with the usual time-telling tools in favor of spelling things out, in five different languages no less. What's more, it changes up its verbiage each time you ask it the time, displaying variations like "forty-five minutes past four," "fifteen minutes to five," "four forty-five", and "a quarter to five." This being Lebedev, of course, they're also taking their time to build up anticipation in the device, with the clock supposedly set to only begin shipping in November. You can get your pre-orders in now, however, with a discount price of $158.25 available to those who order before September 1st, after which it'll set you back about $180. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93944802/
          2007-02-21T20:44:00
          HTC "Gene" makes FCC appearanceFiled under: Cellphones, Handhelds -After a fairly productive 3GSM last week showing off new Windows Mobile 6 wares in the form of the Vox and the Advantage, everyone's favorite Taiwanese Windows Mobile ODM has graced us with this here "Gene" (or at least we think that's what it's called, based on its model number, GENE100) via our usual Tipster Extraordinare, the FCC. The specs aren't really enough to knock our socks off -- data tops out with quadband EDGE, the cam is a simple 2 megapixel unit, plus the usual Bluetooth 2.0, 128MB of ROM, 64MB of RAM, and QVGA display atop a 201MHz TI OMAP850 -- but at this point, we're still happy to get whatever new Professional hardware we can get. Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93941965/
          2007-02-21T20:24:00
          Helio's Pantech PN-810 QWERTY device pops up in FCCFiled under: Cellphones, Handhelds -And here it is, Helio's coup de gr ce. The QWERTY handset we'd heard Helio was cookin' up with Korea's Pantech actually hit the FCC some time ago, but the shots we were able to glean from the test apparatus documentation were teasers at best. Thanks to the wonders of expired confientiality agreements, that same FCC documentation now yields a bounty of goodness, including a user's manual and a full array of pictures. The so-called PN-810 gives the illusion of a dual slider, but actually employs two distinct layers to provide two completely different keypads depending on the slide direction: QWERTY in one, numeric in the other. Key features (other than the unusual form factor, of course) include a 2.1 megapixel cam, Bluetooth, and the full array of goodies that comes with Helio membership. A release date remains uncertain, but the PN-810's been chilling with the feds for some time now, so we wouldn't be terribly surprised to see it hit in the near term.Gallery: Helio's Pantech PN-810 QWERTY device pops up in FCC Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93938442/
          2007-02-21T20:05:00
          ATI's R600 graphics chip hits snagFiled under: Desktops, GamingWe've had our eye on ATI"s new top-end R600 graphics chip for some time now, first getting a look at some impressive early benchmarks and then being taken aback by the foot-long graphics card the chips will call home (at least in some configurations). Sadly, it seems that those with money and power (as in 270W) to spare will have to wait a bit longer to slot one of the behemoths into their own PCs, with The Inquirer reporting that the R600 chips, and consequently the graphics cards based on 'em, have been delayed yet again, now pushed back to sometime in the second quarter of this year. There doesn't seem to be any word on the reason for the delay, but the news apparently came straight from ATI parent company AMD. Given what the cards are likely to cost, however, we're guessing that at least some won't be too disappointed in the delay, with the extra time allowing you to save up some more money and make some more excuses for why you're spending so much on a graphics card.[Via TG Daily] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93920986/
          2007-02-21T19:32:00
          Russians congregate over internet, drink via USB shot glassesFiled under: Misc. Gadgets - Considering that we've all some of us have been enjoying online chats, poker, and dating for quite some while, it's not too shocking to see the Russians utilize the power of the web to bring alcoholics and social drinkers together in inebriated harmony. Sergey Mikheev, head of e-generator, has devised a USB shot glass to allow lonely, alcohol-needing individuals to get their drink on while safely at home. While we don't consider ourselves experts in Russian culture, it's apparently not tactful to get plastered solo, and while online drinking might be stretching the rules just a bit, we're sure those vodka-lovin' internet dwellers aren't complaining. The idea is to join a group of drinkers in an online lounge, where the USB shot glass levels are shown on each person's screen; once the go-ahead is given, the folks turn up their glasses and chug it down, ideally showing an empty glass after a random smashing of keys somehow spells out congratulatory phrases. As interesting and novel as this may be, let it remind us all how "getting a life" should be taken oh-so-seriously.[Via ChipChick] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93918114/
          2007-02-21T19:02:00
          Samsung's 19-inch SyncMaster 940UX LCD picks USBFiled under: Displays -After DisplayLink hit us up with a cordless monitor care of Wireless USB, things really can't get much simpler for connecting LCDs with PC towers, but for those not quite ready to jump into all that, Samsung is reportedly readying a USB-only monitor that'll be showcased at CeBIT. Yep, according to reports, the 19-inch SyncMaster 940UX will be axing the DVI and VGA inputs in favor of a USB 2.0 connector, which means you can finally do away with those flakey USB to VGA adapters of days past. Slated for a May release, the display should sync up with Windows XP initially, with Vista drivers (no OS X love?) to follow shortly thereafter. No other details regarding contrast ratio, resolution, or whether a 0.25-page installation manual will be included is currently available, and more importantly, we're not so sure how your CPU is going to feel about its newfangled processing duties when you plug this sucka in. Still, Samsung claims between "three and five" of these monitors can be plugged in and used at any given time based on the amount of processing requirements your applications have, but the real question is how quickly can ATI / NVIDIA can crank out a next-generation GPU with USB 2.0 outputs, eh?[Via Slashgear] Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93898699/
          2007-02-21T18:32:00
          Latest BlackBerry OS confirms 8820 with WiFiFiled under: Cellphones, Handhelds, Wireless - A feature notoriously missing from RIM's range, WiFi is one add-on we can pretty much all agree would make the average BlackBerry user's life noticeably better. We'd heard rumblings ahead of the 8800's release that Canada's newest handset would sport some manner of 802.11 out of the box, but alas -- the release came and went with no 2.4GHz (or 5GHz, for that matter) goodness in sight, allegedly due to technical glitches on RIM's side that the company was unwilling to delay the initial model for. No worries, though -- well, maybe a few worries if you're AT T and you're trying to push the 8800 out the door -- the WiFi-enabled 8820 looks pretty official now thanks to a cameo in RIM's latest BlackBerry OS offering. Other changes should be minimal from its predecessor; a camera still isn't in the cards, leaving shutterbugs who like their BlackBerry served QWERTY style up the same creek they are now. No word on a release, but rumblings have the device launching mid-year. Read | Permalink | Email this | CommentsBOLD MOVES: THE FUTURE OF FORD A new documentary series. Be part of the transformation as it happens in real-timeOffice Depot Featured Gadget: Xbox 360 Platinum System Packs the power to bring games to life! -
          http://feeds.engadget.com/~r/weblogsinc/engadget/~3/93882167/
          2007-02-21T18:02:00
          Italian crisis talks as PM quitsItalian President Giorgio Napolitano is to begin crisis talks after the resignation of PM Romano Prodi.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/europe/6384953.stm
          2007-02-22T07:09:56
          Iraq leader welcomes troops' exitThe Iraqi president welcomes Tony Blair's plans to cut UK troops in Iraq from 7,100 to 5,000 within months.
          http://news.bbc.co.uk/go/rss/-/1/hi/uk_politics/6384685.stm
          2007-02-22T01:06:14
          Apple and Cisco share iPhoneApple and Cisco Systems agree to share the iPhone trademark, allowing both firms to use the name.
          http://news.bbc.co.uk/go/rss/-/1/hi/business/6384875.stm
          2007-02-22T04:52:01
          Indonesia ferry fire kills sixAt least seven people - two of them children - die as fire breaks out on a ferry sailing from Indonesia's capital.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/asia-pacific/6384859.stm
          2007-02-22T07:29:35
          Clinton and Obama row eruptsA row erupts between two leading contenders for the US Democratic Party's presidential nomination.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6384821.stm
          2007-02-22T02:02:19
          Menchu to stand in GuatemalaIndigenous activist and Nobel winner Rigoberta Menchu says she will run for president in Guatemala.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6384845.stm
          2007-02-22T03:33:05
          Most-premature baby goes homeThe world's most-premature baby leaves a Miami hospital, four months after weighing in at just 280 grams.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6384621.stm
          2007-02-21T22:33:54
          US wants tougher Iran sanctionsWashington says it will now push for tougher sanctions against Iran over its nuclear activities.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6384725.stm
          2007-02-21T23:43:08
          US soldier admits murdering girlA second US soldier admits to the gang rape and murder of a 14-year-old Iraqi girl and her family.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6384781.stm
          2007-02-22T01:40:53
          Football: Barca 1-2 L'poolCraig Bellamy and John Arne Riise both score as Liverpool beat holders Barcelona in the first leg of their Champions League tie.
          http://news.bbc.co.uk/go/rss/-/sport1/hi/football/europe/6371395.stm
          2007-02-21T21:37:03
          Football: Porto 1-1 ChelseaAndriy Shevchenko's goal earns Chelsea a draw, but the Blues lose John Terry to an ankle injury in Porto.
          http://news.bbc.co.uk/go/rss/-/sport1/hi/football/europe/6371399.stm
          2007-02-21T21:36:15
          Crisis talks over Bolivian floodsThe Bolivian government is holding emergency talks over the severe flooding in much of the country.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/americas/6384267.stm
          2007-02-21T20:54:40
          Spears 'leaves rehab after a day'Pop star Britney Spears has left a rehab centre after just one day for the second time, according to US reports.
          http://news.bbc.co.uk/go/rss/-/1/hi/entertainment/6384081.stm
          2007-02-21T18:31:01
          Australia may lift Afghan forceAustralia studies sending 450 more troops to Afghanistan, as US Vice-President Dick Cheney prepares to visit.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/asia-pacific/6384965.stm
          2007-02-22T06:43:29
          Blair announces Iraq troops cutTony Blair says he hopes to cut the number of UK troops in Iraq from 7,100 to 5,000 within months.
          http://news.bbc.co.uk/go/rss/-/1/hi/uk_politics/6380933.stm
          2007-02-21T18:15:55
          India ban on Iran nuclear exportsIndian officials say exports to Iran that could be used in the country's nuclear programme have been banned.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6384919.stm
          2007-02-22T05:52:36
          Quartet warning to PalestiniansThe Quartet of Mid-East peace negotiators says the new Palestinian government must recognise Israel.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/6384189.stm
          2007-02-21T20:30:30
          Three 'detained' over train blastPolice in India say they are holding three people after Sunday's bomb attack on a train to Pakistan.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6384867.stm
          2007-02-22T05:20:31
          India state airlines set to mergeAir India and Indian, India's two main state-owned airlines, are to merge to compete with private rivals.
          http://news.bbc.co.uk/go/rss/-/1/hi/world/south_asia/6384881.stm
          2007-02-22T05:11:16
          diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/index.html b/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/index.html deleted file mode 100644 index 2ecd0434b6..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/index.html +++ /dev/null @@ -1,280 +0,0 @@ - - - - - Apache Tuscany Alert Aggregator Sample - - - - - -

          Apache Tuscany Alert Aggregator Sample

          -

          Alert Sources:

          -
          -

          Recent Alerts (Refresh):

      -
      -

      Back to top

      -
      - - - - diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/pop.png b/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/pop.png deleted file mode 100644 index 1cf1df24a7..0000000000 Binary files a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/pop.png and /dev/null differ diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/rss.png b/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/rss.png deleted file mode 100644 index b3c949d224..0000000000 Binary files a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/rss.png and /dev/null differ diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/style.css b/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/style.css deleted file mode 100644 index cd377e90e5..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/htdocs/style.css +++ /dev/null @@ -1,166 +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. - */ - -p,table,li,h1,h2,h3 -{ -font-family: verdana, arial, 'sans serif'; -} - -p, h1, h2, h3, table, li, hr -{ -margin-left: 10pt; -} - -table -{ -border-color: black; -border-collapse: separate; -border-spacing: 0px 1px; - -margin-right: 10pt; -margin-left: 10pt; -width: 800px; -} - -.sourceDetailsTable -{ -width: 600px; -} - -tr, td -{ -margin-left: 0pt; -margin-right: 0pt; -padding-left: 10pt; -font-size: 90%; -} - -p,li,th -{ -font-size: 90%; -margin-left: 10pt; -} - -pre -{ -margin-left: 10pt; -} - -body -{ -#ffffff; -} - -h1,h2,h3,hr -{ -color: firebrick; -} - -a:link {COLOR: firebrick;} -a:visited {COLOR: firebrick;} -a:active {COLOR: navy;} - -.link -{ -COLOR: firebrick; -text-decoration: underline; -} - -.clickable -{ -cursor: pointer -} - -.unread_title -{ -font-weight: bold; -} - -.read_title -{ -font-weight: normal; -} - -.summary -{ -color: DimGrey; -} - -.hidden -{ -display: none; -} - -.alert_data -{ -margin-left: 10px; -width: 800px; -height: 800px; -} - -.source_0 -{ -background-color: LightGreen; -} - -.source_1 -{ -background-color: LightSkyBlue; -} - -.source_2 -{ -background-color: Khaki; -} - -.source_3 -{ -background-color: LightPink; -} - -.source_4 -{ -background-color: Orange; -} - -.source_5 -{ -background-color: LightCoral; -} - -.source_6 -{ -background-color: Orchid; -} - -.source_7 -{ -background-color: Peru; -} - -.source_8 -{ -background-color: SpringGreen; -} - -.source_9 -{ -background-color: LightGrey; -} - diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/startserver.bat b/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/startserver.bat deleted file mode 100644 index dab8cd6c61..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/httpserver.php/startserver.bat +++ /dev/null @@ -1,76 +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 APFULLDIR=%~d0%~p0 -echo Running from %APFULLDIR% - -if "%TUSCANY_SCACPP%" == "" ( -echo "TUSCANY_SCACPP not set" -goto end -) -echo Using SCA installed at %TUSCANY_SCACPP% - -if "%TUSCANY_SDOCPP%" == "" ( -echo "TUSCANY_SDOCPP not set" -goto end -) -echo Using SDO installed at %TUSCANY_SDOCPP% - -if "%HTTPD_HOME%" == "" ( -echo "HTTPD_HOME not set" -goto end -) -echo Using HTTPD installed at %HTTPD_HOME% - -set PATH=%TUSCANY_SCACPP%\extensions\python\bin;%TUSCANY_SCACPP%\extensions\rest\interface\bin;%TUSCANY_SCACPP%\extensions\rest\service\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%HTTPD_HOME%\bin;%PATH% -set PYTHONPATH=%TUSCANY_SCACPP%\extensions\python\bin - -set TUSCANY_SCACPP_ROOT=%APFULLDIR%\..\ -set TUSCANY_SCACPP_BASE_URI=http://localhost:9091 - -@REM Generate the tuscany_sca_mod_rest configuration -if not exist %APFULLDIR%\conf\tuscany_sca_mod_rest.conf ( - echo LoadModule sca_rest_module %TUSCANY_SCACPP%/extensions/rest\service/bin/tuscany_sca_mod_rest.dll > %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo TuscanyHome %TUSCANY_SCACPP% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo SetHandler sca_rest_module >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo TuscanyRoot %TUSCANY_SCACPP_ROOT% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf -) - -@REM Generate the base HTTPD configuration -if not exist %APFULLDIR%\conf\base.conf ( - echo LoadModule mime_module %HTTPD_HOME%\modules\mod_mime.so > %APFULLDIR%\conf\base.conf - echo LoadModule dir_module %HTTPD_HOME%\modules\mod_dir.so >> %APFULLDIR%\conf\base.conf - echo DocumentRoot %APFULLDIR%\htdocs >> %APFULLDIR%\conf\base.conf - echo LoadModule php5_module %PHP_HOME%\php5apache2.dll >> %APFULLDIR%\conf\base.conf - echo AddType application/x-httpd-php .php >> %APFULLDIR%\conf\base.conf - echo PHPIniDir %PHP_HOME% >> %APFULLDIR%\conf\base.conf -) - -@REM Create logs directory -if not exist %APFULLDIR%\logs mkdir %APFULLDIR%\logs -set TUSCANY_SCACPP_LOG=%APFULLDIR%\logs\tuscany-server.log -set TUSCANY_SCACPP_LOGGING=9 - -@REM Start the HTTP server -echo Starting Apache httpd -httpd -d %APFULLDIR% diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver/Makefile.am b/sca-cpp/trunk/samples/AlertAggregator/httpserver/Makefile.am deleted file mode 100644 index 5db11696dc..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/httpserver/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. - -deploydir=$(prefix)/AlertAggregator/deploy -serverdir=$(deploydir)/httpserver - -server_SCRIPTS = startserver.sh stopserver.sh -EXTRA_DIST = startserver.sh stopserver.sh conf htdocs -nobase_server_DATA = conf/httpd.conf conf/mime.types htdocs/index.html htdocs/style.css htdocs/*.png diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver/conf/httpd.conf b/sca-cpp/trunk/samples/AlertAggregator/httpserver/conf/httpd.conf deleted file mode 100644 index d243f85fbf..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/httpserver/conf/httpd.conf +++ /dev/null @@ -1,43 +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 is the main Apache HTTP server configuration file. It contains the -# configuration directives that give the server its instructions. -# See for detailed information. - -Listen 9090 - -# Generated by the startserver script -Include conf/base.conf -Include conf/tuscany_sca_mod_rest.conf - -# User and Group directives may be required if the server must be -# started from the root account. Uncomment the following lines and -# set the correct username and group -# -# User myusername -# Group mygroupname - - -# The Mime module may need to be specifically loaded if -# text rather than a web page is displayed when the web browser goes to -# http://localhost:9090/index.html. Uncomment the following LoadModule -# directive and ensure that the path to mod_mime.so is correct -# -# LoadModule mime_module /usr/lib/httpd/modules/mod_mime.so - - diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver/conf/mime.types b/sca-cpp/trunk/samples/AlertAggregator/httpserver/conf/mime.types deleted file mode 100644 index 4279f51bca..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/httpserver/conf/mime.types +++ /dev/null @@ -1,607 +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 file controls what Internet media types are sent to the client for -# given file extension(s). Sending the correct media type to the client -# is important so they know how to handle the content of the file. -# Extra types can either be added here or by using an AddType directive -# in your config files. For more information about Internet media types, -# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type -# registry is at . - -# MIME type Extensions -application/activemessage -application/andrew-inset ez -application/applefile -application/atom+xml atom -application/atomicmail -application/batch-smtp -application/beep+xml -application/cals-1840 -application/cnrp+xml -application/commonground -application/cpl+xml -application/cybercash -application/dca-rft -application/dec-dx -application/dvcs -application/edi-consent -application/edifact -application/edi-x12 -application/eshop -application/font-tdpfr -application/http -application/hyperstudio -application/iges -application/index -application/index.cmd -application/index.obj -application/index.response -application/index.vnd -application/iotp -application/ipp -application/isup -application/mac-binhex40 hqx -application/mac-compactpro cpt -application/macwriteii -application/marc -application/mathematica -application/mathml+xml mathml -application/msword doc -application/news-message-id -application/news-transmission -application/ocsp-request -application/ocsp-response -application/octet-stream bin dms lha lzh exe class so dll dmg -application/oda oda -application/ogg ogg -application/parityfec -application/pdf pdf -application/pgp-encrypted -application/pgp-keys -application/pgp-signature -application/pkcs10 -application/pkcs7-mime -application/pkcs7-signature -application/pkix-cert -application/pkix-crl -application/pkixcmp -application/postscript ai eps ps -application/prs.alvestrand.titrax-sheet -application/prs.cww -application/prs.nprend -application/prs.plucker -application/qsig -application/rdf+xml rdf -application/reginfo+xml -application/remote-printing -application/riscos -application/rtf -application/sdp -application/set-payment -application/set-payment-initiation -application/set-registration -application/set-registration-initiation -application/sgml -application/sgml-open-catalog -application/sieve -application/slate -application/smil smi smil -application/srgs gram -application/srgs+xml grxml -application/timestamp-query -application/timestamp-reply -application/tve-trigger -application/vemmi -application/vnd.3gpp.pic-bw-large -application/vnd.3gpp.pic-bw-small -application/vnd.3gpp.pic-bw-var -application/vnd.3gpp.sms -application/vnd.3m.post-it-notes -application/vnd.accpac.simply.aso -application/vnd.accpac.simply.imp -application/vnd.acucobol -application/vnd.acucorp -application/vnd.adobe.xfdf -application/vnd.aether.imp -application/vnd.amiga.ami -application/vnd.anser-web-certificate-issue-initiation -application/vnd.anser-web-funds-transfer-initiation -application/vnd.audiograph -application/vnd.blueice.multipass -application/vnd.bmi -application/vnd.businessobjects -application/vnd.canon-cpdl -application/vnd.canon-lips -application/vnd.cinderella -application/vnd.claymore -application/vnd.commerce-battelle -application/vnd.commonspace -application/vnd.contact.cmsg -application/vnd.cosmocaller -application/vnd.criticaltools.wbs+xml -application/vnd.ctc-posml -application/vnd.cups-postscript -application/vnd.cups-raster -application/vnd.cups-raw -application/vnd.curl -application/vnd.cybank -application/vnd.data-vision.rdz -application/vnd.dna -application/vnd.dpgraph -application/vnd.dreamfactory -application/vnd.dxr -application/vnd.ecdis-update -application/vnd.ecowin.chart -application/vnd.ecowin.filerequest -application/vnd.ecowin.fileupdate -application/vnd.ecowin.series -application/vnd.ecowin.seriesrequest -application/vnd.ecowin.seriesupdate -application/vnd.enliven -application/vnd.epson.esf -application/vnd.epson.msf -application/vnd.epson.quickanime -application/vnd.epson.salt -application/vnd.epson.ssf -application/vnd.ericsson.quickcall -application/vnd.eudora.data -application/vnd.fdf -application/vnd.ffsns -application/vnd.fints -application/vnd.flographit -application/vnd.framemaker -application/vnd.fsc.weblaunch -application/vnd.fujitsu.oasys -application/vnd.fujitsu.oasys2 -application/vnd.fujitsu.oasys3 -application/vnd.fujitsu.oasysgp -application/vnd.fujitsu.oasysprs -application/vnd.fujixerox.ddd -application/vnd.fujixerox.docuworks -application/vnd.fujixerox.docuworks.binder -application/vnd.fut-misnet -application/vnd.grafeq -application/vnd.groove-account -application/vnd.groove-help -application/vnd.groove-identity-message -application/vnd.groove-injector -application/vnd.groove-tool-message -application/vnd.groove-tool-template -application/vnd.groove-vcard -application/vnd.hbci -application/vnd.hhe.lesson-player -application/vnd.hp-hpgl -application/vnd.hp-hpid -application/vnd.hp-hps -application/vnd.hp-pcl -application/vnd.hp-pclxl -application/vnd.httphone -application/vnd.hzn-3d-crossword -application/vnd.ibm.afplinedata -application/vnd.ibm.electronic-media -application/vnd.ibm.minipay -application/vnd.ibm.modcap -application/vnd.ibm.rights-management -application/vnd.ibm.secure-container -application/vnd.informix-visionary -application/vnd.intercon.formnet -application/vnd.intertrust.digibox -application/vnd.intertrust.nncp -application/vnd.intu.qbo -application/vnd.intu.qfx -application/vnd.irepository.package+xml -application/vnd.is-xpr -application/vnd.japannet-directory-service -application/vnd.japannet-jpnstore-wakeup -application/vnd.japannet-payment-wakeup -application/vnd.japannet-registration -application/vnd.japannet-registration-wakeup -application/vnd.japannet-setstore-wakeup -application/vnd.japannet-verification -application/vnd.japannet-verification-wakeup -application/vnd.jisp -application/vnd.kde.karbon -application/vnd.kde.kchart -application/vnd.kde.kformula -application/vnd.kde.kivio -application/vnd.kde.kontour -application/vnd.kde.kpresenter -application/vnd.kde.kspread -application/vnd.kde.kword -application/vnd.kenameaapp -application/vnd.koan -application/vnd.liberty-request+xml -application/vnd.llamagraphics.life-balance.desktop -application/vnd.llamagraphics.life-balance.exchange+xml -application/vnd.lotus-1-2-3 -application/vnd.lotus-approach -application/vnd.lotus-freelance -application/vnd.lotus-notes -application/vnd.lotus-organizer -application/vnd.lotus-screencam -application/vnd.lotus-wordpro -application/vnd.mcd -application/vnd.mediastation.cdkey -application/vnd.meridian-slingshot -application/vnd.micrografx.flo -application/vnd.micrografx.igx -application/vnd.mif mif -application/vnd.minisoft-hp3000-save -application/vnd.mitsubishi.misty-guard.trustweb -application/vnd.mobius.daf -application/vnd.mobius.dis -application/vnd.mobius.mbk -application/vnd.mobius.mqy -application/vnd.mobius.msl -application/vnd.mobius.plc -application/vnd.mobius.txf -application/vnd.mophun.application -application/vnd.mophun.certificate -application/vnd.motorola.flexsuite -application/vnd.motorola.flexsuite.adsi -application/vnd.motorola.flexsuite.fis -application/vnd.motorola.flexsuite.gotap -application/vnd.motorola.flexsuite.kmr -application/vnd.motorola.flexsuite.ttc -application/vnd.motorola.flexsuite.wem -application/vnd.mozilla.xul+xml xul -application/vnd.ms-artgalry -application/vnd.ms-asf -application/vnd.ms-excel xls -application/vnd.ms-lrm -application/vnd.ms-powerpoint ppt -application/vnd.ms-project -application/vnd.ms-tnef -application/vnd.ms-works -application/vnd.ms-wpl -application/vnd.mseq -application/vnd.msign -application/vnd.music-niff -application/vnd.musician -application/vnd.netfpx -application/vnd.noblenet-directory -application/vnd.noblenet-sealer -application/vnd.noblenet-web -application/vnd.novadigm.edm -application/vnd.novadigm.edx -application/vnd.novadigm.ext -application/vnd.obn -application/vnd.osa.netdeploy -application/vnd.palm -application/vnd.pg.format -application/vnd.pg.osasli -application/vnd.powerbuilder6 -application/vnd.powerbuilder6-s -application/vnd.powerbuilder7 -application/vnd.powerbuilder7-s -application/vnd.powerbuilder75 -application/vnd.powerbuilder75-s -application/vnd.previewsystems.box -application/vnd.publishare-delta-tree -application/vnd.pvi.ptid1 -application/vnd.pwg-multiplexed -application/vnd.pwg-xhtml-print+xml -application/vnd.quark.quarkxpress -application/vnd.rapid -application/vnd.s3sms -application/vnd.sealed.net -application/vnd.seemail -application/vnd.shana.informed.formdata -application/vnd.shana.informed.formtemplate -application/vnd.shana.informed.interchange -application/vnd.shana.informed.package -application/vnd.smaf -application/vnd.sss-cod -application/vnd.sss-dtf -application/vnd.sss-ntf -application/vnd.street-stream -application/vnd.svd -application/vnd.swiftview-ics -application/vnd.triscape.mxs -application/vnd.trueapp -application/vnd.truedoc -application/vnd.ufdl -application/vnd.uplanet.alert -application/vnd.uplanet.alert-wbxml -application/vnd.uplanet.bearer-choice -application/vnd.uplanet.bearer-choice-wbxml -application/vnd.uplanet.cacheop -application/vnd.uplanet.cacheop-wbxml -application/vnd.uplanet.channel -application/vnd.uplanet.channel-wbxml -application/vnd.uplanet.list -application/vnd.uplanet.list-wbxml -application/vnd.uplanet.listcmd -application/vnd.uplanet.listcmd-wbxml -application/vnd.uplanet.signal -application/vnd.vcx -application/vnd.vectorworks -application/vnd.vidsoft.vidconference -application/vnd.visio -application/vnd.visionary -application/vnd.vividence.scriptfile -application/vnd.vsf -application/vnd.wap.sic -application/vnd.wap.slc -application/vnd.wap.wbxml wbxml -application/vnd.wap.wmlc wmlc -application/vnd.wap.wmlscriptc wmlsc -application/vnd.webturbo -application/vnd.wrq-hp3000-labelled -application/vnd.wt.stf -application/vnd.wv.csp+wbxml -application/vnd.xara -application/vnd.xfdl -application/vnd.yamaha.hv-dic -application/vnd.yamaha.hv-script -application/vnd.yamaha.hv-voice -application/vnd.yellowriver-custom-menu -application/voicexml+xml vxml -application/watcherinfo+xml -application/whoispp-query -application/whoispp-response -application/wita -application/wordperfect5.1 -application/x-bcpio bcpio -application/x-cdlink vcd -application/x-chess-pgn pgn -application/x-compress -application/x-cpio cpio -application/x-csh csh -application/x-director dcr dir dxr -application/x-dvi dvi -application/x-futuresplash spl -application/x-gtar gtar -application/x-gzip -application/x-hdf hdf -application/x-javascript js -application/x-koan skp skd skt skm -application/x-latex latex -application/x-netcdf nc cdf -application/x-sh sh -application/x-shar shar -application/x-shockwave-flash swf -application/x-stuffit sit -application/x-sv4cpio sv4cpio -application/x-sv4crc sv4crc -application/x-tar tar -application/x-tcl tcl -application/x-tex tex -application/x-texinfo texinfo texi -application/x-troff t tr roff -application/x-troff-man man -application/x-troff-me me -application/x-troff-ms ms -application/x-ustar ustar -application/x-wais-source src -application/x400-bp -application/xhtml+xml xhtml xht -application/xslt+xml xslt -application/xml xml xsl -application/xml-dtd dtd -application/xml-external-parsed-entity -application/zip zip -audio/32kadpcm -audio/amr -audio/amr-wb -audio/basic au snd -audio/cn -audio/dat12 -audio/dsr-es201108 -audio/dvi4 -audio/evrc -audio/evrc0 -audio/g722 -audio/g.722.1 -audio/g723 -audio/g726-16 -audio/g726-24 -audio/g726-32 -audio/g726-40 -audio/g728 -audio/g729 -audio/g729D -audio/g729E -audio/gsm -audio/gsm-efr -audio/l8 -audio/l16 -audio/l20 -audio/l24 -audio/lpc -audio/midi mid midi kar -audio/mpa -audio/mpa-robust -audio/mp4a-latm -audio/mpeg mpga mp2 mp3 -audio/parityfec -audio/pcma -audio/pcmu -audio/prs.sid -audio/qcelp -audio/red -audio/smv -audio/smv0 -audio/telephone-event -audio/tone -audio/vdvi -audio/vnd.3gpp.iufp -audio/vnd.cisco.nse -audio/vnd.cns.anp1 -audio/vnd.cns.inf1 -audio/vnd.digital-winds -audio/vnd.everad.plj -audio/vnd.lucent.voice -audio/vnd.nortel.vbk -audio/vnd.nuera.ecelp4800 -audio/vnd.nuera.ecelp7470 -audio/vnd.nuera.ecelp9600 -audio/vnd.octel.sbc -audio/vnd.qcelp -audio/vnd.rhetorex.32kadpcm -audio/vnd.vmx.cvsd -audio/x-aiff aif aiff aifc -audio/x-alaw-basic -audio/x-mpegurl m3u -audio/x-pn-realaudio ram ra -audio/x-pn-realaudio-plugin -application/vnd.rn-realmedia rm -audio/x-wav wav -chemical/x-pdb pdb -chemical/x-xyz xyz -image/bmp bmp -image/cgm cgm -image/g3fax -image/gif gif -image/ief ief -image/jpeg jpeg jpg jpe -image/naplps -image/png png -image/prs.btif -image/prs.pti -image/svg+xml svg -image/t38 -image/tiff tiff tif -image/tiff-fx -image/vnd.cns.inf2 -image/vnd.djvu djvu djv -image/vnd.dwg -image/vnd.dxf -image/vnd.fastbidsheet -image/vnd.fpx -image/vnd.fst -image/vnd.fujixerox.edmics-mmr -image/vnd.fujixerox.edmics-rlc -image/vnd.globalgraphics.pgb -image/vnd.mix -image/vnd.ms-modi -image/vnd.net-fpx -image/vnd.svf -image/vnd.wap.wbmp wbmp -image/vnd.xiff -image/x-cmu-raster ras -image/x-icon ico -image/x-portable-anymap pnm -image/x-portable-bitmap pbm -image/x-portable-graymap pgm -image/x-portable-pixmap ppm -image/x-rgb rgb -image/x-xbitmap xbm -image/x-xpixmap xpm -image/x-xwindowdump xwd -message/delivery-status -message/disposition-notification -message/external-body -message/http -message/news -message/partial -message/rfc822 -message/s-http -message/sip -message/sipfrag -model/iges igs iges -model/mesh msh mesh silo -model/vnd.dwf -model/vnd.flatland.3dml -model/vnd.gdl -model/vnd.gs-gdl -model/vnd.gtw -model/vnd.mts -model/vnd.parasolid.transmit.binary -model/vnd.parasolid.transmit.text -model/vnd.vtu -model/vrml wrl vrml -multipart/alternative -multipart/appledouble -multipart/byteranges -multipart/digest -multipart/encrypted -multipart/form-data -multipart/header-set -multipart/mixed -multipart/parallel -multipart/related -multipart/report -multipart/signed -multipart/voice-message -text/calendar ics ifb -text/css css -text/directory -text/enriched -text/html html htm -text/parityfec -text/plain asc txt -text/prs.lines.tag -text/rfc822-headers -text/richtext rtx -text/rtf rtf -text/sgml sgml sgm -text/t140 -text/tab-separated-values tsv -text/uri-list -text/vnd.abc -text/vnd.curl -text/vnd.dmclientscript -text/vnd.fly -text/vnd.fmi.flexstor -text/vnd.in3d.3dml -text/vnd.in3d.spot -text/vnd.iptc.nitf -text/vnd.iptc.newsml -text/vnd.latex-z -text/vnd.motorola.reflex -text/vnd.ms-mediapackage -text/vnd.net2phone.commcenter.command -text/vnd.sun.j2me.app-descriptor -text/vnd.wap.si -text/vnd.wap.sl -text/vnd.wap.wml wml -text/vnd.wap.wmlscript wmls -text/x-setext etx -text/xml -text/xml-external-parsed-entity -video/bmpeg -video/bt656 -video/celb -video/dv -video/h261 -video/h263 -video/h263-1998 -video/h263-2000 -video/jpeg -video/mp1s -video/mp2p -video/mp2t -video/mp4v-es -video/mpv -video/mpeg mpeg mpg mpe -video/nv -video/parityfec -video/pointer -video/quicktime qt mov -video/smpte292m -video/vnd.fvt -video/vnd.motorola.video -video/vnd.motorola.videop -video/vnd.mpegurl mxu m4u -video/vnd.nokia.interleaved-multimedia -video/vnd.objectvideo -video/vnd.vivo -video/x-msvideo avi -video/x-sgi-movie movie -x-conference/x-cooltalk ice diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver/htdocs/index.html b/sca-cpp/trunk/samples/AlertAggregator/httpserver/htdocs/index.html deleted file mode 100644 index 911f66e013..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/httpserver/htdocs/index.html +++ /dev/null @@ -1,290 +0,0 @@ - - - - - Apache Tuscany Alert Aggregator Sample - - - - - -

      Apache Tuscany Alert Aggregator Sample

      -

      Alert Sources:

      -
      -

      Recent Alerts (Refresh):

      -
      -
      -

      Back to top

      -
      - - - - diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver/htdocs/pop.png b/sca-cpp/trunk/samples/AlertAggregator/httpserver/htdocs/pop.png deleted file mode 100644 index 1cf1df24a7..0000000000 Binary files a/sca-cpp/trunk/samples/AlertAggregator/httpserver/htdocs/pop.png and /dev/null differ diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver/htdocs/rss.png b/sca-cpp/trunk/samples/AlertAggregator/httpserver/htdocs/rss.png deleted file mode 100644 index b3c949d224..0000000000 Binary files a/sca-cpp/trunk/samples/AlertAggregator/httpserver/htdocs/rss.png and /dev/null differ diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver/htdocs/style.css b/sca-cpp/trunk/samples/AlertAggregator/httpserver/htdocs/style.css deleted file mode 100644 index cd377e90e5..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/httpserver/htdocs/style.css +++ /dev/null @@ -1,166 +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. - */ - -p,table,li,h1,h2,h3 -{ -font-family: verdana, arial, 'sans serif'; -} - -p, h1, h2, h3, table, li, hr -{ -margin-left: 10pt; -} - -table -{ -border-color: black; -border-collapse: separate; -border-spacing: 0px 1px; - -margin-right: 10pt; -margin-left: 10pt; -width: 800px; -} - -.sourceDetailsTable -{ -width: 600px; -} - -tr, td -{ -margin-left: 0pt; -margin-right: 0pt; -padding-left: 10pt; -font-size: 90%; -} - -p,li,th -{ -font-size: 90%; -margin-left: 10pt; -} - -pre -{ -margin-left: 10pt; -} - -body -{ -#ffffff; -} - -h1,h2,h3,hr -{ -color: firebrick; -} - -a:link {COLOR: firebrick;} -a:visited {COLOR: firebrick;} -a:active {COLOR: navy;} - -.link -{ -COLOR: firebrick; -text-decoration: underline; -} - -.clickable -{ -cursor: pointer -} - -.unread_title -{ -font-weight: bold; -} - -.read_title -{ -font-weight: normal; -} - -.summary -{ -color: DimGrey; -} - -.hidden -{ -display: none; -} - -.alert_data -{ -margin-left: 10px; -width: 800px; -height: 800px; -} - -.source_0 -{ -background-color: LightGreen; -} - -.source_1 -{ -background-color: LightSkyBlue; -} - -.source_2 -{ -background-color: Khaki; -} - -.source_3 -{ -background-color: LightPink; -} - -.source_4 -{ -background-color: Orange; -} - -.source_5 -{ -background-color: LightCoral; -} - -.source_6 -{ -background-color: Orchid; -} - -.source_7 -{ -background-color: Peru; -} - -.source_8 -{ -background-color: SpringGreen; -} - -.source_9 -{ -background-color: LightGrey; -} - diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver/startserver.bat b/sca-cpp/trunk/samples/AlertAggregator/httpserver/startserver.bat deleted file mode 100644 index fa4d66df31..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/httpserver/startserver.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 - -set APFULLDIR=%~d0%~p0 -echo Running from %APFULLDIR% - -if "%TUSCANY_SCACPP%" == "" ( -echo "TUSCANY_SCACPP not set" -goto end -) -echo Using SCA installed at %TUSCANY_SCACPP% - -if "%TUSCANY_SDOCPP%" == "" ( -echo "TUSCANY_SDOCPP not set" -goto end -) -echo Using SDO installed at %TUSCANY_SDOCPP% - -if "%HTTPD_HOME%" == "" ( -echo "HTTPD_HOME not set" -goto end -) -echo Using HTTPD installed at %HTTPD_HOME% - -set PATH=%TUSCANY_SCACPP%\extensions\python\bin;%TUSCANY_SCACPP%\extensions\rest\interface\bin;%TUSCANY_SCACPP%\extensions\rest\service\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%HTTPD_HOME%\bin;%PATH% -set PYTHONPATH=%TUSCANY_SCACPP%\extensions\python\bin - -set TUSCANY_SCACPP_ROOT=%APFULLDIR%\..\ -set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -@REM Generate the tuscany_sca_mod_rest configuration -if not exist %APFULLDIR%\conf\tuscany_sca_mod_rest.conf ( - echo LoadModule sca_rest_module %TUSCANY_SCACPP%/extensions/rest\service/bin/tuscany_sca_mod_rest.dll > %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo TuscanyHome %TUSCANY_SCACPP% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo SetHandler sca_rest_module >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo TuscanyRoot %TUSCANY_SCACPP_ROOT% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf -) - -@REM Generate the base HTTPD configuration -if not exist %APFULLDIR%\conf\base.conf ( - echo LoadModule mime_module %HTTPD_HOME%\modules\mod_mime.so > %APFULLDIR%\conf\base.conf - echo LoadModule dir_module %HTTPD_HOME%\modules\mod_dir.so >> %APFULLDIR%\conf\base.conf - echo DocumentRoot %APFULLDIR%\htdocs >> %APFULLDIR%\conf\base.conf -) - -@REM Create logs directory -if not exist %APFULLDIR%\logs mkdir %APFULLDIR%\logs -set TUSCANY_SCACPP_LOG=%APFULLDIR%\logs\tuscany-server.log -set TUSCANY_SCACPP_LOGGING=9 - -@REM Start the HTTP server -echo Starting Apache httpd -httpd -d %APFULLDIR% diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver/startserver.sh b/sca-cpp/trunk/samples/AlertAggregator/httpserver/startserver.sh deleted file mode 100755 index d197b94245..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/httpserver/startserver.sh +++ /dev/null @@ -1,78 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -if [ x$PYTHON_LIB != x ]; then -echo "Using Python library installed at $PYTHON_LIB" -export LD_LIBRARY_PATH=$PYTHON_LIB:$LD_LIBRARY_PATH -export PATH=$PYTHON_LIB/../bin:$PATH -fi - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/python/lib:$TUSCANY_SCACPP/extensions/ruby/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH -export PYTHONPATH=$TUSCANY_SCACPP/extensions/python/lib:$PYTHONPATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ -export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -libsuffix=.so -UNAME=`uname -s` -if [ "x$UNAME" = "xDarwin" ]; then - libsuffix=.dylib -fi - -# Generate the mod_rest configuration -if [ ! -f conf/tuscany_sca_mod_rest.conf ]; then - echo "LoadModule sca_rest_module $TUSCANY_SCACPP/extensions/rest/service/lib/libtuscany_sca_mod_rest$libsuffix" >conf/tuscany_sca_mod_rest.conf - echo "TuscanyHome $TUSCANY_SCACPP" >>conf/tuscany_sca_mod_rest.conf - echo "" >>conf/tuscany_sca_mod_rest.conf - echo " SetHandler sca_rest_module" >>conf/tuscany_sca_mod_rest.conf - echo " TuscanyRoot $TUSCANY_SCACPP_ROOT" >>conf/tuscany_sca_mod_rest.conf - echo "" >>conf/tuscany_sca_mod_rest.conf -fi - -if [ ! -f conf/base.conf ]; then - echo "DocumentRoot $APFULLDIR/htdocs" >conf/base.conf -fi - -# Create logs directory -if [ ! -d logs ]; then - mkdir logs -fi - -# Start the HTTP server -echo "Starting Apache httpd" - -# Set LD_PRELOAD to use the expat included in Python to avoid incompatibilities -export LD_PRELOAD=$TUSCANY_SCACPP/extensions/python/lib/libtuscany_sca_python$libsuffix - -apachectl -k start -d $APFULLDIR - diff --git a/sca-cpp/trunk/samples/AlertAggregator/httpserver/stopserver.sh b/sca-cpp/trunk/samples/AlertAggregator/httpserver/stopserver.sh deleted file mode 100755 index c17f632a3e..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/httpserver/stopserver.sh +++ /dev/null @@ -1,25 +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` - -# Stop the HTTP server -echo "Stopping Apache httpd" -apachectl -k stop -d $APFULLDIR - diff --git a/sca-cpp/trunk/samples/AlertAggregator/sample.alerter.app.composite b/sca-cpp/trunk/samples/AlertAggregator/sample.alerter.app.composite deleted file mode 100644 index 4c0d4ccd1a..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/sample.alerter.app.composite +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - sample.alerter.AlerterComponent/AlerterService - - - - - - - diff --git a/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/AlertCheckerImpl.py b/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/AlertCheckerImpl.py deleted file mode 100644 index d9aab820ac..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/AlertCheckerImpl.py +++ /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. -# -import xml.etree.ElementTree, datetime - -def getAllNewAlerts (): - - returnXML = "\n" - returnElem = xml.etree.ElementTree.XML(returnXML) - - # Use the alertConfigService to get the configuration - configElem = alertConfigService.getAlertConfig() - - for sourceElem in configElem.findall("./{http://tuscany.apache.org/samples/alerter}source"): - - sourceid = sourceElem.attrib["id"] - - newAlerts = getAlerts(sourceElem) - if xml.etree.ElementTree.iselement(newAlerts): - # Add the sourceid to each alert and append to the entire list - for alert in newAlerts.findall("./{http://tuscany.apache.org/samples/alerter}alert"): - alert.attrib["sourceid"] = sourceid - returnElem.append(alert) - - return returnElem - -def getAlerts (sourceElem): - - lastcheckedElem = sourceElem.find("./{http://tuscany.apache.org/samples/alerter}lastChecked") - if not xml.etree.ElementTree.iselement(lastcheckedElem): - lastcheckedElem = xml.etree.ElementTree.SubElement(sourceElem, "lastChecked") - lastcheckedElem.text = "" - - if sourceElem.attrib["type"] == "rss": - - feedaddress = sourceElem.find("./{http://tuscany.apache.org/samples/alerter}feedAddress").text - - if feedaddress: - # Use the rssCheckerService to get new articles for this config - newAlerts = rssCheckerService.getNewAlerts(feedaddress, lastcheckedElem.text) - - lastcheckedElem.text = datetime.datetime.now().replace(microsecond=0).isoformat() - alertConfigService.updateSourceConfig(sourceElem) - return newAlerts - - elif sourceElem.attrib["type"] == "pop": - - popserver = sourceElem.find("./{http://tuscany.apache.org/samples/alerter}popServer").text - popusername = sourceElem.find("./{http://tuscany.apache.org/samples/alerter}popUsername").text - poppassword = sourceElem.find("./{http://tuscany.apache.org/samples/alerter}popPassword").text - - if popserver and popusername and poppassword: - # Use the popCheckerService to get new emails for this config - newAlerts = popCheckerService.getNewAlerts(popserver, popusername, poppassword, lastcheckedElem.text) - - lastcheckedElem.text = datetime.datetime.now().replace(microsecond=0).isoformat() - alertConfigService.updateSourceConfig(sourceElem) - return newAlerts - - else: - print "Source type not supported: ", sourceElem.attrib["type"] - - return None - - -def getNewAlerts (sourceId): - # Use the alertConfigService to get the configuration - sourceConfigElem = alertConfigService.getSourceConfig(sourceId) - - # Get the alerts - newAlerts = getAlerts(sourceConfigElem) - - if xml.etree.ElementTree.iselement(newAlerts): - # Add the sourceid to each alert - for alert in newAlerts.findall("./{http://tuscany.apache.org/samples/alerter}alert"): - alert.attrib["sourceid"] = sourceId - - return newAlerts - -def addAlertSource (sourceElem): - # Add the source directly to the configuration - return alertConfigService.addSourceConfig(sourceElem) - -def updateAlertSource (sourceElem): - # Update the source in the configuration - return alertConfigService.updateSourceConfig(sourceElem) - -def removeAlertSource (sourceId): - # Remove the source from the configuration - alertConfigService.removeSourceConfig(sourceId) - -def getAlertSources (): - # Get the config for all the sources - return alertConfigService.getAlertConfig() - -# # Testing -# import AlertConfigImpl as alertConfigService -# import RSSCheckerImpl as rssCheckerService -# import POPCheckerImpl as popCheckerService -# -# print xml.etree.ElementTree.tostring(getAlertSources()) -# print xml.etree.ElementTree.tostring(getAllNewAlerts()) diff --git a/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/AlertConfigImpl.py b/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/AlertConfigImpl.py deleted file mode 100644 index 2800a940b4..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/AlertConfigImpl.py +++ /dev/null @@ -1,175 +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. -# - -import xml.etree.ElementTree, os.path, os - -def getAlertConfig (): - - # Set up some default config data - configData = "\n" - - if os.path.isfile(os.environ['TUSCANY_SCACPP_ROOT']+"/config.xml"): - # Retrieve the configuration from a file - f = open(os.environ['TUSCANY_SCACPP_ROOT']+"/config.xml") - try: - configData = f.read() - finally: - f.close() - - configElem = xml.etree.ElementTree.XML(configData) - - return configElem - -def getSourceConfig (sourceId): - - configElem = getAlertConfig() - - for sourceElem in configElem.findall("./{http://tuscany.apache.org/samples/alerter}source"): - if sourceElem.attrib["id"] == sourceId: - return sourceElem - - print "Source with id matching",sourceId,"not found" - return - -def updateSourceConfig (alertSourceConfigElem): - - configElem = getAlertConfig() - sourceId = alertSourceConfigElem.attrib["id"] - - for sourceElem in configElem.findall("./{http://tuscany.apache.org/samples/alerter}source"): - if sourceElem.attrib["id"] == sourceId: - configElem.remove(sourceElem) - configElem.append(alertSourceConfigElem) - saveConfigData(configElem) - return - print "Source with id matching",sourceId,"not found" - return - -def addSourceConfig (alertSourceConfigElem): - configElem = getAlertConfig() - - #check for source ID, make sure it's not the same as others and create one if it's missing - if "id" in alertSourceConfigElem.attrib: - configId = alertSourceConfigElem.attrib["id"] - else: - configId = "0" - - gotConfigId = False - - while gotConfigId == False: - - config = getSourceConfig(configId) - if config: - configId = str( int(configId)+1 ) - else: - gotConfigId = True - - - alertSourceConfigElem.attrib["id"] = configId - - configElem.append(alertSourceConfigElem) - saveConfigData(configElem) - - return configId - -def saveConfigData (configElem): - configData = xml.etree.ElementTree.tostring(configElem) - - # Save the configuration to a file - f = open(os.environ['TUSCANY_SCACPP_ROOT']+"/config.xml", "w") - - if not f: - print "Failed to open config file for writing" - try: - f.write(configData) - finally: - f.close() - -def removeSourceConfig(sourceId): - configElem = getAlertConfig() - for sourceElem in configElem.findall("./{http://tuscany.apache.org/samples/alerter}source"): - if sourceElem.attrib["id"] == sourceId: - configElem.remove(sourceElem) - saveConfigData(configElem) - return - -# # Testing -# if os.path.isfile("config.xml"): -# os.remove("config.xml") -# data = getAlertConfig() -# print xml.etree.ElementTree.tostring(data), "\n" -# -# newsrcxml = "\n" -# newsrcxml += "PSP Updates\n" -# newsrcxml += "
      http://pspupdates.qj.net
      \n" -# newsrcxml += "http://pspupdates.qj.net/rss.xml" -# -# newsrc = xml.etree.ElementTree.XML(newsrcxml) -# ID = addSourceConfig(newsrc) -# print "Added src with ID:", ID, "\n" -# -# newsrcxml = "\n" -# newsrcxml += "PSP Updates\n" -# newsrcxml += "
      http://pspupdates.qj.net!
      \n" -# newsrcxml += "http://pspupdates.qj.net/atom.xml" -# -# newsrc = xml.etree.ElementTree.XML(newsrcxml) -# ID = addSourceConfig(newsrc) -# print "Added src with ID:", ID, "\n" -# -# data = getAlertConfig() -# print xml.etree.ElementTree.tostring(data), "\n" -# -# data = getSourceConfig("0") -# print xml.etree.ElementTree.tostring(data), "\n" -# print dir(data), "\n" -# -# name = data.find("./{http://tuscany.apache.org/samples/alerter}name") -# name.text = "Hello world!" -# -# updateSourceConfig(data) -# data = getSourceConfig("1") -# print xml.etree.ElementTree.tostring(data), "\n" -# -# removeSourceConfig("1") -# data = getAlertConfig() -# print xml.etree.ElementTree.tostring(data), "\n" -# -# ID = addSourceConfig(newsrc) -# print "Added src with ID:", ID, "\n" -# -# ID = addSourceConfig(newsrc) -# print "Added src with ID:", ID, "\n" -# -# data = getAlertConfig() -# print xml.etree.ElementTree.tostring(data), "\n" -# -# -# newsrcxml = "\n" -# newsrcxml += "PSP Updates\n" -# newsrcxml += "
      http://pspupdates.qj.net!
      \n" -# newsrcxml += "http://pspupdates.qj.net/atom.xml" -# -# newsrc = xml.etree.ElementTree.XML(newsrcxml) -# ID = addSourceConfig(newsrc) -# print "Added src with ID:", ID, "\n" -# -# data = getAlertConfig() -# print xml.etree.ElementTree.tostring(data), "\n" -# - diff --git a/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/Alerter.xsd b/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/Alerter.xsd deleted file mode 100644 index c59460995d..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/Alerter.xsd +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/Makefile.am b/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/Makefile.am deleted file mode 100644 index 9a0ca276a0..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/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. - -deploydir=$(prefix)/AlertAggregator/deploy -compositedir=$(deploydir)/sample.alerter - -composite_DATA = *.composite *.py *.rb *.xsd -EXTRA_DIST = *.composite *.py *.rb *.xsd - diff --git a/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/POPCheckerImpl.py b/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/POPCheckerImpl.py deleted file mode 100644 index 0ae115ac2e..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/POPCheckerImpl.py +++ /dev/null @@ -1,104 +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. -# - -import poplib, email, datetime, re, xml.etree.ElementTree - -def getNewAlerts(popserver, username, password, lastchecktimestamp): - - print "POPCheckerImpl getting new POP e-mail alerts\n" - - alertsXML = "\n" - - # initially set lastchecked to the epoch before trying to use the lastchecked string - lastcheckdate = datetime.datetime.min - if lastchecktimestamp: - lastcheckdate = datetime.datetime.strptime(lastchecktimestamp, "%Y-%m-%dT%H:%M:%S") - - numberOfNewEmails = 0 - - mail = poplib.POP3(popserver) - mail.user(username) - mail.pass_(password) - msgCount, inboxSize = mail.stat() - - for msgNum in range(msgCount): - - print "getting msg", msgNum+1, "of", msgCount - - data = "" - for line in mail.retr(msgNum+1)[1]: - data += str(line) - data += "\n" - - msg = email.message_from_string(data) - - # date is of form "Sun, 21 Jan 2007 13:51:53 -0500" - msgDateString = msg.get("Date") - msgDateString, tz = msgDateString.rsplit(None, 1) - - timezoneadjust = datetime.timedelta(0, (int(tz)/100)*60*60 + int(tz[3:5])*60) - - msgdate = datetime.datetime.strptime(msgDateString, "%a, %d %b %Y %H:%M:%S") + timezoneadjust - - if msgdate >= lastcheckdate: - msgTo = msg.get("To") - msgFrom = msg.get("From") - msgSubject = msg.get("Subject") - - msgBody = "" - if msg.is_multipart(): - for msgPart in msg.get_payload(): - if msgPart.get_content_type() == "text/plain" or (msgPart.get_content_type() == "text/html" and msgBody == ""): - msgBody = msgPart.get_payload() - else: - msgBody = msg.get_payload() - - alertsXML += "" + encodeXML(msgFrom) + " - "+encodeXML(msgSubject)+"\n" - alertsXML += "
      \n" - alertsXML += "" + msgdate.isoformat() + "\n" - alertsXML += "From: " + encodeXML(msgFrom) - alertsXML += "\nTo: "+encodeXML(msgTo) - alertsXML += "\nSubject: "+encodeXML(msgSubject) - alertsXML += "\nDate: " + msgdate.isoformat() - alertsXML += "\n\n" + stripXML(msgBody) + "
      \n" - - - mail.quit() - - alertsXML += "
      " - - return xml.etree.ElementTree.XML(alertsXML) - - -def encodeXML(data): - data = re.sub("<","[", data) - data = re.sub(">","]", data) - return data - -def stripXML(data): - elementsRemoved = re.sub("<.*?>","", data) - entitiesRemoved = re.sub("&.*?;", " ", elementsRemoved) - asciiEncoded = entitiesRemoved.encode('ASCII', 'replace') - returnData = asciiEncoded.replace('&', 'and') - return returnData - - - -# Testing - -# print getNewAlerts("mail.eclipse.co.uk", "andrew@borley-hall.eclipse.co.uk", "app73sauc3", "2007-01-29T02:15:53") diff --git a/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/POPCheckerImpl.rb b/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/POPCheckerImpl.rb deleted file mode 100644 index e61046cb84..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/POPCheckerImpl.rb +++ /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. -# - -require 'net/pop' -require "rexml/document" -include REXML - -# class POPChecker -# -# def initialize() -# print "POPCheckerImpl.initialize\n" -# end - -def getNewAlerts(popserver, username, password, lastchecked) - - print "POPCheckerImpl getting new POP e-mail alerts\n" - - alertsXML = "\n" - - # initially set lastchecked to the epoch before trying to use the lastchecked string - lastcheckedtime = Time.at(0) - if lastchecked != '' - # lastchecked (if provided) is of form 2007-02-17T23:34:56 - year , month, day, hour, min, sec = lastchecked.split(/[-T:]/) - lastcheckedtime = Time.gm(year , month, day, hour, min, sec, nil) - end - - numberOfEmails = 0 - - Net::POP3.start(popserver, 110, username, password) do |pop| - - if !pop.mails.empty? - pop.each_mail do |m| - msg = m.pop - - header, body = msg.split("\r\n\r\n", 2) - date = getMessageField("Date", header) - # date is of form "Sun, 21 Jan 2007 13:51:53 -0500" - parts = date.split(' ') - timeparts = parts[4].split(':') - timezoneSecs = (parts[5].to_i()/100)*60*60 + (parts[5].slice(-2,0).to_i())*60 - - msgtime = Time.gm(timeparts[2], timeparts[1], timeparts[0], parts[1], parts[2], parts[3], nil, nil, nil, nil) + timezoneSecs - - - if msgtime >= lastcheckedtime - from = getMessageField("From", header) - subject = getMessageField("Subject", header) - - alertsXML += "From: " + encodeXML(from) + "\nSubject: "+encodeXML(subject)+"\n" - alertsXML += "
      \n" - alertsXML += "" + msgtime.strftime("%Y-%m-%dT%H:%M:%S") + "\n" - alertsXML += "" + stripXML(body) + "
      \n" - - numberOfEmails += 1 - end - - end - end - end - alertsXML += "
      " - - # Print XML - # puts alertsXML - print "POPCheckerImpl retrieved "+numberOfEmails.to_s+" new POP e-mail alerts\n" - - # Return data as REXML document - result = Document.new(alertsXML) - - return result -end - - -def getMessageField(field, message) - - # Use a regex to get the field - pattern = '^'+field+': (.*?)$' - - re = Regexp.new(pattern) - re =~ message - - if $1 == nil - return '' - end - - return $1 -end - -def encodeXML(data) - data = data.gsub(//,'>') - return data -end - -def stripXML(data) - data = data.gsub(/<.*?>/m,'') - data = data.gsub(/&.*?;/, ' ') - data = data.gsub(/&/, 'and') - data = encodeXML(data) - return data -end - - - -# # Testing -# pop = POPChecker.new() -# print pop.getNewAlerts("mail.eclipse.co.uk", "andrew@borley-hall.eclipse.co.uk", "app73sauc3", "2007-01-29T02:15:53") diff --git a/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/RSSCheckerImpl.py b/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/RSSCheckerImpl.py deleted file mode 100644 index 2e320c0b22..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/RSSCheckerImpl.py +++ /dev/null @@ -1,76 +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. -# - -import feedparser, datetime, xml.etree.ElementTree, re - -def getNewAlerts(rssaddress, lastchecktimestamp): - - print "RSSCheckerImpl.getNewAlerts() called", rssaddress, lastchecktimestamp - - #Get and parse the RSS/Atom data - d = feedparser.parse(rssaddress) - - newalertsxml = "\n" - - lastcheckdate = datetime.datetime.min - if lastchecktimestamp: - lastcheckdate = datetime.datetime.strptime(lastchecktimestamp, "%Y-%m-%dT%H:%M:%S") - - defaultTitle = d.feed.get('title', 'RSS feed article') - defaultLink = d.feed.get('link', 'http://incubator.apache.org/tuscany') - defaultSummary = 'No information provided' - - for entry in d.entries: - - if entry.has_key('date'): - (year, month, day, hour, minute, second, millisecond, microsecond, tzinfo) = entry.date_parsed - entrydate = datetime.datetime(year, month, day, hour, minute, second) - else: - entrydate = datetime.datetime.now() - - - if (entrydate > lastcheckdate) : - - newalertsxml += "" + stripXML(entry.get('title', defaultTitle)) + "\n" - newalertsxml += "
      " + entry.get('link', defaultLink) + "
      \n" - newalertsxml += "" + entrydate.isoformat() + "\n" - newalertsxml += "" + stripXML(entry.get('description', defaultSummary)) + "
      \n" - newalertsxml += "
      " - - return xml.etree.ElementTree.XML(newalertsxml) - -def stripXML(data): - elementsRemoved = re.sub("<.*?>","", data) - entitiesRemoved = re.sub("&.*?;", " ", elementsRemoved) - asciiEncoded = entitiesRemoved.encode('ASCII', 'replace') - returnData = asciiEncoded.replace('&', 'and') - return returnData - - -# Testing -# print xml.etree.ElementTree.tostring(getNewAlerts("http://www.engadget.com/rss.xml", "2007-02-07T17:11:14")) -# -# -# today = datetime.datetime.now().replace(hour=0, minute=0, second=0, microsecond=0) -# data2 = getNewAlerts("http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml", today.isoformat()) -# print xml.etree.ElementTree.tostring(data2) -# -# print "1st call returned", len(data.findall("./{http://tuscany.apache.org/samples/alerter}alert")), "elements" -# print "2nd call returned", len(data2.findall("./{http://tuscany.apache.org/samples/alerter}alert")), "elements" - - diff --git a/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/sample.alerter.composite b/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/sample.alerter.composite deleted file mode 100644 index 21c4ee1093..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/sample.alerter/sample.alerter.composite +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - AlertCheckerComponent - - - - - AlertConfigComponent - RSSCheckerComponent - POPCheckerComponent - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/AlertAggregator/sample.display/Alerter.xsd b/sca-cpp/trunk/samples/AlertAggregator/sample.display/Alerter.xsd deleted file mode 100644 index c59460995d..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/sample.display/Alerter.xsd +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/AlertAggregator/sample.display/HTMLDisplayImpl.py b/sca-cpp/trunk/samples/AlertAggregator/sample.display/HTMLDisplayImpl.py deleted file mode 100644 index 0122701063..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/sample.display/HTMLDisplayImpl.py +++ /dev/null @@ -1,379 +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. -# -# - - -import xml.etree.ElementTree, datetime, os.path, os - -ns = "./{http://tuscany.apache.org/samples/alerter}" - -def getSavedAlerts(): - - # Set up some default config data - alertsData = "\n" - - if os.path.isfile(os.environ['TUSCANY_SCACPP_ROOT']+"/sample.display/alerts.xml"): - # Retrieve the configuration from a file - f = open(os.environ['TUSCANY_SCACPP_ROOT']+"/sample.display/alerts.xml") - try: - alertsData = f.read() - finally: - f.close() - - alertsElem = xml.etree.ElementTree.XML(alertsData) - - return alertsElem - -def saveAlerts(alertsElem): - alertsData = xml.etree.ElementTree.tostring(alertsElem) - - # Save the configuration to a file - f = open(os.environ['TUSCANY_SCACPP_ROOT']+"/sample.display/alerts.xml", "w") - - if not f: - print "Failed to open alerts file for writing" - try: - f.write(alertsData) - finally: - f.close() - - -def updateAllAlertsHTMLTable (): - - alertsElem = getSavedAlerts() - - # Use the alertService reference - newAlertsElem = alertService.getAllNewAlerts() - #newAlertsElem = getAllNewAlerts(); # For testing - - for alert in newAlertsElem.findall(ns+"alert"): - - alert.attrib["unread"]="True" - alertsElem.append(alert) - - return generateHTMLTable(alertsElem) - - -def updateSourceAlertsHTMLTable (sourceId): - - alertsElem = getSavedAlerts() - - # Use the alertService reference - newAlertsElem = alertService.getNewAlerts(sourceId); - #newAlertsElem = getAllNewAlerts(); # For testing - - for alert in newAlertsElem.findall(ns+"alert"): - - alert.attrib["unread"]="True" - alertsElem.append(alert) - - return generateHTMLTable(alertsElem) - - - -def generateHTMLTable (alertsElem): - - returnData = "" - - # If we have more than x alerts, clear out any that have been read - # x is determined by the showNumberOfReadAlerts property - alerts = alertsElem.findall(ns+"alert") - if len(alerts) > int(showNumberOfReadAlerts): - for alert in alerts: - if alert.attrib["unread"]!="True": - alertsElem.remove(alert) - - alertIDNumber = 0 - for alert in alertsElem.findall(ns+"alert"): - - date = datetime.datetime.strptime(alert.find(ns+"date").text, "%Y-%m-%dT%H:%M:%S") - alertID = "alert_"+str(alertIDNumber) - alert.attrib["id"]= alertID - alertIDNumber += 1 - - returnData += "\n" - - returnData += "
      " - title = alert.find(ns+"title").text - noOfChars = 75-len(title) - - if noOfChars>0: - returnData += title - returnData += " - " - returnData += alert.find(ns+"summary").text[0:noOfChars] - returnData += "..." - else: - returnData += title[0:80] - returnData += "" - - returnData += date.strftime("%d/%m/%Y %I:%M %p") - returnData += "
      " - - saveAlerts(alertsElem) - #print xml.etree.ElementTree.tostring(alertsElem) - return returnData - -def readAlert (alertID): - - alertsElem = getSavedAlerts() - - returnData = "" - for alert in alertsElem.findall(ns+"alert"): - - if alert.attrib["id"]==alertID: - alert.attrib["unread"] = "False" - - saveAlerts(alertsElem) - - srcType = getSourceType(alert.attrib["sourceid"]) - - if srcType=="pop": - returnData += "
      "
      -                returnData += alert.find(ns+"summary").text
      -                returnData += "
      " - return returnData - - return - -def getSourceType(sourceid): - # Use the alertService reference - alertSources = alertService.getAlertSources() - #alertSources = getAlertSources() #testing - - for source in alertSources.findall(ns+"source"): - - if sourceid == source.attrib["id"]: - return source.attrib["type"] - - return "none" - - -def getAlertSourcesHTMLTable(): - - returnData = "\n" - - # Use the alertService reference - alertSources = alertService.getAlertSources() - #alertSources = getAlertSources() #testing - - srcIdList = [] - - for source in alertSources.findall(ns+"source"): - - srcId = source.attrib["id"] - srcIdList.append(srcId) - srcType = source.attrib["type"] - - # Write out the source data row - returnData += "\n" - - # Now write out the row that gets shown when "edit" is pressed - returnData += "" - - # Get the first unused srcId - srcId = "0" - while srcId in srcIdList: - srcId = str(int(srcId)+1) - - # Now write out the "add new source" row - returnData += "" - # Add the (initially hidden) new source details row - returnData += "" - returnData += "
      " - returnData += "  " - returnData += source.find(ns+"name").text - returnData += "Update AlertsEdit SourceDelete Source
      " - if srcType=="rss": - returnData += "" - elif srcType=="pop": - returnData += "" - returnData += "" - returnData += "" - returnData += "
      Source name:
      Source address:
      Feed address:
      POP3 server:
      Username:
      Password:
      Add new Alert Source
      " - # Section for RSS feeds - returnData += "" - # Section for POP3 email - returnData += "" - # Last row for buttons - returnData += "
      Source name:
      Source address:
      Source type:
      Feed address:
      " - returnData += "" - returnData += "
      POP3 server:
      Username:
      Password:
      \n" - return returnData - - -def deleteAlertSource (sourceId): - # Use the alertService reference - alertService.removeAlertSource(sourceId) - - - # Remove all alerts with this sourceid - alertsElem = getSavedAlerts() - for alert in alertsElem.findall(ns+"alert"): - if alert.attrib["sourceid"]==sourceId: - alertsElem.remove(alert) - - saveAlerts(alertsElem) - -def addAlertSource(alertSourceElem): - if xml.etree.ElementTree.iselement(alertSourceElem): - # Use the alertService reference - alertService.addAlertSource(alertSourceElem) - return - -def updateAlertSource(alertSourceElem): - - if xml.etree.ElementTree.iselement(alertSourceElem): - - alertsElem = getSavedAlerts() - - # Get the sourceid - sourceId = alertSourceElem.attrib["id"] - - # Remove all alerts with this sourceid - they may have changed - for alert in alertsElem.findall(ns+"alert"): - if alert.attrib["sourceid"]==sourceId: - alertsElem.remove(alert) - - # Use the alertService reference to update the config - alertService.updateAlertSource(alertSourceElem) - - saveAlerts(alertsElem) - - return - - -# # For testing -# showNumberOfReadAlerts = 3 -# -# def getAllNewAlerts (): -# -# data = "" -# -# data += "Arrests over 'terror kidnap plot'" -# data += "Anti-terror police arrest eight people in Birmingham over an alleged plot to kidnap a member of the armed forces." -# data += "
      http://news.bbc.co.uk/go/rss/-/1/hi/uk/6315989.stm
      2007-01-31T15:34:18
      " -# -# data += "
      " -# -# return xml.etree.ElementTree.XML(data) -# -# print getAlertsHTMLTable () + "\n" -# -# readAlert("http://news.bbc.co.uk/go/rss/-/1/hi/uk/6315989.stm") -# -# print getAlertsHTMLTable () + "\n" -# -# def getAlertSources (): -# -# data = "" -# data += "BBC News" -# data += "
      http://news.bbc.co.uk/
      " -# data += "2007-02-02T10:08:40" -# data += "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml" -# data += "
      " -# return xml.etree.ElementTree.XML(data) -# -# print getAlertSourcesHTMLTable() diff --git a/sca-cpp/trunk/samples/AlertAggregator/sample.display/Makefile.am b/sca-cpp/trunk/samples/AlertAggregator/sample.display/Makefile.am deleted file mode 100644 index 6ac781c7df..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/sample.display/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. - -deploydir=$(prefix)/AlertAggregator/deploy -compositedir=$(deploydir)/sample.display - -composite_DATA = *.composite *.py *.xsd -EXTRA_DIST = *.composite *.py *.xsd - diff --git a/sca-cpp/trunk/samples/AlertAggregator/sample.display/sample.display.composite b/sca-cpp/trunk/samples/AlertAggregator/sample.display/sample.display.composite deleted file mode 100644 index 593c53c15f..0000000000 --- a/sca-cpp/trunk/samples/AlertAggregator/sample.display/sample.display.composite +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - HTMLDisplayComponent - - - - - AlerterService - 20 - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/COPYING b/sca-cpp/trunk/samples/COPYING deleted file mode 100755 index 6b0b1270ff..0000000000 --- a/sca-cpp/trunk/samples/COPYING +++ /dev/null @@ -1,203 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/sca-cpp/trunk/samples/ChangeLog b/sca-cpp/trunk/samples/ChangeLog deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/sca-cpp/trunk/samples/CppBigBank/Makefile.am b/sca-cpp/trunk/samples/CppBigBank/Makefile.am deleted file mode 100644 index 95045e0be6..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/Makefile.am +++ /dev/null @@ -1,21 +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. - -deploydir=$(prefix)/CppBigBank/deploy -SUBDIRS = bigbank.account bigbank.client bigbank.phpwsclient -EXTRA_DIST = *.composite README.html -deploy_DATA = *.composite diff --git a/sca-cpp/trunk/samples/CppBigBank/README b/sca-cpp/trunk/samples/CppBigBank/README deleted file mode 100644 index 341db17b63..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/README +++ /dev/null @@ -1,26 +0,0 @@ -Tuscany SCA for C++ Samples - C++ BigBank Sample -=============================================== - -This sample implements the "Simplified BigBank" scenario. A whitepaper -describing the scenario based on the SCA 0.9 Assembly specification can be -found here. This sample uses multiple C++ components, calls out to an -external Web Service via a reference, exposes the service as a Web Service -and also provides a PHP based client. - -There are three sub projects in this workspace: - - bigbank.account - This contains the source code and SCDL artifacts for the SCA BigBank - composite implementing the account services. - - - bigbank.client - A sample client which does a local call to the BigBank service. - - - bigbank.phpclient - A sample PHP client which calls the BigBank Web service and then - deconstructs and displays the result by using the SDO for PHP extension. - -Additionally, there is the bigbank.app.composite file. This describes the -configuration of the SCA BigBank composite deployed to the SCA runtime. - -See the README.html file for instructions to build and run this sample - diff --git a/sca-cpp/trunk/samples/CppBigBank/README.html b/sca-cpp/trunk/samples/CppBigBank/README.html deleted file mode 100644 index 4720dd7b57..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/README.html +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - - - - - - - Tuscany SCA Native Samples - C++ BigBank Sample - - - -
      -
      -
      -

      Tuscany SCA Native Samples - C++ BigBank Sample

      - -

      This sample implements the "Simplified BigBank" scenario. A whitepaper describing - the scenario based on the SCA 0.9 Assembly specification can be found - here. - This sample uses multiple C++ components, calls out to an external Web Service via a reference, - exposes the service as a Web Service and also provides a PHP based client. -

      -

      There are three sub projects in this workspace:

      -
        -
      • bigbank.account
        - This contains the source code and SCDL artifacts for the SCA BigBank - composite implementing the account services. -
      • -
      • bigbank.client
        - A sample client which does a local call to the BigBank service. -
      • -
      • bigbank.phpclient
        - A sample PHP client which calls the BigBank Web service and then deconstructs - and displays the result by using the - SDO for PHP extension. -

        This is a pair of very simple PHP scripts to demonstrate how the Accounts service - that the C++ Big Bank sample exposes can be used from within the PHP scripting - language. -

        -

        bigwelcome.php
        - A bootstrap script that shows a form and allows the user to press a button - in order to invoke the bigaccount.php script -

        -

        bigaccount.php
        - Makes a call to a locally installed BigBank Accounts service. The script - shows how to use PHP SDO and SOAP extensions to construct the call - and interpret the result. -

        -
      • -
      -

      Additionally, there is the bigbank.app.composite file. This describes the - configuration of the SCA BigBank composite deployed to the SCA runtime. -

      - -
      - - - - -
      -

      Building the C++ samples on Linux and Mac OS X

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
      2. - -
      3. Build the C++ samples with the following command sequence: -
          -
        • cd <tuscany_sca_install_dir>/samples
        • -
        • ./configure --prefix=$TUSCANY_SCACPP/samples --enable-static=no
        • -
        • make
        • -
        • make install
        • -
        - NOTE: If you don't provide the --prefix configure option, it will by default install into - /usr/local/tuscany/sca/samples/CppBigBank
      4. -
      -
      - -
      -

      Running the C++ BigBank sample on Linux and Mac OS X

      -

      BigBank with basic client

      -
        -
      1. The C++ BigBank sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        • AXIS2C_HOME=<path to Axis2/C version 0.96>
        • -
        -
      4. -
      5. Run the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>/samples/CppBigBank/deploy/bigbank.client
        • -
        • ./runclient.sh
        • -
        -
      6. -
      -

      BigBank with PHP web client

      -
        -
      1. The C++ BigBank sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
      2. -
      3. Ensure you have enabled Axis2/C to run Tuscany SCA services. Follow the instructions - found here. -
      4. -
      5. Start the Axis2/C simple http server: -
          -
        1. The following environment variables are required: -
            -
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • -
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • -
          • AXIS2C_HOME=<path to Axis2/C version 0.96>
          • -
          -
        2. -
        3. cd <tuscany_sca_install_dir>/samples/CppBigBank/deploy/bin -
        4. -
        5. ./runwsserver.sh
        6. -
        -
      6. -
      7. To run the php scripts requires some configuration and setup of a php runtime with - the SDO and SimpleXML extensions enabled. The bits you will need are: - -

        Follow - these instructions to - install SDO and DAS. -

        -
      8. -
      9. You need to configure Apache to run PHP of course. This is well documented but this - is what to put at the end of httpd.conf: -
        # PHP5 Support
        -LoadModule php5_module "/home/php/php5.1.6/php5apache2.so"
        -AddType application/x-httpd-php .php
        -
        -# configure the path to php.ini
        -PHPIniDir "/home/php/php5.1.6"
        -
      10. -
      11. Copy the <tuscany_sca_install_dir>/samples/CppBigBank/bigbank.phpwsclient - directory to your Apache document root directory (by default this is named 'htdocs'). -
      12. -
      13. Finally, start your Apache web server. -
      14. -
      15. Run the PHP web client by pointing your browser at - http://localhost/bigbank.phpwsclient/welcome.php. - You should now be able to press the "GetAccount" button and see the values - returned from the BigBank SCA application. -
      16. - -
      -
      - -
      -

      Building the C++ BigBank sample on Windows

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
      2. - -
      3. You must have set up the environment for Microsoft Visual C++ tools. - The build command will call vcvars32 to set the environment. Ensure the - directory containing this is on your path. This will be where you - installed the compiler. -
      4. -
      5. Build the source, either via the Visual Studio Express projects under - <tuscany_sca_install_dir>\samples\CppBigBank\VSExpress\CppBigBank.sln or via the command-line build file - found at <tuscany_sca_install_dir>\samples\CppBigBank\VSExpress\CppBigBank\build.bat - which will build and deploy the samples. -
      6. -
      -
      - -
      -

      Running the C++ BigBank sample on Windows

      -

      BigBank with basic client

      -
        -
      1. The C++ BigBank sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        -
      4. -
      5. Run the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>\samples\CppBigBank\deploy\bigbank.client
        • -
        • runclient.bat
        • -
        -
      6. -
      -

      BigBank with PHP web client

      -
        -
      1. The C++ BigBank sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
      2. -
      3. Ensure you have enabled Axis2/C to run Tuscany SCA services. Follow the instructions - found here. -
      4. -
      5. Start the Axis2/C simple http server: -
          -
        1. The following environment variables are required: -
            -
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • -
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • -
          • AXIS2C_HOME=<path to Axis2/C version 0.96>
          • -
          -
        2. -
        3. cd <tuscany_sca_install_dir>\samples\CppBigBank\deploy\bigbank.account -
        4. -
        5. runwsserver.bat
        6. -
        -
      6. -
      7. To run the php scripts requires some configuration and setup of a php runtime with - the SDO and SimpleXML extensions enabled. The bits you will need are: - -

        You can get Windows binary builds from - http://www.php.net/downloads.php. - For SDO you need two dlls as follows: -

        - -

        Copy these to the php5.1.6\ext dir ( php_soap.dll is already there) and add the - following to php.ini file (having already renamed php.ini-recommended to php.ini - of course) -

        extension=php_soap.dll
        -extension=php_sdo.dll
        -extension=php_sdo_das_xml.dll
        - I also changed the extension_dir directive to point to my extensions directory: -
        extension_dir="C:\php5.1.6\ext"
        -

        -

        Asking PHP to list what modules are active gives the following: -

        C:\php5.1.6>php -m
        -[PHP Modules]
        -bcmath
        -calendar
        -com_dotnet
        -ctype
        -date
        -dom
        -ftp
        -hash
        -iconv
        -libxml
        -odbc
        -pcre
        -Reflection
        -sdo
        -sdo_das_xml
        -session
        -SimpleXML
        -soap
        -SPL
        -standard
        -tokenizer
        -wddx
        -xml
        -xmlreader
        -xmlwriter
        -zlib
        -
        -[Zend Modules]
        - Of particular relevance to these scripts note that soap, sdo and sdo_das_xml are active. -

        -
      8. -
      9. You need to configure Apache to run PHP of course. This is well documented but this - is what to put at the end of httpd.conf: -
        # PHP5 Support
        -LoadModule php5_module "C:\php5.1.6\php5apache2.dll"
        -AddType application/x-httpd-php .php
        -
        -# configure the path to php.ini
        -PHPIniDir "C:\php5.1.6"
        -
      10. -
      11. Copy the <tuscany_sca_install_dir>\samples\CppBigBank\bigbank.phpwsclient - directory to your Apache document root directory (by default this is named 'htdocs'). -
      12. -
      13. Finally, start your Apache web server. -
      14. -
      15. Run the PHP web client by pointing your browser at - http://localhost/bigbank.phpwsclient/welcome.php. - You should now be able to press the "GetAccount" button and see the values - returned from the BigBank SCA application. -
      16. -
      -
      - - - -
      -

      Getting Help

      - -

      The first place to look is at the Tuscany SCA FAQ at - http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      - -

      Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      - -
      -
      -
      - - - - diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountDataService.h b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountDataService.h deleted file mode 100644 index 64d093ac6f..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountDataService.h +++ /dev/null @@ -1,63 +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 "commonj/sdo/SDO.h" - -namespace services -{ - namespace accountdata - { - - /** - * AccountDataService business interface - */ - class AccountDataService - { - public: - - // CheckingAccount is a data object containing - // string accountNumber - // float balance - - virtual commonj::sdo::DataObjectPtr /* CheckingAccount*/ getCheckingAccount( - const std::string id) = 0; - - // SavingsAccount is a data object containing - // string accountNumber - // float balance - - virtual commonj::sdo::DataObjectPtr /* SavingsAccount */ getSavingsAccount( - const std::string id) = 0; - - // StockAccount is a data object containing - // string accountNumber - // string symbol - // int quantity - - virtual commonj::sdo::DataObjectPtr /* StockAccount */ getStockAccount ( - const std::string id) = 0; - - }; - - } // End accountdata -} // End services diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.componentType b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.componentType deleted file mode 100644 index b1cab9e1f9..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.componentType +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.cpp b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.cpp deleted file mode 100644 index 2deee17eb2..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.cpp +++ /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$ */ - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "commonj/sdo/SDO.h" -#include "osoa/sca/sca.h" - -#include "AccountDataServiceImpl.h" - -using namespace std; -using namespace commonj::sdo; -using namespace osoa::sca; - -/** - * AccountDataServiceImpl component implementation - */ - -namespace services -{ - namespace accountdata - { - - DataObjectPtr /* CheckingAccount*/ - AccountDataServiceImpl::getCheckingAccount(const string id) - { - try { - - DataFactoryPtr factory = ComponentContext::getCurrent().getDataFactory(); - - DataObjectPtr newaccount = - factory->create("http://www.bigbank.com/AccountService","CheckingAccount"); - - char* name = new char[id.size() + 10]; - strcpy(name,id.c_str()); - strcat(name,"_CHA12345"); - - newaccount->setCString("accountNumber",name); - - delete name; - - newaccount->setFloat("balance",1500.0f); - - return newaccount; - - } - catch (SDORuntimeException&) - { - return 0; - } - } - - - - DataObjectPtr /* SavingsAccount */ - AccountDataServiceImpl::getSavingsAccount(const string id) - { - try { - - DataFactoryPtr factory = ComponentContext::getCurrent().getDataFactory(); - - DataObjectPtr newaccount = - factory->create("http://www.bigbank.com/AccountService","SavingsAccount"); - - char* name = new char[id.size() + 10]; - strcpy(name,id.c_str()); - strcat(name,"_SAA12345"); - - newaccount->setCString("accountNumber",name); - - delete name; - - newaccount->setFloat("balance",1500.0f); - - return newaccount; - - } - catch (SDORuntimeException&) - { - return 0; - } - } - - - DataObjectPtr /* StockAccount */ - AccountDataServiceImpl::getStockAccount (const string id) - { - try { - - DataFactoryPtr factory = ComponentContext::getCurrent().getDataFactory(); - - DataObjectPtr newaccount = - factory->create("http://www.bigbank.com/AccountService","StockAccount"); - - char* name = new char[id.size() + 10]; - strcpy(name,id.c_str()); - strcat(name,"_STA12345"); - - newaccount->setCString("accountNumber",name); - - delete name; - - newaccount->setCString("symbol","IBM"); - - newaccount->setInt("quantity",100); - - return newaccount; - - } - catch (SDORuntimeException&) - { - return 0; - } - } - - } // End accountdata -} // End services diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.h b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.h deleted file mode 100644 index 9312175540..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountDataServiceImpl.h +++ /dev/null @@ -1,61 +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 "AccountDataService.h" - -namespace services -{ - namespace accountdata - { - - /** - * AccountDataServiceImpl component implementation class - */ - class AccountDataServiceImpl : public AccountDataService - { - public: - - // CheckingAccount is a data object containing - // string accountNumber - // float balance - - virtual commonj::sdo::DataObjectPtr /* CheckingAccount*/ getCheckingAccount( - const std::string id); - - // SavingsAccount is a data object containing - // string accountNumber - // float balance - - virtual commonj::sdo::DataObjectPtr /* SavingsAccount */ getSavingsAccount( - const std::string id); - - // StockAccount is a data object containing - // string accountNumber - // string symbol - // int quantity - - virtual commonj::sdo::DataObjectPtr /* StockAccount */ getStockAccount ( - const std::string id); - - }; - - } // End accountdata -} // End services diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountService.h b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountService.h deleted file mode 100644 index 85337d37a9..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountService.h +++ /dev/null @@ -1,51 +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 "commonj/sdo/SDO.h" - -namespace services -{ - namespace account - { - - /** - * AccountService business interface - */ - class AccountService - { - public: - - // The account report data object has one many-valued - // property "accountSummaries", containing the following - // properties: - // string accountNumber - // string accountType - // float balance. - - virtual commonj::sdo::DataObjectPtr /*AccountReport*/ - getAccountReport(const std::string customerID) = 0; - - }; - - } // End account -} // End services diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountService.wsdl b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountService.wsdl deleted file mode 100644 index b83c453462..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountService.wsdl +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountServiceImpl.componentType b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountServiceImpl.componentType deleted file mode 100644 index b65fa1dc18..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountServiceImpl.componentType +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - USD - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountServiceImpl.cpp b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountServiceImpl.cpp deleted file mode 100644 index e9fcace81f..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountServiceImpl.cpp +++ /dev/null @@ -1,132 +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) -#endif - -#include "osoa/sca/sca.h" - -#include "AccountServiceImpl.h" -#include "StockQuoteService.h" -#include "AccountDataService.h" - -using namespace std; -using namespace commonj::sdo; -using namespace osoa::sca; -using namespace services::accountdata; -using namespace services::stockquote; - -/** - * AccountServiceImpl component implementation - */ -namespace services -{ - namespace account - { - - DataObjectPtr /*AccountReport**/ - AccountServiceImpl::getAccountReport(const string customerID) - { - ComponentContext theContext = ComponentContext::getCurrent(); - - commonj::sdo::DataFactoryPtr factory = theContext.getDataFactory(); - - commonj::sdo::DataObjectPtr newReport = - factory->create("http://www.bigbank.com/AccountService","AccountReport"); - - // Get the accountDataService service - AccountDataService *dataService = - (AccountDataService*)theContext.getService("accountDataService"); - - // would be better to return a list of accounts - this only - // gets the first of each. - - commonj::sdo::DataObjectPtr checking = - dataService->getCheckingAccount(customerID); - - if (checking != 0) - { - commonj::sdo::DataObjectList& dl = newReport->getList("checking"); - checking->setFloat("balance", - fromUSDollarToCurrency(checking->getFloat("balance"))); - dl.append(checking); - } - - commonj::sdo::DataObjectPtr savings = dataService->getSavingsAccount(customerID); - - if (savings != 0) - { - commonj::sdo::DataObjectList& dl = newReport->getList("savings"); - savings->setFloat("balance", - fromUSDollarToCurrency(savings->getFloat("balance"))); - dl.append(savings); - } - - // Get the stockQuoteService service - StockQuoteService* stockService = - (StockQuoteService*)theContext.getService("stockQuoteService"); - - commonj::sdo::DataObjectPtr stocks = dataService->getStockAccount(customerID); - - if (stocks != 0) - { - commonj::sdo::DataObjectList& dl = newReport->getList("stocks"); - - float value = 10.0f; - try { - value = stockService->getQuote( - stocks->getCString("symbol")); - } - catch (ServiceRuntimeException& e) - { - std::cout << "Fault from stock quote service" << e << std::endl; - } - stocks->setFloat("balance", - fromUSDollarToCurrency(stocks->getInt("quantity") * - value)); - dl.append(stocks); - } - - return newReport; - } - - float AccountServiceImpl::fromUSDollarToCurrency(float value) - { - // Get the "currency" property - ComponentContext myContext = ComponentContext::getCurrent(); - - commonj::sdo::DataObjectPtr properties = myContext.getProperties(); - if (properties) - { - const char* currency = properties->getCString("currency"); - if (currency != 0) - { - std::cout << "Currency is : " << currency << std::endl; - if (!strcmp(currency,"USD")) return value; - if (!strcmp(currency,"EURO")) return 0.8f * value; - } - } - return 0.0f; - } - - } // End account -} // End services diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountServiceImpl.h b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountServiceImpl.h deleted file mode 100644 index 0c172823fb..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/AccountServiceImpl.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * - * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "AccountService.h" - - -namespace services -{ - namespace account - { - - /** - * AccountServiceImpl component implementation class - */ - class AccountServiceImpl: public AccountService - { - public: - - virtual commonj::sdo::DataObjectPtr /*AccountReport*/ - getAccountReport(const std::string customerID); - - private: - - float fromUSDollarToCurrency(float value); - - }; - - } // End account -} // End services - diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/Makefile.am b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/Makefile.am deleted file mode 100644 index e9af461312..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/Makefile.am +++ /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. - -deploydir=$(prefix)/CppBigBank/deploy -compositedir=$(deploydir)/bigbank.account - -BUILT_SOURCES = scagen - -noinst_HEADERS = *.h - -composite_SCRIPTS = runwsserver.sh - -scagen: - java -jar $(TUSCANY_SCACPP)/bin/scagen.jar -dir . -output . - -composite_LTLIBRARIES = libAccount.la -composite_DATA = *.composite *.componentType *.wsdl *.xsd -EXTRA_DIST = *.composite *.componentType *.wsdl *.xsd runwsserver.sh - -dist_libAccount_la_SOURCES = \ -AccountDataServiceImpl.cpp \ -AccountServiceImpl.cpp \ -StockQuoteServiceImpl.cpp - -nodist_libAccount_la_SOURCES = \ -AccountDataServiceImpl_AccountDataService_Proxy.cpp \ -AccountDataServiceImpl_AccountDataService_Wrapper.cpp \ -AccountServiceImpl_accountDataService_Proxy.cpp \ -AccountServiceImpl_AccountService_Proxy.cpp \ -AccountServiceImpl_AccountService_Wrapper.cpp \ -AccountServiceImpl_stockQuoteService_Proxy.cpp \ -StockQuoteServiceImpl_StockQuoteService_Proxy.cpp \ -StockQuoteServiceImpl_StockQuoteService_Wrapper.cpp \ -StockQuoteServiceImpl_webService_Proxy.cpp - -libAccount_la_LIBADD = \ --L${TUSCANY_SCACPP}/lib \ - -ltuscany_sca \ --L${TUSCANY_SCACPP}/extensions/cpp/lib \ - -ltuscany_sca_cpp - -INCLUDES = \ - -I$(TUSCANY_SCACPP)/extensions/cpp/include \ - -I$(TUSCANY_SCACPP)/include \ - -I${TUSCANY_SDOCPP}/include diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteService.h b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteService.h deleted file mode 100644 index 379af5b425..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteService.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Copyright 2006 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -namespace services -{ - namespace stockquote - { - /** - * StockQuoteService business interface - */ - class StockQuoteService - { - public: - - virtual float getQuote(const std::string symbol) = 0; - - }; - - } // End stockquote -} // End services diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.componentType b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.componentType deleted file mode 100644 index 6ac2b77255..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.componentType +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.cpp b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.cpp deleted file mode 100644 index 8332730d73..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - * - * Copyright 2006 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "osoa/sca/sca.h" -#include "commonj/sdo/SDO.h" - -#include "StockQuoteServiceImpl.h" -#include "StockQuoteWebService.h" - -using namespace std; -using namespace osoa::sca; -using namespace commonj::sdo; - -/** - * StockQuoteServiceImpl component implementation - */ -namespace services { - namespace stockquote { - - // Map the format returned by the StockQuote Web service to - // the format expected in the BigBank application - float StockQuoteServiceImpl::getQuote(const string symbol) - { - ComponentContext myContext = ComponentContext::getCurrent(); - - // Get the StockQuote Web service - StockQuoteWebService* webService = - (StockQuoteWebService*)myContext.getService("webService"); - - // Invoke the service - const string result = webService->GetQuote(symbol); - - float stockPrice = 0.0f; - - // Get the stock price out of the document returned by the StockQuote - // Web service - try - { - XMLHelperPtr xmlHelper = HelperProvider::getXMLHelper(myContext.getDataFactory()); - XMLDocumentPtr stockDoc = xmlHelper->load(result); - if (stockDoc->getRootDataObject()) - { - stockPrice=stockDoc->getRootDataObject()->getFloat("Stock.0/Last"); - } - } - catch (SDORuntimeException& e) - { - std::cout << e << std::endl; - return 0.0f; - } - return stockPrice; - } - - } // End stockquote -} // End services diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.h b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.h deleted file mode 100644 index 9b0ac69b0c..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteServiceImpl.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Copyright 2006 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "StockQuoteService.h" - -namespace services -{ - namespace stockquote - { - - /** - * StockQuoteServiceImpl component implementation class - */ - class StockQuoteServiceImpl : public StockQuoteService - { - public: - - virtual float getQuote(const std::string symbol); - }; - - } // End stockquote -} // End services diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteTypes.xsd b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteTypes.xsd deleted file mode 100644 index 5bce3a63dc..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteTypes.xsd +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteWebService.h b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteWebService.h deleted file mode 100644 index 5c32ff8eaa..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteWebService.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * Copyright 2006 The Apache Software Foundation or its licensors, as applicable. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -namespace services -{ - namespace stockquote - { - - /** - * StockQuoteWebService business interface - * - * This is the interface of the Web service used to get - * live stock quotes. - */ - class StockQuoteWebService - { - public: - - virtual const std::string GetQuote(const std::string symbol) = 0; - - }; - - } // End stockquote -} // End services diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteWebService.wsdl b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteWebService.wsdl deleted file mode 100644 index c14f97c87b..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/StockQuoteWebService.wsdl +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Get Stock quote for a company Symbol - - - - - - - - - - Get Stock quote for a company Symbol - - - - - - - - - - Get Stock quote for a company Symbol - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/bigbank.account.composite b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/bigbank.account.composite deleted file mode 100644 index 7173d584d2..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/bigbank.account.composite +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - AccountServiceComponent - - - - - AccountDataServiceComponent - StockQuoteServiceComponent - EURO - - - - - - - - - StockQuoteWebService - - - - - - - - diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/runwsserver.bat b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/runwsserver.bat deleted file mode 100644 index c08a8fc5d9..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/runwsserver.bat +++ /dev/null @@ -1,50 +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 "%TUSCANY_SCACPP%" == "" ( -echo "TUSCANY_SCACPP not set" -goto end -) -echo Using SCA installed at %TUSCANY_SCACPP% - -if "%TUSCANY_SDOCPP%" == "" ( -echo "TUSCANY_SDOCPP not set" -goto end -) -echo Using SDO installed at %TUSCANY_SDOCPP% - -if "%AXIS2C_HOME%" == "" ( -echo "AXIS2C_HOME not set" -goto end -) -echo Using Axis2C installed at %AXIS2C_HOME% - -rem Run the server -set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SCACPP%\extensions\cpp\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% - -set APFULLDIR=%~d0%~p0 -set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ - -cd %AXIS2C_HOME%\bin -.\axis2_http_server.exe - -:end -endlocal diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/runwsserver.sh b/sca-cpp/trunk/samples/CppBigBank/bigbank.account/runwsserver.sh deleted file mode 100755 index 047e541360..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.account/runwsserver.sh +++ /dev/null @@ -1,45 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -if [ x$AXIS2C_HOME = x ]; then -echo "AXIS2C_HOME not set" -exit; -fi -echo "Using Axis2C installed at $AXIS2C_HOME" - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/cpp/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ - -cd $AXIS2C_HOME/bin -./axis2_http_server diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.app.composite b/sca-cpp/trunk/samples/CppBigBank/bigbank.app.composite deleted file mode 100644 index 5d68e0ae1a..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.app.composite +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.client/AccountClient.cpp b/sca-cpp/trunk/samples/CppBigBank/bigbank.client/AccountClient.cpp deleted file mode 100644 index 009c2d0c4d..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.client/AccountClient.cpp +++ /dev/null @@ -1,127 +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) -#endif - -#include -#include - -#include "osoa/sca/sca.h" - -#include "AccountService.h" - -using namespace std; -using namespace commonj::sdo; -using namespace osoa::sca; -using namespace services::account; - -int main(int argc, char* argv[]) -{ - - if (argc != 2) - { - cout << "account_client: Argument must be the name of the account" << endl; - return 0; - } - try - { - - // Locate a service - CompositeContext myContext = CompositeContext::getCurrent(); - AccountService *accountService = - (AccountService*) myContext.locateService("AccountServiceComponent"); - if (accountService == 0) - { - cout << "account_client: Unable to find Account service" << endl; - } - else - { - try - { - // exercise the account service - - DataObjectPtr report = - accountService->getAccountReport(argv[1]); - - XMLHelperPtr xmlHelper = HelperProvider::getXMLHelper(myContext.getDataFactory()); - char* doc = xmlHelper->save(report, report->getType().getURI(), report->getType().getName()); - cout << "XML: " << doc <getList("stocks"); - - for (i=0;i< stocks.size() ;i++) - { - cout << "Stock Account " << stocks[i]->getCString("accountNumber") << endl; - cout << "Stock Symbol : " << stocks[i]->getCString("symbol") << endl; - cout << " Holding : " << stocks[i]->getCString("quantity") << endl; - balance = stocks[i]->getFloat("balance"); - sprintf(balanceStr,"%.2f",balance); - cout << " Value : " << balanceStr << endl << endl; - } - - DataObjectList& checking = report->getList("checking"); - - for (i=0;i< checking.size() ;i++) - { - cout << "Checking Account " << checking[i]->getCString("accountNumber") << endl; - balance = checking[i]->getFloat("balance"); - sprintf(balanceStr,"%.2f",balance); - cout << " Balance : " << balanceStr << endl << endl; - } - - DataObjectList& savings = report->getList("savings"); - - for (i=0;i< savings.size() ;i++) - { - cout << "Savings Account " << savings[i]->getCString("accountNumber") << endl; - balance = savings[i]->getFloat("balance"); - sprintf(balanceStr,"%.2f",balance); - cout << " Balance : " << balanceStr << endl << endl; - } - - cout << endl; - } - } - catch (SDORuntimeException& e) - { - cout << e << endl; - } - } - - } - catch (ServiceRuntimeException& ex) - { - cout << ex << endl; - } - return 0; -} - diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.client/Makefile.am b/sca-cpp/trunk/samples/CppBigBank/bigbank.client/Makefile.am deleted file mode 100644 index cfc5e8a661..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.client/Makefile.am +++ /dev/null @@ -1,35 +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. - -deploydir=$(prefix)/CppBigBank/deploy -clientdir=$(deploydir)/bigbank.client - -client_PROGRAMS = account_client -client_SCRIPTS = runclient.sh -EXTRA_DIST = runclient.sh - -account_client_SOURCES = AccountClient.cpp - -account_client_LDADD = -L${TUSCANY_SCACPP}/lib -ltuscany_sca \ - -L${TUSCANY_SCACPP}/extensions/cpp/lib -ltuscany_sca_cpp \ - -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo - - -INCLUDES = -I$(TUSCANY_SCACPP)/extensions/cpp/include \ - -I${TUSCANY_SCACPP}/include \ - -I${TUSCANY_SDOCPP}/include \ - -I../bigbank.account diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.client/runclient.bat b/sca-cpp/trunk/samples/CppBigBank/bigbank.client/runclient.bat deleted file mode 100644 index 069463ba2d..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.client/runclient.bat +++ /dev/null @@ -1,50 +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 "%TUSCANY_SCACPP%" == "" ( -echo "TUSCANY_SCACPP not set" -goto end -) -echo Using SCA installed at %TUSCANY_SCACPP% - -if "%TUSCANY_SDOCPP%" == "" ( -echo "TUSCANY_SDOCPP not set" -goto end -) -echo Using SDO installed at %TUSCANY_SDOCPP% - -if "%AXIS2C_HOME%" == "" ( -echo "AXIS2C_HOME not set" -goto end -) -echo Using Axis2C installed at %AXIS2C_HOME% - -rem Run the client -set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SCACPP%\extensions\cpp\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% - -set APFULLDIR=%~d0%~p0 -set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ -set TUSCANY_SCACPP_COMPONENT=bigbank.AccountManagementComponent - -.\AccountClient.exe 1234 - -:end -endlocal diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.client/runclient.sh b/sca-cpp/trunk/samples/CppBigBank/bigbank.client/runclient.sh deleted file mode 100755 index 1cf924a008..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.client/runclient.sh +++ /dev/null @@ -1,46 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -if [ x$AXIS2C_HOME = x ]; then -echo "AXIS2C_HOME not set" -exit; -fi -echo "Using Axis2C installed at $AXIS2C_HOME" - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/cpp/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ -export TUSCANY_SCACPP_COMPONENT=bigbank.AccountManagementComponent - -./AccountClient 1234 - diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/AccountService.wsdl b/sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/AccountService.wsdl deleted file mode 100644 index b83c453462..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/AccountService.wsdl +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/Makefile.am b/sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/Makefile.am deleted file mode 100644 index bdc846e58c..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/Makefile.am +++ /dev/null @@ -1,22 +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. - -deploydir=$(prefix)/CppBigBank/deploy -phpwsclientdir=$(deploydir)/bigbank.phpwsclient - -phpwsclient_DATA = *.php *.wsdl README -EXTRA_DIST = *.php *.wsdl README diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/README b/sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/README deleted file mode 100644 index d02873e860..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/README +++ /dev/null @@ -1,137 +0,0 @@ -Big Bank PHP Client -=================== - -Overview --------- - -This is a pair of very simple PHP scripts to demonstrate how the Accounts service -that the C++ Big Bank sample exposes can be used from within the PHP scripting -language. - -bigwelcome.php - A bootstrap script that shows a form and allows the user to press a button - in order to invoke the bigaccount.php script - -bigaccount.php - Makes a call to a locally installed BigBank Accounts service. The script - shows how to use PHP SDO and SOAP extensions to construct the call - and interpret the result. - -As this is a very simple test client once you have reached bigaccount.php you are done. -So there are no further buttons other than the browser back button. - -Installation ------------- - -This assumes that you have the BigBank sample runnig as a web service in your local -Axis2C container at http://localhost:9090/axis2/services/AccountService - -To run the php scripts requires some configuration and setup of a php runtime with -the SDO and SimpleXML extensions enabled. The bits you will need are: - -Apache web server - http://httpd.apache.org/ (I'm currently at 2.0.55) -PHP 5.1.6 - http://www.php.net/downloads.php (I'm currently at 5.1.6) -PHP SDO - http://pecl.php.net/package/sdo (I'm currently at 1.0.3) - -Windows -------- -If you are on windows you can get binary builds from http://www.php.net/downloads.php. -For SDO you need two dlls as followd - -php_sdo.dll http://pecl4win.php.net/ext.php/php_sdo.dll -php_sdo_das_xml.dll http://pecl4win.php.net/ext.php/php_sdo_das_xml.dll - -I copied these to my php5.1.6/ext dir ( php_soap.dll is already there) - -And added the following to my php.ini file (having already renamed php.ini-recommended to -php.ini of course) - -extension=php_soap.dll -extension=php_sdo.dll -extension=php_sdo_das_xml.dll - -I also changed the extension_dir directive to point to my extensions directory: - -extension_dir="C:/simon/apps/php5.1.6/ext" - -When I ask PHP to list what modules are active in my version of PHP I get the -following - -C:\simon\apps\php5.1.6>php -m -[PHP Modules] -bcmath -calendar -com_dotnet -ctype -date -dom -ftp -hash -iconv -libxml -odbc -pcre -Reflection -sdo -sdo_das_xml -session -SimpleXML -soap -SPL -standard -tokenizer -wddx -xml -xmlreader -xmlwriter -zlib - -[Zend Modules] - -Of particular relevance to these scripts note that soap, sdo and sd_das_xml are active. - -Other Platforms ---------------- - -If your on on another platform, such as Linux, then you will need to compile the -SDO extension. The documentation at the SDO extension page (http://livedocs.phpdoc.info/index.php?l=en&q=ref.sdo) -is currently a bit missleading and needs updating. What you need to do is do a -phpize build of the SDO PECL extension. This is discussed in the SDO documentation -but is also discussed in many other places, for example, http://www.php.net/manual/en/install.pecl.phpize.php. -Here is not the time to go into the details of how to build PHP extensions using -phpize but if you are familar with the process I use the following configure line -on windows. - -cscript configure.js --with-extra-includes=c:\simon\projects\tuscany\php\win32build\include; - c:\simon\apps\libxml2-2.6.23.win32\include; - c:\simon\apps\iconv-1.9.1.win32\include - --with-extra-libs=c:\simon\projects\tuscany\php\win32build\lib; - c:\simon\apps\libxml2-2.6.23.win32\lib; - c:\simon\apps\iconv-1.9.1.win32\lib - --enable-sdo=shared - --enable-soap - -There are no newlines in my command line by the way. I've just included them -here so you can see the command. - -Running -------- - -You need to configure Apache to run PHP of course. This is well documented but this -is what I put at the end of httpd.conf - -# PHP5 Support -LoadModule php5_module "C:/simon/apps/php5.1.6/php5apache2.dll" -AddType application/x-httpd-php .php - -# configure the path to php.ini -PHPIniDir "C:/simon/apps/php5.1.6" - -Having set up Apache all that remains is to - -- put the bigbank.phpwsclient directory in your web server's root documents directory -- start up the Axis2C runtime configured to run BigBank -- point your browser at http://myserver:port/bigbank.phpwsclient/bigwelcome.php - -You should now be able to press the "GetAccount" button and see the values -returned from the BigBank SCA application. diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/bigaccount.php b/sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/bigaccount.php deleted file mode 100644 index b9f77d3297..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/bigaccount.php +++ /dev/null @@ -1,113 +0,0 @@ - - - BigBank Sample - - - - - - -getAccountReport($accountname); - // we have to construct an object hierarchy that matches the - // WSDL request. We can use SDO to do this for us - - // configure SDO based on the WSDL - $xmldas = SDO_DAS_XML::create("AccountService.wsdl"); - - // Get a document that represents the request - // and get the root element - $requestxdoc = $xmldas->createDocument("getAccountReport"); - $requestsdo = $requestxdoc->getRootDataObject(); - - // add the parameter - $requestsdo['customerID'] = $accountname; - - // make the call - $result = $client->getAccountReport($requestsdo); - - // now we have the result as a PHP object - // we can turn this into an SDO but we have to do it manually - // as the SOAP extension won't generate types for us - // automatically just yet - $responsexdoc = $xmldas->createDocument("getAccountReportResponse"); - $responsesdo = $responsexdoc->getRootDataObject(); - - // flesh out the object hierarchy - $account = $responsesdo->createDataObject ('result'); - $checking = $account->createDataObject ('checking'); - $saving = $account->createDataObject ('savings'); - $stocks = $account->createDataObject ('stocks'); - - //copy the data - $checking['accountNumber'] = $result->result->checking->accountNumber; - $checking['balance'] = $result->result->checking->balance; - //etc.. - // This is a bit rubbish as we would want this to happen automatically - - // Now just put the data on the screen - // To do this we don't need to use SDO as you can see but - // it would be really handy if we wanted to pass the XML doc - // onto another service or if we wanted to do some other - // more complex XML manipulation or XPath searches - echo "

      Account $accountname

      "; - echo "

      Checking Account

      "; - echo ""; - echo ""; - echo "
      Account Number $checking->accountNumber
      Balance $checking->balance

      Saving Account

      "; - echo ""; - echo ""; - echo "
      Account Number" . $result->result->savings->accountNumber . "
      Balance" . $result->result->savings->balance . "

      Stock Account

      "; - echo ""; - echo ""; - echo ""; - echo ""; - echo "
      Account Number" . $result->result->stocks->accountNumber . "
      Symbol" . $result->result->stocks->symbol . "
      Quantity" . $result->result->stocks->quantity . "
      Banalce" . $result->result->stocks->balance . "
      "; - } - catch (SoapFault $f) - { - echo "Caught soap exception: \n"; - print_r ( $f ); - } - } - catch ( Exception $e ) - { - echo "Caught exception: \n"; - print_r ( $e ); - - } -?> diff --git a/sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/bigwelcome.php b/sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/bigwelcome.php deleted file mode 100644 index 32159ddc16..0000000000 --- a/sca-cpp/trunk/samples/CppBigBank/bigbank.phpwsclient/bigwelcome.php +++ /dev/null @@ -1,44 +0,0 @@ - - - - BigBank Sample - - - - - - - - -

      Welcome To The BigBank Sample

      - -
      - Please enter your account ID - - -
      - -
      - - diff --git a/sca-cpp/trunk/samples/CppCalculator/Makefile.am b/sca-cpp/trunk/samples/CppCalculator/Makefile.am deleted file mode 100644 index d9d4b499b7..0000000000 --- a/sca-cpp/trunk/samples/CppCalculator/Makefile.am +++ /dev/null @@ -1,21 +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. - -deploydir=$(prefix)/CppCalculator/deploy -SUBDIRS = sample.calculator sample.calculator.client -EXTRA_DIST = *.composite README.html -deploy_DATA = *.composite diff --git a/sca-cpp/trunk/samples/CppCalculator/README b/sca-cpp/trunk/samples/CppCalculator/README deleted file mode 100644 index b9dedd2da3..0000000000 --- a/sca-cpp/trunk/samples/CppCalculator/README +++ /dev/null @@ -1,4 +0,0 @@ -Tuscany SCA for C++ Samples - C++ Calculator Sample -=================================================== - -See the README.html file for instructions to build and run this sample diff --git a/sca-cpp/trunk/samples/CppCalculator/README.html b/sca-cpp/trunk/samples/CppCalculator/README.html deleted file mode 100644 index 264ba3d881..0000000000 --- a/sca-cpp/trunk/samples/CppCalculator/README.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - - - - Tuscany SCA Native Samples - C++ Calculator Sample - - - -
      -
      -
      -

      Tuscany SCA Native Samples - C++ Calculator Sample

      - -

      This is a very simple sample to show how an SCA composite can wire - together two C++ components to implement a Calculator service and invoke - the service via a local client. -

      -

      There are two sub projects in this workspace:

      -
        -
      • sample.calculator
        - This contains the source code and SCDL artifacts for the SCA Calculator - composite implementing the sample Calculator. -
      • -
      • sample.calculator.client
        - A sample client which does a local call to the Calculator service. -
      • -
      -

      Additionally, there is the sample.calculator.app.composite file. This - describes the configuration of the SCA Calculator composite deployed to the SCA - runtime. -

      -
      - - - - -
      -

      Building the C++ samples on Linux and Mac OS X

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
      2. - -
      3. Build the C++ samples with the following command sequence: -
          -
        • cd <tuscany_sca_install_dir>/samples
        • -
        • ./configure --prefix=$TUSCANY_SCACPP/samples --enable-static=no
        • -
        • make
        • -
        • make install
        • -
        - NOTE: If you don't provide the --prefix configure option, it will by default install into - /usr/local/tuscany/sca/samples/CppCalculator
      4. -
      -
      - -
      -

      Running the C++ Calculator sample on Linux and Mac OS X

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        -
      2. -
      3. Run the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>/samples/CppCalculator/deploy/sample.calculator.client
        • -
        • ./runclient.sh
        • -
        -
      4. -
      -
      - -
      -

      Building the C++ Calculator sample on Windows

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
      2. - -
      3. You must have set up the environment for Microsoft Visual C++ tools. - The build command will call vcvars32 to set the environment. Ensure the - directory containing this is on your path. This will be where you - installed the compiler. -
      4. -
      5. Build the source, either via the Visual Studio Express projects under - <tuscany_sca_install_dir>\samples\CppCalculator\VSExpress\CppCalculator.sln or via the command-line build file - found at <tuscany_sca_install_dir>\samples\CppCalculator\VSExpress\CppCalculator\build.bat - which will build and deploy the samples. -
      6. -
      -
      - -
      -

      Running the C++ Calculator sample on Windows

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        -
      2. -
      3. Run the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>\samples\CppCalculator\deploy\sample.calculator.client
        • -
        • runclient.bat
        • -
        -
      4. -
      - - - -
      -

      Getting Help

      - -

      The first place to look is at the Tuscany SCA FAQ at - http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      - -

      Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      - -
      -
      -
      - - - - diff --git a/sca-cpp/trunk/samples/CppCalculator/sample.calculator.app.composite b/sca-cpp/trunk/samples/CppCalculator/sample.calculator.app.composite deleted file mode 100644 index 5753b3c593..0000000000 --- a/sca-cpp/trunk/samples/CppCalculator/sample.calculator.app.composite +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/CppCalculator/sample.calculator.client/CalculatorClient.cpp b/sca-cpp/trunk/samples/CppCalculator/sample.calculator.client/CalculatorClient.cpp deleted file mode 100644 index 37e9d40f66..0000000000 --- a/sca-cpp/trunk/samples/CppCalculator/sample.calculator.client/CalculatorClient.cpp +++ /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$ */ - -#include -#include - -#include "osoa/sca/sca.h" - -#include "Calculator.h" - -using namespace std; -using namespace osoa::sca; - - -void usage(); -bool IsNumber(const char *p); - -int main(int argc, char* argv[]) -{ - const char *operation; - float arg1 = 0; - float arg2 = 0; - - if (argc == 4) - { - operation = argv[1]; - - if (!IsNumber(argv[2])) - { - cout << "calculator_client: Argument 1 is not a number" << endl; - usage(); - } - else - { - arg1 = atof(argv[2]); - } - - if (!IsNumber(argv[3])) - { - cout << "calculator_client: Argument 2 is not a number" << endl; - usage(); - } - else - { - arg2 = atof(argv[3]); - } - } - else - { - usage(); - } - - try - { - // Locate a service - CompositeContext myContext = CompositeContext::getCurrent(); - Calculator *calcService = (Calculator*) myContext.locateService("CalculatorComponent/CalculatorService"); - if (calcService == 0) - { - cout << "calculator_client: Unable to find Calculator service" << endl; - } - else - { - float result = 0; - if (strcmp(operation, "add") == 0) - { - result = calcService->add(arg1, arg2); - cout << "calculator_client: add(" << arg1 << "," << arg2 << ") = " << result << endl; - } - else - if (strcmp(operation, "sub") == 0) - { - result = calcService->sub(arg1, arg2); - cout << "calculator_client: sub(" << arg1 << "," << arg2 << ") = " << result << endl; - } - else - if (strcmp(operation, "mul") == 0) - { - result = calcService->mul(arg1, arg2); - cout << "calculator_client: mul(" << arg1 << "," << arg2 << ") = " << result << endl; - } - else - if (strcmp(operation, "div") == 0) - { - result = calcService->div(arg1, arg2); - cout << "calculator_client: div(" << arg1 << "," << arg2 << ") = " << result << endl; - } - else - { - cout << "calculator_client: Unrecognized operation: " << operation << endl; - } - } - } - catch (ServiceRuntimeException& ex) - { - cout << "calculator_client: exception caught: " << ex << endl; - } - return 0; -} - -void usage() -{ - cout << "Usage: calculator_client add|sub|mul|div arg1 arg2" << endl; - exit(1); -} - -bool IsNumber (const char *p) -{ - int len = strlen(p); - int pointcount = 0; - - if (!isdigit (p[0]) && p[0] != '-' && p[0] != '+') - { - return false; - } - for (int i = 1; i < len; i++) - { - if (!isdigit (p[i])) - { - if (p[i] == '.') - { - if (pointcount > 0) return false; - pointcount++; - } - else - { - return false; - } - } - } - return true; -} diff --git a/sca-cpp/trunk/samples/CppCalculator/sample.calculator.client/Makefile.am b/sca-cpp/trunk/samples/CppCalculator/sample.calculator.client/Makefile.am deleted file mode 100644 index 9782bf5041..0000000000 --- a/sca-cpp/trunk/samples/CppCalculator/sample.calculator.client/Makefile.am +++ /dev/null @@ -1,40 +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. - -deploydir=$(prefix)/CppCalculator/deploy -clientdir=$(deploydir)/sample.calculator.client - -client_PROGRAMS = calculator_client -client_SCRIPTS = runclient.sh -EXTRA_DIST = runclient.sh - -calculator_client_SOURCES = \ -CalculatorClient.cpp - -calculator_client_LDADD = \ --L${TUSCANY_SCACPP}/lib \ - -ltuscany_sca \ --L${TUSCANY_SCACPP}/extensions/cpp/lib \ - -ltuscany_sca_cpp \ --L${TUSCANY_SDOCPP}/lib \ - -ltuscany_sdo - -INCLUDES = \ --I$(TUSCANY_SCACPP)/extensions/cpp/include \ --I${TUSCANY_SCACPP}/include \ --I${TUSCANY_SDOCPP}/include \ --I../sample.calculator diff --git a/sca-cpp/trunk/samples/CppCalculator/sample.calculator.client/runclient.bat b/sca-cpp/trunk/samples/CppCalculator/sample.calculator.client/runclient.bat deleted file mode 100644 index 795325ab52..0000000000 --- a/sca-cpp/trunk/samples/CppCalculator/sample.calculator.client/runclient.bat +++ /dev/null @@ -1,42 +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 "%TUSCANY_SCACPP%" == "" ( -echo "TUSCANY_SCACPP not set" -goto end -) -echo using SCA installed at %TUSCANY_SCACPP% - -if "%TUSCANY_SDOCPP%" == "" ( -echo "TUSCANY_SDOCPP not set" -goto end -) -echo using SDO installed at %TUSCANY_SDOCPP% - -set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SCACPP%\extensions\cpp\bin;%TUSCANY_SDOCPP%\bin;%PATH% - -set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ -set TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent - -.\calculator_client.exe div 5 2 - -:end -endlocal diff --git a/sca-cpp/trunk/samples/CppCalculator/sample.calculator.client/runclient.sh b/sca-cpp/trunk/samples/CppCalculator/sample.calculator.client/runclient.sh deleted file mode 100755 index feae29d557..0000000000 --- a/sca-cpp/trunk/samples/CppCalculator/sample.calculator.client/runclient.sh +++ /dev/null @@ -1,39 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/cpp/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ -export TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent - -./calculator_client div 5 2 diff --git a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/Calculator.h b/sca-cpp/trunk/samples/CppCalculator/sample.calculator/Calculator.h deleted file mode 100644 index 90e97b5319..0000000000 --- a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/Calculator.h +++ /dev/null @@ -1,34 +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 sample_calculator_h -#define sample_calculator_h - -class Calculator -{ -public: - virtual float add(float arg1, float arg2) = 0; - virtual float sub(float arg1, float arg2) = 0; - virtual float mul(float arg1, float arg2) = 0; - virtual float div(float arg1, float arg2) = 0; -}; - -#endif // sample_calculator_h diff --git a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/CalculatorImpl.componentType b/sca-cpp/trunk/samples/CppCalculator/sample.calculator/CalculatorImpl.componentType deleted file mode 100644 index 72fe9842e8..0000000000 --- a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/CalculatorImpl.componentType +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/CalculatorImpl.cpp b/sca-cpp/trunk/samples/CppCalculator/sample.calculator/CalculatorImpl.cpp deleted file mode 100644 index 01dac77c92..0000000000 --- a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/CalculatorImpl.cpp +++ /dev/null @@ -1,90 +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 "osoa/sca/ComponentContext.h" -#include "osoa/sca/ServiceRuntimeException.h" - -#include "CalculatorImpl.h" -#include "Divide.h" - -CalculatorImpl::CalculatorImpl() -{ -} - -CalculatorImpl::~CalculatorImpl() -{ -} - -// Calculator interface -float CalculatorImpl::add(float arg1, float arg2) -{ - float result = arg1 + arg2; - - printf("CalculatorImpl::add %f + %f = %f\n", arg1, arg2, result); - return result; -} - -float CalculatorImpl::sub(float arg1, float arg2) -{ - float result = arg1 - arg2; - printf("CalculatorImpl::sub %f - %f = %f\n", arg1, arg2, result); - return result; -} - -float CalculatorImpl::mul(float arg1, float arg2) -{ - float result = arg1 * arg2; - printf("CalculatorImpl::mul %f * %f = %f\n", arg1, arg2, result); - return result; -} - -float CalculatorImpl::div(float arg1, float arg2) -{ - float result = 0; - - // This method shows how to invoke a service on a different component from within a component - - // First, get the current ComponentContext - osoa::sca::ComponentContext myContext = osoa::sca::ComponentContext::getCurrent(); - - try - { - // Find the required service, as referenced in CalculatorImpl.componentType - Divide* divideService = (Divide*)myContext.getService("divideService"); - - // Finally, invoke the service - result = divideService->divide(arg1, arg2); - - printf("CalculatorImpl::div Divide returned result: %f\n", result); - - } - catch (osoa::sca::ServiceRuntimeException& e) - { - // Print out error message and carry on - printf("CalculatorImpl::div Error whilst invoking Divide: %s", e.getMessageText()); - } - - return result; -} - - diff --git a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/CalculatorImpl.h b/sca-cpp/trunk/samples/CppCalculator/sample.calculator/CalculatorImpl.h deleted file mode 100644 index af8a5eeab1..0000000000 --- a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/CalculatorImpl.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 sample_calculatorimpl_h -#define sample_calculatorimpl_h - -#include "Calculator.h" - -class CalculatorImpl : public Calculator -{ -public: - CalculatorImpl(); - virtual ~CalculatorImpl(); - - // Calculator interface - virtual float add(float arg1, float arg2); - virtual float sub(float arg1, float arg2); - virtual float mul(float arg1, float arg2); - virtual float div(float arg1, float arg2); -}; - -#endif // sample_calculatorimpl_h - diff --git a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/Divide.h b/sca-cpp/trunk/samples/CppCalculator/sample.calculator/Divide.h deleted file mode 100644 index 6e171ed733..0000000000 --- a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/Divide.h +++ /dev/null @@ -1,34 +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 sample_divide_h -#define sample_divide_h - -class Divide -{ -public: - virtual float divide(float arg1, float arg2) = 0; -}; - -#endif // sample_divide_h - - diff --git a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/DivideImpl.componentType b/sca-cpp/trunk/samples/CppCalculator/sample.calculator/DivideImpl.componentType deleted file mode 100644 index d7369e3ff0..0000000000 --- a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/DivideImpl.componentType +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/DivideImpl.cpp b/sca-cpp/trunk/samples/CppCalculator/sample.calculator/DivideImpl.cpp deleted file mode 100644 index f1a927cf4c..0000000000 --- a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/DivideImpl.cpp +++ /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. - */ - -/* $Rev$ $Date$ */ - -#include - -#include "DivideImpl.h" - -DivideImpl::DivideImpl() -{ -} - -DivideImpl::~DivideImpl() -{ -} - -// Divide interface -float DivideImpl::divide(float arg1, float arg2) -{ - if(arg2 == 0.0) - { - printf("DivideImpl::div %f / %f !! Cannot divide by zero, so returning 0\n", arg1, arg2); - return 0; - } - - float result = arg1 / arg2; - printf("DivideImpl::div %f / %f = %f\n", arg1, arg2, result); - return result; -} - - diff --git a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/DivideImpl.h b/sca-cpp/trunk/samples/CppCalculator/sample.calculator/DivideImpl.h deleted file mode 100644 index 64045f1899..0000000000 --- a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/DivideImpl.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 sample_divideimpl_h -#define sample_divideimpl_h - -#include "Divide.h" - -class DivideImpl : public Divide -{ -public: - DivideImpl(); - virtual ~DivideImpl(); - - // Divide interface - virtual float divide(float arg1, float arg2); -}; - -#endif // sample_divideimpl_h - diff --git a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/Makefile.am b/sca-cpp/trunk/samples/CppCalculator/sample.calculator/Makefile.am deleted file mode 100644 index de6dad787d..0000000000 --- a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/Makefile.am +++ /dev/null @@ -1,53 +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. - -deploydir=$(prefix)/CppCalculator/deploy -compositedir=$(deploydir)/sample.calculator - -BUILT_SOURCES = scagen - -noinst_HEADERS = *.h - -scagen: - java -jar $(TUSCANY_SCACPP)/bin/scagen.jar -dir . -output . - -composite_LTLIBRARIES = libCalculator.la -composite_DATA = *.composite *.componentType -EXTRA_DIST = *.composite *.componentType - -dist_libCalculator_la_SOURCES = \ -CalculatorImpl.cpp \ -DivideImpl.cpp - -nodist_libCalculator_la_SOURCES = \ -CalculatorImpl_CalculatorService_Proxy.cpp \ -CalculatorImpl_CalculatorService_Wrapper.cpp \ -CalculatorImpl_divideService_Proxy.cpp \ -DivideImpl_DivideService_Proxy.cpp \ -DivideImpl_DivideService_Wrapper.cpp - -libCalculator_la_LIBADD = \ --L${TUSCANY_SCACPP}/lib \ - -ltuscany_sca \ --L${TUSCANY_SCACPP}/extensions/cpp/lib \ - -ltuscany_sca_cpp - -INCLUDES = \ --I$(TUSCANY_SCACPP)/extensions/cpp/include \ --I$(TUSCANY_SCACPP)/include \ --I${TUSCANY_SDOCPP}/include - diff --git a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/sample.calculator.composite b/sca-cpp/trunk/samples/CppCalculator/sample.calculator/sample.calculator.composite deleted file mode 100644 index 6903cf21d8..0000000000 --- a/sca-cpp/trunk/samples/CppCalculator/sample.calculator/sample.calculator.composite +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - DivideComponent/DivideService - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/GettingStarted.html b/sca-cpp/trunk/samples/GettingStarted.html deleted file mode 100644 index dcb2cfd19c..0000000000 --- a/sca-cpp/trunk/samples/GettingStarted.html +++ /dev/null @@ -1,513 +0,0 @@ - - - - - - - - - - - Tuscany SCA Native Samples - Getting Started - - - -
      -
      -
      -

      Tuscany Samples - Getting Started - SCA Native Milestone release 3

      - -

      Tuscany SCA Native includes a set of simple technology samples that demonstrates some of the functionality of - the Tuscany SCA Native runtime. This page describes the samples and links to the documents that describe how to - build and run them -

      -
      - -
      -

      Samples

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      CppCalculatorA very simple sample to show how an SCA composite can wire - together two C++ components to implement a Calculator service -
      PythonCalculatorA very simple sample to show how an SCA composite can wire - together two Python components to implement a Calculator service -
      RubyCalculatorA very simple sample to show how an SCA composite can wire - together two Ruby components to implement a Calculator service -
      RESTCalculatorThis sample is based on RubyCalculator but exposes the Calculator service as a REST Service - running under the Apache HTTPD server
      CppBigBankA more complex sample that implements the "Simplified BigBank" scenario. A whitepaper describing - the scenario based on the SCA 0.9 Assembly specification can be found - here. - This sample uses multiple C++ components, calls out to an external Web Service via a reference, - exposes the service as a Web Service and also provides a PHP based client. -
      RubyBigBankA more complex sample that implements the "Simplified BigBank" scenario. This sample uses multiple - Ruby components, calls out to an external Web Service via a reference and exposes the service as a - Web Service. -
      HTTPDBigBankA more complex sample that implements the "Simplified BigBank" scenario. This sample contains the same - SCA components and calls as RubyBigBank, but demonstrates running the sample under the Apache HTTPD server -
      PythonWeatherForecastThis sample makes calls to an external Web Service via a reference, demonstrating how Python - ElementTree objects are used in Tuscany to access the XML data returned from the service.
      RestCustomerThis sample demonstrates a Python component exposed as a REST Service either with or without the REST - interface (which specifies whether the service uses CRUD operations that translate to HTTP POST, GET, PUT - and DELETE or uses HTTP GET and XML over HTTP POST to invoke named operations) running under the Apache - HTTPD server
      RestYahooThis sample demonstrates a Python component that is wired to make REST calls out to the external - Yahoo! Web Search service. This sample uses a Ruby local client to invoke the Python component.
      AlertAggregatorA more complex sample that shows how a Web 2.0-style application can be built using SCA. The Alert - Aggregator Sample aggregates various data sources and presents a unified view of data from these sources, - served as XML and displayed via a web page
      -
      -
      -
      -

      Sample Dependencies

      -

      The Tuscany samples each demonstrate different aspects of functionality provided by Tuscany, often in - particular extensions. The table below documents the extension dependencies that each sample has. - Please see the extension documentation for more details on the dependencies that particular extensions have. -

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      C++ ExtensionPython ExtensionRuby ExtensionAxis2C Web Service Service ExtensionAxis2C Web Service Reference ExtensionREST Service ExtensionREST Reference ExtensionREST Interface ExtensionSCA Service ExtensionSCA Reference Extension
      CppCalculatorYes
      PythonCalculator Yes
      RubyCalculator Yes
      RESTCalculator Yes Yes Yes
      CppBigBankYes Yes Yes
      RubyBigBank Yes Yes Yes
      HTTPDBigBank Yes Yes Yes Yes Yes
      PythonWeatherForecast Yes Yes
      RestCustomer Yes Yes Yes Yes
      RestYahoo Yes Yes Yes
      AlertAggregator Yes Yes Yes
      -
      -

      The table below documents the libraries or environments necessary to build and/or run each sample. These are generally - required by the Tuscany extensions that the sample employs. - Please see the extension documentation for more details (such as the version required) about the dependencies that particular - extensions require. -

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Java runtimePython runtimeRuby runtimeAxis2/C libraryAxis2/C HTTP serverlibcurl libraryHTTPD serverUniversal Feed Parser library
      CppCalculatorBuild
      PythonCalculator Run
      RubyCalculator Run
      RESTCalculator Run Run Run
      CppBigBankBuild Run
      RubyBigBank Run Run Run
      HTTPDBigBank Run Run Run
      PythonWeatherForecast Run Run
      RestCustomer Run Run Run
      RestYahoo Run Run Run
      AlertAggregator Run Run Run Run
      -
      -
      - -
      -

      Getting Help

      - -

      The first place to look is at the Tuscany SCA FAQ at - http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      - -

      Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      - - -

       

      - -

       

      - -

       

      - - - - - - -
      - -

      Thank you for your interest in Tuscany.

      -The - Tuscany Development Team -
      -
      - -
      - -
      - - - diff --git a/sca-cpp/trunk/samples/HttpdBigBank/Makefile.am b/sca-cpp/trunk/samples/HttpdBigBank/Makefile.am deleted file mode 100644 index 7ae86e6d2c..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/Makefile.am +++ /dev/null @@ -1,21 +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. - -deploydir=$(prefix)/HttpdBigBank/deploy -SUBDIRS = bigbank.account bigbank.accountdata bigbank.wsclient httpserver -EXTRA_DIST = *.composite -deploy_DATA = *.composite diff --git a/sca-cpp/trunk/samples/HttpdBigBank/README b/sca-cpp/trunk/samples/HttpdBigBank/README deleted file mode 100644 index a3442236bd..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/README +++ /dev/null @@ -1,37 +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 sample shows how to run the Bigbank app with the Apache HTTP server - -This is a more modular version of the original Bigbank app, the account -service and the account data service are in different composites. - -The httpserver directory contains a minimal httpd configuration. -Make sure that Apache apachectl and httpd 2.2.x are on the PATH. - -To start the server, cd to httpserver, and run ./startserver.sh. - -To verify that the server is working, point your Web browser to -http://localhost:9090. - -To verify that Axis2C is working, point your Web browser to -http://localhost:9090/axis2, you should see a list of deployed services. - -To stop the server, cd to httpserver, and run ./stopserver.sh. - -To run the sample go to bigbank.wsclient, and run ./runwsclient.sh. - diff --git a/sca-cpp/trunk/samples/HttpdBigBank/README.html b/sca-cpp/trunk/samples/HttpdBigBank/README.html deleted file mode 100644 index bfd33ee1cd..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/README.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - - - - - Tuscany SCA Native Samples - HTTPD BigBank Sample - - - -
      -
      -
      -

      Tuscany SCA Native Samples - HTTPD BigBank Sample

      - -

      This sample implements the "Simplified BigBank" scenario. A whitepaper describing - the scenario based on the SCA 0.9 Assembly specification can be found - here. - This is a more modular version of the original Bigbank app, with the account - service and the account data service are in different composites. -

      -

      The HTTPD BigBank sample requires the following extensions: -

      - Please follow the documentation to ensure you have these extensions built and installed - on your system -

      -

      There are three sub-projects in this workspace:

      -
        -
      • bigbank.account
        - This contains the source code and SCDL artifacts for the SCA HTTPD BigBank - composite implementing the account services. -
      • -
      • bigbank.accountdata
        - This contains the source code and SCDL artifacts for the SCA HTTPD BigBank - composite implementing the account data services. -
      • -
      • bigbank.wsclient
        - A sample client which uses an SCA Web Service reference to make a remote - call to the BigBank service. -
      • -
      -

      Additionally, there is the bigbank.app.composite file. This - describes the configuration of the SCA BigBank composite deployed to the SCA - runtime. -

      -

      Note that this sample does not run on Windows, due to threading incompatibilities - between Apache HTTPD and the Ruby runtime

      -
      - - - - -
      -

      Building the HTTPD BigBank sample on Linux and Mac OS X

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
      2. - -
      3. As the HTTPD BigBank sample is based on Ruby scripts, a specific compilation step is not necessary - - only deployment is required. Deploy the Ruby samples only with the following command sequence: -
          -
        • cd <tuscany_sca_install_dir>/samples
        • -
        • ./configure --enable-ruby --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
        • -
        • make install
        • -
        - NOTE: If you don't provide the --prefix configure option, it will by default install into - /usr/local/tuscany/sca/samples/HttpdBigBank -
      4. -
      -
      - -
      -

      Running the HTTPD BigBank sample on Linux and Mac OS X

      -
        -
      1. The HTTPD BigBank sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
      2. -
      3. Ensure you have enabled Axis2/C to run Tuscany SCA services. Follow the instructions - found here. -
      4. -
      5. Start the Apache HTTPD server: -
          -
        1. The following environment variables are required: -
            -
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • -
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • -
          • AXIS2C_HOME=<path to Axis2/C version 0.96>
          • -
          -
        2. -
        3. cd <tuscany_sca_install_dir>/samples/HttpdBigBank/deploy/httpserver
        4. -
        5. ./startserver.sh
          - NOTE: Depending on your installation of Apache HTTPD you may need to log in as root before following - these steps. If so, you may also need to uncomment the User and Group directives in the - <tuscany_sca_install_dir>/samples/HttpdBigBank/deploy/httpserver/conf/httpd.conf file - and set these to the appropriate username and group that the server should run as
        6. -
        -
      6. -
      7. Now run the Web Service client: -
          -
        1. The following environment variables are required: -
            -
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • -
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • -
          • AXIS2C_HOME=<path to Axis2/C version 0.96>
          • -
          -
        2. -
        3. Run the sample with the following commands: -
            -
          • cd <tuscany_sca_install_dir>/samples/HttpdBigBank/deploy/bigbank.wsclient
          • -
          • ./runwsclient.sh
          • -
          -
        4. -
        -
      8. -
      9. The PHP web client detailed in the - CppBigBank sample can also be used - with the HTTPD BigBank service that is served by the HTTPD server started above. -
      10. -
      -
      - -
      -

      The HTTPD BigBank sample on Windows

      -

      The HttpdBigBank sample does not currently run on Windows, due to the sample being based on Ruby - components running under Apache HTTPD. The Ruby runtime is single-threaded and, on Windows, HTTPD - is multi-threaded, which means that Ruby throws "cross-thread violation" errors when Tuscany - attempts to run a Ruby script under HTTPD.

      -
      - -
      -

      Getting Help

      - -

      The first place to look is at the Tuscany SCA FAQ at - http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      - -

      Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      - -
      -
      -
      - - - - diff --git a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/AccountService.wsdl b/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/AccountService.wsdl deleted file mode 100644 index b83c453462..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/AccountService.wsdl +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/AccountServiceImpl.rb b/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/AccountServiceImpl.rb deleted file mode 100644 index 20af2cfedb..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/AccountServiceImpl.rb +++ /dev/null @@ -1,83 +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. -# - -require "rexml/document" -include REXML - -class AccountServiceImpl - - attr_writer :accountDataService - attr_writer :stockQuoteService - attr_writer :currency - - def initialize() - print "Ruby - AccountServiceImpl.initialize\n" - end - - def getAccountReport(customerID) - - # Get the checking account info - checking = @accountDataService.getCheckingAccount(customerID) - - # Get the savings account info - savings = @accountDataService.getSavingsAccount(customerID) - - # Get the stocks account info - stock = @accountDataService.getStockAccount(customerID); - - symbol = stock.root.elements["symbol"].text - quantity = stock.root.elements["quantity"].text - - # Get the stock price - price = @stockQuoteService.getQuote(symbol); - - # Convert to the configured currency - price = price.to_f * 0.80 if @currency == "EUR" - - # Calculate the balance - balance = price.to_f * quantity.to_f - - # Form the AccountReport document - report = Document.new <<-eof - - - - #{ checking.root.elements["accountNumber"].text } - #{ checking.root.elements["balance"].text } - - - - #{ savings.root.elements["accountNumber"].text } - #{ savings.root.elements["balance"].text } - - - - #{ stock.root.elements["accountNumber"].text } - #{ symbol } - #{ quantity } - #{ balance } - - - - eof - - return report - end - -end diff --git a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/Makefile.am b/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/Makefile.am deleted file mode 100644 index 01c8681555..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/Makefile.am +++ /dev/null @@ -1,22 +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. - -deploydir=$(prefix)/HttpdBigBank/deploy -compositedir=$(deploydir)/bigbank.account - -composite_DATA = *.composite *.wsdl *.xsd *.rb -EXTRA_DIST = *.composite *.wsdl *.xsd *.rb diff --git a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/StockQuoteServiceImpl.rb b/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/StockQuoteServiceImpl.rb deleted file mode 100644 index 7f8634072c..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/StockQuoteServiceImpl.rb +++ /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. -# - -require "rexml/document" -include REXML - -class StockQuoteServiceImpl - - attr_writer :webService - - def initialize() - print "Ruby - StockQuoteServiceImpl.initialize\n" - end - - def getQuote(symbol) - print "Ruby - StockQuoteServiceImpl.getQuote ", symbol, "\n" - - price = 0 - catch (:RuntimeError) do - begin - - result = @webService.GetQuote(symbol) - doc = Document.new(result) - price = doc.root.elements["Stock"].elements["Last"].text; - - rescue - # offline or StockQuote web service is down - price = 95.0 - end - end - - print "Ruby - stock price = ", price, "\n" - - return price.to_f - end - -end \ No newline at end of file diff --git a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/StockQuoteTypes.xsd b/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/StockQuoteTypes.xsd deleted file mode 100644 index 2f7012b5fb..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/StockQuoteTypes.xsd +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/StockQuoteWebService.wsdl b/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/StockQuoteWebService.wsdl deleted file mode 100644 index c14f97c87b..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/StockQuoteWebService.wsdl +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Get Stock quote for a company Symbol - - - - - - - - - - Get Stock quote for a company Symbol - - - - - - - - - - Get Stock quote for a company Symbol - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/bigbank.account.composite b/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/bigbank.account.composite deleted file mode 100644 index 208402cdb3..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.account/bigbank.account.composite +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - AccountServiceComponent - - - - - AccountDataService - StockQuoteServiceComponent - USD - - - - - StockQuoteWebService - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.accountdata/AccountData.xsd b/sca-cpp/trunk/samples/HttpdBigBank/bigbank.accountdata/AccountData.xsd deleted file mode 100644 index 8c8ff7c637..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.accountdata/AccountData.xsd +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.accountdata/AccountDataServiceImpl.rb b/sca-cpp/trunk/samples/HttpdBigBank/bigbank.accountdata/AccountDataServiceImpl.rb deleted file mode 100644 index 8ae0e23bab..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.accountdata/AccountDataServiceImpl.rb +++ /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. -# - -require "rexml/document" -include REXML - -class AccountDataServiceImpl - - def initialize() - print "Ruby - AccountDataServiceImpl.initialize\n" - end - - def getCheckingAccount(id) - print "Ruby - AccountDataServiceImpl.getCheckingAccount ", id, "\n" - - result = Document.new <<-eof - - #{ id.to_s + "_CHA12345"} - 1500.0 - - eof - - return result - end - - def getSavingsAccount(id) - print "Ruby - AccountDataServiceImpl.getSavingsAccount ", id, "\n" - - result = Document.new <<-eof - - #{ id.to_s + "_SAA12345"} - 1500.0 - - eof - - return result - end - - def getStockAccount(id) - print "Ruby - AccountDataServiceImpl.getStockAccount ", id, "\n" - - result = Document.new <<-eof - - #{ id.to_s + "_STA12345"} - IBM - 100 - - - eof - - return result - end - -end diff --git a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.accountdata/Makefile.am b/sca-cpp/trunk/samples/HttpdBigBank/bigbank.accountdata/Makefile.am deleted file mode 100644 index 7735720b26..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.accountdata/Makefile.am +++ /dev/null @@ -1,22 +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. - -deploydir=$(prefix)/HttpdBigBank/deploy -compositedir=$(deploydir)/bigbank.accountdata - -composite_DATA = *.composite *.xsd *.rb -EXTRA_DIST = *.composite *.xsd *.rb diff --git a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.accountdata/bigbank.accountdata.composite b/sca-cpp/trunk/samples/HttpdBigBank/bigbank.accountdata/bigbank.accountdata.composite deleted file mode 100644 index 30c2802d5b..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.accountdata/bigbank.accountdata.composite +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - AccountDataServiceComponent - - - - - - - diff --git a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.app.composite b/sca-cpp/trunk/samples/HttpdBigBank/bigbank.app.composite deleted file mode 100644 index 9507997464..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.app.composite +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - bigbank.AccountDataManagementComponent/AccountDataService - - - - - - - - - bigbank.AccountManagementComponent/AccountService - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/AccountService.wsdl b/sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/AccountService.wsdl deleted file mode 100644 index b83c453462..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/AccountService.wsdl +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/AccountWSClient.rb b/sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/AccountWSClient.rb deleted file mode 100644 index 6775b80f7a..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/AccountWSClient.rb +++ /dev/null @@ -1,40 +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. -# -# - -require("tuscany_sca_ruby") - -accountService = SCA::locateService("AccountService") - -report = accountService.getAccountReport(1234) - -checking = report.root.elements["checking"] -savings = report.root.elements["savings"] -stocks = report.root.elements["stocks"] - -print "\n\n" -print "Checking account #: ", checking.elements["accountNumber"].text.strip, "\n" -print "Balance: ", checking.elements["balance"].text.strip, "\n" - -print "Savings account #: ", savings.elements["accountNumber"].text.strip, "\n" -print "Balance: ", savings.elements["balance"].text.strip, "\n" - -print "Stocks account #:", stocks.elements["accountNumber"].text.strip, "\n" -print "Symbol: ", stocks.elements["symbol"].text.strip, "\n" -print "Quantity: ", stocks.elements["quantity"].text.strip, "\n" -print "Balance: ", stocks.elements["balance"].text.strip, "\n" diff --git a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/Makefile.am b/sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/Makefile.am deleted file mode 100644 index b1f1cfff0e..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -deploydir=$(prefix)/HttpdBigBank/deploy -clientdir=$(deploydir)/bigbank.wsclient - -client_DATA = *.rb *.composite *.wsdl -client_SCRIPTS = runwsclient.sh -EXTRA_DIST = runwsclient.sh *.rb *.composite *.wsdl diff --git a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/bigbank.wsclient.composite b/sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/bigbank.wsclient.composite deleted file mode 100644 index f484a2fc7c..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/bigbank.wsclient.composite +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/runwsclient.bat b/sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/runwsclient.bat deleted file mode 100644 index 05d0ee2153..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/runwsclient.bat +++ /dev/null @@ -1,51 +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 "%TUSCANY_SCACPP%" == "" ( -echo "TUSCANY_SCACPP not set" -goto end -) -echo Using SCA installed at %TUSCANY_SCACPP% - -if "%TUSCANY_SDOCPP%" == "" ( -echo "TUSCANY_SDOCPP not set" -goto end -) -echo Using SDO installed at %TUSCANY_SDOCPP% - -if "%AXIS2C_HOME%" == "" ( -echo "AXIS2C_HOME not set" -goto end -) -echo Using Axis2C installed at %AXIS2C_HOME% - -rem Run the client -set PATH=%TUSCANY_SCACPP%\extensions\ruby\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SCACPP%\extensions\ws\reference\bin;%TUSCANY_SCACPP%\extensions\ws\service\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% - -set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ -set TUSCANY_SCACPP_COMPONENT=bigbank.AccountWSClientComponent -set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -cd %TUSCANY_SCACPP_ROOT%\bigbank.wsclient -ruby -I%TUSCANY_SCACPP%\extensions\ruby\bin AccountWSClient.rb - -:end -endlocal diff --git a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/runwsclient.sh b/sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/runwsclient.sh deleted file mode 100755 index d50e6a4b0a..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/bigbank.wsclient/runwsclient.sh +++ /dev/null @@ -1,48 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -if [ x$AXIS2C_HOME = x ]; then -echo "AXIS2C_HOME not set" -exit; -fi -echo "Using Axis2C installed at $AXIS2C_HOME" - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/ruby/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ -export TUSCANY_SCACPP_COMPONENT=bigbank.AccountWSClientComponent -export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -cd $TUSCANY_SCACPP_ROOT/bigbank.wsclient -ruby -I$TUSCANY_SCACPP/extensions/ruby/lib AccountWSClient.rb diff --git a/sca-cpp/trunk/samples/HttpdBigBank/httpserver/Makefile.am b/sca-cpp/trunk/samples/HttpdBigBank/httpserver/Makefile.am deleted file mode 100644 index 1195ee1aae..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/httpserver/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -deploydir=$(prefix)/HttpdBigBank/deploy -serverdir=$(deploydir)/httpserver - -server_SCRIPTS = startserver.sh stopserver.sh -EXTRA_DIST = startserver.sh stopserver.sh conf htdocs -nobase_server_DATA = conf/httpd.conf conf/mime.types htdocs/index.html diff --git a/sca-cpp/trunk/samples/HttpdBigBank/httpserver/conf/httpd.conf b/sca-cpp/trunk/samples/HttpdBigBank/httpserver/conf/httpd.conf deleted file mode 100644 index e9a438dc85..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/httpserver/conf/httpd.conf +++ /dev/null @@ -1,35 +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 is the main Apache HTTP server configuration file. It contains the -# configuration directives that give the server its instructions. -# See for detailed information. - -Listen 9090 - -# Generated by the startserver script -Include conf/base.conf -Include conf/mod_axis2.conf -# Include conf/tuscany_sca_mod_rest.conf - -# User and Group directives may be required if the server must be -# started from the root account. Uncomment the following lines and -# set the correct username and group -# -# User myusername -# Group mygroupname - diff --git a/sca-cpp/trunk/samples/HttpdBigBank/httpserver/conf/mime.types b/sca-cpp/trunk/samples/HttpdBigBank/httpserver/conf/mime.types deleted file mode 100644 index 4279f51bca..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/httpserver/conf/mime.types +++ /dev/null @@ -1,607 +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 file controls what Internet media types are sent to the client for -# given file extension(s). Sending the correct media type to the client -# is important so they know how to handle the content of the file. -# Extra types can either be added here or by using an AddType directive -# in your config files. For more information about Internet media types, -# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type -# registry is at . - -# MIME type Extensions -application/activemessage -application/andrew-inset ez -application/applefile -application/atom+xml atom -application/atomicmail -application/batch-smtp -application/beep+xml -application/cals-1840 -application/cnrp+xml -application/commonground -application/cpl+xml -application/cybercash -application/dca-rft -application/dec-dx -application/dvcs -application/edi-consent -application/edifact -application/edi-x12 -application/eshop -application/font-tdpfr -application/http -application/hyperstudio -application/iges -application/index -application/index.cmd -application/index.obj -application/index.response -application/index.vnd -application/iotp -application/ipp -application/isup -application/mac-binhex40 hqx -application/mac-compactpro cpt -application/macwriteii -application/marc -application/mathematica -application/mathml+xml mathml -application/msword doc -application/news-message-id -application/news-transmission -application/ocsp-request -application/ocsp-response -application/octet-stream bin dms lha lzh exe class so dll dmg -application/oda oda -application/ogg ogg -application/parityfec -application/pdf pdf -application/pgp-encrypted -application/pgp-keys -application/pgp-signature -application/pkcs10 -application/pkcs7-mime -application/pkcs7-signature -application/pkix-cert -application/pkix-crl -application/pkixcmp -application/postscript ai eps ps -application/prs.alvestrand.titrax-sheet -application/prs.cww -application/prs.nprend -application/prs.plucker -application/qsig -application/rdf+xml rdf -application/reginfo+xml -application/remote-printing -application/riscos -application/rtf -application/sdp -application/set-payment -application/set-payment-initiation -application/set-registration -application/set-registration-initiation -application/sgml -application/sgml-open-catalog -application/sieve -application/slate -application/smil smi smil -application/srgs gram -application/srgs+xml grxml -application/timestamp-query -application/timestamp-reply -application/tve-trigger -application/vemmi -application/vnd.3gpp.pic-bw-large -application/vnd.3gpp.pic-bw-small -application/vnd.3gpp.pic-bw-var -application/vnd.3gpp.sms -application/vnd.3m.post-it-notes -application/vnd.accpac.simply.aso -application/vnd.accpac.simply.imp -application/vnd.acucobol -application/vnd.acucorp -application/vnd.adobe.xfdf -application/vnd.aether.imp -application/vnd.amiga.ami -application/vnd.anser-web-certificate-issue-initiation -application/vnd.anser-web-funds-transfer-initiation -application/vnd.audiograph -application/vnd.blueice.multipass -application/vnd.bmi -application/vnd.businessobjects -application/vnd.canon-cpdl -application/vnd.canon-lips -application/vnd.cinderella -application/vnd.claymore -application/vnd.commerce-battelle -application/vnd.commonspace -application/vnd.contact.cmsg -application/vnd.cosmocaller -application/vnd.criticaltools.wbs+xml -application/vnd.ctc-posml -application/vnd.cups-postscript -application/vnd.cups-raster -application/vnd.cups-raw -application/vnd.curl -application/vnd.cybank -application/vnd.data-vision.rdz -application/vnd.dna -application/vnd.dpgraph -application/vnd.dreamfactory -application/vnd.dxr -application/vnd.ecdis-update -application/vnd.ecowin.chart -application/vnd.ecowin.filerequest -application/vnd.ecowin.fileupdate -application/vnd.ecowin.series -application/vnd.ecowin.seriesrequest -application/vnd.ecowin.seriesupdate -application/vnd.enliven -application/vnd.epson.esf -application/vnd.epson.msf -application/vnd.epson.quickanime -application/vnd.epson.salt -application/vnd.epson.ssf -application/vnd.ericsson.quickcall -application/vnd.eudora.data -application/vnd.fdf -application/vnd.ffsns -application/vnd.fints -application/vnd.flographit -application/vnd.framemaker -application/vnd.fsc.weblaunch -application/vnd.fujitsu.oasys -application/vnd.fujitsu.oasys2 -application/vnd.fujitsu.oasys3 -application/vnd.fujitsu.oasysgp -application/vnd.fujitsu.oasysprs -application/vnd.fujixerox.ddd -application/vnd.fujixerox.docuworks -application/vnd.fujixerox.docuworks.binder -application/vnd.fut-misnet -application/vnd.grafeq -application/vnd.groove-account -application/vnd.groove-help -application/vnd.groove-identity-message -application/vnd.groove-injector -application/vnd.groove-tool-message -application/vnd.groove-tool-template -application/vnd.groove-vcard -application/vnd.hbci -application/vnd.hhe.lesson-player -application/vnd.hp-hpgl -application/vnd.hp-hpid -application/vnd.hp-hps -application/vnd.hp-pcl -application/vnd.hp-pclxl -application/vnd.httphone -application/vnd.hzn-3d-crossword -application/vnd.ibm.afplinedata -application/vnd.ibm.electronic-media -application/vnd.ibm.minipay -application/vnd.ibm.modcap -application/vnd.ibm.rights-management -application/vnd.ibm.secure-container -application/vnd.informix-visionary -application/vnd.intercon.formnet -application/vnd.intertrust.digibox -application/vnd.intertrust.nncp -application/vnd.intu.qbo -application/vnd.intu.qfx -application/vnd.irepository.package+xml -application/vnd.is-xpr -application/vnd.japannet-directory-service -application/vnd.japannet-jpnstore-wakeup -application/vnd.japannet-payment-wakeup -application/vnd.japannet-registration -application/vnd.japannet-registration-wakeup -application/vnd.japannet-setstore-wakeup -application/vnd.japannet-verification -application/vnd.japannet-verification-wakeup -application/vnd.jisp -application/vnd.kde.karbon -application/vnd.kde.kchart -application/vnd.kde.kformula -application/vnd.kde.kivio -application/vnd.kde.kontour -application/vnd.kde.kpresenter -application/vnd.kde.kspread -application/vnd.kde.kword -application/vnd.kenameaapp -application/vnd.koan -application/vnd.liberty-request+xml -application/vnd.llamagraphics.life-balance.desktop -application/vnd.llamagraphics.life-balance.exchange+xml -application/vnd.lotus-1-2-3 -application/vnd.lotus-approach -application/vnd.lotus-freelance -application/vnd.lotus-notes -application/vnd.lotus-organizer -application/vnd.lotus-screencam -application/vnd.lotus-wordpro -application/vnd.mcd -application/vnd.mediastation.cdkey -application/vnd.meridian-slingshot -application/vnd.micrografx.flo -application/vnd.micrografx.igx -application/vnd.mif mif -application/vnd.minisoft-hp3000-save -application/vnd.mitsubishi.misty-guard.trustweb -application/vnd.mobius.daf -application/vnd.mobius.dis -application/vnd.mobius.mbk -application/vnd.mobius.mqy -application/vnd.mobius.msl -application/vnd.mobius.plc -application/vnd.mobius.txf -application/vnd.mophun.application -application/vnd.mophun.certificate -application/vnd.motorola.flexsuite -application/vnd.motorola.flexsuite.adsi -application/vnd.motorola.flexsuite.fis -application/vnd.motorola.flexsuite.gotap -application/vnd.motorola.flexsuite.kmr -application/vnd.motorola.flexsuite.ttc -application/vnd.motorola.flexsuite.wem -application/vnd.mozilla.xul+xml xul -application/vnd.ms-artgalry -application/vnd.ms-asf -application/vnd.ms-excel xls -application/vnd.ms-lrm -application/vnd.ms-powerpoint ppt -application/vnd.ms-project -application/vnd.ms-tnef -application/vnd.ms-works -application/vnd.ms-wpl -application/vnd.mseq -application/vnd.msign -application/vnd.music-niff -application/vnd.musician -application/vnd.netfpx -application/vnd.noblenet-directory -application/vnd.noblenet-sealer -application/vnd.noblenet-web -application/vnd.novadigm.edm -application/vnd.novadigm.edx -application/vnd.novadigm.ext -application/vnd.obn -application/vnd.osa.netdeploy -application/vnd.palm -application/vnd.pg.format -application/vnd.pg.osasli -application/vnd.powerbuilder6 -application/vnd.powerbuilder6-s -application/vnd.powerbuilder7 -application/vnd.powerbuilder7-s -application/vnd.powerbuilder75 -application/vnd.powerbuilder75-s -application/vnd.previewsystems.box -application/vnd.publishare-delta-tree -application/vnd.pvi.ptid1 -application/vnd.pwg-multiplexed -application/vnd.pwg-xhtml-print+xml -application/vnd.quark.quarkxpress -application/vnd.rapid -application/vnd.s3sms -application/vnd.sealed.net -application/vnd.seemail -application/vnd.shana.informed.formdata -application/vnd.shana.informed.formtemplate -application/vnd.shana.informed.interchange -application/vnd.shana.informed.package -application/vnd.smaf -application/vnd.sss-cod -application/vnd.sss-dtf -application/vnd.sss-ntf -application/vnd.street-stream -application/vnd.svd -application/vnd.swiftview-ics -application/vnd.triscape.mxs -application/vnd.trueapp -application/vnd.truedoc -application/vnd.ufdl -application/vnd.uplanet.alert -application/vnd.uplanet.alert-wbxml -application/vnd.uplanet.bearer-choice -application/vnd.uplanet.bearer-choice-wbxml -application/vnd.uplanet.cacheop -application/vnd.uplanet.cacheop-wbxml -application/vnd.uplanet.channel -application/vnd.uplanet.channel-wbxml -application/vnd.uplanet.list -application/vnd.uplanet.list-wbxml -application/vnd.uplanet.listcmd -application/vnd.uplanet.listcmd-wbxml -application/vnd.uplanet.signal -application/vnd.vcx -application/vnd.vectorworks -application/vnd.vidsoft.vidconference -application/vnd.visio -application/vnd.visionary -application/vnd.vividence.scriptfile -application/vnd.vsf -application/vnd.wap.sic -application/vnd.wap.slc -application/vnd.wap.wbxml wbxml -application/vnd.wap.wmlc wmlc -application/vnd.wap.wmlscriptc wmlsc -application/vnd.webturbo -application/vnd.wrq-hp3000-labelled -application/vnd.wt.stf -application/vnd.wv.csp+wbxml -application/vnd.xara -application/vnd.xfdl -application/vnd.yamaha.hv-dic -application/vnd.yamaha.hv-script -application/vnd.yamaha.hv-voice -application/vnd.yellowriver-custom-menu -application/voicexml+xml vxml -application/watcherinfo+xml -application/whoispp-query -application/whoispp-response -application/wita -application/wordperfect5.1 -application/x-bcpio bcpio -application/x-cdlink vcd -application/x-chess-pgn pgn -application/x-compress -application/x-cpio cpio -application/x-csh csh -application/x-director dcr dir dxr -application/x-dvi dvi -application/x-futuresplash spl -application/x-gtar gtar -application/x-gzip -application/x-hdf hdf -application/x-javascript js -application/x-koan skp skd skt skm -application/x-latex latex -application/x-netcdf nc cdf -application/x-sh sh -application/x-shar shar -application/x-shockwave-flash swf -application/x-stuffit sit -application/x-sv4cpio sv4cpio -application/x-sv4crc sv4crc -application/x-tar tar -application/x-tcl tcl -application/x-tex tex -application/x-texinfo texinfo texi -application/x-troff t tr roff -application/x-troff-man man -application/x-troff-me me -application/x-troff-ms ms -application/x-ustar ustar -application/x-wais-source src -application/x400-bp -application/xhtml+xml xhtml xht -application/xslt+xml xslt -application/xml xml xsl -application/xml-dtd dtd -application/xml-external-parsed-entity -application/zip zip -audio/32kadpcm -audio/amr -audio/amr-wb -audio/basic au snd -audio/cn -audio/dat12 -audio/dsr-es201108 -audio/dvi4 -audio/evrc -audio/evrc0 -audio/g722 -audio/g.722.1 -audio/g723 -audio/g726-16 -audio/g726-24 -audio/g726-32 -audio/g726-40 -audio/g728 -audio/g729 -audio/g729D -audio/g729E -audio/gsm -audio/gsm-efr -audio/l8 -audio/l16 -audio/l20 -audio/l24 -audio/lpc -audio/midi mid midi kar -audio/mpa -audio/mpa-robust -audio/mp4a-latm -audio/mpeg mpga mp2 mp3 -audio/parityfec -audio/pcma -audio/pcmu -audio/prs.sid -audio/qcelp -audio/red -audio/smv -audio/smv0 -audio/telephone-event -audio/tone -audio/vdvi -audio/vnd.3gpp.iufp -audio/vnd.cisco.nse -audio/vnd.cns.anp1 -audio/vnd.cns.inf1 -audio/vnd.digital-winds -audio/vnd.everad.plj -audio/vnd.lucent.voice -audio/vnd.nortel.vbk -audio/vnd.nuera.ecelp4800 -audio/vnd.nuera.ecelp7470 -audio/vnd.nuera.ecelp9600 -audio/vnd.octel.sbc -audio/vnd.qcelp -audio/vnd.rhetorex.32kadpcm -audio/vnd.vmx.cvsd -audio/x-aiff aif aiff aifc -audio/x-alaw-basic -audio/x-mpegurl m3u -audio/x-pn-realaudio ram ra -audio/x-pn-realaudio-plugin -application/vnd.rn-realmedia rm -audio/x-wav wav -chemical/x-pdb pdb -chemical/x-xyz xyz -image/bmp bmp -image/cgm cgm -image/g3fax -image/gif gif -image/ief ief -image/jpeg jpeg jpg jpe -image/naplps -image/png png -image/prs.btif -image/prs.pti -image/svg+xml svg -image/t38 -image/tiff tiff tif -image/tiff-fx -image/vnd.cns.inf2 -image/vnd.djvu djvu djv -image/vnd.dwg -image/vnd.dxf -image/vnd.fastbidsheet -image/vnd.fpx -image/vnd.fst -image/vnd.fujixerox.edmics-mmr -image/vnd.fujixerox.edmics-rlc -image/vnd.globalgraphics.pgb -image/vnd.mix -image/vnd.ms-modi -image/vnd.net-fpx -image/vnd.svf -image/vnd.wap.wbmp wbmp -image/vnd.xiff -image/x-cmu-raster ras -image/x-icon ico -image/x-portable-anymap pnm -image/x-portable-bitmap pbm -image/x-portable-graymap pgm -image/x-portable-pixmap ppm -image/x-rgb rgb -image/x-xbitmap xbm -image/x-xpixmap xpm -image/x-xwindowdump xwd -message/delivery-status -message/disposition-notification -message/external-body -message/http -message/news -message/partial -message/rfc822 -message/s-http -message/sip -message/sipfrag -model/iges igs iges -model/mesh msh mesh silo -model/vnd.dwf -model/vnd.flatland.3dml -model/vnd.gdl -model/vnd.gs-gdl -model/vnd.gtw -model/vnd.mts -model/vnd.parasolid.transmit.binary -model/vnd.parasolid.transmit.text -model/vnd.vtu -model/vrml wrl vrml -multipart/alternative -multipart/appledouble -multipart/byteranges -multipart/digest -multipart/encrypted -multipart/form-data -multipart/header-set -multipart/mixed -multipart/parallel -multipart/related -multipart/report -multipart/signed -multipart/voice-message -text/calendar ics ifb -text/css css -text/directory -text/enriched -text/html html htm -text/parityfec -text/plain asc txt -text/prs.lines.tag -text/rfc822-headers -text/richtext rtx -text/rtf rtf -text/sgml sgml sgm -text/t140 -text/tab-separated-values tsv -text/uri-list -text/vnd.abc -text/vnd.curl -text/vnd.dmclientscript -text/vnd.fly -text/vnd.fmi.flexstor -text/vnd.in3d.3dml -text/vnd.in3d.spot -text/vnd.iptc.nitf -text/vnd.iptc.newsml -text/vnd.latex-z -text/vnd.motorola.reflex -text/vnd.ms-mediapackage -text/vnd.net2phone.commcenter.command -text/vnd.sun.j2me.app-descriptor -text/vnd.wap.si -text/vnd.wap.sl -text/vnd.wap.wml wml -text/vnd.wap.wmlscript wmls -text/x-setext etx -text/xml -text/xml-external-parsed-entity -video/bmpeg -video/bt656 -video/celb -video/dv -video/h261 -video/h263 -video/h263-1998 -video/h263-2000 -video/jpeg -video/mp1s -video/mp2p -video/mp2t -video/mp4v-es -video/mpv -video/mpeg mpeg mpg mpe -video/nv -video/parityfec -video/pointer -video/quicktime qt mov -video/smpte292m -video/vnd.fvt -video/vnd.motorola.video -video/vnd.motorola.videop -video/vnd.mpegurl mxu m4u -video/vnd.nokia.interleaved-multimedia -video/vnd.objectvideo -video/vnd.vivo -video/x-msvideo avi -video/x-sgi-movie movie -x-conference/x-cooltalk ice diff --git a/sca-cpp/trunk/samples/HttpdBigBank/httpserver/htdocs/index.html b/sca-cpp/trunk/samples/HttpdBigBank/httpserver/htdocs/index.html deleted file mode 100644 index 1bfb3e30c2..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/httpserver/htdocs/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - -

      It works!

      - diff --git a/sca-cpp/trunk/samples/HttpdBigBank/httpserver/startserver.bat b/sca-cpp/trunk/samples/HttpdBigBank/httpserver/startserver.bat deleted file mode 100644 index fe319248f5..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/httpserver/startserver.bat +++ /dev/null @@ -1,89 +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 APFULLDIR=%~d0%~p0 -echo Running from %APFULLDIR% - -if "%TUSCANY_SCACPP%" == "" ( -echo "TUSCANY_SCACPP not set" -goto end -) -echo Using SCA installed at %TUSCANY_SCACPP% - -if "%TUSCANY_SDOCPP%" == "" ( -echo "TUSCANY_SDOCPP not set" -goto end -) -echo Using SDO installed at %TUSCANY_SDOCPP% - -if "%AXIS2C_HOME%" == "" ( -echo "AXIS2C_HOME not set" -goto end -) -echo Using Axis2C installed at %AXIS2C_HOME% - -if "%HTTPD_HOME%" == "" ( -echo "HTTPD_HOME not set" -goto end -) -echo Using HTTPD installed at %HTTPD_HOME% - -set PATH=%TUSCANY_SCACPP%\extensions\sca\reference\bin;%TUSCANY_SCACPP%\extensions\sca\service\bin;%TUSCANY_SCACPP%\extensions\ws\reference\bin;%TUSCANY_SCACPP%\extensions\ws\service\bin;%TUSCANY_SCACPP%\extensions\ruby\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%HTTPD_HOME%\bin;%PATH% - -set TUSCANY_SCACPP_ROOT=%APFULLDIR%\..\ -set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -@REM Generate the mod_axis2 configuration -if not exist %APFULLDIR%\conf\mod_axis2.conf ( - echo LoadModule axis2_module %AXIS2C_HOME%\lib\mod_axis2.dll > %APFULLDIR%\conf\mod_axis2.conf - echo Axis2RepoPath %AXIS2C_HOME% >> %APFULLDIR%\conf\mod_axis2.conf - echo Axis2LogFile %AXIS2C_HOME%\logs\httpd.log >> %APFULLDIR%\conf\mod_axis2.conf - echo Axis2LogLevel AXIS2_LOG_LEVEL_DEBUG >> %APFULLDIR%\conf\mod_axis2.conf - echo ^ >> %APFULLDIR%\conf\mod_axis2.conf - echo SetHandler axis2_module >> %APFULLDIR%\conf\mod_axis2.conf - echo ^ >> %APFULLDIR%\conf\mod_axis2.conf -) - -@REM Generate the tuscany_sca_mod_rest configuration -@REM if not exist %APFULLDIR%\conf\tuscany_sca_mod_rest.conf ( -@REM echo LoadModule sca_rest_module %TUSCANY_SCACPP%/extensions/rest\service/bin/tuscany_sca_mod_rest.dll > %APFULLDIR%\conf\tuscany_sca_mod_rest.conf -@REM echo TuscanyHome %TUSCANY_SCACPP% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf -@REM echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf -@REM echo SetHandler sca_rest_module >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf -@REM echo TuscanyRoot %TUSCANY_SCACPP_ROOT% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf -@REM echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf -@REM ) - -@REM Generate the base HTTPD configuration -if not exist %APFULLDIR%\conf\base.conf ( - echo LoadModule mime_module %HTTPD_HOME%\modules\mod_mime.so > %APFULLDIR%\conf\base.conf - echo LoadModule dir_module %HTTPD_HOME%\modules\mod_dir.so >> %APFULLDIR%\conf\base.conf - echo DocumentRoot %APFULLDIR%\htdocs >> %APFULLDIR%\conf\base.conf -) - -@REM Create logs directory -if not exist %APFULLDIR%\logs mkdir %APFULLDIR%\logs -@rem set TUSCANY_SCACPP_LOG=%APFULLDIR%\logs\tuscany-server.log -set TUSCANY_SCACPP_LOGGING=9 - -@REM Start the HTTP server -echo Starting Apache httpd -httpd -X -d %APFULLDIR% diff --git a/sca-cpp/trunk/samples/HttpdBigBank/httpserver/startserver.sh b/sca-cpp/trunk/samples/HttpdBigBank/httpserver/startserver.sh deleted file mode 100755 index cca8472b75..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/httpserver/startserver.sh +++ /dev/null @@ -1,78 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -if [ x$AXIS2C_HOME = x ]; then -echo "AXIS2C_HOME not set" -exit; -fi -echo "Using Axis2C installed at $AXIS2C_HOME" - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/cpp/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ -export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -# Generate the mod_axis2 configuration -if [ ! -f conf/mod_axis2.conf ]; then - echo "LoadModule axis2_module $AXIS2C_HOME/lib/libmod_axis2.so.0.0.0" >conf/mod_axis2.conf - echo "Axis2RepoPath $AXIS2C_HOME" >>conf/mod_axis2.conf - echo "Axis2LogFile $AXIS2C_HOME/logs/httpd.log" >>conf/mod_axis2.conf - echo "Axis2LogLevel AXIS2_LOG_LEVEL_INFO" >>conf/mod_axis2.conf - echo "" >>conf/mod_axis2.conf - echo " SetHandler axis2_module" >>conf/mod_axis2.conf - echo "" >>conf/mod_axis2.conf -fi - -# Generate the mod_rest configuration -if [ ! -f conf/tuscany_sca_mod_rest.conf ]; then - echo "LoadModule sca_rest_module $TUSCANY_SCACPP/extensions/rest/service/lib/libtuscany_sca_mod_rest.so.0.0.0" >conf/tuscany_sca_mod_rest.conf - echo "TuscanyHome $TUSCANY_SCACPP" >>conf/tuscany_sca_mod_rest.conf - echo "" >>conf/tuscany_sca_mod_rest.conf - echo " SetHandler sca_rest_module" >>conf/tuscany_sca_mod_rest.conf - echo " TuscanyRoot $TUSCANY_SCACPP_ROOT" >>conf/tuscany_sca_mod_rest.conf - echo "" >>conf/tuscany_sca_mod_rest.conf -fi - -# Generate the HTTPD base configuration -if [ ! -f conf/base.conf ]; then - echo "DocumentRoot $APFULLDIR/htdocs" >conf/base.conf -fi - -# Create logs directory -if [ ! -d logs ]; then - mkdir logs -fi - -# Start the HTTP server -echo "Starting Apache httpd" -apachectl -k start -d $APFULLDIR diff --git a/sca-cpp/trunk/samples/HttpdBigBank/httpserver/stopserver.sh b/sca-cpp/trunk/samples/HttpdBigBank/httpserver/stopserver.sh deleted file mode 100755 index c17f632a3e..0000000000 --- a/sca-cpp/trunk/samples/HttpdBigBank/httpserver/stopserver.sh +++ /dev/null @@ -1,25 +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` - -# Stop the HTTP server -echo "Stopping Apache httpd" -apachectl -k stop -d $APFULLDIR - diff --git a/sca-cpp/trunk/samples/INSTALL b/sca-cpp/trunk/samples/INSTALL deleted file mode 100644 index 3d7155367d..0000000000 --- a/sca-cpp/trunk/samples/INSTALL +++ /dev/null @@ -1,2 +0,0 @@ -Please read the GettingStarted.html document for information on -building, installing and running Tuscany SCA for C++ Samples \ No newline at end of file diff --git a/sca-cpp/trunk/samples/LICENSE b/sca-cpp/trunk/samples/LICENSE deleted file mode 100755 index f433b1a53f..0000000000 --- a/sca-cpp/trunk/samples/LICENSE +++ /dev/null @@ -1,177 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/sca-cpp/trunk/samples/Makefile.am b/sca-cpp/trunk/samples/Makefile.am deleted file mode 100644 index 0fdf524cc1..0000000000 --- a/sca-cpp/trunk/samples/Makefile.am +++ /dev/null @@ -1,40 +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_SAMPLES - CPP_SAMPLES = CppCalculator CppBigBank - PYTHON_SAMPLES = PythonCalculator PythonWeatherForecast RestCustomer AlertAggregator - RUBY_SAMPLES = RubyCalculator RubyBigBank HttpdBigBank RestCalculator - PYTHON_RUBY_SAMPLES = RestYahoo -else -if WANT_CPP_SAMPLES - CPP_SAMPLES = CppCalculator CppBigBank -endif -if WANT_PYTHON_SAMPLES - PYTHON_SAMPLES = PythonCalculator PythonWeatherForecast RestCustomer AlertAggregator -if WANT_RUBY_SAMPLES - PYTHON_RUBY_SAMPLES = RestYahoo -endif -endif -if WANT_RUBY_SAMPLES - RUBY_SAMPLES = RubyCalculator RubyBigBank HttpdBigBank RestCalculator -endif -endif -SUBDIRS = ${CPP_SAMPLES} ${PYTHON_SAMPLES} ${RUBY_SAMPLES} ${PYTHON_RUBY_SAMPLES} - -EXTRA_DIST = autogen.sh build.sh GettingStarted.html - diff --git a/sca-cpp/trunk/samples/NEWS b/sca-cpp/trunk/samples/NEWS deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/sca-cpp/trunk/samples/NOTICE b/sca-cpp/trunk/samples/NOTICE deleted file mode 100644 index 44befbee63..0000000000 --- a/sca-cpp/trunk/samples/NOTICE +++ /dev/null @@ -1,5 +0,0 @@ -Apache Tuscany SCA Native -Copyright 2005, 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/) \ No newline at end of file diff --git a/sca-cpp/trunk/samples/PHPCalculator/Makefile.am b/sca-cpp/trunk/samples/PHPCalculator/Makefile.am deleted file mode 100644 index 3277f97e6e..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/Makefile.am +++ /dev/null @@ -1,22 +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. - -deploydir=$(prefix)/PHPCalculator/deploy -# SUBDIRS = sample.calculator sample.calculator.client -SUBDIRS = sample.calculator -EXTRA_DIST = *.composite -deploy_DATA = *.composite diff --git a/sca-cpp/trunk/samples/PHPCalculator/README b/sca-cpp/trunk/samples/PHPCalculator/README deleted file mode 100644 index d91c958763..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/README +++ /dev/null @@ -1,122 +0,0 @@ -Tuscany SCA for C++ Samples - PHP Calculator Sample -=================================================== - -This is a simple sample to show how an SCA composite can wire together -a number of components to implement a Calculator service and expose that service as -to a number of different tpyes of client. The sample components are implemented in various -ways to demonstrate the different features of the PHP SCA extension. - -There are three sub projects in this workspace: - - sample.calculator - This contains the source code and SCDL artifacts for the SCA Calculator - composite implementing the sample Calculator - - - sample.calculator.client - A sample client which does a local call to the Calculator service - - - sample.calculator.wsclient - A sample PHP SCA Web Service client which calls the Calculator Web service. - -Additionally, there is the sample.calculator.app.composite file. This -describes the configuration of the SCA Calculator composite deployed to the -SCA runtime. - -(See the README.html file for instructions to build and run this sample - TODO) - -The file phpcalculator.png is a picture of the sample. Given the restrictions on the -current PHP extension (see TODOs in the PHP Extension README) some parts of this -have not been tested yet. - -The path that has been tested is as follows: - -Local CPP client -> CPP Calculator -> PHP Divide -> PHP Add ------> PHP Log - |-------> PHP Subtract -> PHP Log - |-------> PHP Multiple -> PHP Log - |-------> PHP Divide ---> PHP Log - -The local CPP client is used because - - the work to enable PHP to host SCA is not done yet - - running with the axis service causes missing symbols errors on my box - -The CPP Calculator component is used because - - The local CPP client can only talk directly to a CPP component - -To run the sample in this configuration use the CalculatorClient.cpp found in the -sample.calculator.client directory - -Windows -======= - -Hasn't yet been tests on windows in this configuration so ignore the following - -I use the following bat file to start the stand alone axis server and include -appropriate references to PHP dependencies. This needs turning into a proper -run script but I haven't got to this yet - -set TUSCANY_SCACPP_LOGGING=9 -set AXIS2C_HOME=C:\axis2c-bin-0.95-win32 -set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%TUSCANY_SCACPP%\extensions\php\bin;%AXIS2C_HOME%\lib;c:\libxml2-2.6.23.win32\bin;c:\apps\iconv-1.9.1.win32\bin;c:\apps\zlib-1.2.3.win32\bin;C:\php-5.2.0\ -set TUSCANY_SCACPP_ROOT=%TUSCANY_SCACPP%\samples\PHPCalculator -rem set TUSCANY_SCACPP_DEFAULT_COMPONENT=sample.calculator.CalculatorComponent - -%AXIS2C_HOME%\bin\axis2_http_server.exe -l 9 - -I then - -cd %TUSCANY_SCACPP%\samples\PHPCalculator\samples.calculator.wsclient -runwsclient.bat - -This has the effect of runing a PHP/SCA client (no C++ SCA content at all) -to generate a web service request to the C++ SCA runtime hosting the calculator -application. - -Currently this doesn't run all the way through due to a WSDL bug in PHP SCA -(http://pecl.php.net/bugs/bug.php?id=9572). But it gets 99% of the way there. -You will see the server doing all of its stuff and returning the correct result. - -Linux -===== - -I find the following environment variables useful when running PHP embedded inside of -Tuscany SCA. - -# the library path use to locate shared libraries -export LD_LIBRARY_PATH=$LIBXML2_LIB:\ -$AXIS2C_HOME/lib:\ -$PHP_LIB:\ -$TUSCANY_SDOCPP/lib:\ -$TUSCANY_SCACPP/lib:\ -$TUSCANY_SCACPP/extensions/cpp/lib:\ -$TUSCANY_SCACPP/extensions/php/lib:\ -$TUSCANY_SCACPP/extensions/ws/lib:\ -$TUSCANY_SCACPP/samples/PHPCalculator/deploy/sample.calculator:\ -$PHP_SCA_SDO_LIB - -# tell PHP specifically where to find php.ini rather than relying on the default -set PHPRC=/usr/local/lib - -# tell Tuscany SCA which composite appplication to run -export TUSCANY_SCACPP_ROOT=/usr/local/tuscany/cpp/sca/deploy/samples/PHPCalculator - -# tell Tuscany SCA which is the default component in this composite -export TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent - -# turn on logging so you can see what's going on -export TUSCANY_SCACPP_LOGGING=9 - -There is an env.sh file that can be edited and used to set your environment. One edited -to reflect your environment do: - -source env.sh - -The CPP client currently has an independent Makefile due to build problems with the automake -build on my box. If you have your environment configured as above you should be able to do: - -make - -This will produce a.out which can be run using the provided script. - -runclient_cpp.sh - - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/phpcalculator.png b/sca-cpp/trunk/samples/PHPCalculator/phpcalculator.png deleted file mode 100644 index c251364548..0000000000 Binary files a/sca-cpp/trunk/samples/PHPCalculator/phpcalculator.png and /dev/null differ diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.app.composite b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.app.composite deleted file mode 100644 index 1450ad687b..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.app.composite +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/CalculatorClient.cpp b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/CalculatorClient.cpp deleted file mode 100644 index e72b52f87e..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/CalculatorClient.cpp +++ /dev/null @@ -1,61 +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 - -#include - -#include - -#include "commonj/sdo/SDO.h" - -#include "osoa/sca/sca.h" - -#include "Calculator.h" - - -using namespace std; -using namespace commonj::sdo; -using namespace osoa::sca; - - -int main (int argc, char** argv) -{ - - try - { - CompositeContext myContext = CompositeContext::getCurrent(); - Calculator *calcService = (Calculator*) myContext.locateService("CalculatorCPPComponent/CalculatorService"); - float result = calcService->div(10, 2); - cout << "calculator_client: div(10,2) = " << result << endl; - } - catch (...) - { - printf("Got and exception"); - } - - return 0; -} diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/CalculatorClient.php b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/CalculatorClient.php deleted file mode 100644 index 7a512260ae..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/CalculatorClient.php +++ /dev/null @@ -1,32 +0,0 @@ -add(1.23, 4.56) . "\n"; -echo "sub(1.23, 4.56) = " . $service->sub(1.23, 4.56) . "\n"; -echo "mul(1.23, 4.56) = " . $service->mul(1.23, 4.56) . "\n"; -echo "div(1.23, 4.56) = " . $service->div(1.23, 4.56) . "\n"; - -?> diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/env.sh b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/env.sh deleted file mode 100755 index de34f1b42a..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/env.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# 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. - -export AXIS2C_HOME=/home/slaws/apps/axis2c-bin-0.96-linux - -export LIBXML2_LIB=/usr/lib -export LIBXML2_INCLUDE=/usr/include/libxml2 - -export PHP_LIB=/usr/local/lib -export PHP_INCLUDE=/usr/local/include/php - -export PHP_SCA_SDO_INCLUDE=/home/slaws/phpbuild-5-2/pecl/SDO -export PHP_SCA_SDO_LIB=$PHP_LIB/php/extensions/no-debug-zts-20060613/ - -export TUSCANY_SDOCPP=/sdo/deploy -export TUSCANY_SCACPP=/usr/local/tuscany/cpp/sca/deploy - -export LD_LIBRARY_PATH=$LIBXML2_LIB:\ -$AXIS2C_HOME/lib:\ -$PHP_LIB:\ -$TUSCANY_SDOCPP/lib:\ -$TUSCANY_SCACPP/lib:\ -$TUSCANY_SCACPP/extensions/cpp/lib:\ -$TUSCANY_SCACPP/extensions/php/lib:\ -$TUSCANY_SCACPP/extensions/ws/lib:\ -$TUSCANY_SCACPP/samples/PHPCalculator/deploy/sample.calculator:\ -$PHP_SCA_SDO_LIB - -export TUSCANY_SCACPP_LOGGING=9 -export TUSCANY_SCACPP_ROOT=/usr/local/tuscany/cpp/sca/deploy/samples/PHPCalculator - -export PATH=.:$PATH diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/runclient_cpp.bat b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/runclient_cpp.bat deleted file mode 100644 index 0493d7410d..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/runclient_cpp.bat +++ /dev/null @@ -1,26 +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. - -set TUSCANY_SCACPP_ROOT=%TUSCANY_SCACPP%\samples\PHPCalculator\deploy -set TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent -set TUSCANY_SCACPP_LOGGING=9 -set PHRC=C:\simon\Projects\Tuscany\php\php-5.2.0\Debug_TS - -calculator_client.exe - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/runclient_cpp.sh b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/runclient_cpp.sh deleted file mode 100755 index 85a472b7fb..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/runclient_cpp.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# 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. - -export TUSCANY_SCACPP_ROOT=/usr/local/tuscany/cpp/sca/deploy/samples/PHPCalculator -export TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent - -a.out -# gdb a.out -# strace a.out &> strace.txt -# valgrind a.out diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/runclient_php.bat b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/runclient_php.bat deleted file mode 100644 index 815c4fb58e..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.client/runclient_php.bat +++ /dev/null @@ -1,25 +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 - -php TuscanyTest.php - -:end -endlocal diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.wsclient/Calculator.wsdl b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.wsclient/Calculator.wsdl deleted file mode 100644 index 4d6904b687..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.wsclient/Calculator.wsdl +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.wsclient/CalculatorWSClient.php b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.wsclient/CalculatorWSClient.php deleted file mode 100644 index 82faf1ef19..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.wsclient/CalculatorWSClient.php +++ /dev/null @@ -1,31 +0,0 @@ -add(1.23, 4.56) . "\n"; -//echo "sub(1.23, 4.56) = " . $service->sub(1.23, 4.56) . "\n"; -//echo "mul(1.23, 4.56) = " . $service->mul(1.23, 4.56) . "\n"; -echo "div(1.23, 4.56) = " . $service->div(1.23, 4.56) . "\n"; - -?> diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.wsclient/runwsclient.bat b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.wsclient/runwsclient.bat deleted file mode 100644 index a1482be5db..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator.wsclient/runwsclient.bat +++ /dev/null @@ -1,25 +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 - -php CalculatorWSClient.php - -:end -endlocal diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Add.componentType b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Add.componentType deleted file mode 100644 index aca0b2a6e4..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Add.componentType +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Add.h b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Add.h deleted file mode 100644 index 4abfe9af6b..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Add.h +++ /dev/null @@ -1,34 +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 sample_add_h -#define sample_add_h - -class Add -{ - public: - virtual float add(float num1, float num2) = 0; -}; - -#endif // sample_add_h - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Add.php b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Add.php deleted file mode 100644 index 4b5747e10f..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Add.php +++ /dev/null @@ -1,32 +0,0 @@ -log_message($result); - -echo $result; -?> diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Calculator.componentType b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Calculator.componentType deleted file mode 100644 index 7767c663bf..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Calculator.componentType +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Calculator.h b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Calculator.h deleted file mode 100644 index 90e97b5319..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Calculator.h +++ /dev/null @@ -1,34 +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 sample_calculator_h -#define sample_calculator_h - -class Calculator -{ -public: - virtual float add(float arg1, float arg2) = 0; - virtual float sub(float arg1, float arg2) = 0; - virtual float mul(float arg1, float arg2) = 0; - virtual float div(float arg1, float arg2) = 0; -}; - -#endif // sample_calculator_h diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Calculator.php b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Calculator.php deleted file mode 100644 index ce8f7899da..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Calculator.php +++ /dev/null @@ -1,97 +0,0 @@ -mul_service->add($num1, $num2); - } - - /** - * Subtraction - * - * @param float $num1 (the first number) - * @param float $num2 (the second number) - * @return float The result - */ - function sub($num1, $num2) { - return $this->mul_service->sub($num1, $num2); - } - - /** - * Multiplication - * - * @param float $num1 (the first number) - * @param float $num2 (the second number) - * @return float The result - */ - function mul($num1, $num2) { - return $this->mul_service->mul($num1, $num2); - } - - /** - * Division - * - * @param float $num1 (the first number) - * @param float $num2 (the second number) - * @return float The result - */ - function div($num1, $num2) { - return $this->div_service->div($num1, $num2); - } -} - -?> diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Calculator.wsdl b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Calculator.wsdl deleted file mode 100644 index 331b996ba2..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Calculator.wsdl +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl.componentType b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl.componentType deleted file mode 100644 index e2799af955..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl.componentType +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl.cpp b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl.cpp deleted file mode 100644 index 2d880de72d..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl.cpp +++ /dev/null @@ -1,90 +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 "osoa/sca/ComponentContext.h" -#include "osoa/sca/ServiceRuntimeException.h" - -#include "CalculatorImpl.h" -#include "Divide.h" - -CalculatorImpl::CalculatorImpl() -{ -} - -CalculatorImpl::~CalculatorImpl() -{ -} - -// Calculator interface -float CalculatorImpl::add(float arg1, float arg2) -{ - float result = arg1 + arg2; - - printf("CalculatorImpl::add %f + %f = %f\n", arg1, arg2, result); - return result; -} - -float CalculatorImpl::sub(float arg1, float arg2) -{ - float result = arg1 - arg2; - printf("CalculatorImpl::sub %f - %f = %f\n", arg1, arg2, result); - return result; -} - -float CalculatorImpl::mul(float arg1, float arg2) -{ - float result = arg1 * arg2; - printf("CalculatorImpl::mul %f * %f = %f\n", arg1, arg2, result); - return result; -} - -float CalculatorImpl::div(float arg1, float arg2) -{ - float result = 0; - - // This method shows how to invoke a service on a different component from within a component - - // First, get the current ComponentContext - osoa::sca::ComponentContext myContext = osoa::sca::ComponentContext::getCurrent(); - - try - { - // Find the required service, as referenced in CalculatorImpl.componentType - Divide* divideService = (Divide*)myContext.getService("divideService"); - - // Finally, invoke the service - result = divideService->div(arg1, arg2); - - printf("CalculatorImpl::div Divide returned result: %f\n", result); - - } - catch (osoa::sca::ServiceRuntimeException& e) - { - // Print out error message and carry on - printf("CalculatorImpl::div Error whilst invoking Divide: %s", e.getMessageText()); - } - - return result; -} - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl.h b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl.h deleted file mode 100644 index af8a5eeab1..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl.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 sample_calculatorimpl_h -#define sample_calculatorimpl_h - -#include "Calculator.h" - -class CalculatorImpl : public Calculator -{ -public: - CalculatorImpl(); - virtual ~CalculatorImpl(); - - // Calculator interface - virtual float add(float arg1, float arg2); - virtual float sub(float arg1, float arg2); - virtual float mul(float arg1, float arg2); - virtual float div(float arg1, float arg2); -}; - -#endif // sample_calculatorimpl_h - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.cpp b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.cpp deleted file mode 100644 index 084e6fbf2f..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.cpp +++ /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. - */ - -#include "CalculatorImpl_CalculatorService_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CalculatorImpl_CalculatorService_Proxy* CalculatorImpl_CalculatorService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new CalculatorImpl_CalculatorService_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void CalculatorImpl_CalculatorService_Proxy_Destructor(void* proxy) - { - delete (CalculatorImpl_CalculatorService_Proxy*)proxy; - } -} - -CalculatorImpl_CalculatorService_Proxy::CalculatorImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -CalculatorImpl_CalculatorService_Proxy::~CalculatorImpl_CalculatorService_Proxy() -{ - if (target) - delete target; -} - -float CalculatorImpl_CalculatorService_Proxy::add( float arg0, float arg1) -{ - tuscany::sca::Operation operation("add"); - operation.addParameter("arg1", &arg0); - operation.addParameter("arg2", &arg1); - float ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(float*)operation.getReturnValue(); -} - -float CalculatorImpl_CalculatorService_Proxy::sub( float arg0, float arg1) -{ - tuscany::sca::Operation operation("sub"); - operation.addParameter("arg1", &arg0); - operation.addParameter("arg2", &arg1); - float ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(float*)operation.getReturnValue(); -} - -float CalculatorImpl_CalculatorService_Proxy::mul( float arg0, float arg1) -{ - tuscany::sca::Operation operation("mul"); - operation.addParameter("arg1", &arg0); - operation.addParameter("arg2", &arg1); - float ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(float*)operation.getReturnValue(); -} - -float CalculatorImpl_CalculatorService_Proxy::div( float arg0, float arg1) -{ - tuscany::sca::Operation operation("div"); - operation.addParameter("arg1", &arg0); - operation.addParameter("arg2", &arg1); - float ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(float*)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.h b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.h deleted file mode 100644 index 700a060636..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.h +++ /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. - */ - -#ifndef CalculatorImpl_CalculatorService_Proxy_h -#define CalculatorImpl_CalculatorService_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "Calculator.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class CalculatorImpl_CalculatorService_Proxy : public Calculator -{ -public: - CalculatorImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~CalculatorImpl_CalculatorService_Proxy(); - virtual float add( float arg1, float arg2); - virtual float sub( float arg1, float arg2); - virtual float mul( float arg1, float arg2); - virtual float div( float arg1, float arg2); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // CalculatorImpl_CalculatorService_Proxy_h - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.cpp b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.cpp deleted file mode 100644 index 82114b4d6d..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.cpp +++ /dev/null @@ -1,135 +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. - */ - -#include "CalculatorImpl_CalculatorService_Wrapper.h" - -#include "osoa/sca/sca.h" - - - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CalculatorImpl_CalculatorService_Wrapper* CalculatorImpl_CalculatorService_Wrapper_Factory(tuscany::sca::model::Service* target) - { - return new CalculatorImpl_CalculatorService_Wrapper(target); - } -} - -CalculatorImpl_CalculatorService_Wrapper::CalculatorImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) -{ - impl = (CalculatorImpl*)getImplementation(); -} - -CalculatorImpl_CalculatorService_Wrapper::~CalculatorImpl_CalculatorService_Wrapper() -{ - releaseImplementation(); -} - -void* CalculatorImpl_CalculatorService_Wrapper::newImplementation() -{ - return new CalculatorImpl; -} - -void CalculatorImpl_CalculatorService_Wrapper::deleteImplementation() -{ - delete impl; -} - -void CalculatorImpl_CalculatorService_Wrapper::invokeService(tuscany::sca::Operation& operation) -{ - const std::string& operationName = operation.getName(); - - if (operationName == "add") - { - float& p0 = *( float*)operation.getParameterValue(0); - float& p1 = *( float*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(float*)operation.getReturnValue() = impl->add(p0, p1); - } - else - { - float* ret = new float; - *ret = impl->add(p0, p1); - operation.setReturnValue((const float*)ret); - } - return; - } - if (operationName == "sub") - { - float& p0 = *( float*)operation.getParameterValue(0); - float& p1 = *( float*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(float*)operation.getReturnValue() = impl->sub(p0, p1); - } - else - { - float* ret = new float; - *ret = impl->sub(p0, p1); - operation.setReturnValue((const float*)ret); - } - return; - } - if (operationName == "mul") - { - float& p0 = *( float*)operation.getParameterValue(0); - float& p1 = *( float*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(float*)operation.getReturnValue() = impl->mul(p0, p1); - } - else - { - float* ret = new float; - *ret = impl->mul(p0, p1); - operation.setReturnValue((const float*)ret); - } - return; - } - if (operationName == "div") - { - float& p0 = *( float*)operation.getParameterValue(0); - float& p1 = *( float*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(float*)operation.getReturnValue() = impl->div(p0, p1); - } - else - { - float* ret = new float; - *ret = impl->div(p0, p1); - operation.setReturnValue((const float*)ret); - } - return; - } - - - throw osoa::sca::ServiceRuntimeException("Invalid operation"); - -} - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.h b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.h deleted file mode 100644 index 63bae2f75c..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.h +++ /dev/null @@ -1,43 +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. - */ - -#ifndef CalculatorImpl_CalculatorService_Wrapper_h -#define CalculatorImpl_CalculatorService_Wrapper_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "CalculatorImpl.h" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -class CalculatorImpl_CalculatorService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper -{ -public: - CalculatorImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target); - virtual ~CalculatorImpl_CalculatorService_Wrapper(); - virtual void invokeService(tuscany::sca::Operation& operation); - virtual void* newImplementation(); - virtual void deleteImplementation(); -private: - CalculatorImpl* impl; -}; - -#endif // CalculatorImpl_CalculatorService_Wrapper_h - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.cpp b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.cpp deleted file mode 100644 index 510069c331..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.cpp +++ /dev/null @@ -1,65 +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. - */ - -#include "CalculatorImpl_divideService_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - CalculatorImpl_divideService_Proxy* CalculatorImpl_divideService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new CalculatorImpl_divideService_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void CalculatorImpl_divideService_Proxy_Destructor(void* proxy) - { - delete (CalculatorImpl_divideService_Proxy*)proxy; - } -} - -CalculatorImpl_divideService_Proxy::CalculatorImpl_divideService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -CalculatorImpl_divideService_Proxy::~CalculatorImpl_divideService_Proxy() -{ - if (target) - delete target; -} - -float CalculatorImpl_divideService_Proxy::div( float arg0, float arg1) -{ - tuscany::sca::Operation operation("div"); - operation.addParameter("num1", &arg0); - operation.addParameter("num2", &arg1); - float ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(float*)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.h b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.h deleted file mode 100644 index 0459e70f33..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.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. - */ - -#ifndef CalculatorImpl_divideService_Proxy_h -#define CalculatorImpl_divideService_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "Divide.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class CalculatorImpl_divideService_Proxy : public Divide -{ -public: - CalculatorImpl_divideService_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~CalculatorImpl_divideService_Proxy(); - virtual float div( float num1, float num2); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // CalculatorImpl_divideService_Proxy_h - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Divide.componentType b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Divide.componentType deleted file mode 100644 index 428d19f8bc..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Divide.componentType +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Divide.h b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Divide.h deleted file mode 100644 index c2ab3b816c..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Divide.h +++ /dev/null @@ -1,34 +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 sample_divide_h -#define sample_divide_h - -class Divide -{ - public: - virtual float div(float num1, float num2) = 0; -}; - -#endif // sample_divide_h - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Divide.php b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Divide.php deleted file mode 100644 index c2e9adda70..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Divide.php +++ /dev/null @@ -1,71 +0,0 @@ -add_service->add(12.0, 27.0); - //$this->subtract_service->sub(12.0, 27.0); - $this->multiply_service->mul(12.0, 27.0); - - $result = $this->another_divide->div($num1, $num2); - - return $result; - } - -} - -?> diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl.componentType b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl.componentType deleted file mode 100644 index d7369e3ff0..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl.componentType +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl.cpp b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl.cpp deleted file mode 100644 index 88b9065171..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl.cpp +++ /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. - */ - -/* $Rev$ $Date$ */ - -#include - -#include "DivideImpl.h" - -DivideImpl::DivideImpl() -{ -} - -DivideImpl::~DivideImpl() -{ -} - -// Divide interface -float DivideImpl::div(float arg1, float arg2) -{ - if(arg2 == 0.0) - { - printf("DivideImpl::div %f / %f !! Cannot divide by zero, so returning 0\n", arg1, arg2); - return 0; - } - - float result = arg1 / arg2; - printf("DivideImpl::div %f / %f = %f\n", arg1, arg2, result); - return result; -} - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl.h b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl.h deleted file mode 100644 index 42cf47b1d4..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl.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 sample_divideimpl_h -#define sample_divideimpl_h - -#include "Divide.h" - -class DivideImpl : public Divide -{ -public: - DivideImpl(); - virtual ~DivideImpl(); - - // Divide interface - virtual float div(float arg1, float arg2); -}; - -#endif // sample_divideimpl_h - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.cpp b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.cpp deleted file mode 100644 index e8dbeb2e0d..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.cpp +++ /dev/null @@ -1,65 +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. - */ - -#include "DivideImpl_DivideService_Proxy.h" - -#include "osoa/sca/sca.h" - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - DivideImpl_DivideService_Proxy* DivideImpl_DivideService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) - { - return new DivideImpl_DivideService_Proxy(target); - } - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - void DivideImpl_DivideService_Proxy_Destructor(void* proxy) - { - delete (DivideImpl_DivideService_Proxy*)proxy; - } -} - -DivideImpl_DivideService_Proxy::DivideImpl_DivideService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) -{ -} - -DivideImpl_DivideService_Proxy::~DivideImpl_DivideService_Proxy() -{ - if (target) - delete target; -} - -float DivideImpl_DivideService_Proxy::div( float arg0, float arg1) -{ - tuscany::sca::Operation operation("div"); - operation.addParameter("num1", &arg0); - operation.addParameter("num2", &arg1); - float ret; - operation.setReturnValue(&ret); - target->invoke(operation); - return *(float*)operation.getReturnValue(); -} - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.h b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.h deleted file mode 100644 index d66cde1c06..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.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. - */ - -#ifndef DivideImpl_DivideService_Proxy_h -#define DivideImpl_DivideService_Proxy_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "Divide.h" -#include "tuscany/sca/core/ServiceWrapper.h" - -class DivideImpl_DivideService_Proxy : public Divide -{ -public: - DivideImpl_DivideService_Proxy(tuscany::sca::ServiceWrapper*); - virtual ~DivideImpl_DivideService_Proxy(); - virtual float div( float num1, float num2); -private: - tuscany::sca::ServiceWrapper* target; -}; - -#endif // DivideImpl_DivideService_Proxy_h - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.cpp b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.cpp deleted file mode 100644 index 9c6f2101fe..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.cpp +++ /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. - */ - -#include "DivideImpl_DivideService_Wrapper.h" - -#include "osoa/sca/sca.h" - - - -extern "C" -{ - - #if defined(WIN32) || defined(_WINDOWS) - __declspec(dllexport) - #endif - DivideImpl_DivideService_Wrapper* DivideImpl_DivideService_Wrapper_Factory(tuscany::sca::model::Service* target) - { - return new DivideImpl_DivideService_Wrapper(target); - } -} - -DivideImpl_DivideService_Wrapper::DivideImpl_DivideService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) -{ - impl = (DivideImpl*)getImplementation(); -} - -DivideImpl_DivideService_Wrapper::~DivideImpl_DivideService_Wrapper() -{ - releaseImplementation(); -} - -void* DivideImpl_DivideService_Wrapper::newImplementation() -{ - return new DivideImpl; -} - -void DivideImpl_DivideService_Wrapper::deleteImplementation() -{ - delete impl; -} - -void DivideImpl_DivideService_Wrapper::invokeService(tuscany::sca::Operation& operation) -{ - const std::string& operationName = operation.getName(); - - if (operationName == "div") - { - float& p0 = *( float*)operation.getParameterValue(0); - float& p1 = *( float*)operation.getParameterValue(1); - - if(operation.getReturnValue() != NULL) - { - *(float*)operation.getReturnValue() = impl->div(p0, p1); - } - else - { - float* ret = new float; - *ret = impl->div(p0, p1); - operation.setReturnValue((const float*)ret); - } - return; - } - - - throw osoa::sca::ServiceRuntimeException("Invalid operation"); - -} - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.h b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.h deleted file mode 100644 index 5cd10f5188..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.h +++ /dev/null @@ -1,43 +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. - */ - -#ifndef DivideImpl_DivideService_Wrapper_h -#define DivideImpl_DivideService_Wrapper_h - -#if defined(WIN32) || defined (_WINDOWS) -#pragma warning(disable: 4786) -#endif - -#include "DivideImpl.h" -#include "tuscany/sca/cpp/CPPServiceWrapper.h" - -class DivideImpl_DivideService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper -{ -public: - DivideImpl_DivideService_Wrapper(tuscany::sca::model::Service* target); - virtual ~DivideImpl_DivideService_Wrapper(); - virtual void invokeService(tuscany::sca::Operation& operation); - virtual void* newImplementation(); - virtual void deleteImplementation(); -private: - DivideImpl* impl; -}; - -#endif // DivideImpl_DivideService_Wrapper_h - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Log.componentType b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Log.componentType deleted file mode 100644 index 0b4423300d..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Log.componentType +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Log.h b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Log.h deleted file mode 100644 index c21da1bddf..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Log.h +++ /dev/null @@ -1,34 +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 sample_log_h -#define sample_log_h - -class Log -{ - public: - virtual void div(char *message) = 0; -}; - -#endif // sample_log_h - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Log.php b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Log.php deleted file mode 100644 index 0a955f36d3..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Log.php +++ /dev/null @@ -1,36 +0,0 @@ -toLog('>>> ' . $message); - } -} - -?> diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Makefile.am b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Makefile.am deleted file mode 100644 index 84567a5add..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Makefile.am +++ /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. - -deploydir=$(prefix)/PHPCalculator/deploy -compositedir=$(deploydir)/sample.calculator - -BUILT_SOURCES = scagen - -noinst_HEADERS = *.h - -scagen: - java -jar $(TUSCANY_SCACPP)/bin/scagen.jar -dir . -output . - -composite_SCRIPTS = runwsserver.sh - -composite_LTLIBRARIES = libCalculator.la -composite_DATA = *.composite *.componentType *.wsdl *.php -EXTRA_DIST = *.composite *.componentType *.wsdl *.php runwsserver.sh - -dist_libCalculator_la_SOURCES = \ -CalculatorImpl.cpp \ -DivideImpl.cpp - -nodist_libCalculator_la_SOURCES = \ -CalculatorImpl_CalculatorService_Proxy.cpp \ -CalculatorImpl_CalculatorService_Wrapper.cpp \ -CalculatorImpl_divideService_Proxy.cpp \ -DivideImpl_DivideService_Proxy.cpp \ -DivideImpl_DivideService_Wrapper.cpp - - -libCalculator_la_LIBADD = \ --L${TUSCANY_SCACPP}/lib \ - -ltuscany_sca \ --L${TUSCANY_SCACPP}/extensions/cpp/lib \ - -ltuscany_sca_cpp - -INCLUDES = \ --I$(TUSCANY_SCACPP)/extensions/cpp/include \ --I$(TUSCANY_SCACPP)/include \ --I${TUSCANY_SDOCPP}/include - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Multiply.componentType b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Multiply.componentType deleted file mode 100644 index af1631518a..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Multiply.componentType +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Multiply.h b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Multiply.h deleted file mode 100644 index 94de825f62..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Multiply.h +++ /dev/null @@ -1,34 +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 sample_multiply_h -#define sample_multiply_h - -class Multiply -{ - public: - virtual float mul(float num1, float num2) = 0; -}; - -#endif // sample_multiply_h - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Multiply.php b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Multiply.php deleted file mode 100644 index 8ffe02675d..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Multiply.php +++ /dev/null @@ -1,33 +0,0 @@ -log_message($result); - - return $result; - } -} - -?> diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Subtract.componentType b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Subtract.componentType deleted file mode 100644 index 35dab8bb9b..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Subtract.componentType +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Subtract.h b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Subtract.h deleted file mode 100644 index a50b79ccc6..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Subtract.h +++ /dev/null @@ -1,34 +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 sample_subtract_h -#define sample_subtract_h - -class Subtract -{ - public: - virtual float sub(float num1, float num2) = 0; -}; - -#endif // sample_subtract_h - - diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Subtract.php b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Subtract.php deleted file mode 100644 index 8d3a1b3ddf..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/Subtract.php +++ /dev/null @@ -1,30 +0,0 @@ -log_message($result); - - return $result; -} -?> diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/runwsserver.sh b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/runwsserver.sh deleted file mode 100755 index 069d734fea..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/runwsserver.sh +++ /dev/null @@ -1,45 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -if [ x$AXIS2C_HOME = x ]; then -echo "AXIS2C_HOME not set" -exit; -fi -echo "Using Axis2C installed at $AXIS2C_HOME" - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SCACPP/extensions/cpp/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ - -cd $AXIS2C_HOME/bin -./axis2_http_server diff --git a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/sample.calculator.composite b/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/sample.calculator.composite deleted file mode 100644 index 09b7070fb8..0000000000 --- a/sca-cpp/trunk/samples/PHPCalculator/sample.calculator/sample.calculator.composite +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - DivideComponent/DivideService - - - - - AddComponent - SubtractComponent - MultiplyComponent - DivideComponent - - - - - LogComponent - - - - - LogComponent - - - - - LogComponent - - - - - DivideCPPComponent/DivideService - AddComponent - MultiplyComponent - SubtractComponent - AddComponent - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/PythonCalculator/Makefile.am b/sca-cpp/trunk/samples/PythonCalculator/Makefile.am deleted file mode 100644 index 21952e3df4..0000000000 --- a/sca-cpp/trunk/samples/PythonCalculator/Makefile.am +++ /dev/null @@ -1,21 +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. - -deploydir=$(prefix)/PythonCalculator/deploy -SUBDIRS = sample.calculator sample.calculator.client -EXTRA_DIST = *.composite README.html -deploy_DATA = *.composite diff --git a/sca-cpp/trunk/samples/PythonCalculator/README b/sca-cpp/trunk/samples/PythonCalculator/README deleted file mode 100644 index 670f561dc1..0000000000 --- a/sca-cpp/trunk/samples/PythonCalculator/README +++ /dev/null @@ -1,20 +0,0 @@ -Tuscany SCA for C++ Samples - Calculator Sample -=============================================== - -This is a very simple sample to show how an SCA composite can wire together -two components to implement a Calculator service and expose that service as -a Web Service. - -There are two sub projects in this workspace: - - sample.calculator - This contains the source code and SCDL artifacts for the SCA Calculator. - composite implementing the sample Calculator. - - - sample.calculator.client - A sample client which does a local call to the Calculator service. - -Additionally, there is the sample.calculator.app.composite file. This -describes the configuration of the SCA Calculator composite deployed to the -SCA runtime. - -See the README.html file for instructions to build and run this sample diff --git a/sca-cpp/trunk/samples/PythonCalculator/README.html b/sca-cpp/trunk/samples/PythonCalculator/README.html deleted file mode 100644 index 3b9f72864e..0000000000 --- a/sca-cpp/trunk/samples/PythonCalculator/README.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - - - - - Tuscany SCA Native Samples - Python Calculator Sample - - - -
      -
      -
      -

      Tuscany SCA Native Samples - Python Calculator Sample

      - -

      This is a very simple sample to show how an SCA composite can wire - together two Python components to implement a Calculator service and invoke - the service via a local client. -

      -

      See the Python extension - documentation for information about building the Tuscany Python extension - and using Python in SCA composites. -

      -

      There are two sub projects in this workspace:

      -
        -
      • sample.calculator
        - This contains the Python scripts and SCDL artifacts for the SCA Calculator - composite implementing the sample Calculator. -
      • -
      • sample.calculator.client
        - A sample client which does a local call to the Calculator service. -
      • -
      -

      Additionally, there is the sample.calculator.app.composite file. This - describes the configuration of the SCA Calculator composite deployed to the SCA - runtime. -

      - -
      - - - - -
      -

      Building the Python samples on Linux and Mac OS X

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
      2. - -
      3. As the Python Calculator sample is based on Python scripts, a specific compilation step is not necessary - - only deployment is required. Deploy the Python samples only with the following command sequence: -
          -
        • cd <tuscany_sca_install_dir>/samples
        • -
        • ./configure --enable-python --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
        • -
        • make install
        • -
        - NOTE: If you don't provide the --prefix configure option, it will by default install into - /usr/local/tuscany/sca/samples/PythonCalculator
      4. -
      -
      - -
      -

      Running the Python Calculator sample on Linux and Mac OS X

      -
        -
      1. The Python Calculator sample requires the following extension: - - Please follow the documentation to ensure you have this extension built and installed - on your system -
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        -
      4. -
      5. Run the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>/samples/PythonCalculator/deploy/sample.calculator.client
        • -
        • ./runclient.sh
        • -
        -
      6. -
      -
      - -
      -

      Building the Python Calculator sample on Windows

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
      2. - -
      3. As this sample is based on Python scripts, a specific compilation step is not necessary - - only deployment is required. Deploy the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>\samples\PythonCalculator
        • -
        • deploy.bat
        • -
        -
      4. -
      -
      - -
      -

      Running the Python Calculator sample on Windows

      -
        -
      1. The Python Calculator sample requires the following extension: - - Please follow the documentation to ensure you have this extension built and installed - on your system -
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        -
      4. -
      5. Run the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>\samples\PythonCalculator\deploy\sample.calculator.client
        • -
        • runclient.bat
        • -
        -
      6. -
      -
      - -
      -

      Getting Help

      - -

      The first place to look is at the Tuscany SCA FAQ at - http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      - -

      Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      - -
      -
      -
      - - - - diff --git a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator.app.composite b/sca-cpp/trunk/samples/PythonCalculator/sample.calculator.app.composite deleted file mode 100644 index ea4e3e118d..0000000000 --- a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator.app.composite +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator.client/Makefile.am b/sca-cpp/trunk/samples/PythonCalculator/sample.calculator.client/Makefile.am deleted file mode 100644 index df1187aab1..0000000000 --- a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator.client/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. - -deploydir=$(prefix)/PythonCalculator/deploy -clientdir=$(deploydir)/sample.calculator.client - -client_DATA = *.py -client_SCRIPTS = runclient.sh -EXTRA_DIST = runclient.sh *.py diff --git a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator.client/calculator_client.py b/sca-cpp/trunk/samples/PythonCalculator/sample.calculator.client/calculator_client.py deleted file mode 100644 index 58d6f45606..0000000000 --- a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator.client/calculator_client.py +++ /dev/null @@ -1,50 +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 a simple sample that provides a Python -# client for the Calculator sample - - -import sys -import sca - -op = sys.argv[1] -val1 = sys.argv[2] -val2 = sys.argv[3] - -# Locate the calculator service -calc = sca.locateservice("CalculatorComponent") - -# Invoke the calculator operations -if op == 'add': - result = calc.add(val1, val2) - -elif op == 'sub': - result = calc.sub(val1, val2) - -elif op == 'mul': - result = calc.mul(val1, val2) - -elif op == 'div': - result = calc.div(val1, val2) - - -print "calculator_client: ",op,"(",val1,",",val2,") = ",result - diff --git a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator.client/runclient.bat b/sca-cpp/trunk/samples/PythonCalculator/sample.calculator.client/runclient.bat deleted file mode 100644 index 206b1e5a59..0000000000 --- a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator.client/runclient.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 "%TUSCANY_SCACPP%" == "" ( -echo "TUSCANY_SCACPP not set" -goto end -) -echo using SCA installed at %TUSCANY_SCACPP% - -if "%TUSCANY_SDOCPP%" == "" ( -echo "TUSCANY_SDOCPP not set" -goto end -) -echo using SDO installed at %TUSCANY_SDOCPP% - -set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SCACPP%\extensions\python\bin;%TUSCANY_SDOCPP%\bin;%PATH% -set PYTHONPATH=%TUSCANY_SCACPP%\extensions\python\bin - -set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ -set TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent -set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -cd %TUSCANY_SCACPP_ROOT%\sample.calculator.client -python calculator_client.py div 5 2 - -:end -endlocal diff --git a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator.client/runclient.sh b/sca-cpp/trunk/samples/PythonCalculator/sample.calculator.client/runclient.sh deleted file mode 100755 index d500d3d132..0000000000 --- a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator.client/runclient.sh +++ /dev/null @@ -1,48 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -if [ x$PYTHON_LIB != x ]; then -echo "Using Python library installed at $PYTHON_LIB" -export LD_LIBRARY_PATH=$PYTHON_LIB:$LD_LIBRARY_PATH -export PATH=$PYTHON_LIB/../bin:$PATH -fi - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SCACPP/extensions/python/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH -export PYTHONPATH=$TUSCANY_SCACPP/extensions/python/lib:$PYTHONPATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ -export TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent -export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -cd $TUSCANY_SCACPP_ROOT/sample.calculator.client -python calculator_client.py div 5 2 diff --git a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator/Calculator.wsdl b/sca-cpp/trunk/samples/PythonCalculator/sample.calculator/Calculator.wsdl deleted file mode 100644 index 331b996ba2..0000000000 --- a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator/Calculator.wsdl +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator/CalculatorImpl.py b/sca-cpp/trunk/samples/PythonCalculator/sample.calculator/CalculatorImpl.py deleted file mode 100644 index 86dbef9e4d..0000000000 --- a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator/CalculatorImpl.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 a simple sample that provides a Python implementation of -# the Calculator sample -# - - -# The module-level add function -def add(val1, val2): - result = float(val1) + float(val2) - print "Python - CalculatorImpl.add " + str(val1) + " + " + str(val2) + " = " + str(result) - return result - -# The module-level sub function -def sub(val1, val2): - result = float(val1) - float(val2) - print "Python - CalculatorImpl.sub " + str(val1) + " - " + str(val2) + " = " + str(result) - return result - -# The module-level mul function -def mul(val1, val2): - result = float(val1) * float(val2) - print "Python - CalculatorImpl.mul " + str(val1) + " * " + str(val2) + " = " + str(result) - return result - -# The module-level div function -def div(val1, val2): - - - print "Python - CalculatorImpl.div calling divideService to determine " + str(val1) + " / " + str(val2) - - # Use the divideService reference - result = divideService.divide(val1, val2) - - print "Python - CalculatorImpl.div divideService returned " + str(result) - - return result - diff --git a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator/DivideImpl.py b/sca-cpp/trunk/samples/PythonCalculator/sample.calculator/DivideImpl.py deleted file mode 100644 index 3921731de6..0000000000 --- a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator/DivideImpl.py +++ /dev/null @@ -1,65 +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 a simple sample that provides a Python implementation of -# the Divide Service used in the Calculator sample -# -# Either use the divide function in the DivideClass class (using classes allows -# composite scoping to be used) -# e.g. in CalculatorComposite.composite use the line: -# -# -# Or just use the module-level divide function -# e.g. in CalculatorComposite.composite use the line: -# -# - - -class DivideClass: - "A class to handle dividing" - - def __init__(self): - print "Python - DivideImpl.DivideClass constructor" - - # The class-level divide function - def divide(self, val1, val2): - result = float(val1) / float(val2) - - print "Python - DivideImpl.DivideClass.divide " + str( val1 ) + " / " + str(val2) + " = " + str(result) - - # Use the doRounding property - if doRounding: - result = round(result) - print "Python - DivideImpl.DivideClass.divide is rounding the result to " + str(result) - - return result - -# The module-level divide function -def divide(val1, val2): - result = float(val1) / float(val2) - print "Python - DivideImpl.divide " + str(val1) + " / " + str(val2) + " = " + str(result) - - # Use the doRounding property - if doRounding: - result = round(result) - print "Python - DivideImpl.divide is rounding the result to " + str(result) - - return result - diff --git a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator/Makefile.am b/sca-cpp/trunk/samples/PythonCalculator/sample.calculator/Makefile.am deleted file mode 100644 index ec7cf8a8ad..0000000000 --- a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator/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. - -deploydir=$(prefix)/PythonCalculator/deploy -compositedir=$(deploydir)/sample.calculator - -composite_DATA = *.composite *.wsdl *.py - -EXTRA_DIST = *.composite *.wsdl *.py diff --git a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator/sample.calculator.composite b/sca-cpp/trunk/samples/PythonCalculator/sample.calculator/sample.calculator.composite deleted file mode 100644 index 7f2221b696..0000000000 --- a/sca-cpp/trunk/samples/PythonCalculator/sample.calculator/sample.calculator.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - DivideComponent - - - - - true - - - diff --git a/sca-cpp/trunk/samples/PythonWeatherForecast/Makefile.am b/sca-cpp/trunk/samples/PythonWeatherForecast/Makefile.am deleted file mode 100644 index 6b2d218134..0000000000 --- a/sca-cpp/trunk/samples/PythonWeatherForecast/Makefile.am +++ /dev/null @@ -1,21 +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. - -deploydir=$(prefix)/PythonWeatherForecast/deploy -SUBDIRS = sample.weather sample.weather.client -EXTRA_DIST = *.composite README.html -deploy_DATA = *.composite diff --git a/sca-cpp/trunk/samples/PythonWeatherForecast/README b/sca-cpp/trunk/samples/PythonWeatherForecast/README deleted file mode 100644 index c590973f5f..0000000000 --- a/sca-cpp/trunk/samples/PythonWeatherForecast/README +++ /dev/null @@ -1,20 +0,0 @@ -Tuscany SCA for C++ Samples - Weather Sample -============================================ - -This is a very simple sample to show how an SCA composite can wire together -two components to implement calls to a Weather Forecast web service - -There are three sub projects in this workspace: - - sample.weather - This contains the source code and SCDL artifacts for the SCA Weather - composite implementing the calls to the Weather web services. - - - sample.weather.client - A sample client which does a local call to the SCA Weather service. - - -Additionally, there is the sample.weather.app.composite file. This -describes the configuration of the SCA Weather composite deployed to the -SCA runtime. - -See the README.html file for instructions to build and run this sample diff --git a/sca-cpp/trunk/samples/PythonWeatherForecast/README.html b/sca-cpp/trunk/samples/PythonWeatherForecast/README.html deleted file mode 100644 index c52cb6ec86..0000000000 --- a/sca-cpp/trunk/samples/PythonWeatherForecast/README.html +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - - - - - - - Tuscany SCA Native Samples - PythonWeatherForecast Sample - - - -
      -
      -
      -

      Tuscany SCA Native Samples - PythonWeatherForecast Sample

      - -

      This is a very simple sample to show how an SCA composite can wire - together two components to implement calls to a Weather Forecast web service. -

      -

      The PythonWeatherForecast sample requires the following extensions: -

      - Please follow the documentation to ensure you have these extensions built and installed - on your system -

      -

      There are two sub projects in this workspace:

      -
        -
      • sample.weather
        - This contains the source code and SCDL artifacts for the SCA Weather - composite implementing the calls to the Weather web services. -
      • -
      • sample.weather.client
        - A sample client which does a local call to the SCA Weather service. -
      • -
      -

      Additionally, there is the sample.weather.app.composite file. This - describes the configuration of the SCA Weather composite deployed to the SCA - runtime. -

      - -
      - - - - -
      -

      Building the PythonWeatherForecast sample on Linux and Mac OS X

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        -
      2. -
      3. As the PythonWeatherForecast sample is based on Python scripts, a specific compilation step is not necessary - - only deployment is required. Deploy the Python samples only with the following command sequence: -
          -
        • cd <tuscany_sca_install_dir>/samples
        • -
        • ./configure --enable-python --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
        • -
        • make install
        • -
        - NOTE: If you don't provide the --prefix configure option, it will by default install into - /usr/local/tuscany/sca/samples/PythonWeatherForecast
      4. -
      -
      - -
      -

      Running the PythonWeatherForecast sample on Linux and Mac OS X

      -
        -
      1. The PythonWeatherForecast sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        • AXIS2C_HOME=<path to Axis2/C version 0.96>
        • -
        • PYTHON_LIB=<path to the Python library>
          - Note: If you are using a default installation of Python 2.5 this is usually /usr/lib
        • -
        -
      4. -
      5. Run the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>/samples/PythonWeatherForecast/deploy/sample.weather.client
        • -
        • ./runclient.sh
        • -
        -
      6. -
      -
      - -
      -

      Building the PythonWeatherForecast sample on Windows

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
      2. - -
      3. As this sample is based on Python scripts, a specific compilation step is not necessary - - only deployment is required. Deploy the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>\samples\PythonWeatherForecast
        • -
        • deploy.bat
        • -
        -
      4. -
      -
      - -
      -

      Running the PythonWeatherForecast sample on Windows

      -
        -
      1. The PythonWeatherForecast sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        • AXIS2C_HOME=<path to Axis2/C version 0.96>
        • -
        -
      4. -
      5. Run the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>\samples\PythonWeatherForecast\deploy\sample.weather.client
        • -
        • runclient.bat
        • -
        -
      6. -
      -
      - -
      -

      Getting Help

      - -

      The first place to look is at the Tuscany SCA FAQ at - http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      - -

      Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      - -
      -
      -
      - - - - diff --git a/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.app.composite b/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.app.composite deleted file mode 100644 index 522a2fc0c8..0000000000 --- a/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.app.composite +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.client/Makefile.am b/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.client/Makefile.am deleted file mode 100644 index 8c4781759e..0000000000 --- a/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.client/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. - -deploydir=$(prefix)/PythonWeatherForecast/deploy -clientdir=$(deploydir)/sample.weather.client - -client_DATA = *.py -client_SCRIPTS = runclient.sh -EXTRA_DIST = runclient.sh *.py diff --git a/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.client/runclient.bat b/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.client/runclient.bat deleted file mode 100644 index 93c044ed82..0000000000 --- a/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.client/runclient.bat +++ /dev/null @@ -1,50 +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 "%TUSCANY_SCACPP%" == "" ( -echo "TUSCANY_SCACPP not set" -goto end -) -echo using SCA installed at %TUSCANY_SCACPP% - -if "%TUSCANY_SDOCPP%" == "" ( -echo "TUSCANY_SDOCPP not set" -goto end -) -echo using SDO installed at %TUSCANY_SDOCPP% - -if "%AXIS2C_HOME%" == "" ( -echo "AXIS2C_HOME not set" -goto end -) -echo using Axis2C installed at %AXIS2C_HOME% - -set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SCACPP%\extensions\python\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% -set PYTHONPATH=%TUSCANY_SCACPP%\extensions\python\bin - -set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ -set TUSCANY_SCACPP_COMPONENT=sample.weather.WeatherForecastComponent - -cd %TUSCANY_SCACPP_ROOT%\sample.weather.client -python weather_forecast_client.py - -:end -endlocal diff --git a/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.client/runclient.sh b/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.client/runclient.sh deleted file mode 100755 index e6ec73b209..0000000000 --- a/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.client/runclient.sh +++ /dev/null @@ -1,54 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -if [ x$AXIS2C_HOME = x ]; then -echo "AXIS2C_HOME not set" -exit; -fi -echo "Using Axis2C installed at $AXIS2C_HOME" - -if [ x$PYTHON_LIB != x ]; then -echo "Using Python library installed at $PYTHON_LIB" -export LD_LIBRARY_PATH=$PYTHON_LIB:$LD_LIBRARY_PATH -export PATH=$PYTHON_LIB/../bin:$PATH -fi - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SCACPP/extensions/python/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH -export PYTHONPATH=$TUSCANY_SCACPP/extensions/python/lib:$PYTHONPATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ -export TUSCANY_SCACPP_COMPONENT=sample.weather.WeatherForecastComponent - -cd $TUSCANY_SCACPP_ROOT/sample.weather.client -python weather_forecast_client.py - diff --git a/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.client/weather_forecast_client.py b/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.client/weather_forecast_client.py deleted file mode 100644 index 5de99fcf8e..0000000000 --- a/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather.client/weather_forecast_client.py +++ /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. -# -# -# -# -# This Python code is a simple sample that provides a Python -# client for the WeatherForecast sample - - -import sys -import sca -import xml.etree.ElementTree - - - -# The main script: - -# Locate the Weather service -weatherService = sca.locateservice("WeatherComponent") - -place = "San Jose" -print "\nFinding Weather Forecast for", place -weatherText = weatherService.getForecastByPlaceName(place) -print weatherText - -zip = 90210 -print "\nFinding Weather Forecast for zip code", zip -weatherText = weatherService.getForecastByZipCode(zip) -print weatherText - - - - - diff --git a/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather/Makefile.am b/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather/Makefile.am deleted file mode 100644 index d0450ef707..0000000000 --- a/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather/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. - -deploydir=$(prefix)/PythonWeatherForecast/deploy -compositedir=$(deploydir)/sample.weather - -composite_DATA = *.composite *.wsdl *.py -EXTRA_DIST = *.composite *.wsdl *.py - diff --git a/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather/WeatherForecast.wsdl b/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather/WeatherForecast.wsdl deleted file mode 100644 index ec39e2287a..0000000000 --- a/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather/WeatherForecast.wsdl +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather/WeatherForecastImpl.py b/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather/WeatherForecastImpl.py deleted file mode 100644 index 6e3775de0b..0000000000 --- a/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather/WeatherForecastImpl.py +++ /dev/null @@ -1,65 +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 a simple sample that calls a service that returns an -# SDO which has been converted into an ElementTree Element object. The Element -# object is then converted into formatted text - -import xml.etree.ElementTree - -def getForecastByPlaceName(placeName): - - print "Python - WeatherForecastImpl.getForecastByPlaceName:", placeName - - xmlResult = weatherWebService.GetWeatherByPlaceName(placeName) - - print "Python - Formatting result from weatherService:", xmlResult - - return formatWeather(xmlResult, placeName) - - -def getForecastByZipCode(zipCode): - - print "Python - WeatherForecastImpl.getForecastByZipCode:", zipCode - - xmlResult = weatherWebService.GetWeatherByZipCode(zipCode) - - print "Python - Formatting result from weatherService:", xmlResult - - return formatWeather(xmlResult, zipCode) - - -def formatWeather(weather, name): - - result = "Could not retrieve Weather Forecast for " + str(name) - - pathAndNS = "./{http://www.webservicex.net}" - - if weather.findtext(pathAndNS+"PlaceName"): - - result = "\n\nWeather Forecast for "+ weather.findtext(pathAndNS+"PlaceName")+ ", "+ weather.findtext(pathAndNS+"StateCode")+"\n" - result += "Latitude: "+ weather.findtext(pathAndNS+"Latitude")+ " Longitude: "+ weather.findtext(pathAndNS+"Longitude")+"\n\n" - - for node in weather.findall(".//{http://www.webservicex.net}WeatherData"): - if node.findtext(pathAndNS+"Day"): result += node.findtext(pathAndNS+"Day") - if node.findtext(pathAndNS+"MaxTemperatureC"): result += ":\tMax "+ node.findtext(pathAndNS+"MaxTemperatureC") - if node.findtext(pathAndNS+"MinTemperatureC"): result += "C. Min "+ node.findtext(pathAndNS+"MinTemperatureC")+ "C.\n" - - return result diff --git a/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather/sample.weather.composite b/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather/sample.weather.composite deleted file mode 100644 index 70e9674d23..0000000000 --- a/sca-cpp/trunk/samples/PythonWeatherForecast/sample.weather/sample.weather.composite +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - WeatherService - - - - - - - - - diff --git a/sca-cpp/trunk/samples/README b/sca-cpp/trunk/samples/README deleted file mode 100644 index 3d7155367d..0000000000 --- a/sca-cpp/trunk/samples/README +++ /dev/null @@ -1,2 +0,0 @@ -Please read the GettingStarted.html document for information on -building, installing and running Tuscany SCA for C++ Samples \ No newline at end of file diff --git a/sca-cpp/trunk/samples/RestCalculator/Makefile.am b/sca-cpp/trunk/samples/RestCalculator/Makefile.am deleted file mode 100644 index e3b215ad90..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/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. - -deploydir=$(prefix)/RestCalculator/deploy -SUBDIRS = sample.calculator sample.calculator.restclient httpserver - -EXTRA_DIST = *.composite README.html -deploy_DATA = *.composite - diff --git a/sca-cpp/trunk/samples/RestCalculator/README b/sca-cpp/trunk/samples/RestCalculator/README deleted file mode 100644 index 03c6b6a325..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/README +++ /dev/null @@ -1,23 +0,0 @@ -Tuscany SCA for C++ Samples - REST Calculator Sample -=============================================== - -This is a very simple sample to show how to use the SCA REST binding to -expose a Calculator service as a REST service and invoke that service. - -There are three sub projects in this workspace: - - sample.calculator - This contains the source code and SCDL artifacts for the SCA Calculator. - composite implementing the sample Calculator. - - - sample.calculator.restclient - A sample REST client which calls the Calculator service. - - - httpserver - This contains a minimal configuration for the Apache HTTP server used - to host the REST service as well as scripts to start and stop the server. - -Additionally, there is the sample.calculator.app.composite file. This -describes the configuration of the SCA Calculator composite deployed to the -SCA runtime. - -See the README.html file for instructions to build and run this sample diff --git a/sca-cpp/trunk/samples/RestCalculator/README.html b/sca-cpp/trunk/samples/RestCalculator/README.html deleted file mode 100644 index 80f7462c8a..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/README.html +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - Tuscany SCA Native Samples - REST Calculator Sample - - - -
      -
      -
      -

      Tuscany SCA Native Samples - REST Calculator Sample

      - -

      This is a very simple sample to show how an SCA composite can wire - together two Ruby components to implement a Calculator service and expose - that service as a REST Service running under Apache HTTPD. -

      -

      The REST Calculator sample requires the following extensions: -

      - Please follow the documentation to ensure you have these extensions built and installed - on your system

      -

      There are three sub projects in this workspace:

      -
        -
      • sample.calculator
        - This contains the Ruby scripts and SCDL artifacts for the SCA Calculator - composite implementing the sample Calculator. -
      • -
      • sample.calculator.restclient
        - A sample client which does a local call to the Calculator service. -
      • -
      • httpserver
        - A minimal configuration for the Apache HTTP server used to host the - REST service as well as scripts to start and stop the server. -
      • -
      -

      Additionally, there is the sample.calculator.app.composite file. This - describes the configuration of the SCA Calculator composite deployed to the SCA - runtime. -

      -
      - - - - -
      -

      Building the REST Calculator sample on Linux and Mac OS X

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        -
      2. -
      3. As the REST Calculator sample is based on Ruby scripts, a specific compilation step is not necessary - - only deployment is required. Deploy the Ruby samples only with the following command sequence: -
          -
        • cd <tuscany_sca_install_dir>/samples
        • -
        • ./configure --enable-ruby --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
        • -
        • make install
        • -
        - NOTE: If you don't provide the --prefix configure option, it will by default install into - /usr/local/tuscany/sca/samples/RestCalculator
      4. -
      -
      - -
      -

      Running the REST Calculator sample on Linux and Mac OS X

      -
        -
      1. The REST Calculator sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
      2. -
      3. Start the HTTPD server: -
          -
        1. The following environment variables are required: -
            -
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • -
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • -
          -
        2. -
        3. cd <tuscany_sca_install_dir>/samples/RestCalculator/deploy/httpserver
        4. -
        5. ./startserver.sh
          - NOTE: Depending on your installation of Apache HTTPD you may need to log in as root before following - these steps. If so, you may also need to uncomment the User and Group directives in the - <tuscany_sca_install_dir>/samples/RestCalculator/deploy/httpserver/conf/httpd.conf file - and set these to the appropriate username and group that the server should run as
        6. -
        -
      4. -
      5. Run the client: -
          -
        1. The following environment variables are required: -
            -
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • -
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • -
          -
        2. -
        3. cd <tuscany_sca_install_dir>/samples/RestCalculator/deploy/sample.calculator.restclient
        4. -
        5. ./runrestclient.sh
        6. -
        -
      6. -
      -
      - -
      -

      Building the REST Calculator sample on Windows

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
      2. - -
      3. As this sample is based on Ruby scripts, a specific compilation step is not necessary - - only deployment is required. Deploy the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>\samples\RestCalculator
        • -
        • deploy.bat
        • -
        -
      4. -
      -
      - -
      -

      Running the REST Calculator sample on Windows

      -
        -
      1. The REST Calculator sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
      2. -
      3. Start the HTTPD server: -
          -
        1. The following environment variables are required: -
            -
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • -
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • -
          • HTTPD_HOME=<path to installed Apache HTTPD server>
          • -
          -
        2. -
        3. cd <tuscany_sca_install_dir>\samples\RestCalculator\deploy\httpserver
        4. -
        5. startserver.bat
        6. -
        -
      4. -
      5. Run the client: -
          -
        1. The following environment variables are required: -
            -
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • -
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • -
          • LIBCURL_HOME=<path to installed libcurl libraries>
          • -
          -
        2. -
        3. cd <tuscany_sca_install_dir>\samples\RestCalculator\deploy\sample.calculator.restclient
        4. -
        5. runrestclient.bat
        6. -
        -
      6. -
      -
      - - - -
      -

      Getting Help

      - -

      The first place to look is at the Tuscany SCA FAQ at - http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      - -

      Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      - -
      -
      -
      - - - - diff --git a/sca-cpp/trunk/samples/RestCalculator/httpserver/Makefile.am b/sca-cpp/trunk/samples/RestCalculator/httpserver/Makefile.am deleted file mode 100644 index f9412183dc..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/httpserver/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -deploydir=$(prefix)/RestCalculator/deploy -serverdir=$(deploydir)/httpserver - -server_SCRIPTS = startserver.sh stopserver.sh -EXTRA_DIST = startserver.sh stopserver.sh conf htdocs -nobase_server_DATA = conf/httpd.conf conf/mime.types htdocs/index.html diff --git a/sca-cpp/trunk/samples/RestCalculator/httpserver/conf/httpd.conf b/sca-cpp/trunk/samples/RestCalculator/httpserver/conf/httpd.conf deleted file mode 100644 index 0303f787e9..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/httpserver/conf/httpd.conf +++ /dev/null @@ -1,34 +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 is the main Apache HTTP server configuration file. It contains the -# configuration directives that give the server its instructions. -# See for detailed information. - -Listen 9090 - -# Generated by the startserver script -Include conf/base.conf -Include conf/tuscany_sca_mod_rest.conf - -# User and Group directives may be required if the server must be -# started from the root account. Uncomment the following lines and -# set the correct username and group -# -# User myusername -# Group mygroupname - diff --git a/sca-cpp/trunk/samples/RestCalculator/httpserver/conf/mime.types b/sca-cpp/trunk/samples/RestCalculator/httpserver/conf/mime.types deleted file mode 100644 index 4279f51bca..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/httpserver/conf/mime.types +++ /dev/null @@ -1,607 +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 file controls what Internet media types are sent to the client for -# given file extension(s). Sending the correct media type to the client -# is important so they know how to handle the content of the file. -# Extra types can either be added here or by using an AddType directive -# in your config files. For more information about Internet media types, -# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type -# registry is at . - -# MIME type Extensions -application/activemessage -application/andrew-inset ez -application/applefile -application/atom+xml atom -application/atomicmail -application/batch-smtp -application/beep+xml -application/cals-1840 -application/cnrp+xml -application/commonground -application/cpl+xml -application/cybercash -application/dca-rft -application/dec-dx -application/dvcs -application/edi-consent -application/edifact -application/edi-x12 -application/eshop -application/font-tdpfr -application/http -application/hyperstudio -application/iges -application/index -application/index.cmd -application/index.obj -application/index.response -application/index.vnd -application/iotp -application/ipp -application/isup -application/mac-binhex40 hqx -application/mac-compactpro cpt -application/macwriteii -application/marc -application/mathematica -application/mathml+xml mathml -application/msword doc -application/news-message-id -application/news-transmission -application/ocsp-request -application/ocsp-response -application/octet-stream bin dms lha lzh exe class so dll dmg -application/oda oda -application/ogg ogg -application/parityfec -application/pdf pdf -application/pgp-encrypted -application/pgp-keys -application/pgp-signature -application/pkcs10 -application/pkcs7-mime -application/pkcs7-signature -application/pkix-cert -application/pkix-crl -application/pkixcmp -application/postscript ai eps ps -application/prs.alvestrand.titrax-sheet -application/prs.cww -application/prs.nprend -application/prs.plucker -application/qsig -application/rdf+xml rdf -application/reginfo+xml -application/remote-printing -application/riscos -application/rtf -application/sdp -application/set-payment -application/set-payment-initiation -application/set-registration -application/set-registration-initiation -application/sgml -application/sgml-open-catalog -application/sieve -application/slate -application/smil smi smil -application/srgs gram -application/srgs+xml grxml -application/timestamp-query -application/timestamp-reply -application/tve-trigger -application/vemmi -application/vnd.3gpp.pic-bw-large -application/vnd.3gpp.pic-bw-small -application/vnd.3gpp.pic-bw-var -application/vnd.3gpp.sms -application/vnd.3m.post-it-notes -application/vnd.accpac.simply.aso -application/vnd.accpac.simply.imp -application/vnd.acucobol -application/vnd.acucorp -application/vnd.adobe.xfdf -application/vnd.aether.imp -application/vnd.amiga.ami -application/vnd.anser-web-certificate-issue-initiation -application/vnd.anser-web-funds-transfer-initiation -application/vnd.audiograph -application/vnd.blueice.multipass -application/vnd.bmi -application/vnd.businessobjects -application/vnd.canon-cpdl -application/vnd.canon-lips -application/vnd.cinderella -application/vnd.claymore -application/vnd.commerce-battelle -application/vnd.commonspace -application/vnd.contact.cmsg -application/vnd.cosmocaller -application/vnd.criticaltools.wbs+xml -application/vnd.ctc-posml -application/vnd.cups-postscript -application/vnd.cups-raster -application/vnd.cups-raw -application/vnd.curl -application/vnd.cybank -application/vnd.data-vision.rdz -application/vnd.dna -application/vnd.dpgraph -application/vnd.dreamfactory -application/vnd.dxr -application/vnd.ecdis-update -application/vnd.ecowin.chart -application/vnd.ecowin.filerequest -application/vnd.ecowin.fileupdate -application/vnd.ecowin.series -application/vnd.ecowin.seriesrequest -application/vnd.ecowin.seriesupdate -application/vnd.enliven -application/vnd.epson.esf -application/vnd.epson.msf -application/vnd.epson.quickanime -application/vnd.epson.salt -application/vnd.epson.ssf -application/vnd.ericsson.quickcall -application/vnd.eudora.data -application/vnd.fdf -application/vnd.ffsns -application/vnd.fints -application/vnd.flographit -application/vnd.framemaker -application/vnd.fsc.weblaunch -application/vnd.fujitsu.oasys -application/vnd.fujitsu.oasys2 -application/vnd.fujitsu.oasys3 -application/vnd.fujitsu.oasysgp -application/vnd.fujitsu.oasysprs -application/vnd.fujixerox.ddd -application/vnd.fujixerox.docuworks -application/vnd.fujixerox.docuworks.binder -application/vnd.fut-misnet -application/vnd.grafeq -application/vnd.groove-account -application/vnd.groove-help -application/vnd.groove-identity-message -application/vnd.groove-injector -application/vnd.groove-tool-message -application/vnd.groove-tool-template -application/vnd.groove-vcard -application/vnd.hbci -application/vnd.hhe.lesson-player -application/vnd.hp-hpgl -application/vnd.hp-hpid -application/vnd.hp-hps -application/vnd.hp-pcl -application/vnd.hp-pclxl -application/vnd.httphone -application/vnd.hzn-3d-crossword -application/vnd.ibm.afplinedata -application/vnd.ibm.electronic-media -application/vnd.ibm.minipay -application/vnd.ibm.modcap -application/vnd.ibm.rights-management -application/vnd.ibm.secure-container -application/vnd.informix-visionary -application/vnd.intercon.formnet -application/vnd.intertrust.digibox -application/vnd.intertrust.nncp -application/vnd.intu.qbo -application/vnd.intu.qfx -application/vnd.irepository.package+xml -application/vnd.is-xpr -application/vnd.japannet-directory-service -application/vnd.japannet-jpnstore-wakeup -application/vnd.japannet-payment-wakeup -application/vnd.japannet-registration -application/vnd.japannet-registration-wakeup -application/vnd.japannet-setstore-wakeup -application/vnd.japannet-verification -application/vnd.japannet-verification-wakeup -application/vnd.jisp -application/vnd.kde.karbon -application/vnd.kde.kchart -application/vnd.kde.kformula -application/vnd.kde.kivio -application/vnd.kde.kontour -application/vnd.kde.kpresenter -application/vnd.kde.kspread -application/vnd.kde.kword -application/vnd.kenameaapp -application/vnd.koan -application/vnd.liberty-request+xml -application/vnd.llamagraphics.life-balance.desktop -application/vnd.llamagraphics.life-balance.exchange+xml -application/vnd.lotus-1-2-3 -application/vnd.lotus-approach -application/vnd.lotus-freelance -application/vnd.lotus-notes -application/vnd.lotus-organizer -application/vnd.lotus-screencam -application/vnd.lotus-wordpro -application/vnd.mcd -application/vnd.mediastation.cdkey -application/vnd.meridian-slingshot -application/vnd.micrografx.flo -application/vnd.micrografx.igx -application/vnd.mif mif -application/vnd.minisoft-hp3000-save -application/vnd.mitsubishi.misty-guard.trustweb -application/vnd.mobius.daf -application/vnd.mobius.dis -application/vnd.mobius.mbk -application/vnd.mobius.mqy -application/vnd.mobius.msl -application/vnd.mobius.plc -application/vnd.mobius.txf -application/vnd.mophun.application -application/vnd.mophun.certificate -application/vnd.motorola.flexsuite -application/vnd.motorola.flexsuite.adsi -application/vnd.motorola.flexsuite.fis -application/vnd.motorola.flexsuite.gotap -application/vnd.motorola.flexsuite.kmr -application/vnd.motorola.flexsuite.ttc -application/vnd.motorola.flexsuite.wem -application/vnd.mozilla.xul+xml xul -application/vnd.ms-artgalry -application/vnd.ms-asf -application/vnd.ms-excel xls -application/vnd.ms-lrm -application/vnd.ms-powerpoint ppt -application/vnd.ms-project -application/vnd.ms-tnef -application/vnd.ms-works -application/vnd.ms-wpl -application/vnd.mseq -application/vnd.msign -application/vnd.music-niff -application/vnd.musician -application/vnd.netfpx -application/vnd.noblenet-directory -application/vnd.noblenet-sealer -application/vnd.noblenet-web -application/vnd.novadigm.edm -application/vnd.novadigm.edx -application/vnd.novadigm.ext -application/vnd.obn -application/vnd.osa.netdeploy -application/vnd.palm -application/vnd.pg.format -application/vnd.pg.osasli -application/vnd.powerbuilder6 -application/vnd.powerbuilder6-s -application/vnd.powerbuilder7 -application/vnd.powerbuilder7-s -application/vnd.powerbuilder75 -application/vnd.powerbuilder75-s -application/vnd.previewsystems.box -application/vnd.publishare-delta-tree -application/vnd.pvi.ptid1 -application/vnd.pwg-multiplexed -application/vnd.pwg-xhtml-print+xml -application/vnd.quark.quarkxpress -application/vnd.rapid -application/vnd.s3sms -application/vnd.sealed.net -application/vnd.seemail -application/vnd.shana.informed.formdata -application/vnd.shana.informed.formtemplate -application/vnd.shana.informed.interchange -application/vnd.shana.informed.package -application/vnd.smaf -application/vnd.sss-cod -application/vnd.sss-dtf -application/vnd.sss-ntf -application/vnd.street-stream -application/vnd.svd -application/vnd.swiftview-ics -application/vnd.triscape.mxs -application/vnd.trueapp -application/vnd.truedoc -application/vnd.ufdl -application/vnd.uplanet.alert -application/vnd.uplanet.alert-wbxml -application/vnd.uplanet.bearer-choice -application/vnd.uplanet.bearer-choice-wbxml -application/vnd.uplanet.cacheop -application/vnd.uplanet.cacheop-wbxml -application/vnd.uplanet.channel -application/vnd.uplanet.channel-wbxml -application/vnd.uplanet.list -application/vnd.uplanet.list-wbxml -application/vnd.uplanet.listcmd -application/vnd.uplanet.listcmd-wbxml -application/vnd.uplanet.signal -application/vnd.vcx -application/vnd.vectorworks -application/vnd.vidsoft.vidconference -application/vnd.visio -application/vnd.visionary -application/vnd.vividence.scriptfile -application/vnd.vsf -application/vnd.wap.sic -application/vnd.wap.slc -application/vnd.wap.wbxml wbxml -application/vnd.wap.wmlc wmlc -application/vnd.wap.wmlscriptc wmlsc -application/vnd.webturbo -application/vnd.wrq-hp3000-labelled -application/vnd.wt.stf -application/vnd.wv.csp+wbxml -application/vnd.xara -application/vnd.xfdl -application/vnd.yamaha.hv-dic -application/vnd.yamaha.hv-script -application/vnd.yamaha.hv-voice -application/vnd.yellowriver-custom-menu -application/voicexml+xml vxml -application/watcherinfo+xml -application/whoispp-query -application/whoispp-response -application/wita -application/wordperfect5.1 -application/x-bcpio bcpio -application/x-cdlink vcd -application/x-chess-pgn pgn -application/x-compress -application/x-cpio cpio -application/x-csh csh -application/x-director dcr dir dxr -application/x-dvi dvi -application/x-futuresplash spl -application/x-gtar gtar -application/x-gzip -application/x-hdf hdf -application/x-javascript js -application/x-koan skp skd skt skm -application/x-latex latex -application/x-netcdf nc cdf -application/x-sh sh -application/x-shar shar -application/x-shockwave-flash swf -application/x-stuffit sit -application/x-sv4cpio sv4cpio -application/x-sv4crc sv4crc -application/x-tar tar -application/x-tcl tcl -application/x-tex tex -application/x-texinfo texinfo texi -application/x-troff t tr roff -application/x-troff-man man -application/x-troff-me me -application/x-troff-ms ms -application/x-ustar ustar -application/x-wais-source src -application/x400-bp -application/xhtml+xml xhtml xht -application/xslt+xml xslt -application/xml xml xsl -application/xml-dtd dtd -application/xml-external-parsed-entity -application/zip zip -audio/32kadpcm -audio/amr -audio/amr-wb -audio/basic au snd -audio/cn -audio/dat12 -audio/dsr-es201108 -audio/dvi4 -audio/evrc -audio/evrc0 -audio/g722 -audio/g.722.1 -audio/g723 -audio/g726-16 -audio/g726-24 -audio/g726-32 -audio/g726-40 -audio/g728 -audio/g729 -audio/g729D -audio/g729E -audio/gsm -audio/gsm-efr -audio/l8 -audio/l16 -audio/l20 -audio/l24 -audio/lpc -audio/midi mid midi kar -audio/mpa -audio/mpa-robust -audio/mp4a-latm -audio/mpeg mpga mp2 mp3 -audio/parityfec -audio/pcma -audio/pcmu -audio/prs.sid -audio/qcelp -audio/red -audio/smv -audio/smv0 -audio/telephone-event -audio/tone -audio/vdvi -audio/vnd.3gpp.iufp -audio/vnd.cisco.nse -audio/vnd.cns.anp1 -audio/vnd.cns.inf1 -audio/vnd.digital-winds -audio/vnd.everad.plj -audio/vnd.lucent.voice -audio/vnd.nortel.vbk -audio/vnd.nuera.ecelp4800 -audio/vnd.nuera.ecelp7470 -audio/vnd.nuera.ecelp9600 -audio/vnd.octel.sbc -audio/vnd.qcelp -audio/vnd.rhetorex.32kadpcm -audio/vnd.vmx.cvsd -audio/x-aiff aif aiff aifc -audio/x-alaw-basic -audio/x-mpegurl m3u -audio/x-pn-realaudio ram ra -audio/x-pn-realaudio-plugin -application/vnd.rn-realmedia rm -audio/x-wav wav -chemical/x-pdb pdb -chemical/x-xyz xyz -image/bmp bmp -image/cgm cgm -image/g3fax -image/gif gif -image/ief ief -image/jpeg jpeg jpg jpe -image/naplps -image/png png -image/prs.btif -image/prs.pti -image/svg+xml svg -image/t38 -image/tiff tiff tif -image/tiff-fx -image/vnd.cns.inf2 -image/vnd.djvu djvu djv -image/vnd.dwg -image/vnd.dxf -image/vnd.fastbidsheet -image/vnd.fpx -image/vnd.fst -image/vnd.fujixerox.edmics-mmr -image/vnd.fujixerox.edmics-rlc -image/vnd.globalgraphics.pgb -image/vnd.mix -image/vnd.ms-modi -image/vnd.net-fpx -image/vnd.svf -image/vnd.wap.wbmp wbmp -image/vnd.xiff -image/x-cmu-raster ras -image/x-icon ico -image/x-portable-anymap pnm -image/x-portable-bitmap pbm -image/x-portable-graymap pgm -image/x-portable-pixmap ppm -image/x-rgb rgb -image/x-xbitmap xbm -image/x-xpixmap xpm -image/x-xwindowdump xwd -message/delivery-status -message/disposition-notification -message/external-body -message/http -message/news -message/partial -message/rfc822 -message/s-http -message/sip -message/sipfrag -model/iges igs iges -model/mesh msh mesh silo -model/vnd.dwf -model/vnd.flatland.3dml -model/vnd.gdl -model/vnd.gs-gdl -model/vnd.gtw -model/vnd.mts -model/vnd.parasolid.transmit.binary -model/vnd.parasolid.transmit.text -model/vnd.vtu -model/vrml wrl vrml -multipart/alternative -multipart/appledouble -multipart/byteranges -multipart/digest -multipart/encrypted -multipart/form-data -multipart/header-set -multipart/mixed -multipart/parallel -multipart/related -multipart/report -multipart/signed -multipart/voice-message -text/calendar ics ifb -text/css css -text/directory -text/enriched -text/html html htm -text/parityfec -text/plain asc txt -text/prs.lines.tag -text/rfc822-headers -text/richtext rtx -text/rtf rtf -text/sgml sgml sgm -text/t140 -text/tab-separated-values tsv -text/uri-list -text/vnd.abc -text/vnd.curl -text/vnd.dmclientscript -text/vnd.fly -text/vnd.fmi.flexstor -text/vnd.in3d.3dml -text/vnd.in3d.spot -text/vnd.iptc.nitf -text/vnd.iptc.newsml -text/vnd.latex-z -text/vnd.motorola.reflex -text/vnd.ms-mediapackage -text/vnd.net2phone.commcenter.command -text/vnd.sun.j2me.app-descriptor -text/vnd.wap.si -text/vnd.wap.sl -text/vnd.wap.wml wml -text/vnd.wap.wmlscript wmls -text/x-setext etx -text/xml -text/xml-external-parsed-entity -video/bmpeg -video/bt656 -video/celb -video/dv -video/h261 -video/h263 -video/h263-1998 -video/h263-2000 -video/jpeg -video/mp1s -video/mp2p -video/mp2t -video/mp4v-es -video/mpv -video/mpeg mpeg mpg mpe -video/nv -video/parityfec -video/pointer -video/quicktime qt mov -video/smpte292m -video/vnd.fvt -video/vnd.motorola.video -video/vnd.motorola.videop -video/vnd.mpegurl mxu m4u -video/vnd.nokia.interleaved-multimedia -video/vnd.objectvideo -video/vnd.vivo -video/x-msvideo avi -video/x-sgi-movie movie -x-conference/x-cooltalk ice diff --git a/sca-cpp/trunk/samples/RestCalculator/httpserver/htdocs/index.html b/sca-cpp/trunk/samples/RestCalculator/httpserver/htdocs/index.html deleted file mode 100644 index 1bfb3e30c2..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/httpserver/htdocs/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - -

      It works!

      - diff --git a/sca-cpp/trunk/samples/RestCalculator/httpserver/startserver.bat b/sca-cpp/trunk/samples/RestCalculator/httpserver/startserver.bat deleted file mode 100644 index 2fc567a7e6..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/httpserver/startserver.bat +++ /dev/null @@ -1,72 +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 APFULLDIR=%~d0%~p0 -echo Running from %APFULLDIR% - -if "%TUSCANY_SCACPP%" == "" ( -echo "TUSCANY_SCACPP not set" -goto end -) -echo Using SCA installed at %TUSCANY_SCACPP% - -if "%TUSCANY_SDOCPP%" == "" ( -echo "TUSCANY_SDOCPP not set" -goto end -) -echo Using SDO installed at %TUSCANY_SDOCPP% - -if "%HTTPD_HOME%" == "" ( -echo "HTTPD_HOME not set" -goto end -) -echo Using HTTPD installed at %HTTPD_HOME% - -set PATH=%TUSCANY_SCACPP%\extensions\ruby\bin;%TUSCANY_SCACPP%\extensions\rest\interface\bin;%TUSCANY_SCACPP%\extensions\rest\service\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%HTTPD_HOME%\bin;%PATH% - -set TUSCANY_SCACPP_ROOT=%APFULLDIR%\..\ -set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -@REM Generate the tuscany_sca_mod_rest configuration -if not exist %APFULLDIR%\conf\tuscany_sca_mod_rest.conf ( - echo LoadModule sca_rest_module %TUSCANY_SCACPP%/extensions/rest\service/bin/tuscany_sca_mod_rest.dll > %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo TuscanyHome %TUSCANY_SCACPP% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo SetHandler sca_rest_module >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo TuscanyRoot %TUSCANY_SCACPP_ROOT% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf -) - -@REM Generate the base HTTPD configuration -if not exist %APFULLDIR%\conf\base.conf ( - echo LoadModule mime_module %HTTPD_HOME%\modules\mod_mime.so > %APFULLDIR%\conf\base.conf - echo LoadModule dir_module %HTTPD_HOME%\modules\mod_dir.so >> %APFULLDIR%\conf\base.conf - echo DocumentRoot %APFULLDIR%\htdocs >> %APFULLDIR%\conf\base.conf -) - -@REM Create logs directory -if not exist %APFULLDIR%\logs mkdir %APFULLDIR%\logs -set TUSCANY_SCACPP_LOG=%APFULLDIR%\logs\tuscany-server.log -set TUSCANY_SCACPP_LOGGING=9 - -@REM Start the HTTP server -echo Starting Apache httpd -httpd -d %APFULLDIR% diff --git a/sca-cpp/trunk/samples/RestCalculator/httpserver/startserver.sh b/sca-cpp/trunk/samples/RestCalculator/httpserver/startserver.sh deleted file mode 100755 index e5d3d8f1ce..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/httpserver/startserver.sh +++ /dev/null @@ -1,66 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/ruby/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ -export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -libsuffix=.so -UNAME=`uname -s` -if [ "x$UNAME" = "xDarwin" ]; then - libsuffix=.dylib -fi -# Generate the mod_rest configuration -if [ ! -f conf/tuscany_sca_mod_rest.conf ]; then - echo "LoadModule sca_rest_module $TUSCANY_SCACPP/extensions/rest/service/lib/libtuscany_sca_mod_rest$libsuffix" >conf/tuscany_sca_mod_rest.conf - echo "TuscanyHome $TUSCANY_SCACPP" >>conf/tuscany_sca_mod_rest.conf - echo "" >>conf/tuscany_sca_mod_rest.conf - echo " SetHandler sca_rest_module" >>conf/tuscany_sca_mod_rest.conf - echo " TuscanyRoot $TUSCANY_SCACPP_ROOT" >>conf/tuscany_sca_mod_rest.conf - echo "" >>conf/tuscany_sca_mod_rest.conf -fi - -if [ ! -f conf/base.conf ]; then - echo "DocumentRoot $APFULLDIR/htdocs" >conf/base.conf -fi - -# Create logs directory -if [ ! -d logs ]; then - mkdir logs -fi - -# Start the HTTP server -echo "Starting Apache httpd" -apachectl -k start -d $APFULLDIR - diff --git a/sca-cpp/trunk/samples/RestCalculator/httpserver/stopserver.sh b/sca-cpp/trunk/samples/RestCalculator/httpserver/stopserver.sh deleted file mode 100755 index c17f632a3e..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/httpserver/stopserver.sh +++ /dev/null @@ -1,25 +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` - -# Stop the HTTP server -echo "Stopping Apache httpd" -apachectl -k stop -d $APFULLDIR - diff --git a/sca-cpp/trunk/samples/RestCalculator/sample.calculator.app.composite b/sca-cpp/trunk/samples/RestCalculator/sample.calculator.app.composite deleted file mode 100644 index b7c42f4731..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/sample.calculator.app.composite +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - sample.calculator.CalculatorComponent/CalculatorService - - - diff --git a/sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/CalculatorRestClient.rb b/sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/CalculatorRestClient.rb deleted file mode 100644 index 4305c3e185..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/CalculatorRestClient.rb +++ /dev/null @@ -1,25 +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. -# -# - -require("tuscany_sca_ruby") - -calculator = SCA::locateService("CalculatorService") - -x = calculator.div(5, 2) -print "Retrieved result from RestCalculator service: ", x, "\n" diff --git a/sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/Makefile.am b/sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/Makefile.am deleted file mode 100644 index 5eee4677b8..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/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. - -deploydir=$(prefix)/RestCalculator/deploy -restclientdir=$(deploydir)/sample.calculator.restclient - -restclient_DATA = *.rb *.composite -restclient_SCRIPTS = runrestclient.sh -EXTRA_DIST = runrestclient.sh *.rb *.composite diff --git a/sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/runrestclient.bat b/sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/runrestclient.bat deleted file mode 100644 index fb97ed8b74..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/runrestclient.bat +++ /dev/null @@ -1,50 +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 "%TUSCANY_SCACPP%" == "" ( -echo TUSCANY_SCACPP not set -goto end -) -echo using SCA installed at %TUSCANY_SCACPP% - -if "%TUSCANY_SDOCPP%" == "" ( -echo TUSCANY_SDOCPP not set -goto end -) -echo using SDO installed at %TUSCANY_SDOCPP% - -if "%LIBCURL_HOME%" == "" ( -echo LIBCURL_HOME not set -goto end -) -echo using Libcurl installed at %LIBCURL_HOME% - -set PATH=%HTTPD_HOME%\bin;%LIBCURL_HOME%\lib;%TUSCANY_SCACPP%\extensions\ruby\bin;%TUSCANY_SCACPP%\extensions\rest\interface\bin;%TUSCANY_SCACPP%\extensions\rest\reference\bin;%TUSCANY_SCACPP%\extensions\rest\service\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%PATH% - -set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ -set TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorRestClientComponent -set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -cd %TUSCANY_SCACPP_ROOT%\sample.calculator.restclient -ruby -I%TUSCANY_SCACPP%\extensions\ruby\bin CalculatorRestClient.rb - -:end -endlocal diff --git a/sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/runrestclient.sh b/sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/runrestclient.sh deleted file mode 100755 index 0c6c6c182c..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/runrestclient.sh +++ /dev/null @@ -1,41 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/ruby/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ -export TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorRestClientComponent -export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -cd $TUSCANY_SCACPP_ROOT/sample.calculator.restclient -ruby -I$TUSCANY_SCACPP/extensions/ruby/lib CalculatorRestClient.rb diff --git a/sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/sample.calculator.restclient.composite b/sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/sample.calculator.restclient.composite deleted file mode 100644 index fee8c6e14f..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/sample.calculator.restclient/sample.calculator.restclient.composite +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/RestCalculator/sample.calculator/CalculatorImpl.rb b/sca-cpp/trunk/samples/RestCalculator/sample.calculator/CalculatorImpl.rb deleted file mode 100644 index 36ed15ff9b..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/sample.calculator/CalculatorImpl.rb +++ /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. -# -# - -class CalculatorImpl - - attr_writer :divideService - - def initialize() - print "Ruby - CalculatorImpl.initialize\n" - end - - def div(arg1, arg2) - print "Ruby - CalculatorImpl.div\n" - @divideService.divide(arg1.to_f, arg2.to_f) - end - - def add(arg1, arg2) - print "Ruby - CalculatorImpl.add\n" - arg1.to_f + arg2.to_f - end - - def sub(arg1, arg2) - print "Ruby - CalculatorImpl.sub\n" - arg1.to_f - arg2.to_f - end - - def mul(arg1, arg2) - print "Ruby - CalculatorImpl.mul\n" - arg1.to_f * arg2.to_f - end - -end \ No newline at end of file diff --git a/sca-cpp/trunk/samples/RestCalculator/sample.calculator/DivideImpl.rb b/sca-cpp/trunk/samples/RestCalculator/sample.calculator/DivideImpl.rb deleted file mode 100644 index c6615bfcfa..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/sample.calculator/DivideImpl.rb +++ /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. -# -# - -class DivideImpl - - attr_writer :round - - def initialize() - print "Ruby - DivideImpl.initialize\n" - end - - def divide(arg1, arg2) - print "Ruby - DivideImpl.divide ", arg1, " / ", arg2, "\n" - res = arg1.to_f / arg2.to_f - if @round then - res = res.round - print "DivideImpl.divide rounding\n" - end - print "DivideImpl.divide ", res, "\n" - res - end - -end \ No newline at end of file diff --git a/sca-cpp/trunk/samples/RestCalculator/sample.calculator/Makefile.am b/sca-cpp/trunk/samples/RestCalculator/sample.calculator/Makefile.am deleted file mode 100644 index b715fe2424..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/sample.calculator/Makefile.am +++ /dev/null @@ -1,22 +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. - -deploydir=$(prefix)/RestCalculator/deploy -compositedir=$(deploydir)/sample.calculator - -composite_DATA = *.composite *.rb -EXTRA_DIST = *.composite *.rb diff --git a/sca-cpp/trunk/samples/RestCalculator/sample.calculator/sample.calculator.composite b/sca-cpp/trunk/samples/RestCalculator/sample.calculator/sample.calculator.composite deleted file mode 100644 index 49fbf17f54..0000000000 --- a/sca-cpp/trunk/samples/RestCalculator/sample.calculator/sample.calculator.composite +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - CalculatorComponent - - - - - DivideComponent - - - - - true - - - diff --git a/sca-cpp/trunk/samples/RestCustomer/Makefile.am b/sca-cpp/trunk/samples/RestCustomer/Makefile.am deleted file mode 100644 index bf259580ce..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/Makefile.am +++ /dev/null @@ -1,22 +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. - -deploydir=$(prefix)/RestCustomer/deploy -SUBDIRS = sample.customer sample.customer.restclient httpserver - -EXTRA_DIST = *.composite README.html -deploy_DATA = *.composite diff --git a/sca-cpp/trunk/samples/RestCustomer/README b/sca-cpp/trunk/samples/RestCustomer/README deleted file mode 100644 index bf2a1c3eb6..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/README +++ /dev/null @@ -1,25 +0,0 @@ -Tuscany SCA for C++ Samples - REST Customer Sample -================================================== - -This is a very simple sample to show how to use the SCA REST binding to -implement a resource management service and make resources available -through HTTP. - -There are three sub projects in this workspace: - - sample.customer - This contains the source code and SCDL artifacts for the SCA component - implementing the Customer resource management service. - - - sample.customer.restclient - A sample REST client which shows how to create, update, retrieve, and - delete Customer resources. - - - httpserver - This contains a minimal configuration for the Apache HTTP server used - to host the REST service as well as scripts to start and stop the server. - -Additionally, there is the sample.customer.app.composite file. This -describes the configuration of the SCA Calculator composite deployed to the -SCA runtime. - -See the README.html file for instructions to build and run this sample diff --git a/sca-cpp/trunk/samples/RestCustomer/README.html b/sca-cpp/trunk/samples/RestCustomer/README.html deleted file mode 100644 index 7d43177b9a..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/README.html +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - - - - - - - Tuscany SCA Native Samples - REST Customer Sample - - - -
      -
      -
      -

      Tuscany SCA Native Samples - REST Customer Sample

      - -

      This is a very simple sample to show how to use the SCA REST binding to - implement a resource management service and make resources available - through HTTP. -

      -

      The REST Customer sample requires the following extensions: -

      - Please follow the documentation to ensure you have these extensions built and installed - on your system -

      -

      There are three sub-projects in this workspace:

      -
        -
      • sample.customer
        - This contains the source code and SCDL artifacts for the SCA component - implementing the Customer resource management service. -
      • -
      • sample.customer.restclient
        - A sample REST client which shows how to create, update, retrieve, and - delete Customer resources. -
      • -
      • httpserver
        - This contains a minimal configuration for the Apache HTTP server used - to host the REST service as well as scripts to start and stop the server. -
      • -
      -

      Additionally, there is the sample.customer.app.composite file. This - describes the configuration of the SCA Customer composite deployed to the SCA - runtime. -

      -
      - - - - -
      -

      Building the REST Customer sample on Linux and Mac OS X

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        -
      2. -
      3. As the REST Customer sample is based on Python scripts, a specific compilation step is not necessary - - only deployment is required. Deploy the Python samples only with the following command sequence: -
          -
        • cd <tuscany_sca_install_dir>/samples
        • -
        • ./configure --enable-python --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
        • -
        • make install
        • -
        - NOTE: If you don't provide the --prefix configure option, it will by default install into - /usr/local/tuscany/sca/samples/RestCustomer
      4. -
      -
      - -
      -

      Running the REST Customer sample on Linux and Mac OS X

      -
        -
      1. The REST Customer sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
      2. -
      3. Start the Apache HTTPD server: -
          -
        1. The following environment variables are required: -
            -
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • -
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • -
          • PYTHON_LIB=<path to the Python library>
            - Note: If you are using a default installation of Python 2.5 this is usually /usr/lib
          • -
          -
        2. -
        3. cd <tuscany_sca_install_dir>/samples/RestCustomer/deploy/httpserver
        4. -
        5. ./startserver.sh
          - NOTE: Depending on your installation of Apache HTTPD you may need to log in as root before following - these steps. If so, you may also need to uncomment the User and Group directives in the - <tuscany_sca_install_dir>/samples/RestCustomer/deploy/httpserver/conf/httpd.conf file - and set these to the appropriate username and group that the server should run as
        6. -
        -
      4. -
      5. Run the client: -
          -
        1. The following environment variable is required: -
            -
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • -
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • -
          • PYTHON_LIB=<path to the Python library>
            - Note: If you are using a default installation of Python 2.5 this is usually /usr/lib
          • -
          -
        2. -
        3. cd <tuscany_sca_install_dir>/samples/RestCustomer/deploy/sample.customer.restclient
        4. -
        5. ./runrestclient.sh
        6. -
        -
      6. -
      -
      - -
      -

      Building the REST Customer sample on Windows

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
      2. - -
      3. As this sample is based on Ruby scripts, a specific compilation step is not necessary - - only deployment is required. Deploy the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>\samples\RestCustomer
        • -
        • deploy.bat
        • -
        -
      4. -
      -
      - -
      -

      Running the REST Customer sample on Windows

      -
    • The REST Customer sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
    • -
    • Start the Apache HTTPD server: -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        • HTTPD_HOME=<path to installed Apache HTTPD server>
        • -
        -
      2. -
      3. cd <tuscany_sca_install_dir>\samples\RestCustomer\deploy\httpserver
      4. -
      5. startserver.bat
      6. -
      -
    • -
    • Run the client: -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        • LIBCURL_HOME=<path to installed libcurl libraries>
        • -
        -
      2. -
      3. cd <tuscany_sca_install_dir>\samples\RestCustomer\deploy\sample.customer.restclient
      4. -
      5. runrestclient.bat
      6. -
      -
    • - -
      - - - -
      -

      Getting Help

      - -

      The first place to look is at the Tuscany SCA FAQ at - http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      - -

      Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      - -
      -
      -
      - - - - diff --git a/sca-cpp/trunk/samples/RestCustomer/httpserver/Makefile.am b/sca-cpp/trunk/samples/RestCustomer/httpserver/Makefile.am deleted file mode 100644 index af8c0bb550..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/httpserver/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -deploydir=$(prefix)/RestCustomer/deploy -serverdir=$(deploydir)/httpserver - -server_SCRIPTS = startserver.sh stopserver.sh -EXTRA_DIST = startserver.sh stopserver.sh conf htdocs -nobase_server_DATA = conf/httpd.conf conf/mime.types htdocs/index.html diff --git a/sca-cpp/trunk/samples/RestCustomer/httpserver/conf/httpd.conf b/sca-cpp/trunk/samples/RestCustomer/httpserver/conf/httpd.conf deleted file mode 100644 index 0303f787e9..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/httpserver/conf/httpd.conf +++ /dev/null @@ -1,34 +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 is the main Apache HTTP server configuration file. It contains the -# configuration directives that give the server its instructions. -# See for detailed information. - -Listen 9090 - -# Generated by the startserver script -Include conf/base.conf -Include conf/tuscany_sca_mod_rest.conf - -# User and Group directives may be required if the server must be -# started from the root account. Uncomment the following lines and -# set the correct username and group -# -# User myusername -# Group mygroupname - diff --git a/sca-cpp/trunk/samples/RestCustomer/httpserver/conf/mime.types b/sca-cpp/trunk/samples/RestCustomer/httpserver/conf/mime.types deleted file mode 100644 index 4279f51bca..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/httpserver/conf/mime.types +++ /dev/null @@ -1,607 +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 file controls what Internet media types are sent to the client for -# given file extension(s). Sending the correct media type to the client -# is important so they know how to handle the content of the file. -# Extra types can either be added here or by using an AddType directive -# in your config files. For more information about Internet media types, -# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type -# registry is at . - -# MIME type Extensions -application/activemessage -application/andrew-inset ez -application/applefile -application/atom+xml atom -application/atomicmail -application/batch-smtp -application/beep+xml -application/cals-1840 -application/cnrp+xml -application/commonground -application/cpl+xml -application/cybercash -application/dca-rft -application/dec-dx -application/dvcs -application/edi-consent -application/edifact -application/edi-x12 -application/eshop -application/font-tdpfr -application/http -application/hyperstudio -application/iges -application/index -application/index.cmd -application/index.obj -application/index.response -application/index.vnd -application/iotp -application/ipp -application/isup -application/mac-binhex40 hqx -application/mac-compactpro cpt -application/macwriteii -application/marc -application/mathematica -application/mathml+xml mathml -application/msword doc -application/news-message-id -application/news-transmission -application/ocsp-request -application/ocsp-response -application/octet-stream bin dms lha lzh exe class so dll dmg -application/oda oda -application/ogg ogg -application/parityfec -application/pdf pdf -application/pgp-encrypted -application/pgp-keys -application/pgp-signature -application/pkcs10 -application/pkcs7-mime -application/pkcs7-signature -application/pkix-cert -application/pkix-crl -application/pkixcmp -application/postscript ai eps ps -application/prs.alvestrand.titrax-sheet -application/prs.cww -application/prs.nprend -application/prs.plucker -application/qsig -application/rdf+xml rdf -application/reginfo+xml -application/remote-printing -application/riscos -application/rtf -application/sdp -application/set-payment -application/set-payment-initiation -application/set-registration -application/set-registration-initiation -application/sgml -application/sgml-open-catalog -application/sieve -application/slate -application/smil smi smil -application/srgs gram -application/srgs+xml grxml -application/timestamp-query -application/timestamp-reply -application/tve-trigger -application/vemmi -application/vnd.3gpp.pic-bw-large -application/vnd.3gpp.pic-bw-small -application/vnd.3gpp.pic-bw-var -application/vnd.3gpp.sms -application/vnd.3m.post-it-notes -application/vnd.accpac.simply.aso -application/vnd.accpac.simply.imp -application/vnd.acucobol -application/vnd.acucorp -application/vnd.adobe.xfdf -application/vnd.aether.imp -application/vnd.amiga.ami -application/vnd.anser-web-certificate-issue-initiation -application/vnd.anser-web-funds-transfer-initiation -application/vnd.audiograph -application/vnd.blueice.multipass -application/vnd.bmi -application/vnd.businessobjects -application/vnd.canon-cpdl -application/vnd.canon-lips -application/vnd.cinderella -application/vnd.claymore -application/vnd.commerce-battelle -application/vnd.commonspace -application/vnd.contact.cmsg -application/vnd.cosmocaller -application/vnd.criticaltools.wbs+xml -application/vnd.ctc-posml -application/vnd.cups-postscript -application/vnd.cups-raster -application/vnd.cups-raw -application/vnd.curl -application/vnd.cybank -application/vnd.data-vision.rdz -application/vnd.dna -application/vnd.dpgraph -application/vnd.dreamfactory -application/vnd.dxr -application/vnd.ecdis-update -application/vnd.ecowin.chart -application/vnd.ecowin.filerequest -application/vnd.ecowin.fileupdate -application/vnd.ecowin.series -application/vnd.ecowin.seriesrequest -application/vnd.ecowin.seriesupdate -application/vnd.enliven -application/vnd.epson.esf -application/vnd.epson.msf -application/vnd.epson.quickanime -application/vnd.epson.salt -application/vnd.epson.ssf -application/vnd.ericsson.quickcall -application/vnd.eudora.data -application/vnd.fdf -application/vnd.ffsns -application/vnd.fints -application/vnd.flographit -application/vnd.framemaker -application/vnd.fsc.weblaunch -application/vnd.fujitsu.oasys -application/vnd.fujitsu.oasys2 -application/vnd.fujitsu.oasys3 -application/vnd.fujitsu.oasysgp -application/vnd.fujitsu.oasysprs -application/vnd.fujixerox.ddd -application/vnd.fujixerox.docuworks -application/vnd.fujixerox.docuworks.binder -application/vnd.fut-misnet -application/vnd.grafeq -application/vnd.groove-account -application/vnd.groove-help -application/vnd.groove-identity-message -application/vnd.groove-injector -application/vnd.groove-tool-message -application/vnd.groove-tool-template -application/vnd.groove-vcard -application/vnd.hbci -application/vnd.hhe.lesson-player -application/vnd.hp-hpgl -application/vnd.hp-hpid -application/vnd.hp-hps -application/vnd.hp-pcl -application/vnd.hp-pclxl -application/vnd.httphone -application/vnd.hzn-3d-crossword -application/vnd.ibm.afplinedata -application/vnd.ibm.electronic-media -application/vnd.ibm.minipay -application/vnd.ibm.modcap -application/vnd.ibm.rights-management -application/vnd.ibm.secure-container -application/vnd.informix-visionary -application/vnd.intercon.formnet -application/vnd.intertrust.digibox -application/vnd.intertrust.nncp -application/vnd.intu.qbo -application/vnd.intu.qfx -application/vnd.irepository.package+xml -application/vnd.is-xpr -application/vnd.japannet-directory-service -application/vnd.japannet-jpnstore-wakeup -application/vnd.japannet-payment-wakeup -application/vnd.japannet-registration -application/vnd.japannet-registration-wakeup -application/vnd.japannet-setstore-wakeup -application/vnd.japannet-verification -application/vnd.japannet-verification-wakeup -application/vnd.jisp -application/vnd.kde.karbon -application/vnd.kde.kchart -application/vnd.kde.kformula -application/vnd.kde.kivio -application/vnd.kde.kontour -application/vnd.kde.kpresenter -application/vnd.kde.kspread -application/vnd.kde.kword -application/vnd.kenameaapp -application/vnd.koan -application/vnd.liberty-request+xml -application/vnd.llamagraphics.life-balance.desktop -application/vnd.llamagraphics.life-balance.exchange+xml -application/vnd.lotus-1-2-3 -application/vnd.lotus-approach -application/vnd.lotus-freelance -application/vnd.lotus-notes -application/vnd.lotus-organizer -application/vnd.lotus-screencam -application/vnd.lotus-wordpro -application/vnd.mcd -application/vnd.mediastation.cdkey -application/vnd.meridian-slingshot -application/vnd.micrografx.flo -application/vnd.micrografx.igx -application/vnd.mif mif -application/vnd.minisoft-hp3000-save -application/vnd.mitsubishi.misty-guard.trustweb -application/vnd.mobius.daf -application/vnd.mobius.dis -application/vnd.mobius.mbk -application/vnd.mobius.mqy -application/vnd.mobius.msl -application/vnd.mobius.plc -application/vnd.mobius.txf -application/vnd.mophun.application -application/vnd.mophun.certificate -application/vnd.motorola.flexsuite -application/vnd.motorola.flexsuite.adsi -application/vnd.motorola.flexsuite.fis -application/vnd.motorola.flexsuite.gotap -application/vnd.motorola.flexsuite.kmr -application/vnd.motorola.flexsuite.ttc -application/vnd.motorola.flexsuite.wem -application/vnd.mozilla.xul+xml xul -application/vnd.ms-artgalry -application/vnd.ms-asf -application/vnd.ms-excel xls -application/vnd.ms-lrm -application/vnd.ms-powerpoint ppt -application/vnd.ms-project -application/vnd.ms-tnef -application/vnd.ms-works -application/vnd.ms-wpl -application/vnd.mseq -application/vnd.msign -application/vnd.music-niff -application/vnd.musician -application/vnd.netfpx -application/vnd.noblenet-directory -application/vnd.noblenet-sealer -application/vnd.noblenet-web -application/vnd.novadigm.edm -application/vnd.novadigm.edx -application/vnd.novadigm.ext -application/vnd.obn -application/vnd.osa.netdeploy -application/vnd.palm -application/vnd.pg.format -application/vnd.pg.osasli -application/vnd.powerbuilder6 -application/vnd.powerbuilder6-s -application/vnd.powerbuilder7 -application/vnd.powerbuilder7-s -application/vnd.powerbuilder75 -application/vnd.powerbuilder75-s -application/vnd.previewsystems.box -application/vnd.publishare-delta-tree -application/vnd.pvi.ptid1 -application/vnd.pwg-multiplexed -application/vnd.pwg-xhtml-print+xml -application/vnd.quark.quarkxpress -application/vnd.rapid -application/vnd.s3sms -application/vnd.sealed.net -application/vnd.seemail -application/vnd.shana.informed.formdata -application/vnd.shana.informed.formtemplate -application/vnd.shana.informed.interchange -application/vnd.shana.informed.package -application/vnd.smaf -application/vnd.sss-cod -application/vnd.sss-dtf -application/vnd.sss-ntf -application/vnd.street-stream -application/vnd.svd -application/vnd.swiftview-ics -application/vnd.triscape.mxs -application/vnd.trueapp -application/vnd.truedoc -application/vnd.ufdl -application/vnd.uplanet.alert -application/vnd.uplanet.alert-wbxml -application/vnd.uplanet.bearer-choice -application/vnd.uplanet.bearer-choice-wbxml -application/vnd.uplanet.cacheop -application/vnd.uplanet.cacheop-wbxml -application/vnd.uplanet.channel -application/vnd.uplanet.channel-wbxml -application/vnd.uplanet.list -application/vnd.uplanet.list-wbxml -application/vnd.uplanet.listcmd -application/vnd.uplanet.listcmd-wbxml -application/vnd.uplanet.signal -application/vnd.vcx -application/vnd.vectorworks -application/vnd.vidsoft.vidconference -application/vnd.visio -application/vnd.visionary -application/vnd.vividence.scriptfile -application/vnd.vsf -application/vnd.wap.sic -application/vnd.wap.slc -application/vnd.wap.wbxml wbxml -application/vnd.wap.wmlc wmlc -application/vnd.wap.wmlscriptc wmlsc -application/vnd.webturbo -application/vnd.wrq-hp3000-labelled -application/vnd.wt.stf -application/vnd.wv.csp+wbxml -application/vnd.xara -application/vnd.xfdl -application/vnd.yamaha.hv-dic -application/vnd.yamaha.hv-script -application/vnd.yamaha.hv-voice -application/vnd.yellowriver-custom-menu -application/voicexml+xml vxml -application/watcherinfo+xml -application/whoispp-query -application/whoispp-response -application/wita -application/wordperfect5.1 -application/x-bcpio bcpio -application/x-cdlink vcd -application/x-chess-pgn pgn -application/x-compress -application/x-cpio cpio -application/x-csh csh -application/x-director dcr dir dxr -application/x-dvi dvi -application/x-futuresplash spl -application/x-gtar gtar -application/x-gzip -application/x-hdf hdf -application/x-javascript js -application/x-koan skp skd skt skm -application/x-latex latex -application/x-netcdf nc cdf -application/x-sh sh -application/x-shar shar -application/x-shockwave-flash swf -application/x-stuffit sit -application/x-sv4cpio sv4cpio -application/x-sv4crc sv4crc -application/x-tar tar -application/x-tcl tcl -application/x-tex tex -application/x-texinfo texinfo texi -application/x-troff t tr roff -application/x-troff-man man -application/x-troff-me me -application/x-troff-ms ms -application/x-ustar ustar -application/x-wais-source src -application/x400-bp -application/xhtml+xml xhtml xht -application/xslt+xml xslt -application/xml xml xsl -application/xml-dtd dtd -application/xml-external-parsed-entity -application/zip zip -audio/32kadpcm -audio/amr -audio/amr-wb -audio/basic au snd -audio/cn -audio/dat12 -audio/dsr-es201108 -audio/dvi4 -audio/evrc -audio/evrc0 -audio/g722 -audio/g.722.1 -audio/g723 -audio/g726-16 -audio/g726-24 -audio/g726-32 -audio/g726-40 -audio/g728 -audio/g729 -audio/g729D -audio/g729E -audio/gsm -audio/gsm-efr -audio/l8 -audio/l16 -audio/l20 -audio/l24 -audio/lpc -audio/midi mid midi kar -audio/mpa -audio/mpa-robust -audio/mp4a-latm -audio/mpeg mpga mp2 mp3 -audio/parityfec -audio/pcma -audio/pcmu -audio/prs.sid -audio/qcelp -audio/red -audio/smv -audio/smv0 -audio/telephone-event -audio/tone -audio/vdvi -audio/vnd.3gpp.iufp -audio/vnd.cisco.nse -audio/vnd.cns.anp1 -audio/vnd.cns.inf1 -audio/vnd.digital-winds -audio/vnd.everad.plj -audio/vnd.lucent.voice -audio/vnd.nortel.vbk -audio/vnd.nuera.ecelp4800 -audio/vnd.nuera.ecelp7470 -audio/vnd.nuera.ecelp9600 -audio/vnd.octel.sbc -audio/vnd.qcelp -audio/vnd.rhetorex.32kadpcm -audio/vnd.vmx.cvsd -audio/x-aiff aif aiff aifc -audio/x-alaw-basic -audio/x-mpegurl m3u -audio/x-pn-realaudio ram ra -audio/x-pn-realaudio-plugin -application/vnd.rn-realmedia rm -audio/x-wav wav -chemical/x-pdb pdb -chemical/x-xyz xyz -image/bmp bmp -image/cgm cgm -image/g3fax -image/gif gif -image/ief ief -image/jpeg jpeg jpg jpe -image/naplps -image/png png -image/prs.btif -image/prs.pti -image/svg+xml svg -image/t38 -image/tiff tiff tif -image/tiff-fx -image/vnd.cns.inf2 -image/vnd.djvu djvu djv -image/vnd.dwg -image/vnd.dxf -image/vnd.fastbidsheet -image/vnd.fpx -image/vnd.fst -image/vnd.fujixerox.edmics-mmr -image/vnd.fujixerox.edmics-rlc -image/vnd.globalgraphics.pgb -image/vnd.mix -image/vnd.ms-modi -image/vnd.net-fpx -image/vnd.svf -image/vnd.wap.wbmp wbmp -image/vnd.xiff -image/x-cmu-raster ras -image/x-icon ico -image/x-portable-anymap pnm -image/x-portable-bitmap pbm -image/x-portable-graymap pgm -image/x-portable-pixmap ppm -image/x-rgb rgb -image/x-xbitmap xbm -image/x-xpixmap xpm -image/x-xwindowdump xwd -message/delivery-status -message/disposition-notification -message/external-body -message/http -message/news -message/partial -message/rfc822 -message/s-http -message/sip -message/sipfrag -model/iges igs iges -model/mesh msh mesh silo -model/vnd.dwf -model/vnd.flatland.3dml -model/vnd.gdl -model/vnd.gs-gdl -model/vnd.gtw -model/vnd.mts -model/vnd.parasolid.transmit.binary -model/vnd.parasolid.transmit.text -model/vnd.vtu -model/vrml wrl vrml -multipart/alternative -multipart/appledouble -multipart/byteranges -multipart/digest -multipart/encrypted -multipart/form-data -multipart/header-set -multipart/mixed -multipart/parallel -multipart/related -multipart/report -multipart/signed -multipart/voice-message -text/calendar ics ifb -text/css css -text/directory -text/enriched -text/html html htm -text/parityfec -text/plain asc txt -text/prs.lines.tag -text/rfc822-headers -text/richtext rtx -text/rtf rtf -text/sgml sgml sgm -text/t140 -text/tab-separated-values tsv -text/uri-list -text/vnd.abc -text/vnd.curl -text/vnd.dmclientscript -text/vnd.fly -text/vnd.fmi.flexstor -text/vnd.in3d.3dml -text/vnd.in3d.spot -text/vnd.iptc.nitf -text/vnd.iptc.newsml -text/vnd.latex-z -text/vnd.motorola.reflex -text/vnd.ms-mediapackage -text/vnd.net2phone.commcenter.command -text/vnd.sun.j2me.app-descriptor -text/vnd.wap.si -text/vnd.wap.sl -text/vnd.wap.wml wml -text/vnd.wap.wmlscript wmls -text/x-setext etx -text/xml -text/xml-external-parsed-entity -video/bmpeg -video/bt656 -video/celb -video/dv -video/h261 -video/h263 -video/h263-1998 -video/h263-2000 -video/jpeg -video/mp1s -video/mp2p -video/mp2t -video/mp4v-es -video/mpv -video/mpeg mpeg mpg mpe -video/nv -video/parityfec -video/pointer -video/quicktime qt mov -video/smpte292m -video/vnd.fvt -video/vnd.motorola.video -video/vnd.motorola.videop -video/vnd.mpegurl mxu m4u -video/vnd.nokia.interleaved-multimedia -video/vnd.objectvideo -video/vnd.vivo -video/x-msvideo avi -video/x-sgi-movie movie -x-conference/x-cooltalk ice diff --git a/sca-cpp/trunk/samples/RestCustomer/httpserver/htdocs/index.html b/sca-cpp/trunk/samples/RestCustomer/httpserver/htdocs/index.html deleted file mode 100644 index 1bfb3e30c2..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/httpserver/htdocs/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - -

      It works!

      - diff --git a/sca-cpp/trunk/samples/RestCustomer/httpserver/startserver.bat b/sca-cpp/trunk/samples/RestCustomer/httpserver/startserver.bat deleted file mode 100644 index a62f4bd510..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/httpserver/startserver.bat +++ /dev/null @@ -1,75 +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 APFULLDIR=%~d0%~p0 -echo Running from %APFULLDIR% - -if "%TUSCANY_SCACPP%" == "" ( -echo "TUSCANY_SCACPP not set" -goto end -) -echo Using SCA installed at %TUSCANY_SCACPP% - -if "%TUSCANY_SDOCPP%" == "" ( -echo "TUSCANY_SDOCPP not set" -goto end -) -echo Using SDO installed at %TUSCANY_SDOCPP% - -if "%HTTPD_HOME%" == "" ( -echo "HTTPD_HOME not set" -goto end -) -echo Using HTTPD installed at %HTTPD_HOME% - -set PATH=%TUSCANY_SCACPP%\extensions\python\bin;%TUSCANY_SCACPP%\extensions\rest\interface\bin;%TUSCANY_SCACPP%\extensions\rest\service\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%HTTPD_HOME%\bin;%PATH% -set PYTHONPATH=%TUSCANY_SCACPP%\extensions\python\bin - -set TUSCANY_SCACPP_ROOT=%APFULLDIR%\..\ -set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -set CUSTOMER_DIR=%TUSCANY_SCACPP_ROOT%\sample.customer - -@REM Generate the tuscany_sca_mod_rest configuration -if not exist %APFULLDIR%\conf\tuscany_sca_mod_rest.conf ( - echo LoadModule sca_rest_module %TUSCANY_SCACPP%/extensions/rest\service/bin/tuscany_sca_mod_rest.dll > %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo TuscanyHome %TUSCANY_SCACPP% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo SetHandler sca_rest_module >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo TuscanyRoot %TUSCANY_SCACPP_ROOT% >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf - echo ^ >> %APFULLDIR%\conf\tuscany_sca_mod_rest.conf -) - -@REM Generate the base HTTPD configuration -if not exist %APFULLDIR%\conf\base.conf ( - echo LoadModule mime_module %HTTPD_HOME%\modules\mod_mime.so > %APFULLDIR%\conf\base.conf - echo LoadModule dir_module %HTTPD_HOME%\modules\mod_dir.so >> %APFULLDIR%\conf\base.conf - echo DocumentRoot %APFULLDIR%\htdocs >> %APFULLDIR%\conf\base.conf -) - -@REM Create logs directory -if not exist %APFULLDIR%\logs mkdir %APFULLDIR%\logs -set TUSCANY_SCACPP_LOG=%APFULLDIR%\logs\tuscany-server.log -set TUSCANY_SCACPP_LOGGING=9 - -@REM Start the HTTP server -echo Starting Apache httpd -httpd -d %APFULLDIR% diff --git a/sca-cpp/trunk/samples/RestCustomer/httpserver/startserver.sh b/sca-cpp/trunk/samples/RestCustomer/httpserver/startserver.sh deleted file mode 100755 index 0d4561e3d3..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/httpserver/startserver.sh +++ /dev/null @@ -1,80 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -if [ x$PYTHON_LIB != x ]; then -echo "Using Python library installed at $PYTHON_LIB" -export LD_LIBRARY_PATH=$PYTHON_LIB:$LD_LIBRARY_PATH -export PATH=$PYTHON_LIB/../bin:$PATH -fi - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SCACPP/extensions/python/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH -export PYTHONPATH=$TUSCANY_SCACPP/extensions/python/lib:$PYTHONPATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ -export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -export CUSTOMER_DIR=$TUSCANY_SCACPP_ROOT/sample.customer - -libsuffix=.so -UNAME=`uname -s` -if [ "x$UNAME" = "xDarwin" ]; then - libsuffix=.dylib -fi - -# Generate the mod_rest configuration -if [ ! -f conf/tuscany_sca_mod_rest.conf ]; then - echo "LoadModule sca_rest_module $TUSCANY_SCACPP/extensions/rest/service/lib/libtuscany_sca_mod_rest$libsuffix" >conf/tuscany_sca_mod_rest.conf - echo "TuscanyHome $TUSCANY_SCACPP" >>conf/tuscany_sca_mod_rest.conf - echo "" >>conf/tuscany_sca_mod_rest.conf - echo " SetHandler sca_rest_module" >>conf/tuscany_sca_mod_rest.conf - echo " TuscanyRoot $TUSCANY_SCACPP_ROOT" >>conf/tuscany_sca_mod_rest.conf - echo "" >>conf/tuscany_sca_mod_rest.conf -fi - -if [ ! -f conf/base.conf ]; then - echo "DocumentRoot $APFULLDIR/htdocs" >conf/base.conf -fi - -# Create logs directory -if [ ! -d logs ]; then - mkdir logs -fi - -# Start the HTTP server -echo "Starting Apache httpd" - -# Set LD_PRELOAD to use the expat included in Python to avoid incompatibilities -export LD_PRELOAD=$TUSCANY_SCACPP/extensions/python/lib/libtuscany_sca_python$libsuffix - -apachectl -k start -d $APFULLDIR - diff --git a/sca-cpp/trunk/samples/RestCustomer/httpserver/stopserver.sh b/sca-cpp/trunk/samples/RestCustomer/httpserver/stopserver.sh deleted file mode 100755 index c17f632a3e..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/httpserver/stopserver.sh +++ /dev/null @@ -1,25 +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` - -# Stop the HTTP server -echo "Stopping Apache httpd" -apachectl -k stop -d $APFULLDIR - diff --git a/sca-cpp/trunk/samples/RestCustomer/sample.customer.app.composite b/sca-cpp/trunk/samples/RestCustomer/sample.customer.app.composite deleted file mode 100644 index 65565f1e3c..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/sample.customer.app.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - sample.customer.CustomerComponent/CustomerResource - sample.customer.CustomerComponent/CustomerCommand - - - diff --git a/sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/Customer.xsd b/sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/Customer.xsd deleted file mode 100644 index 1cec1b0ae6..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/Customer.xsd +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/CustomerRestClient.py b/sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/CustomerRestClient.py deleted file mode 100644 index 340da8700d..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/CustomerRestClient.py +++ /dev/null @@ -1,85 +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 a simple sample that provides a Python -# client for the REST Customer sample - - -from xml.etree import ElementTree as et -import sca - -# Locate the customer resource service -customerResource = sca.locateservice("CustomerResource") - -# Show how to invoke CRUD operations on the customer resource -# The CRUD operations translate to HTTP POST, GET, PUT and DELETE -# according to the REST pattern - -customer = customerResource.retrieve("2345") -print "Rest - Retrieved customer " + et.tostring(customer) - -customer = et.fromstring("""1234JaneDoe""") -url = customerResource.create(customer) -print "Rest - Created customer " + url - -customer = customerResource.retrieve("1234") -print "Rest - Retrieved customer " + et.tostring(customer) - -customer = customerResource.retrieve(url) -print "Rest - Retrieved by url " + et.tostring(customer) - -customer.find("{http://sample.customer}lastName").text="Smith" -customerResource.update("1234", customer) -print "Rest - Updated customer 1234" - -customer = customerResource.retrieve("1234") -print "Rest - Retrieved customer " + et.tostring(customer) - -customerResource.delete("1234") -print "Rest - Deleted customer 1234" - -# Also show how to use REST binding to invoke remote commands -# using HTTP GET and XML over HTTP POST, the REST binding -# uses that command pattern when you don't declare a REST interface -# on your SCA reference - -# Locate the customer command service -customerCommand = sca.locateservice("CustomerCommand") - -# Invoke operations on the customer command service -customer = customerCommand.retrieve("2345") -print "Command - Retrieved customer " + et.tostring(customer) - -customer = et.fromstring("""1234JaneDoe""") -url = customerCommand.create(customer) -print "Command - Created customer " + url - -customer = customerCommand.retrieve("1234") -print "Command - Retrieved customer " + et.tostring(customer) - -customer.find("{http://sample.customer}lastName").text="Smith" -customerCommand.update("1234", customer) -print "Command - Updated customer 1234" - -customer = customerCommand.retrieve("1234") -print "Command - Retrieved customer " + et.tostring(customer) - -customerCommand.delete("1234") -print "Command - Deleted customer 1234" diff --git a/sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/Makefile.am b/sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/Makefile.am deleted file mode 100644 index 13c14d07e9..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/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. - -deploydir=$(prefix)/RestCustomer/deploy -restclientdir=$(deploydir)/sample.customer.restclient - -restclient_DATA = *.py *.composite *.xsd -restclient_SCRIPTS = runrestclient.sh -EXTRA_DIST = runrestclient.sh *.py *.composite *.xsd diff --git a/sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/runrestclient.bat b/sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/runrestclient.bat deleted file mode 100644 index 982b9b5e83..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/runrestclient.bat +++ /dev/null @@ -1,53 +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 "%TUSCANY_SCACPP%" == "" ( -echo TUSCANY_SCACPP not set -goto end -) -echo using SCA installed at %TUSCANY_SCACPP% - -if "%TUSCANY_SDOCPP%" == "" ( -echo TUSCANY_SDOCPP not set -goto end -) -echo using SDO installed at %TUSCANY_SDOCPP% - -if "%LIBCURL_HOME%" == "" ( -echo LIBCURL_HOME not set -goto end -) -echo using Libcurl installed at %LIBCURL_HOME% - -set PATH=%HTTPD_HOME%\bin;%LIBCURL_HOME%\lib;%TUSCANY_SCACPP%\extensions\rest\interface\bin;%TUSCANY_SCACPP%\extensions\rest\reference\bin;%TUSCANY_SCACPP%\extensions\python\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%PATH% -set PYTHONPATH=%TUSCANY_SCACPP%\extensions\python\bin - -set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ -set TUSCANY_SCACPP_COMPONENT=sample.customer.CustomerRestClientComponent -set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -set CUSTOMER_DIR=%TUSCANY_SCACPP_ROOT%\sample.customer - -cd %TUSCANY_SCACPP_ROOT%\sample.customer.restclient -python CustomerRestClient.py - -:end -endlocal diff --git a/sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/runrestclient.sh b/sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/runrestclient.sh deleted file mode 100755 index 54c068f4e2..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/runrestclient.sh +++ /dev/null @@ -1,50 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -if [ x$PYTHON_LIB != x ]; then -echo "Using Python library installed at $PYTHON_LIB" -export LD_LIBRARY_PATH=$PYTHON_LIB:$LD_LIBRARY_PATH -export PATH=$PYTHON_LIB/../bin:$PATH -fi - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SCACPP/extensions/python/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH -export PYTHONPATH=$TUSCANY_SCACPP/extensions/python/lib:$PYTHONPATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ -export TUSCANY_SCACPP_COMPONENT=sample.customer.CustomerRestClientComponent -export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -export CUSTOMER_DIR=$TUSCANY_SCACPP_ROOT/sample.customer - -cd $TUSCANY_SCACPP_ROOT/sample.customer.restclient -python CustomerRestClient.py diff --git a/sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/sample.customer.restclient.composite b/sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/sample.customer.restclient.composite deleted file mode 100644 index 15072f28f8..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/sample.customer.restclient/sample.customer.restclient.composite +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/RestCustomer/sample.customer/2345.xml b/sca-cpp/trunk/samples/RestCustomer/sample.customer/2345.xml deleted file mode 100644 index 48083380ea..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/sample.customer/2345.xml +++ /dev/null @@ -1,20 +0,0 @@ - - -2345JohnSmith \ No newline at end of file diff --git a/sca-cpp/trunk/samples/RestCustomer/sample.customer/Customer.xsd b/sca-cpp/trunk/samples/RestCustomer/sample.customer/Customer.xsd deleted file mode 100644 index 1cec1b0ae6..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/sample.customer/Customer.xsd +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/RestCustomer/sample.customer/CustomerResourceImpl.py b/sca-cpp/trunk/samples/RestCustomer/sample.customer/CustomerResourceImpl.py deleted file mode 100644 index 1d6796959e..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/sample.customer/CustomerResourceImpl.py +++ /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. -# -# - -# -# This Python code implements a simple SCA component that -# manages Customer resources. -# - -import os -import shutil -from xml.etree import ElementTree as et - -qname = "{http://sample.customer}id" -dir = os.environ["CUSTOMER_DIR"] - -class CustomerResourceImpl: - "A class that manages Customer resources" - - def create(self, customer): - id = customer.findtext(qname) - print "Python - CustomerResourceImpl.create " + id - f = open(dir + "/" + id + ".xml", "w") - f.write(et.tostring(customer)) - f.close() - return id - - def retrieve(self, id): - print "Python - CustomerResourceImpl.retrieve " + id - f = open(dir + "/" + id + ".xml", "r") - customer = et.fromstring(f.read()) - f.close() - return customer - - def update(self, id, customer): - print "Python - CustomerResourceImpl.update " + id - f = open(dir + "/" + id + ".xml", "w") - f.write(et.tostring(customer)) - f.close() - - def delete(self, id): - print "Python - CustomerResourceImpl.delete " + id - shutil.copyfile(dir + "/" + id + ".xml", dir + "/" + id + "-bak.xml") - os.remove(dir + "/" + id + ".xml") diff --git a/sca-cpp/trunk/samples/RestCustomer/sample.customer/Makefile.am b/sca-cpp/trunk/samples/RestCustomer/sample.customer/Makefile.am deleted file mode 100644 index e48bb502c8..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/sample.customer/Makefile.am +++ /dev/null @@ -1,22 +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. - -deploydir=$(prefix)/RestCustomer/deploy -compositedir=$(deploydir)/sample.customer - -composite_DATA = *.composite *.py *.xsd *.xml -EXTRA_DIST = *.composite *.py *.xsd *.xml diff --git a/sca-cpp/trunk/samples/RestCustomer/sample.customer/sample.customer.composite b/sca-cpp/trunk/samples/RestCustomer/sample.customer/sample.customer.composite deleted file mode 100644 index 1ee3b2d6a2..0000000000 --- a/sca-cpp/trunk/samples/RestCustomer/sample.customer/sample.customer.composite +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - CustomerComponent - - - - - CustomerComponent - - - - - - - diff --git a/sca-cpp/trunk/samples/RestYahoo/Makefile.am b/sca-cpp/trunk/samples/RestYahoo/Makefile.am deleted file mode 100644 index de28cf2d53..0000000000 --- a/sca-cpp/trunk/samples/RestYahoo/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. - -deploydir=$(prefix)/RestYahoo/deploy -SUBDIRS = sample.yahoo sample.yahoo.client - -EXTRA_DIST = *.composite README.html -deploy_DATA = *.composite - diff --git a/sca-cpp/trunk/samples/RestYahoo/README b/sca-cpp/trunk/samples/RestYahoo/README deleted file mode 100644 index 79ee6c7813..0000000000 --- a/sca-cpp/trunk/samples/RestYahoo/README +++ /dev/null @@ -1,19 +0,0 @@ -Tuscany SCA for C++ Samples - REST Yahoo Sample -=============================================== - -This is a very simple sample to show how to use the SCA REST binding to -invoke the Yahoo Web Search REST service. - -There are two sub-projects in this workspace: - - sample.yahoo - This contains the SCDL artifacts and source code for the WebSearch - Component which calls a Reference that is configured to call the - Yahoo service - - sample.yahoo.client - A Ruby client which calls the WebSearch component. - -Additionally, there is the sample.yahoo.app.composite file. This -describes the configuration of the SCA Yahoo Search composite deployed to -the SCA runtime. - -See the README.html file for instructions to build and run this sample diff --git a/sca-cpp/trunk/samples/RestYahoo/README.html b/sca-cpp/trunk/samples/RestYahoo/README.html deleted file mode 100644 index 967f2c84b1..0000000000 --- a/sca-cpp/trunk/samples/RestYahoo/README.html +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - - - - - - - Tuscany SCA Native Samples - REST Yahoo Search Sample - - - -
      -
      -
      -

      Tuscany SCA Native Samples - REST Yahoo Search Sample

      - -

      This is a very simple sample to show how to use the SCA REST binding to - invoke the Yahoo Web Search REST service. -

      -

      The REST Yahoo Search sample requires the following extensions: -

      - Please follow the documentation to ensure you have these extensions built and installed - on your system -

      -

      There are two sub projects in this workspace:

      -
        -
      • sample.yahoo
        - This contains the SCDL artifacts and Python source code for the WebSearch - Component which calls a Reference that is configured to call the - Yahoo service -
      • -
      • sample.yahoo.client
        - A Ruby client which calls the WebSearch component -
      • -
      -

      Additionally, there is the sample.yahoo.app.composite file. This - describes the configuration of the SCA Yahoo Search composite deployed to - the SCA runtime. -

      -
      - - - - -
      -

      Building the Ruby & Python samples on Linux and Mac OS X

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
      2. - -
      3. As the REST Yahoo sample is based on Ruby and Python scripts, a specific compilation step is not necessary - - only deployment is required. Deploy the Ruby and Python samples only with the following command sequence: -
          -
        • cd <tuscany_sca_install_dir>/samples
        • -
        • ./configure --enable-ruby --enable-python --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
        • -
        • make install
        • -
        - NOTE: If you don't provide the --prefix configure option, it will by default install into - /usr/local/tuscany/sca/samples/RestYahoo
      4. -
      -
      - -
      -

      Running the REST Yahoo Search sample on Linux and Mac OS X

      -
        -
      1. The REST Yahoo Search sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        -
      4. -
      5. Run the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>/samples/RestYahoo/deploy/sample.yahoo.client
        • -
        • ./runclient.sh
        • -
        -
      6. -
      -
      - -
      -

      Building the REST Yahoo Search sample on Windows

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
      2. - -
      3. As this sample is based on Ruby and Python scripts, a specific compilation step is not necessary - - only deployment is required. Deploy the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>\samples\RestYahoo
        • -
        • deploy.bat
        • -
        -
      4. -
      -
      - -
      -

      Running the REST Yahoo Search sample on Windows

      -
        -
      1. The REST Yahoo Search sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        • LIBCURL_HOME=<path to libcurl>
        • -
        -
      4. -
      5. Run the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>\samples\RestYahoo\deploy\sample.yahoo.client
        • -
        • runclient.bat
        • -
        -
      6. -
      -
      - - - -
      -

      Getting Help

      - -

      The first place to look is at the Tuscany SCA FAQ at - http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      - -

      Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      - -
      -
      -
      - - - - diff --git a/sca-cpp/trunk/samples/RestYahoo/sample.yahoo.app.composite b/sca-cpp/trunk/samples/RestYahoo/sample.yahoo.app.composite deleted file mode 100644 index eb19962fe3..0000000000 --- a/sca-cpp/trunk/samples/RestYahoo/sample.yahoo.app.composite +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/RestYahoo/sample.yahoo.client/Makefile.am b/sca-cpp/trunk/samples/RestYahoo/sample.yahoo.client/Makefile.am deleted file mode 100644 index 4fcbf00e16..0000000000 --- a/sca-cpp/trunk/samples/RestYahoo/sample.yahoo.client/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. - -deploydir=$(prefix)/RestYahoo/deploy -clientdir=$(deploydir)/sample.yahoo.client - -client_DATA = *.rb -client_SCRIPTS = runclient.sh -EXTRA_DIST = runclient.sh *.rb diff --git a/sca-cpp/trunk/samples/RestYahoo/sample.yahoo.client/YahooWebSearchClient.rb b/sca-cpp/trunk/samples/RestYahoo/sample.yahoo.client/YahooWebSearchClient.rb deleted file mode 100644 index 0a87ccd815..0000000000 --- a/sca-cpp/trunk/samples/RestYahoo/sample.yahoo.client/YahooWebSearchClient.rb +++ /dev/null @@ -1,25 +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. -# -# - -require("tuscany_sca_ruby") - -yahooWebSearch = SCA::locateService("WebSearchComponent") - -results = yahooWebSearch.search("Tuscany") -print results, "\n" diff --git a/sca-cpp/trunk/samples/RestYahoo/sample.yahoo.client/runclient.bat b/sca-cpp/trunk/samples/RestYahoo/sample.yahoo.client/runclient.bat deleted file mode 100644 index bf95f27738..0000000000 --- a/sca-cpp/trunk/samples/RestYahoo/sample.yahoo.client/runclient.bat +++ /dev/null @@ -1,50 +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 "%TUSCANY_SCACPP%" == "" ( -echo TUSCANY_SCACPP not set -goto end -) -echo using SCA installed at %TUSCANY_SCACPP% - -if "%TUSCANY_SDOCPP%" == "" ( -echo TUSCANY_SDOCPP not set -goto end -) -echo using SDO installed at %TUSCANY_SDOCPP% - -if "%LIBCURL_HOME%" == "" ( -echo LIBCURL_HOME not set -goto end -) -echo using Libcurl installed at %LIBCURL_HOME% - -set PATH=%LIBCURL_HOME%\lib;%TUSCANY_SCACPP%\extensions\rest\interface\bin;%TUSCANY_SCACPP%\extensions\ruby\bin;%TUSCANY_SCACPP%\extensions\rest\reference\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%PATH% -set PYTHONPATH=%TUSCANY_SCACPP%\extensions\python\bin - -set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ -set TUSCANY_SCACPP_COMPONENT=sample.yahoo.app.WebSearchComponent - -cd %TUSCANY_SCACPP_ROOT%\sample.yahoo.client -ruby -I%TUSCANY_SCACPP%\extensions\ruby\bin YahooWebSearchClient.rb - -:end -endlocal diff --git a/sca-cpp/trunk/samples/RestYahoo/sample.yahoo.client/runclient.sh b/sca-cpp/trunk/samples/RestYahoo/sample.yahoo.client/runclient.sh deleted file mode 100755 index 7dbae64748..0000000000 --- a/sca-cpp/trunk/samples/RestYahoo/sample.yahoo.client/runclient.sh +++ /dev/null @@ -1,51 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/ruby/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$TUSCANY_SCACPP/extensions/python/lib:$LD_LIBRARY_PATH -export PYTHONPATH=$TUSCANY_SCACPP/extensions/python/lib:$PYTHONPATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ -export TUSCANY_SCACPP_COMPONENT=sample.yahoo.app.WebSearchComponent - -cd $TUSCANY_SCACPP_ROOT/sample.yahoo.client - -libsuffix=.so -UNAME=`uname -s` -if [ "x$UNAME" = "xDarwin" ]; then - libsuffix=.dylib -fi -# Set LD_PRELOAD to use the expat included in Python to avoid incompatibilities -export LD_PRELOAD=$TUSCANY_SCACPP/extensions/python/lib/libtuscany_sca_python$libsuffix - -ruby -I$TUSCANY_SCACPP/extensions/ruby/lib YahooWebSearchClient.rb diff --git a/sca-cpp/trunk/samples/RestYahoo/sample.yahoo/Makefile.am b/sca-cpp/trunk/samples/RestYahoo/sample.yahoo/Makefile.am deleted file mode 100644 index 7e330ca7b1..0000000000 --- a/sca-cpp/trunk/samples/RestYahoo/sample.yahoo/Makefile.am +++ /dev/null @@ -1,22 +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. - -deploydir=$(prefix)/RestYahoo/deploy -compositedir=$(deploydir)/sample.yahoo - -composite_DATA = *.composite *.py *.xsd -EXTRA_DIST = *.composite *.py *.xsd diff --git a/sca-cpp/trunk/samples/RestYahoo/sample.yahoo/YahooWebSearchImpl.py b/sca-cpp/trunk/samples/RestYahoo/sample.yahoo/YahooWebSearchImpl.py deleted file mode 100644 index 7ba6ab80ef..0000000000 --- a/sca-cpp/trunk/samples/RestYahoo/sample.yahoo/YahooWebSearchImpl.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. -# -# - -try: - import xml.etree.ElementTree -except ImportError: - # Running under a pre-Python2.5 - try: - import elementtree.ElementTree - except ImportError: - print "The RestYahoo sample requires the ElementTree package" - - -def search(searchText): - - print "Python - YahooWebSearchImpl.py running Yahoo search for:", searchText, "with ID:", yahooAppID - - # Use the yahooWebSearchService reference to call the Yahoo REST service - # also use the yahooAppID property from the composite definition - xmlResult = yahooWebSearchService.webSearch(appid = yahooAppID, query = searchText, results = 5) - - print "Python - YahooWebSearchImpl.py formatting result from Yahoo:", xmlResult - - return formatResults(xmlResult, searchText) - - -def formatResults(results, searchText): - - formatted = "Failed to run Yahoo search service for \"" + str(searchText) + "\"" - - ns = "{urn:yahoo:srch}" - pathAndNS = "./" + ns - - formatted = "\n\nYahoo Web Search Results for \""+ str(searchText) +"\"\n" - formatted += results.attrib["totalResultsAvailable"]+ " results available. First "+ results.attrib["totalResultsReturned"]+ " below\n\n" - pos = 1 - - for node in results.findall(".//"+ns+"Result"): - formatted += str(pos) + ". "+ node.findtext(pathAndNS+"Title") +"\n\t" - formatted += node.findtext(pathAndNS+"Summary") +"\n\t" - formatted += node.findtext(pathAndNS+"Url") +"\n\n" - pos += 1 - - return formatted diff --git a/sca-cpp/trunk/samples/RestYahoo/sample.yahoo/YahooWebSearchResponse.xsd b/sca-cpp/trunk/samples/RestYahoo/sample.yahoo/YahooWebSearchResponse.xsd deleted file mode 100644 index 210aabcf42..0000000000 --- a/sca-cpp/trunk/samples/RestYahoo/sample.yahoo/YahooWebSearchResponse.xsd +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/RestYahoo/sample.yahoo/sample.yahoo.composite b/sca-cpp/trunk/samples/RestYahoo/sample.yahoo/sample.yahoo.composite deleted file mode 100644 index a37a9be7c4..0000000000 --- a/sca-cpp/trunk/samples/RestYahoo/sample.yahoo/sample.yahoo.composite +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - YahooWebSearchReference - ApacheTuscanyC++SampleRestYahoo - - - - - - - diff --git a/sca-cpp/trunk/samples/RubyBigBank/Makefile.am b/sca-cpp/trunk/samples/RubyBigBank/Makefile.am deleted file mode 100644 index ae0b4958f1..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/Makefile.am +++ /dev/null @@ -1,21 +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. - -deploydir=$(prefix)/RubyBigBank/deploy -SUBDIRS = bigbank.account bigbank.client bigbank.wsclient -EXTRA_DIST = *.composite README.html -deploy_DATA = *.composite diff --git a/sca-cpp/trunk/samples/RubyBigBank/README b/sca-cpp/trunk/samples/RubyBigBank/README deleted file mode 100644 index 6b2dba4206..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/README +++ /dev/null @@ -1,21 +0,0 @@ -Tuscany SCA for C++ Samples - Ruby BigBank Sample -=============================================== - -This sample implements the "Simplified BigBank" scenario. A whitepaper -describing the scenario based on the SCA 0.9 Assembly specification can be -found here. This sample uses multiple Ruby components, calls out to an -external Web Service via a reference, exposes the service as a Web Service -and also provides a PHP based client. - -There are two sub projects in this workspace: - - bigbank.account - This contains the source code and SCDL artifacts for the SCA BigBank - composite implementing the account services. - - - bigbank.client - A sample client which does a local call to the BigBank service. - -Additionally, there is the bigbank.app.composite file. This describes the -configuration of the SCA BigBank composite deployed to the SCA runtime. - -See the README.html file for instructions to build and run this sample diff --git a/sca-cpp/trunk/samples/RubyBigBank/README.html b/sca-cpp/trunk/samples/RubyBigBank/README.html deleted file mode 100644 index 6eeb377d6f..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/README.html +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - - - - - - - Tuscany SCA Native Samples - Ruby BigBank Sample - - - -
      -
      -
      -

      Tuscany SCA Native Samples - Ruby BigBank Sample

      - -

      This sample implements the "Simplified BigBank" scenario. A whitepaper describing - the scenario based on the SCA 0.9 Assembly specification can be found - here. - This sample uses multiple Ruby components, calls out to an external Web Service via a reference - and exposes the service as a Web Service. -

      -

      The Ruby BigBank sample requires the following extensions: -

      - Please follow the documentation to ensure you have these extensions built and installed - on your system -

      -

      There are three sub projects in this workspace:

      -
        -
      • bigbank.account
        - This contains the source code and SCDL artifacts for the SCA Ruby BigBank - composite implementing the account services. -
      • -
      • bigbank.client
        - A sample client which does a local call to the BigBank service. -
      • -
      • bigbank.wsclient
        - A sample client which uses an SCA Web Service reference to make a remote - call to the BigBank service. -
      • -
      -

      Additionally, there is the bigbank.app.composite file. This - describes the configuration of the SCA BigBank composite deployed to the SCA - runtime. -

      -
      - - - - -
      -

      Building the Ruby BigBank sample on Linux and Mac OS X

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
      2. - -
      3. As the Ruby BigBank sample is based on Ruby scripts, a specific compilation step is not necessary - - only deployment is required. Deploy the Ruby samples only with the following command sequence: -
          -
        • cd <tuscany_sca_install_dir>/samples
        • -
        • ./configure --enable-ruby --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
        • -
        • make install
        • -
        - NOTE: If you don't provide the --prefix configure option, it will by default install into - /usr/local/tuscany/sca/samples/RubyBigBank -
      4. -
      -
      - -
      -

      Running the Ruby BigBank sample on Linux and Mac OS X

      -

      BigBank with basic client

      -
        -
      1. The Ruby BigBank sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        -
      4. -
      5. Run the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>/samples/RubyBigBank/deploy/bigbank.client
        • -
        • ./runclient.sh
        • -
        -
      6. -
      -

      BigBank with Web Service clients

      -
        -
      1. The Ruby BigBank sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
      2. -
      3. Ensure you have enabled Axis2/C to run Tuscany SCA services. Follow the instructions - found here. -
      4. -
      5. Start the Axis2/C simple http server: -
          -
        1. The following environment variables are required: -
            -
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • -
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • -
          • AXIS2C_HOME=<path to Axis2/C version 0.96>
          • -
          -
        2. -
        3. cd <tuscany_sca_install_dir>/samples/RubyBigBank/deploy/bigbank.account
        4. -
        5. ./runwsserver.sh
        6. -
        -
      6. -
      7. Now run the Web Service client: -
          -
        1. The following environment variables are required: -
            -
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • -
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • -
          • AXIS2C_HOME=<path to Axis2/C version 0.96>
          • -
          -
        2. -
        3. Run the sample with the following commands: -
            -
          • cd <tuscany_sca_install_dir>/samples/RubyBigBank/deploy/bigbank.wsclient
          • -
          • ./runwsclient.sh
          • -
          -
        4. -
        -
      8. -
      9. The PHP web client detailed in the - CppBigBank sample can also be used - with the Ruby BigBank service that is served by the Axis2/C http server started above. -
      10. -
      -
      - -
      -

      Building the Ruby BigBank sample on Windows

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA> -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO> -
      2. - -
      3. As this sample is based on Ruby scripts, a specific compilation step is not necessary - - only deployment is required. Deploy the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>\samples\RubyBigBank
        • -
        • deploy.bat
        • -
        -
      4. -
      -
      - -
      -

      Running the Ruby BigBank sample on Windows

      -

      BigBank with basic client

      -
        -
      1. The Ruby BigBank sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        -
      4. -
      5. Run the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>\samples\RubyBigBank\deploy\bigbank.client
        • -
        • runclient.bat
        • -
        -
      6. -
      -

      BigBank with Web Service clients

      -
        -
      1. The Ruby BigBank sample requires the following extensions: - - Please follow the documentation to ensure you have these extensions built and installed - on your system -
      2. -
      3. Ensure you have enabled Axis2/C to run Tuscany SCA services. Follow the instructions - found here. -
      4. -
      5. Start the Axis2/C simple http server: -
          -
        1. The following environment variables are required: -
            -
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • -
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • -
          • AXIS2C_HOME=<path to Axis2/C version 0.96>
          • -
          -
        2. -
        3. cd <tuscany_sca_install_dir>\samples\RubyBigBank\deploy\bigbank.account -
        4. -
        5. runwsserver.bat
        6. -
        -
      6. -
      7. Now run the Web Service client: -
          -
        1. The following environment variables are required: -
            -
          • TUSCANY_SCACPP=<path to installed Tuscany SCA>
          • -
          • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
          • -
          • AXIS2C_HOME=<path to Axis2/C version 0.96>
          • -
          -
        2. -
        3. Run the sample with the following commands: -
            -
          • cd <tuscany_sca_install_dir>/samples/RubyBigBank/deploy/bigbank.wsclient
          • -
          • ./runwsclient.bat
          • -
          -
        4. -
        -
      8. -
      9. The PHP web client detailed in the - CppBigBank sample can also be used - with the Ruby BigBank service that is served by the Axis2/C http server started above. -
      10. -
      -
      - - - -
      -

      Getting Help

      - -

      The first place to look is at the Tuscany SCA FAQ at - http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      - -

      Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      - -
      -
      -
      - - - - diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/AccountDataServiceImpl.rb b/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/AccountDataServiceImpl.rb deleted file mode 100644 index 8ae0e23bab..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/AccountDataServiceImpl.rb +++ /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. -# - -require "rexml/document" -include REXML - -class AccountDataServiceImpl - - def initialize() - print "Ruby - AccountDataServiceImpl.initialize\n" - end - - def getCheckingAccount(id) - print "Ruby - AccountDataServiceImpl.getCheckingAccount ", id, "\n" - - result = Document.new <<-eof - - #{ id.to_s + "_CHA12345"} - 1500.0 - - eof - - return result - end - - def getSavingsAccount(id) - print "Ruby - AccountDataServiceImpl.getSavingsAccount ", id, "\n" - - result = Document.new <<-eof - - #{ id.to_s + "_SAA12345"} - 1500.0 - - eof - - return result - end - - def getStockAccount(id) - print "Ruby - AccountDataServiceImpl.getStockAccount ", id, "\n" - - result = Document.new <<-eof - - #{ id.to_s + "_STA12345"} - IBM - 100 - - - eof - - return result - end - -end diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/AccountService.wsdl b/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/AccountService.wsdl deleted file mode 100644 index b83c453462..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/AccountService.wsdl +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/AccountServiceImpl.rb b/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/AccountServiceImpl.rb deleted file mode 100644 index aab789ca13..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/AccountServiceImpl.rb +++ /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. -# - -require "rexml/document" -include REXML - -class AccountServiceImpl - - attr_writer :accountDataService - attr_writer :stockQuoteService - attr_writer :currency - - def initialize() - print "Ruby - AccountServiceImpl.initialize\n" - end - - def getAccountReport(customerID) - - # Get the checking account info - checking = @accountDataService.getCheckingAccount(customerID) - - # Get the savings account info - savings = @accountDataService.getSavingsAccount(customerID) - - # Get the stocks account info - stock = @accountDataService.getStockAccount(customerID); - symbol = stock.root.elements["symbol"].text - quantity = stock.root.elements["quantity"].text - - # Get the stock price - price = @stockQuoteService.getQuote(symbol); - - # Convert to the configured currency - price = price.to_f * 0.80 if @currency == "EUR" - - # Calculate the balance - balance = price.to_f * quantity.to_f - - # Form the AccountReport document - report = Document.new <<-eof - - - - #{ checking.root.elements["accountNumber"].text } - #{ checking.root.elements["balance"].text } - - - - #{ savings.root.elements["accountNumber"].text } - #{ savings.root.elements["balance"].text } - - - - #{ stock.root.elements["accountNumber"].text } - #{ symbol } - #{ quantity } - #{ balance } - - - - eof - - return report - end - -end diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/Makefile.am b/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/Makefile.am deleted file mode 100644 index 6e5ec38414..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/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. - -deploydir=$(prefix)/RubyBigBank/deploy -compositedir=$(deploydir)/bigbank.account - -composite_SCRIPTS = runwsserver.sh - -composite_DATA = *.composite *.wsdl *.xsd *.rb -EXTRA_DIST = *.composite *.wsdl *.xsd runwsserver.sh *.rb diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/StockQuoteServiceImpl.rb b/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/StockQuoteServiceImpl.rb deleted file mode 100644 index 7f8634072c..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/StockQuoteServiceImpl.rb +++ /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. -# - -require "rexml/document" -include REXML - -class StockQuoteServiceImpl - - attr_writer :webService - - def initialize() - print "Ruby - StockQuoteServiceImpl.initialize\n" - end - - def getQuote(symbol) - print "Ruby - StockQuoteServiceImpl.getQuote ", symbol, "\n" - - price = 0 - catch (:RuntimeError) do - begin - - result = @webService.GetQuote(symbol) - doc = Document.new(result) - price = doc.root.elements["Stock"].elements["Last"].text; - - rescue - # offline or StockQuote web service is down - price = 95.0 - end - end - - print "Ruby - stock price = ", price, "\n" - - return price.to_f - end - -end \ No newline at end of file diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/StockQuoteTypes.xsd b/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/StockQuoteTypes.xsd deleted file mode 100644 index 2f7012b5fb..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/StockQuoteTypes.xsd +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/StockQuoteWebService.wsdl b/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/StockQuoteWebService.wsdl deleted file mode 100644 index c14f97c87b..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/StockQuoteWebService.wsdl +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Get Stock quote for a company Symbol - - - - - - - - - - Get Stock quote for a company Symbol - - - - - - - - - - Get Stock quote for a company Symbol - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/bigbank.account.composite b/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/bigbank.account.composite deleted file mode 100644 index 8fff8425a1..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/bigbank.account.composite +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - AccountServiceComponent - - - - - AccountDataServiceComponent - StockQuoteServiceComponent - USD - - - - - - - - - StockQuoteWebService - - - - - - - - diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/runwsserver.bat b/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/runwsserver.bat deleted file mode 100644 index 3ab4275436..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/runwsserver.bat +++ /dev/null @@ -1,51 +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 "%TUSCANY_SCACPP%" == "" ( -echo "TUSCANY_SCACPP not set" -goto end -) -echo Using SCA installed at %TUSCANY_SCACPP% - -if "%TUSCANY_SDOCPP%" == "" ( -echo "TUSCANY_SDOCPP not set" -goto end -) -echo Using SDO installed at %TUSCANY_SDOCPP% - -if "%AXIS2C_HOME%" == "" ( -echo "AXIS2C_HOME not set" -goto end -) -echo Using Axis2C installed at %AXIS2C_HOME% - -set APFULLDIR=%~d0%~p0 -set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ -set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -rem Run the server -set PATH=%TUSCANY_SCACPP%\bin;%TUSCANY_SCACPP%\extensions\cpp\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% - -cd %AXIS2C_HOME%\bin -.\axis2_http_server.exe - -:end -endlocal diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/runwsserver.sh b/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/runwsserver.sh deleted file mode 100755 index e3bbca46c6..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.account/runwsserver.sh +++ /dev/null @@ -1,46 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -if [ x$AXIS2C_HOME = x ]; then -echo "AXIS2C_HOME not set" -exit; -fi -echo "Using Axis2C installed at $AXIS2C_HOME" - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/cpp/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ -export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -cd $AXIS2C_HOME/bin -./axis2_http_server diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.app.composite b/sca-cpp/trunk/samples/RubyBigBank/bigbank.app.composite deleted file mode 100644 index dd94e61e5b..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.app.composite +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - bigbank.AccountManagementComponent/AccountService - - - diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.client/AccountClient.rb b/sca-cpp/trunk/samples/RubyBigBank/bigbank.client/AccountClient.rb deleted file mode 100644 index 31c0acc909..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.client/AccountClient.rb +++ /dev/null @@ -1,40 +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. -# -# - -require("tuscany_sca_ruby") - -accountService = SCA::locateService("AccountServiceComponent") - -report = accountService.getAccountReport(1234) - -checking = report.root.elements["checking"] -savings = report.root.elements["savings"] -stocks = report.root.elements["stocks"] - -print "\n" -print "Checking account: ", checking.elements["accountNumber"].text.strip, "\n" -print "Balance: ", checking.elements["balance"].text.strip, "\n" - -print "Savings account: ", savings.elements["accountNumber"].text.strip, "\n" -print "Balance: ", savings.elements["balance"].text.strip, "\n" - -print "Stocks account:", stocks.elements["accountNumber"].text.strip, "\n" -print "Symbol: ", stocks.elements["symbol"].text.strip, "\n" -print "Quantity: ", stocks.elements["quantity"].text.strip, "\n" -print "Balance: ", stocks.elements["balance"].text.strip, "\n" diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.client/Makefile.am b/sca-cpp/trunk/samples/RubyBigBank/bigbank.client/Makefile.am deleted file mode 100644 index 4e4936746a..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.client/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. - -deploydir=$(prefix)/RubyBigBank/deploy -clientdir=$(deploydir)/bigbank.client - -client_DATA = *.rb -client_SCRIPTS = runclient.sh -EXTRA_DIST = runclient.sh *.rb diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.client/runclient.bat b/sca-cpp/trunk/samples/RubyBigBank/bigbank.client/runclient.bat deleted file mode 100644 index 0495237f7f..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.client/runclient.bat +++ /dev/null @@ -1,51 +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 "%TUSCANY_SCACPP%" == "" ( -echo "TUSCANY_SCACPP not set" -goto end -) -echo Using SCA installed at %TUSCANY_SCACPP% - -if "%TUSCANY_SDOCPP%" == "" ( -echo "TUSCANY_SDOCPP not set" -goto end -) -echo Using SDO installed at %TUSCANY_SDOCPP% - -if "%AXIS2C_HOME%" == "" ( -echo "AXIS2C_HOME not set" -goto end -) -echo Using Axis2C installed at %AXIS2C_HOME% - -rem Run the client -set PATH=%TUSCANY_SCACPP%\extensions\ruby\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% - -set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ -set TUSCANY_SCACPP_COMPONENT=bigbank.AccountManagementComponent -set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -cd %TUSCANY_SCACPP_ROOT%\bigbank.client -ruby -I%TUSCANY_SCACPP%\extensions\ruby\bin AccountClient.rb - -:end -endlocal diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.client/runclient.sh b/sca-cpp/trunk/samples/RubyBigBank/bigbank.client/runclient.sh deleted file mode 100755 index 94d5cd6ff8..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.client/runclient.sh +++ /dev/null @@ -1,48 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -if [ x$AXIS2C_HOME = x ]; then -echo "AXIS2C_HOME not set" -exit; -fi -echo "Using Axis2C installed at $AXIS2C_HOME" - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/ruby/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ -export TUSCANY_SCACPP_COMPONENT=bigbank.AccountManagementComponent -export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -cd $TUSCANY_SCACPP_ROOT/bigbank.client -ruby -I$TUSCANY_SCACPP/extensions/ruby/lib AccountClient.rb diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/AccountService.wsdl b/sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/AccountService.wsdl deleted file mode 100644 index b83c453462..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/AccountService.wsdl +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/AccountWSClient.rb b/sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/AccountWSClient.rb deleted file mode 100644 index 6775b80f7a..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/AccountWSClient.rb +++ /dev/null @@ -1,40 +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. -# -# - -require("tuscany_sca_ruby") - -accountService = SCA::locateService("AccountService") - -report = accountService.getAccountReport(1234) - -checking = report.root.elements["checking"] -savings = report.root.elements["savings"] -stocks = report.root.elements["stocks"] - -print "\n\n" -print "Checking account #: ", checking.elements["accountNumber"].text.strip, "\n" -print "Balance: ", checking.elements["balance"].text.strip, "\n" - -print "Savings account #: ", savings.elements["accountNumber"].text.strip, "\n" -print "Balance: ", savings.elements["balance"].text.strip, "\n" - -print "Stocks account #:", stocks.elements["accountNumber"].text.strip, "\n" -print "Symbol: ", stocks.elements["symbol"].text.strip, "\n" -print "Quantity: ", stocks.elements["quantity"].text.strip, "\n" -print "Balance: ", stocks.elements["balance"].text.strip, "\n" diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/Makefile.am b/sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/Makefile.am deleted file mode 100644 index 23f8b55959..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/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. - -deploydir=$(prefix)/RubyBigBank/deploy -clientdir=$(deploydir)/bigbank.wsclient - -client_DATA = *.rb *.composite *.wsdl -client_SCRIPTS = runwsclient.sh -EXTRA_DIST = runwsclient.sh *.rb *.composite *.wsdl diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/bigbank.wsclient.composite b/sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/bigbank.wsclient.composite deleted file mode 100644 index f484a2fc7c..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/bigbank.wsclient.composite +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/runwsclient.bat b/sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/runwsclient.bat deleted file mode 100644 index 6e1bb27b4a..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/runwsclient.bat +++ /dev/null @@ -1,51 +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 "%TUSCANY_SCACPP%" == "" ( -echo "TUSCANY_SCACPP not set" -goto end -) -echo Using SCA installed at %TUSCANY_SCACPP% - -if "%TUSCANY_SDOCPP%" == "" ( -echo "TUSCANY_SDOCPP not set" -goto end -) -echo Using SDO installed at %TUSCANY_SDOCPP% - -if "%AXIS2C_HOME%" == "" ( -echo "AXIS2C_HOME not set" -goto end -) -echo Using Axis2C installed at %AXIS2C_HOME% - -rem Run the client -set PATH=%TUSCANY_SCACPP%\extensions\ruby\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%AXIS2C_HOME%\lib;%PATH% - -set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ -set TUSCANY_SCACPP_COMPONENT=bigbank.AccountWSClientComponent -set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -cd %TUSCANY_SCACPP_ROOT%\bigbank.wsclient -ruby -I%TUSCANY_SCACPP%\extensions\ruby\bin AccountWSClient.rb - -:end -endlocal diff --git a/sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/runwsclient.sh b/sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/runwsclient.sh deleted file mode 100755 index d50e6a4b0a..0000000000 --- a/sca-cpp/trunk/samples/RubyBigBank/bigbank.wsclient/runwsclient.sh +++ /dev/null @@ -1,48 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -if [ x$AXIS2C_HOME = x ]; then -echo "AXIS2C_HOME not set" -exit; -fi -echo "Using Axis2C installed at $AXIS2C_HOME" - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/ruby/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ -export TUSCANY_SCACPP_COMPONENT=bigbank.AccountWSClientComponent -export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -cd $TUSCANY_SCACPP_ROOT/bigbank.wsclient -ruby -I$TUSCANY_SCACPP/extensions/ruby/lib AccountWSClient.rb diff --git a/sca-cpp/trunk/samples/RubyCalculator/Makefile.am b/sca-cpp/trunk/samples/RubyCalculator/Makefile.am deleted file mode 100644 index 246ea1852f..0000000000 --- a/sca-cpp/trunk/samples/RubyCalculator/Makefile.am +++ /dev/null @@ -1,21 +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. - -deploydir=$(prefix)/RubyCalculator/deploy -SUBDIRS = sample.calculator sample.calculator.client -EXTRA_DIST = *.composite README.html -deploy_DATA = *.composite diff --git a/sca-cpp/trunk/samples/RubyCalculator/README b/sca-cpp/trunk/samples/RubyCalculator/README deleted file mode 100644 index 670f561dc1..0000000000 --- a/sca-cpp/trunk/samples/RubyCalculator/README +++ /dev/null @@ -1,20 +0,0 @@ -Tuscany SCA for C++ Samples - Calculator Sample -=============================================== - -This is a very simple sample to show how an SCA composite can wire together -two components to implement a Calculator service and expose that service as -a Web Service. - -There are two sub projects in this workspace: - - sample.calculator - This contains the source code and SCDL artifacts for the SCA Calculator. - composite implementing the sample Calculator. - - - sample.calculator.client - A sample client which does a local call to the Calculator service. - -Additionally, there is the sample.calculator.app.composite file. This -describes the configuration of the SCA Calculator composite deployed to the -SCA runtime. - -See the README.html file for instructions to build and run this sample diff --git a/sca-cpp/trunk/samples/RubyCalculator/README.html b/sca-cpp/trunk/samples/RubyCalculator/README.html deleted file mode 100644 index bb6fe7e0ea..0000000000 --- a/sca-cpp/trunk/samples/RubyCalculator/README.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - Tuscany SCA Native Samples - Ruby Calculator Sample - - - -
      -
      -
      -

      Tuscany SCA Native Samples - Ruby Calculator Sample

      - -

      This is a very simple sample to show how an SCA composite can wire - together two Ruby components to implement a Calculator service and invoke - the service via a local client. -

      -

      There are two sub projects in this workspace:

      -
        -
      • sample.calculator
        - This contains the Ruby scripts and SCDL artifacts for the SCA Calculator - composite implementing the sample Calculator. -
      • -
      • sample.calculator.client
        - A sample client which does a local call to the Calculator service. -
      • -
      -

      Additionally, there is the sample.calculator.app.composite file. This - describes the configuration of the SCA Calculator composite deployed to the SCA - runtime. -

      -
      - - - - -
      -

      Building the Ruby samples on Linux and Mac OS X

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
      2. - -
      3. As the Ruby Calculator sample is based on Ruby scripts, a specific compilation step is not necessary - - only deployment is required. Deploy the Ruby samples only with the following command sequence: -
          -
        • cd <tuscany_sca_install_dir>/samples
        • -
        • ./configure --enable-ruby --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
        • -
        • make install
        • -
        - NOTE: If you don't provide the --prefix configure option, it will by default install into - /usr/local/tuscany/sca/samples/RubyCalculator
      4. -
      -
      - -
      -

      Running the Ruby Calculator sample on Linux and Mac OS X

      -
        -
      1. The Ruby Calculator sample requires the following extension: - - Please follow the documentation to ensure you have this extension built and installed - on your system -
      2. - -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        -
      4. -
      5. Run the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>/samples/RubyCalculator/deploy/sample.calculator.client
        • -
        • ./runclient.sh
        • -
        -
      6. -
      -
      - -
      -

      Building the Ruby Calculator sample on Windows

      -

      If using the binary distribution the samples are built and installed in - <tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.

      -
        -
      1. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        -
      2. -
      3. As this sample is based on Ruby scripts, a specific compilation step is not necessary - - only deployment is required. Deploy the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>\samples\RubyCalculator
        • -
        • deploy.bat
        • -
        -
      4. -
      -
      - -
      -

      Running the Ruby Calculator sample on Windows

      -
        -
      1. The Ruby Calculator sample requires the following extension: - - Please follow the documentation to ensure you have this extension built and installed - on your system -
      2. -
      3. The following environment variables are required: -
          -
        • TUSCANY_SCACPP=<path to installed Tuscany SCA>
        • -
        • TUSCANY_SDOCPP=<path to installed Tuscany SDO>
        • -
        -
      4. -
      5. Run the sample with the following commands: -
          -
        • cd <tuscany_sca_install_dir>\samples\RubyCalculator\deploy\sample.calculator.client
        • -
        • runclient.bat
        • -
        -
      6. -
      -
      - -
      -

      Getting Help

      - -

      The first place to look is at the Tuscany SCA FAQ at - http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+-+FAQ

      - -

      Any problem with this release can be reported to the Tuscany - mailing lists or create a JIRA issue at http://issues.apache.org/jira/browse/Tuscany.

      - -
      -
      -
      - - - - diff --git a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator.app.composite b/sca-cpp/trunk/samples/RubyCalculator/sample.calculator.app.composite deleted file mode 100644 index ada4d89a1c..0000000000 --- a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator.app.composite +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator.client/CalculatorClient.rb b/sca-cpp/trunk/samples/RubyCalculator/sample.calculator.client/CalculatorClient.rb deleted file mode 100644 index 253928df0c..0000000000 --- a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator.client/CalculatorClient.rb +++ /dev/null @@ -1,25 +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. -# -# - -require("tuscany_sca_ruby") - -calculator = SCA::locateService("CalculatorComponent") - -x = calculator.div(5, 2) -print x, "\n" diff --git a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator.client/Makefile.am b/sca-cpp/trunk/samples/RubyCalculator/sample.calculator.client/Makefile.am deleted file mode 100644 index 38f61539d3..0000000000 --- a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator.client/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. - -deploydir=$(prefix)/RubyCalculator/deploy -clientdir=$(deploydir)/sample.calculator.client - -client_DATA = *.rb -client_SCRIPTS = runclient.sh -EXTRA_DIST = runclient.sh *.rb diff --git a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator.client/runclient.bat b/sca-cpp/trunk/samples/RubyCalculator/sample.calculator.client/runclient.bat deleted file mode 100644 index 4a1079986a..0000000000 --- a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator.client/runclient.bat +++ /dev/null @@ -1,44 +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 "%TUSCANY_SCACPP%" == "" ( -echo "TUSCANY_SCACPP not set" -goto end -) -echo using SCA installed at %TUSCANY_SCACPP% - -if "%TUSCANY_SDOCPP%" == "" ( -echo "TUSCANY_SDOCPP not set" -goto end -) -echo using SDO installed at %TUSCANY_SDOCPP% - -set PATH=%TUSCANY_SCACPP%\extensions\ruby\bin;%TUSCANY_SCACPP%\bin;%TUSCANY_SDOCPP%\bin;%PATH% - -set TUSCANY_SCACPP_ROOT=%~d0%~p0\..\ -set TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent -set TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -cd %TUSCANY_SCACPP_ROOT%\sample.calculator.client -ruby -I%TUSCANY_SCACPP%\extensions\ruby\bin CalculatorClient.rb - -:end -endlocal diff --git a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator.client/runclient.sh b/sca-cpp/trunk/samples/RubyCalculator/sample.calculator.client/runclient.sh deleted file mode 100755 index bc2d6c0904..0000000000 --- a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator.client/runclient.sh +++ /dev/null @@ -1,42 +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$TUSCANY_SCACPP = x ]; then -echo "TUSCANY_SCACPP not set" -exit; -fi -echo "Using SCA installed at $TUSCANY_SCACPP" - -if [ x$TUSCANY_SDOCPP = x ]; then -echo "TUSCANY_SDOCPP not set" -exit; -fi -echo "Using SDO installed at $TUSCANY_SDOCPP" - -export LD_LIBRARY_PATH=$TUSCANY_SCACPP/extensions/ruby/lib:$TUSCANY_SCACPP/lib:$TUSCANY_SDOCPP/lib:$LD_LIBRARY_PATH - -export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ -export TUSCANY_SCACPP_COMPONENT=sample.calculator.CalculatorComponent -export TUSCANY_SCACPP_BASE_URI=http://localhost:9090 - -cd $TUSCANY_SCACPP_ROOT/sample.calculator.client -ruby -I$TUSCANY_SCACPP/extensions/ruby/lib CalculatorClient.rb diff --git a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator/Calculator.wsdl b/sca-cpp/trunk/samples/RubyCalculator/sample.calculator/Calculator.wsdl deleted file mode 100644 index 331b996ba2..0000000000 --- a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator/Calculator.wsdl +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator/CalculatorImpl.rb b/sca-cpp/trunk/samples/RubyCalculator/sample.calculator/CalculatorImpl.rb deleted file mode 100644 index 36ed15ff9b..0000000000 --- a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator/CalculatorImpl.rb +++ /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. -# -# - -class CalculatorImpl - - attr_writer :divideService - - def initialize() - print "Ruby - CalculatorImpl.initialize\n" - end - - def div(arg1, arg2) - print "Ruby - CalculatorImpl.div\n" - @divideService.divide(arg1.to_f, arg2.to_f) - end - - def add(arg1, arg2) - print "Ruby - CalculatorImpl.add\n" - arg1.to_f + arg2.to_f - end - - def sub(arg1, arg2) - print "Ruby - CalculatorImpl.sub\n" - arg1.to_f - arg2.to_f - end - - def mul(arg1, arg2) - print "Ruby - CalculatorImpl.mul\n" - arg1.to_f * arg2.to_f - end - -end \ No newline at end of file diff --git a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator/DivideImpl.rb b/sca-cpp/trunk/samples/RubyCalculator/sample.calculator/DivideImpl.rb deleted file mode 100644 index c6615bfcfa..0000000000 --- a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator/DivideImpl.rb +++ /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. -# -# - -class DivideImpl - - attr_writer :round - - def initialize() - print "Ruby - DivideImpl.initialize\n" - end - - def divide(arg1, arg2) - print "Ruby - DivideImpl.divide ", arg1, " / ", arg2, "\n" - res = arg1.to_f / arg2.to_f - if @round then - res = res.round - print "DivideImpl.divide rounding\n" - end - print "DivideImpl.divide ", res, "\n" - res - end - -end \ No newline at end of file diff --git a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator/Makefile.am b/sca-cpp/trunk/samples/RubyCalculator/sample.calculator/Makefile.am deleted file mode 100644 index 7de5b9fdd3..0000000000 --- a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator/Makefile.am +++ /dev/null @@ -1,22 +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. - -deploydir=$(prefix)/RubyCalculator/deploy -compositedir=$(deploydir)/sample.calculator - -composite_DATA = *.composite *.wsdl *.rb -EXTRA_DIST = *.composite *.wsdl *.rb diff --git a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator/sample.calculator.composite b/sca-cpp/trunk/samples/RubyCalculator/sample.calculator/sample.calculator.composite deleted file mode 100644 index d77ba538fe..0000000000 --- a/sca-cpp/trunk/samples/RubyCalculator/sample.calculator/sample.calculator.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - DivideComponent - - - - - true - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.demo.app.composite b/sca-cpp/trunk/samples/SupplyChain/supplychain.demo.app.composite deleted file mode 100644 index 3b8738a843..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.demo.app.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - supplychain.Retailer/RetailerService - supplychain.Logging/LoggingService - - - - - - - diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.demo/DemoClientImpl.componentType b/sca-cpp/trunk/samples/SupplyChain/supplychain.demo/DemoClientImpl.componentType deleted file mode 100644 index a63e4c37d3..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.demo/DemoClientImpl.componentType +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.demo/supplychain.demo.composite b/sca-cpp/trunk/samples/SupplyChain/supplychain.demo/supplychain.demo.composite deleted file mode 100644 index 20b0e49ec1..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.demo/supplychain.demo.composite +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - retailer - logging - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.logging/LoggerImpl.componentType b/sca-cpp/trunk/samples/SupplyChain/supplychain.logging/LoggerImpl.componentType deleted file mode 100644 index e78e602635..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.logging/LoggerImpl.componentType +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.logging/LoggingFacility.wsdl b/sca-cpp/trunk/samples/SupplyChain/supplychain.logging/LoggingFacility.wsdl deleted file mode 100644 index c78357b1a8..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.logging/LoggingFacility.wsdl +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.logging/supplychain.logging.composite b/sca-cpp/trunk/samples/SupplyChain/supplychain.logging/supplychain.logging.composite deleted file mode 100644 index 2b28c8f9e2..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.logging/supplychain.logging.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - Logger/Logging - - - - - - - diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturer/Manufacturer.wsdl b/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturer/Manufacturer.wsdl deleted file mode 100644 index fb0c8a5676..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturer/Manufacturer.wsdl +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturer/ManufacturerImpl.componentType b/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturer/ManufacturerImpl.componentType deleted file mode 100644 index 63530bc0ee..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturer/ManufacturerImpl.componentType +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturer/WarehouseCallback.wsdl b/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturer/WarehouseCallback.wsdl deleted file mode 100644 index 256671f64f..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturer/WarehouseCallback.wsdl +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturer/supplychain.manufacturer.composite b/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturer/supplychain.manufacturer.composite deleted file mode 100644 index c61657c0a7..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturer/supplychain.manufacturer.composite +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - ManufacturerProcess/ManufacturerService - - - - - - - callback - logging - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturerA.app.composite b/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturerA.app.composite deleted file mode 100644 index 1963304b83..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturerA.app.composite +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - supplychain.Logging/LoggingService - manufacturerA - - - diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturerB.app.composite b/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturerB.app.composite deleted file mode 100644 index a2f9141f00..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturerB.app.composite +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - supplychain.Logging/LoggingService - manufacturerB - - - diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturerC.app.composite b/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturerC.app.composite deleted file mode 100644 index a48258b6ca..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.manufacturerC.app.composite +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - supplychain.Logging/LoggingService - manufacturerC - - - diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.retailer.app.composite b/sca-cpp/trunk/samples/SupplyChain/supplychain.retailer.app.composite deleted file mode 100644 index 734849de05..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.retailer.app.composite +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - supplychain.WarehouseA/WarehouseService - supplychain.WarehouseB/WarehouseService - supplychain.WarehouseC/WarehouseService - supplychain.Logging/LoggingService - - - - - supplychain.manufacturerA/ManufacturerService - supplychain.Logging/LoggingService - warehouseA - - - - - supplychain.manufacturerB/ManufacturerService - supplychain.Logging/LoggingService - warehouseB - - - - - supplychain.manufacturerA/ManufacturerService - supplychain.Logging/LoggingService - warehouseC - - - - supplychain.manufacturerA/callback - supplychain.WarehouseA/WarehouseCallbackService - - - supplychain.manufacturerB/callback - supplychain.WarehouseB/WarehouseCallbackService - - - supplychain.manufacturerC/callback - supplychain.WarehouseC/WarehouseCallbackService - - - diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.retailer/Retailer.wsdl b/sca-cpp/trunk/samples/SupplyChain/supplychain.retailer/Retailer.wsdl deleted file mode 100644 index 39bd1963f2..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.retailer/Retailer.wsdl +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.retailer/RetailerImpl.componentType b/sca-cpp/trunk/samples/SupplyChain/supplychain.retailer/RetailerImpl.componentType deleted file mode 100644 index fb381ec9a6..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.retailer/RetailerImpl.componentType +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.retailer/supplychain.retailer.composite b/sca-cpp/trunk/samples/SupplyChain/supplychain.retailer/supplychain.retailer.composite deleted file mode 100644 index 51a2b96b1b..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.retailer/supplychain.retailer.composite +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - RetailerProcess/RetailerService - - - - - warehouses - logging - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.warehouse/Warehouse.wsdl b/sca-cpp/trunk/samples/SupplyChain/supplychain.warehouse/Warehouse.wsdl deleted file mode 100644 index a007f9957b..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.warehouse/Warehouse.wsdl +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.warehouse/WarehouseCallbackImpl.componentType b/sca-cpp/trunk/samples/SupplyChain/supplychain.warehouse/WarehouseCallbackImpl.componentType deleted file mode 100644 index fbc1edb462..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.warehouse/WarehouseCallbackImpl.componentType +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.warehouse/WarehouseImpl.componentType b/sca-cpp/trunk/samples/SupplyChain/supplychain.warehouse/WarehouseImpl.componentType deleted file mode 100644 index 7f63d3b571..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.warehouse/WarehouseImpl.componentType +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-cpp/trunk/samples/SupplyChain/supplychain.warehouse/supplychain.warehouse.composite b/sca-cpp/trunk/samples/SupplyChain/supplychain.warehouse/supplychain.warehouse.composite deleted file mode 100644 index e44b964eb4..0000000000 --- a/sca-cpp/trunk/samples/SupplyChain/supplychain.warehouse/supplychain.warehouse.composite +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - WarehouseProcess/WarehouseService - - - - - - WarehouseCallbackProcess/WarehouseCallbackService - - - - - - - manufacturer - logging - - - - - - logging - - - - - - - - - - - - - - diff --git a/sca-cpp/trunk/samples/autogen.sh b/sca-cpp/trunk/samples/autogen.sh deleted file mode 100755 index 18277601c8..0000000000 --- a/sca-cpp/trunk/samples/autogen.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# 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. - -for i in "libtoolize --force" aclocal autoconf autoheader -do - echo -n "Running $i..." - $i || exit 1 - echo 'done.' -done - -echo -n 'Running automake...' -automake --add-missing -echo 'done.' -exit 0 - diff --git a/sca-cpp/trunk/samples/build.sh b/sca-cpp/trunk/samples/build.sh deleted file mode 100755 index c306d2a20d..0000000000 --- a/sca-cpp/trunk/samples/build.sh +++ /dev/null @@ -1,22 +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. - -./configure.sh -make install - diff --git a/sca-cpp/trunk/samples/configure.ac b/sca-cpp/trunk/samples/configure.ac deleted file mode 100644 index 41cd6f4dbe..0000000000 --- a/sca-cpp/trunk/samples/configure.ac +++ /dev/null @@ -1,206 +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. - -dnl run autogen.sh to generate the configure script. - -AC_PREREQ(2.59) -AC_INIT(tuscany-sca-samples, 1.0-M3) -AC_CANONICAL_SYSTEM -AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) -AC_PREFIX_DEFAULT(/usr/local/tuscany/sca/samples) - -# Checks for programs. -AC_PROG_CXX -AC_PROG_CC -AC_PROG_CPP -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MAKE_SET -AC_PROG_LIBTOOL - -# Check for running on Darwin -AC_MSG_CHECKING([Checking if running on Darwin]) -UNAME=`uname -s` -if test "x$UNAME" = "xDarwin"; then - AC_DEFINE([IS_DARWIN], [1], [Set to 1 when running on Darwin - Mac OSX]) - AC_MSG_RESULT(yes) - AC_SUBST([libsuffix],[".dylib"]) - is_darwin=true -else - AC_MSG_RESULT(no) - AC_SUBST([libsuffix],[".so"]) - is_darwin=false -fi -AM_CONDITIONAL([DARWIN], [test x$is_darmin = xtrue]) - -# Checks for libraries. - -# Checks for header files. -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_CHECK_HEADERS([inttypes.h stdlib.h string.h sys/time.h unistd.h]) - -# Checks for typedefs, structures, and compiler characteristics. -AC_HEADER_STDBOOL -AC_C_CONST -AC_C_INLINE - -# Checks for library functions. -AC_FUNC_CLOSEDIR_VOID -AC_FUNC_STAT -AC_FUNC_VPRINTF -AC_CHECK_FUNCS([getcwd putenv strdup]) - -# Configure TUSCANY_SCACPP and TUSCANY_SDOCPP -TUSCANY_SCACPP=`echo "$TUSCANY_SCACPP"` -if test "x$TUSCANY_SCACPP" = "x"; then - SCAPWD=`pwd` - AC_SUBST([TUSCANY_SCACPP], ["$SCAPWD/.."]) -fi - -TUSCANY_SDOCPP=`echo "$TUSCANY_SDOCPP"` -if test "x$TUSCANY_SDOCPP" = "x"; then - SCAPWD=`pwd` - AC_SUBST([TUSCANY_SDOCPP], ["$SCAPWD/../../sdo/deploy"]) -fi - -# Configure LIBXML2_INCLUDE and LIBXML2_LIB -LIBXML2_INCLUDE=`echo "$LIBXML2_INCLUDE"` -if test "x$LIBXML2_INCLUDE" = "x"; then - AC_SUBST([LIBXML2_INCLUDE], ["/usr/include/libxml2"]) -fi - -LIBXML2_LIB=`echo "$LIBXML2_LIB"` -if test "x$LIBXML2_LIB" = "x"; then - AC_SUBST([LIBXML2_LIB], ["/usr/lib"]) -fi - -# Configure GCC C++ compile options -AC_SUBST([CXXFLAGS], ["$(CXXFLAGS) -D_DEBUG -O0 -g3 -Wall -std=c++0x -fmessage-length=0"]) - -AC_MSG_CHECKING(whether to build all samples) -AC_ARG_ENABLE(all-samples, [AS_HELP_STRING([--enable-all-samples],[build all samples [default=no]])], -[ case "${enableval}" in - no) - AC_MSG_RESULT(no) - want_all_samples=false - ;; - *) - AC_MSG_RESULT(yes) - want_all_samples=true - ;; - esac ], -[ AC_MSG_RESULT(no) - want_all_samples=false ] -) -AM_CONDITIONAL([WANT_ALL_SAMPLES], [test x$want_all_samples = xtrue]) - -AC_MSG_CHECKING(whether to build C++ samples) -AC_ARG_ENABLE(cpp, [AS_HELP_STRING([--enable-cpp],[build C++ samples [default=yes]])], -[ case "${enableval}" in - no) - AC_MSG_RESULT(no) - want_cpp_samples=false - ;; - *) - AC_MSG_RESULT(yes) - want_cpp_samples=true - ;; - esac ], -[ AC_MSG_RESULT(yes) - want_cpp_samples=true ] -) -AM_CONDITIONAL([WANT_CPP_SAMPLES], [test x$want_cpp_samples = xtrue]) - -AC_MSG_CHECKING(whether to build Python samples) -AC_ARG_ENABLE(python, [AS_HELP_STRING([--enable-python],[build Python samples [default=no]])], -[ case "${enableval}" in - no) - AC_MSG_RESULT(no) - want_python_samples=false - ;; - *) - AC_MSG_RESULT(yes) - want_python_samples=true - ;; - esac ], -[ AC_MSG_RESULT(no) - want_python_samples=false ] -) -AM_CONDITIONAL([WANT_PYTHON_SAMPLES], [test x$want_python_samples = xtrue]) - -AC_MSG_CHECKING(whether to build Ruby samples) -AC_ARG_ENABLE(ruby, [AS_HELP_STRING([--enable-ruby],[build Ruby samples [default=no]])], -[ case "${enableval}" in - no) - AC_MSG_RESULT(no) - want_ruby_samples=false - ;; - *) - AC_MSG_RESULT(yes) - want_ruby_samples=true - ;; - esac ], -[ AC_MSG_RESULT(no) - want_ruby_samples=false ] -) -AM_CONDITIONAL([WANT_RUBY_SAMPLES], [test x$want_ruby_samples = xtrue]) - -AC_CONFIG_FILES([Makefile - AlertAggregator/Makefile - AlertAggregator/sample.alerter/Makefile - AlertAggregator/sample.display/Makefile - AlertAggregator/httpserver/Makefile - CppCalculator/Makefile - CppCalculator/sample.calculator/Makefile - CppCalculator/sample.calculator.client/Makefile - RubyCalculator/Makefile - RubyCalculator/sample.calculator/Makefile - RubyCalculator/sample.calculator.client/Makefile - PythonCalculator/Makefile - PythonCalculator/sample.calculator/Makefile - PythonCalculator/sample.calculator.client/Makefile - PythonWeatherForecast/Makefile - PythonWeatherForecast/sample.weather/Makefile - PythonWeatherForecast/sample.weather.client/Makefile - RestCalculator/Makefile - RestCalculator/sample.calculator/Makefile - RestCalculator/sample.calculator.restclient/Makefile - RestCalculator/httpserver/Makefile - RestCustomer/Makefile - RestCustomer/sample.customer/Makefile - RestCustomer/sample.customer.restclient/Makefile - RestCustomer/httpserver/Makefile - RestYahoo/Makefile - RestYahoo/sample.yahoo/Makefile - RestYahoo/sample.yahoo.client/Makefile - CppBigBank/Makefile - CppBigBank/bigbank.account/Makefile - CppBigBank/bigbank.client/Makefile - CppBigBank/bigbank.phpwsclient/Makefile - RubyBigBank/Makefile - RubyBigBank/bigbank.account/Makefile - RubyBigBank/bigbank.client/Makefile - RubyBigBank/bigbank.wsclient/Makefile - HttpdBigBank/Makefile - HttpdBigBank/bigbank.account/Makefile - HttpdBigBank/bigbank.accountdata/Makefile - HttpdBigBank/bigbank.wsclient/Makefile - HttpdBigBank/httpserver/Makefile - ]) -AC_OUTPUT diff --git a/sca-cpp/trunk/samples/runtest.sh b/sca-cpp/trunk/samples/runtest.sh deleted file mode 100755 index 1c016a5287..0000000000 --- a/sca-cpp/trunk/samples/runtest.sh +++ /dev/null @@ -1,159 +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. - - -echo "Running CppCalculator client" -cd $TUSCANY_SCACPP/samples/CppCalculator/deploy/sample.calculator.client -r=`./runclient.sh | grep "div(5,2) = 2.5"` -if [ "x$r" == "x" ] -then - echo "CppCalculator client failed" -fi - -echo "Running CppCalculator wsclient" -cd $TUSCANY_SCACPP/samples/CppCalculator/deploy/sample.calculator -(./runwsserver.sh >/dev/null)& -cd $TUSCANY_SCACPP/samples/CppCalculator/deploy/sample.calculator.wsclient -r=`./runwsclient.sh | grep "Result = 2.500e+00"` -killall -q axis2_http_server >/dev/null -if [ "x$r" == "x" ] -then - echo "CppCalculator wsclient failed" -fi - -echo "Running CppBigBank client" -cd $TUSCANY_SCACPP/samples/CppBigBank/deploy/bigbank.client -r=`./runclient.sh | grep "Balance"` -if [ "x$r" == "x" ] -then - echo "CppBigBank client failed" -fi - -echo "Running CppBigBank wsclient" -cd $TUSCANY_SCACPP/samples/CppBigBank/deploy/bigbank.account -(./runwsserver.sh >/dev/null)& -cd $TUSCANY_SCACPP/samples/CppBigBank/deploy/bigbank.wsclient -r=`./runwsclient.sh | grep ""` -killall -q axis2_http_server >/dev/null -if [ "x$r" == "x" ] -then - echo "CppBigBank wsclient failed" -fi - -echo "Running RubyCalculator client" -cd $TUSCANY_SCACPP/samples/RubyCalculator/deploy/sample.calculator.client -r=`./runclient.sh | grep "^3"` -if [ "x$r" == "x" ] -then - echo "RubyCalculator client failed" -fi - -echo "Running RubyCalculator wsclient" -cd $TUSCANY_SCACPP/samples/RubyCalculator/deploy/sample.calculator -(./runwsserver.sh >/dev/null)& -cd $TUSCANY_SCACPP/samples/RubyCalculator/deploy/sample.calculator.wsclient -r=`./runwsclient.sh | grep "^3.0"` -killall -q axis2_http_server >/dev/null -if [ "x$r" == "x" ] -then - echo "RubyCalculator wsclient failed" -fi - -echo "Running RubyBigBank client" -cd $TUSCANY_SCACPP/samples/RubyBigBank/deploy/bigbank.client -r=`./runclient.sh | grep "Balance:"` -if [ "x$r" == "x" ] -then - echo "RubyBigBank client failed" -fi - -echo "Running RubyBigBank wsclient" -cd $TUSCANY_SCACPP/samples/RubyBigBank/deploy/bigbank.account -(./runwsserver.sh >/dev/null)& -cd $TUSCANY_SCACPP/samples/RubyBigBank/deploy/bigbank.wsclient -r=`./runwsclient.sh | grep "Balance:"` -killall -q axis2_http_server >/dev/null -if [ "x$r" == "x" ] -then - echo "RubyBigBank wsclient failed" -fi - -echo "Running PythonCalculator client" -cd $TUSCANY_SCACPP/samples/PythonCalculator/deploy/sample.calculator.client -r=`./runclient.sh | grep "div ( 5 , 2 ) = 3.0"` -if [ "x$r" == "x" ] -then - echo "PythonCalculator client failed" -fi - -echo "Running PythonCalculator wsclient" -cd $TUSCANY_SCACPP/samples/PythonCalculator/deploy/sample.calculator -(./runwsserver.sh >/dev/null)& -cd $TUSCANY_SCACPP/samples/PythonCalculator/deploy/sample.calculator.wsclient -r=`./runwsclient.sh | grep "div ( 5 , 2 ) = 3.0"` -killall -q axis2_http_server >/dev/null -if [ "x$r" == "x" ] -then - echo "PythonCalculator wsclient failed" -fi - -echo "Running PythonWeatherForecast client" -cd $TUSCANY_SCACPP/samples/PythonWeatherForecast/deploy/sample.weather.client -r=`./runclient.sh | grep "Latitude: 34.090107"` -if [ "x$r" == "x" ] -then - echo "PythonWeatherForecast client failed" -fi - -echo "Running HttpdBigBank wsclient" -cd $TUSCANY_SCACPP/samples/HttpdBigBank/deploy/httpserver -./startserver.sh >/dev/null -cd $TUSCANY_SCACPP/samples/HttpdBigBank/deploy/bigbank.wsclient -r=`./runwsclient.sh | grep "Balance:"` -cd $TUSCANY_SCACPP/samples/HttpdBigBank/deploy/httpserver -./stopserver.sh >/dev/null -if [ "x$r" == "x" ] -then - echo "HttpdBigBank wsclient failed" -fi - -echo "Running RestCalculator restclient" -cd $TUSCANY_SCACPP/samples/RestCalculator/deploy/httpserver -./startserver.sh >/dev/null -cd $TUSCANY_SCACPP/samples/RestCalculator/deploy/sample.calculator.restclient -r=`./runrestclient.sh | grep "^3"` -cd $TUSCANY_SCACPP/samples/RestCalculator/deploy/httpserver -./stopserver.sh >/dev/null -if [ "x$r" == "x" ] -then - echo "RestCalculator restclient failed" -fi - -echo "Running RestCustomer restclient" -cd $TUSCANY_SCACPP/samples/RestCustomer/deploy/httpserver -./startserver.sh >/dev/null -cd $TUSCANY_SCACPP/samples/RestCustomer/deploy/sample.customer.restclient -r=`./runrestclient.sh | grep "Command - Deleted customer 1234"` -cd $TUSCANY_SCACPP/samples/RestCustomer/deploy/httpserver -./stopserver.sh >/dev/null -if [ "x$r" == "x" ] -then - echo "RestCustomer restclient failed" -fi - diff --git a/sca-cpp/trunk/samples/scagen.bat b/sca-cpp/trunk/samples/scagen.bat deleted file mode 100644 index 169855a0a9..0000000000 --- a/sca-cpp/trunk/samples/scagen.bat +++ /dev/null @@ -1,37 +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 copy the correct files from the source tree for packaging and -rem deployment of the SCA Calculator sample. - -setlocal - -if . == .%1 ( -echo source path not specified -goto usage -) -set srcdir=%1 - -%TUSCANY_SCACPP%\extensions\cpp\bin\scagen.bat -dir %srcdir% -output %srcdir% -verbose - -goto end -:usage -echo Usage: scagen -:end - -endlocal diff --git a/sca-cpp/trunk/test/store-function/Makefile.am b/sca-cpp/trunk/test/store-function/Makefile.am index 8d73bf3bff..1628ffb624 100644 --- a/sca-cpp/trunk/test/store-function/Makefile.am +++ b/sca-cpp/trunk/test/store-function/Makefile.am @@ -15,18 +15,14 @@ # specific language governing permissions and limitations # under the License. -store_function_PROGRAMS = store-function-test -store_functiondir=$(prefix)/test/store-function/deploy +noinst_PROGRAMS = store-function-test -nobase_include_HEADERS = *.hpp +noinst_HEADERS = *.hpp INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${APR_INCLUDE} store_function_test_SOURCES = store-function-test.cpp store_function_test_LDADD = -lpthread -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1 -EXTRA_DIST = *.composite -store_function_DATA = *.composite - TESTS = store-function-test diff --git a/sca-cpp/trunk/test/store-object/Makefile.am b/sca-cpp/trunk/test/store-object/Makefile.am index 9e5621c6ca..0ff35210d4 100644 --- a/sca-cpp/trunk/test/store-object/Makefile.am +++ b/sca-cpp/trunk/test/store-object/Makefile.am @@ -15,18 +15,14 @@ # specific language governing permissions and limitations # under the License. -store_object_PROGRAMS = store-object-test -store_objectdir=$(prefix)/test/store-object/deploy +noinst_PROGRAMS = store-object-test -nobase_include_HEADERS = *.hpp +noinst_HEADERS = *.hpp INCLUDES = -I. -I$(top_builddir)/kernel -I${LIBXML2_INCLUDE} -I${APR_INCLUDE} store_object_test_SOURCES = store-object-test.cpp store_object_test_LDADD = -lpthread -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1 -EXTRA_DIST = *.composite -store_object_DATA = *.composite - TESTS = store-object-test diff --git a/sca-cpp/trunk/test/store-script/Makefile.am b/sca-cpp/trunk/test/store-script/Makefile.am index d5c4a8c0eb..9795d16a2b 100644 --- a/sca-cpp/trunk/test/store-script/Makefile.am +++ b/sca-cpp/trunk/test/store-script/Makefile.am @@ -15,16 +15,12 @@ # specific language governing permissions and limitations # under the License. -store_script_PROGRAMS = store-script-test -store_scriptdir=$(prefix)/test/store-script/deploy +noinst_PROGRAMS = store-script-test -INCLUDES = -I. -I$(top_builddir)/kernel -I$(top_builddir)/modules/eval -I${LIBXML2_INCLUDE} -I${APR_INCLUDE} -I${LIBMOZJS_INCLUDE} +INCLUDES = -I. -I$(top_builddir)/kernel -I$(top_builddir)/modules/eval -I${LIBXML2_INCLUDE} -I${APR_INCLUDE} -I${JS_INCLUDE} store_script_test_SOURCES = store-script-test.cpp -store_script_test_LDADD = -lpthread -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1 -L${LIBMOZJS_LIB} -lmozjs +store_script_test_LDADD = -lpthread -L${LIBXML2_LIB} -lxml2 -L${APR_LIB} -lapr-1 -laprutil-1 -L${JS_LIB} -lmozjs -EXTRA_DIST = *.composite -store_script_DATA = *.composite - TESTS = store-script-test store-http-test -- cgit v1.2.3