You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2006/08/28 12:42:20 UTC

svn commit: r437637 [1/8] - in /incubator/tuscany/cpp/sca: runtime/core/src/ runtime/core/src/osoa/sca/ runtime/core/src/tuscany/sca/core/ runtime/core/src/tuscany/sca/cpp/ runtime/core/src/tuscany/sca/extension/ runtime/core/src/tuscany/sca/model/ run...

Author: jsdelfino
Date: Mon Aug 28 03:42:10 2006
New Revision: 437637

URL: http://svn.apache.org/viewvc?rev=437637&view=rev
Log:
Refactored the assembly model classes to support composites, separate component and component type, and delegate creation of service proxies and service wrappers to the bindings and component implementations

Added:
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ComponentContextImpl.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ComponentContextImpl.h   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeContextImpl.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeContextImpl.h   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeServiceHelper.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeServiceHelper.h   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/DefaultServiceProxy.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/DefaultServiceProxy.h   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/cpp/   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/cpp/CPPServiceWrapper.h   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ComponentType.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ComponentType.h   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CompositeReference.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CompositeReference.h   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CompositeService.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CompositeService.h   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Contract.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Contract.h   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Reference.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Reference.h   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ReferenceBinding.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ReferenceBinding.h   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ReferenceType.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ReferenceType.h   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ServiceBinding.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ServiceBinding.h   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ServiceType.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ServiceType.h   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.h   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLOperation.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLOperation.h   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSReferenceBinding.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSReferenceBinding.h   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSServiceBinding.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSServiceBinding.h   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSServiceWrapper.h   (with props)
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/CPPServiceProxy.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/CPPServiceProxy.h   (with props)
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/CPPServiceWrapper.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/CPPServiceWrapper.h   (with props)
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/model/CPPReferenceBinding.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/model/CPPReferenceBinding.h   (with props)
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/model/CPPServiceBinding.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/model/CPPServiceBinding.h   (with props)
    incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/WSServiceWrapper.cpp   (with props)
Removed:
    incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ComponentContextImpl.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ComponentContextImpl.h
    incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/CompositeContextImpl.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/CompositeContextImpl.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ComponentServiceWrapper.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ComponentServiceWrapper.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeReferenceWrapper.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeReferenceWrapper.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeService.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeService.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPImplementation.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPImplementation.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CompositeReferenceType.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CompositeReferenceType.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CompositeServiceType.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CompositeServiceType.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Implementation.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Implementation.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ServiceReference.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ServiceReference.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Subsystem.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/System.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/System.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSBinding.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSBinding.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WireTarget.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WireTarget.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wsdl.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wsdl.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WsdlOperation.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WsdlOperation.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSReferenceWrapper.h
    incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/WSReferenceWrapper.cpp
Modified:
    incubator/tuscany/cpp/sca/runtime/core/src/Makefile.am
    incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ComponentContext.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ComponentContext.h
    incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/CompositeContext.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/CompositeContext.h
    incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ServiceList.h
    incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ServiceRuntimeException.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Operation.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceWrapper.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceWrapper.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ImplementationExtension.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/InterfaceExtension.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Binding.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Binding.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Composite.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Composite.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wire.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Library.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Logging.h
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSServiceProxy.cpp
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/ws/WSServiceProxy.h
    incubator/tuscany/cpp/sca/runtime/core/test/CustomerInfo/CustomerInfoImpl_CustomerInfoService_Proxy.h
    incubator/tuscany/cpp/sca/runtime/core/test/CustomerInfo/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp
    incubator/tuscany/cpp/sca/runtime/core/test/CustomerInfo/CustomerInfoImpl_CustomerInfoService_Wrapper.h
    incubator/tuscany/cpp/sca/runtime/core/test/CustomerInfo/Makefile.am
    incubator/tuscany/cpp/sca/runtime/core/test/MyValue/Makefile.am
    incubator/tuscany/cpp/sca/runtime/core/test/MyValue/MyValueImpl_MyValueService_Proxy.h
    incubator/tuscany/cpp/sca/runtime/core/test/MyValue/MyValueImpl_MyValueService_Wrapper.cpp
    incubator/tuscany/cpp/sca/runtime/core/test/MyValue/MyValueImpl_MyValueService_Wrapper.h
    incubator/tuscany/cpp/sca/runtime/core/test/MyValue/MyValueImpl_customerInfo_Proxy.h
    incubator/tuscany/cpp/sca/runtime/core/test/MyValue/MyValueImpl_stockQuote_Proxy.h
    incubator/tuscany/cpp/sca/runtime/core/test/src/Makefile.am
    incubator/tuscany/cpp/sca/runtime/extensions/   (props changed)
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/   (props changed)
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/   (props changed)
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/CPPExtension.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/CPPExtension.h
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/CPPImplementationExtension.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/CPPImplementationExtension.h
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/CPPInterfaceExtension.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/CPPInterfaceExtension.h
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/Makefile.am
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/model/CPPImplementation.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/model/CPPImplementation.h
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/model/CPPInterface.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/model/CPPInterface.h
    incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/Axis2Client.cpp
    incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/Axis2Client.h
    incubator/tuscany/cpp/sca/runtime/ws_reference/axis2c/src/Makefile.am
    incubator/tuscany/cpp/sca/runtime/ws_service/axis2c/src/Axis2Service_skeleton.cpp
    incubator/tuscany/cpp/sca/runtime/ws_service/axis2c/src/Axis2Utils.h
    incubator/tuscany/cpp/sca/runtime/ws_service/axis2c/src/Makefile.am
    incubator/tuscany/cpp/sca/samples/BigBank/AccountClient/Makefile.am
    incubator/tuscany/cpp/sca/samples/BigBank/AccountClient/runclient.cmd
    incubator/tuscany/cpp/sca/samples/BigBank/AccountClient/runclient.sh
    incubator/tuscany/cpp/sca/samples/BigBank/Accounts/Makefile.am
    incubator/tuscany/cpp/sca/samples/Calculator/CalculatorComposite/CalculatorImpl_CalculatorService_Wrapper.cpp
    incubator/tuscany/cpp/sca/samples/Calculator/CalculatorComposite/CalculatorImpl_CalculatorService_Wrapper.h
    incubator/tuscany/cpp/sca/samples/Calculator/CalculatorComposite/DivideServiceImpl_DivideService_Wrapper.cpp
    incubator/tuscany/cpp/sca/samples/Calculator/CalculatorComposite/DivideServiceImpl_DivideService_Wrapper.h
    incubator/tuscany/cpp/sca/samples/Calculator/CalculatorComposite/Makefile.am
    incubator/tuscany/cpp/sca/samples/Calculator/Client/Makefile.am
    incubator/tuscany/cpp/sca/samples/Calculator/Client/runclient.cmd
    incubator/tuscany/cpp/sca/samples/Calculator/Client/runclient.sh
    incubator/tuscany/cpp/sca/test/WSEntryPointTest/WSEntryPointTestComposite/WSEntryPointTest.h
    incubator/tuscany/cpp/sca/test/WSEntryPointTest/WSEntryPointTestComposite/WSEntryPointTestImpl.cpp
    incubator/tuscany/cpp/sca/test/WSEntryPointTest/WSEntryPointTestComposite/WSEntryPointTestImpl.h
    incubator/tuscany/cpp/sca/test/WSEntryPointTest/WSEntryPointTestComposite/WSEntryPointTestImpl_WSEntryPointTestService_Proxy.cpp
    incubator/tuscany/cpp/sca/test/WSEntryPointTest/WSEntryPointTestComposite/WSEntryPointTestImpl_WSEntryPointTestService_Proxy.h
    incubator/tuscany/cpp/sca/test/WSEntryPointTest/WSEntryPointTestComposite/WSEntryPointTestImpl_WSEntryPointTestService_Wrapper.cpp
    incubator/tuscany/cpp/sca/test/WSEntryPointTest/WSEntryPointTestComposite/WSEntryPointTestImpl_WSEntryPointTestService_Wrapper.h
    incubator/tuscany/cpp/sca/test/WSEntryPointTest/runtime/packages/WSEntryPointTestComposite/WSEntryPointTest.h
    incubator/tuscany/cpp/sca/test/WSEntryPointTest/runtime/packages/WSEntryPointTestComposite/WSEntryPointTestImpl.h
    incubator/tuscany/cpp/sca/test/WSEntryPointTestRPC/WSEntryPointTestRPCComposite/WSEntryPointTestRPC.h
    incubator/tuscany/cpp/sca/test/WSEntryPointTestRPC/WSEntryPointTestRPCComposite/WSEntryPointTestRPCImpl.cpp
    incubator/tuscany/cpp/sca/test/WSEntryPointTestRPC/WSEntryPointTestRPCComposite/WSEntryPointTestRPCImpl.h
    incubator/tuscany/cpp/sca/test/WSEntryPointTestRPC/WSEntryPointTestRPCComposite/WSEntryPointTestRPCImpl_WSEntryPointTestRPCService_Proxy.cpp
    incubator/tuscany/cpp/sca/test/WSEntryPointTestRPC/WSEntryPointTestRPCComposite/WSEntryPointTestRPCImpl_WSEntryPointTestRPCService_Proxy.h
    incubator/tuscany/cpp/sca/test/WSEntryPointTestRPC/WSEntryPointTestRPCComposite/WSEntryPointTestRPCImpl_WSEntryPointTestRPCService_Wrapper.cpp
    incubator/tuscany/cpp/sca/test/WSEntryPointTestRPC/WSEntryPointTestRPCComposite/WSEntryPointTestRPCImpl_WSEntryPointTestRPCService_Wrapper.h
    incubator/tuscany/cpp/sca/test/WSEntryPointTestRPC/runtime/packages/WSEntryPointTestRPCComposite/WSEntryPointTestRPC.h
    incubator/tuscany/cpp/sca/test/WSEntryPointTestRPC/runtime/packages/WSEntryPointTestRPCComposite/WSEntryPointTestRPCImpl.h
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Wrapper.cpp
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/CalculatorCompositeAndComponent/expected_output/CalculatorImpl_CalculatorService_Wrapper.h
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Wrapper.cpp
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorBackImpl_CalculatorService_Wrapper.h
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Wrapper.cpp
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/CalculatorSlashDirectionTest/expected_output/CalculatorForwardImpl_CalculatorService_Wrapper.h
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/CustomerInfoImplMultiParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/CustomerInfoImplSingleParamDiffTypesTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.cpp
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.h
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Wrapper.cpp
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/MyValueServiceComposite/expected_output/MyValueImpl_MyValueService_Wrapper.h
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.cpp
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.h
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.cpp
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/MyValueServiceCompositeImplClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.h
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.cpp
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespace/expected_output/MyValueImpl_MyValueService_Wrapper.h
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.cpp
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/MyValueServiceCompositeIntfClassWithNamespaceButNotInClassAttr/expected_output/MyValueImpl_MyValueService_Wrapper.h
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.cpp
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/CustomerInfoImpl2_CustomerInfoService_Wrapper.h
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Wrapper.cpp
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/MyValueServiceCompositeTwoClasses/expected_output/MyValueImpl_MyValueService_Wrapper.h
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.cpp
    incubator/tuscany/cpp/sca/tools/scagen/junit/testoutput/SimplePublicPrivateProtectedTest/expected_output/CustomerInfoImpl_CustomerInfoService_Wrapper.h
    incubator/tuscany/cpp/sca/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperCPP.xsl
    incubator/tuscany/cpp/sca/tools/scagen/src/org/apache/tuscany/sca/cpp/tools/services/xsl/SCA4CPPIntfWrapperHeader.xsl

Modified: incubator/tuscany/cpp/sca/runtime/core/src/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/Makefile.am?rev=437637&r1=437636&r2=437637&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/Makefile.am (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/Makefile.am Mon Aug 28 03:42:10 2006
@@ -1,63 +1,52 @@
 lib_LTLIBRARIES = libtuscany_sca.la
 
 nobase_include_HEADERS = \
-osoa/sca/ComponentContext.h \
-osoa/sca/ComponentContextImpl.h \
-osoa/sca/export.h \
-osoa/sca/CompositeContext.h \
-osoa/sca/CompositeContextImpl.h \
-osoa/sca/sca.h \
-osoa/sca/ServiceList.h \
-osoa/sca/ServiceRuntimeException.h \
-tuscany/sca/core/ComponentServiceWrapper.h \
-tuscany/sca/core/CompositeReferenceWrapper.h \
-tuscany/sca/core/Operation.h \
-tuscany/sca/core/CompositeService.h \
-tuscany/sca/core/SCARuntime.h \
-tuscany/sca/core/ServiceProxy.h \
-tuscany/sca/core/ServiceWrapper.h \
-tuscany/sca/core/TuscanyRuntime.h \
-tuscany/sca/model/Binding.h \
-tuscany/sca/model/Component.h \
-tuscany/sca/model/CPPImplementation.h \
-tuscany/sca/model/CPPInterface.h \
-tuscany/sca/model/CompositeServiceType.h \
-tuscany/sca/model/CompositeReferenceType.h \
-tuscany/sca/model/Implementation.h \
-tuscany/sca/model/Interface.h \
-tuscany/sca/model/ModelLoader.h \
-tuscany/sca/model/Composite.h \
-tuscany/sca/model/Service.h \
-tuscany/sca/model/ServiceReference.h \
-tuscany/sca/model/Subsystem.h \
-tuscany/sca/model/System.h \
-tuscany/sca/model/Wire.h \
-tuscany/sca/model/WireTarget.h \
-tuscany/sca/model/WSBinding.h \
-tuscany/sca/model/Wsdl.h \
-tuscany/sca/model/WsdlOperation.h \
-tuscany/sca/util/DefaultLogWriter.h \
-tuscany/sca/util/Exceptions.h \
-tuscany/sca/util/File.h \
-tuscany/sca/util/FileLogWriter.h \
-tuscany/sca/util/Library.h \
-tuscany/sca/util/Logger.h \
-tuscany/sca/util/Logging.h \
-tuscany/sca/util/LogWriter.h \
-tuscany/sca/util/Utils.h \
-tuscany/sca/ws/WSReferenceWrapper.h \
-tuscany/sca/ws/WSServiceProxy.h \
+osoa/sca/*.h \
+tuscany/sca/core/*.h \
+tuscany/sca/model/*.h \
+tuscany/sca/util/*.h \
+tuscany/sca/cpp/*.h \
+tuscany/sca/ws/*.h \
 tuscany/sca/extension/*.h
 
-
+## To list the source files execute the following:
+## ls -1 osoa/sca/*.cpp 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 = \
 osoa/sca/ComponentContext.cpp \
-osoa/sca/ComponentContextImpl.cpp \
 osoa/sca/CompositeContext.cpp \
-osoa/sca/CompositeContextImpl.cpp \
 osoa/sca/SCA.cpp \
 osoa/sca/ServiceList.cpp \
 osoa/sca/ServiceRuntimeException.cpp \
+tuscany/sca/core/DefaultServiceProxy.cpp \
+tuscany/sca/core/ComponentContextImpl.cpp \
+tuscany/sca/core/CompositeContextImpl.cpp \
+tuscany/sca/core/CompositeServiceHelper.cpp \
+tuscany/sca/core/Operation.cpp \
+tuscany/sca/core/SCARuntime.cpp \
+tuscany/sca/core/ServiceProxy.cpp \
+tuscany/sca/core/ServiceWrapper.cpp \
+tuscany/sca/core/TuscanyRuntime.cpp \
+tuscany/sca/extension/ImplementationExtension.cpp \
+tuscany/sca/extension/InterfaceExtension.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/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/WSDLOperation.cpp \
 tuscany/sca/util/DefaultLogWriter.cpp \
 tuscany/sca/util/File.cpp \
 tuscany/sca/util/FileLogWriter.cpp \
@@ -65,36 +54,9 @@
 tuscany/sca/util/Logger.cpp \
 tuscany/sca/util/LogWriter.cpp \
 tuscany/sca/util/Utils.cpp \
-tuscany/sca/model/Binding.cpp \
-tuscany/sca/model/Component.cpp \
-tuscany/sca/model/CPPImplementation.cpp \
-tuscany/sca/model/CPPInterface.cpp \
-tuscany/sca/model/CompositeServiceType.cpp \
-tuscany/sca/model/CompositeReferenceType.cpp \
-tuscany/sca/model/Implementation.cpp \
-tuscany/sca/model/Interface.cpp \
-tuscany/sca/model/ModelLoader.cpp \
-tuscany/sca/model/Composite.cpp \
-tuscany/sca/model/Service.cpp \
-tuscany/sca/model/ServiceReference.cpp \
-tuscany/sca/model/Subsystem.cpp \
-tuscany/sca/model/System.cpp \
-tuscany/sca/model/Wire.cpp \
-tuscany/sca/model/WireTarget.cpp \
-tuscany/sca/model/WSBinding.cpp \
-tuscany/sca/model/Wsdl.cpp \
-tuscany/sca/model/WsdlOperation.cpp \
-tuscany/sca/core/ComponentServiceWrapper.cpp \
-tuscany/sca/core/CompositeReferenceWrapper.cpp \
-tuscany/sca/core/Operation.cpp \
-tuscany/sca/core/CompositeService.cpp \
-tuscany/sca/core/SCARuntime.cpp \
-tuscany/sca/core/ServiceProxy.cpp \
-tuscany/sca/core/ServiceWrapper.cpp \
-tuscany/sca/core/TuscanyRuntime.cpp \
-tuscany/sca/ws/WSServiceProxy.cpp \
-tuscany/sca/extension/ImplementationExtension.cpp \
-tuscany/sca/extension/InterfaceExtension.cpp
+tuscany/sca/ws/WSReferenceBinding.cpp \
+tuscany/sca/ws/WSServiceBinding.cpp \
+tuscany/sca/ws/WSServiceProxy.cpp
 
 libtuscany_sca_la_LIBADD = -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo \
     -L$(top_builddir)/runtime/ws_reference/axis2c/src -ltuscany_sca_ws_reference

Modified: incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ComponentContext.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ComponentContext.cpp?rev=437637&r1=437636&r2=437637&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ComponentContext.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ComponentContext.cpp Mon Aug 28 03:42:10 2006
@@ -20,9 +20,11 @@
 #include "osoa/sca/ComponentContext.h"
 #include "tuscany/sca/util/Logging.h"
 #include "tuscany/sca/util/Exceptions.h"
-#include "osoa/sca/ComponentContextImpl.h"
+#include "tuscany/sca/core/ComponentContextImpl.h"
 #include "tuscany/sca/core/SCARuntime.h"
+#include "commonj/sdo/SDO.h"
 
+using namespace commonj::sdo;
 using namespace tuscany::sca;
 
 namespace osoa
@@ -36,12 +38,12 @@
         ComponentContext ComponentContext::getCurrent()
         {
             LOGENTRY(1, "ComponentContext::getCurrent");
-            Component* component = SCARuntime::getInstance()->getCurrentComponent();
+            Component* component = tuscany::sca::SCARuntime::getInstance()->getCurrentComponent();
             if (!component)
             {
                 throw ComponentContextException("No current component");
             }
-            ComponentContextImpl* cci = new ComponentContextImpl(component);
+            ComponentContext* cci = new tuscany::sca::ComponentContextImpl(component);
             LOGEXIT(1, "ComponentContext::constructor");
             return ComponentContext(cci);
         }
@@ -49,7 +51,7 @@
         // ===========
         // Constructor
         // ===========    
-        ComponentContext::ComponentContext(ComponentContextImpl* implementation)
+        ComponentContext::ComponentContext(ComponentContext* implementation)
             : impl(implementation)
         {
             LOGENTRY(1, "ComponentContext::constructor");
@@ -71,7 +73,8 @@
         // ===================================
         ComponentContext::ComponentContext(const ComponentContext& ctx)
         {
-            impl = new ComponentContextImpl(impl->getComponent());
+            Component* component = ((tuscany::sca::ComponentContextImpl*)impl)->getComponent();
+            impl = new tuscany::sca::ComponentContextImpl(component);
         }
         
         // =============================
@@ -81,7 +84,8 @@
         {
             if (this != &ctx)
             {
-                impl = new ComponentContextImpl(impl->getComponent());
+                Component* component = ((tuscany::sca::ComponentContextImpl*)impl)->getComponent();
+                impl = new tuscany::sca::ComponentContextImpl(component);
             }
             return *this;
         }

Modified: incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ComponentContext.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ComponentContext.h?rev=437637&r1=437636&r2=437637&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ComponentContext.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ComponentContext.h Mon Aug 28 03:42:10 2006
@@ -27,7 +27,6 @@
 {
     namespace sca
     {
-        class ComponentContextImpl;
 
         /**
          * An SCA component implementation uses the ComponentContext class to 
@@ -50,7 +49,7 @@
              * the name of a reference configured in the component type file for
              * this component.
              */
-            void* getService(const char* referenceName);
+            virtual void* getService(const char* referenceName);
 
             /** 
              * Resolve a reference name into a list of configured services.
@@ -58,14 +57,14 @@
              * the name of a reference configured in the component type file for
              * this component.
              */
-            ServiceList getServices(const char* referenceName);
+            virtual ServiceList getServices(const char* referenceName);
 
             /** 
              * Get the configured properties for the component.
              * @return A data object representing all the properties that
              * are configured for this component.
              */
-            commonj::sdo::DataObjectPtr getProperties();
+            virtual commonj::sdo::DataObjectPtr getProperties();
 
             /** 
              * Get an SDO data factory which will allow the component to 
@@ -74,29 +73,36 @@
              * @return A data factory to be used by the component to create
              * new data objects.
              */
-            commonj::sdo::DataFactoryPtr getDataFactory();
+            virtual commonj::sdo::DataFactoryPtr getDataFactory();
 
             /** 
              * Destructor
              */
             virtual ~ComponentContext();
 
-
+            /**
+             * Constructor
+             */
             ComponentContext(const ComponentContext&);
+
+            /**
+             * Copy operator
+             */
             ComponentContext& operator=(const ComponentContext&);
             
-        private:
             /** 
              * Constructor to create an interface class from the contained
              * implementation.
              * @param  implementation the actual implementation class
              */
-            ComponentContext(ComponentContextImpl* implementation);
+            ComponentContext(ComponentContext* implementation);
+
+        private:
 
             /**
              * Pointer to the class which provides the actual implementation.
              */
-            ComponentContextImpl* impl;
+            ComponentContext* impl;
                         
         };
     } // End namespace sca

Modified: incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/CompositeContext.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/CompositeContext.cpp?rev=437637&r1=437636&r2=437637&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/CompositeContext.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/CompositeContext.cpp Mon Aug 28 03:42:10 2006
@@ -19,9 +19,11 @@
 
 #include "osoa/sca/CompositeContext.h"
 #include "tuscany/sca/util/Logging.h"
-#include "osoa/sca/CompositeContextImpl.h"
+#include "tuscany/sca/core/CompositeContextImpl.h"
 #include "tuscany/sca/core/SCARuntime.h"
+#include "commonj/sdo/SDO.h"
 
+using namespace commonj::sdo;
 using namespace tuscany::sca;
 
 namespace osoa
@@ -31,7 +33,7 @@
         // ===========
         // Constructor
         // ===========    
-        CompositeContext::CompositeContext(CompositeContextImpl* implementation)
+        CompositeContext::CompositeContext(CompositeContext* implementation)
             : impl(implementation)
         {
         }
@@ -41,7 +43,8 @@
         // ===================================
         CompositeContext::CompositeContext(const CompositeContext& ctx)
         {
-            impl = new CompositeContextImpl(SCARuntime::getInstance()->getCurrentComposite());
+            impl = new tuscany::sca::CompositeContextImpl(
+                tuscany::sca::SCARuntime::getInstance()->getDefaultComponent());
         }
         
         // =============================
@@ -51,7 +54,8 @@
         {
             if (this != &ctx)
             {
-                impl = new CompositeContextImpl(SCARuntime::getInstance()->getCurrentComposite());
+                impl = new tuscany::sca::CompositeContextImpl(
+                    tuscany::sca::SCARuntime::getInstance()->getDefaultComponent());
             }
             return *this;
         }
@@ -72,9 +76,10 @@
         CompositeContext CompositeContext::getCurrent()
         {
             LOGENTRY(1, "CompositeContext::getCurrent");
-            CompositeContextImpl* mci = new CompositeContextImpl(SCARuntime::getInstance()->getCurrentComposite());
+            CompositeContext* cci = new tuscany::sca::CompositeContextImpl(
+                tuscany::sca::SCARuntime::getInstance()->getDefaultComponent());
             LOGEXIT(1, "CompositeContext::getCurrent");
-            return CompositeContext(mci);
+            return CompositeContext(cci);
         }
 
         // =============

Modified: incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/CompositeContext.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/CompositeContext.h?rev=437637&r1=437636&r2=437637&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/CompositeContext.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/CompositeContext.h Mon Aug 28 03:42:10 2006
@@ -27,8 +27,6 @@
 {
     namespace sca
     {
-        class CompositeContextImpl;
-
         /**
          * An SCA component implementation, or a non-SCA client, uses the 
          * CompositeContext class to retrieve information about the configured 
@@ -51,7 +49,7 @@
              * @return A pointer to an object which can be cast to the
              * business interface of the target service.
              */
-            void* locateService(const char* serviceName);
+            virtual void* locateService(const char* serviceName);
 
             /** 
              * Get an SDO data factory which will allow the component to 
@@ -60,28 +58,36 @@
              * @return A data factory to be used by the component to create
              * new data objects.
              */
-            commonj::sdo::DataFactoryPtr getDataFactory();
+            virtual commonj::sdo::DataFactoryPtr getDataFactory();
 
             /**
              * Destructor.
              */
             virtual ~CompositeContext();
 
+            /**
+             * Constructor
+             */
             CompositeContext(const CompositeContext&);
+            
+            /**
+             * Copy operator
+             */
             CompositeContext& operator=(const CompositeContext&);
             
-        private:
             /**
              * Constructor to create an interface class from the contained
              * implementation.
              * @param  implementation The actual implementation class.
              */
-            CompositeContext(CompositeContextImpl* implementation);
+            CompositeContext(CompositeContext* implementation);
+            
+        private:
 
             /**
              * Pointer to the class which provides the actual implementation.
              */
-            CompositeContextImpl* impl;
+            CompositeContext* impl;
             
         };
     } // End namespace sca

Modified: incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ServiceList.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ServiceList.h?rev=437637&r1=437636&r2=437637&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ServiceList.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ServiceList.h Mon Aug 28 03:42:10 2006
@@ -22,6 +22,14 @@
 
 #include "osoa/sca/export.h"
 
+namespace tuscany
+{
+    namespace sca
+    {
+        class ComponentContextImpl;
+    }
+}
+
 namespace osoa
 {
     namespace sca
@@ -53,7 +61,9 @@
             virtual ~ServiceList();
             
         private:
-            friend class ComponentContextImpl;
+        
+            //TODO Should remove this dependency on the implementation
+            friend class tuscany::sca::ComponentContextImpl;
 
             /**
              * Create a new service list with the known number of 

Modified: incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ServiceRuntimeException.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ServiceRuntimeException.h?rev=437637&r1=437636&r2=437637&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ServiceRuntimeException.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/osoa/sca/ServiceRuntimeException.h Mon Aug 28 03:42:10 2006
@@ -217,16 +217,16 @@
         /**
          * Unable to find the specified entry point in the composite.
          */
-        class SCA_API CompositeServiceTypeNotFoundException: public ServiceRuntimeException
+        class SCA_API CompositeServiceNotFoundException: public ServiceRuntimeException
         {
         public:
-            CompositeServiceTypeNotFoundException(const char* msg)
-                : ServiceRuntimeException("CompositeServiceTypeNotFoundException", Error,
+            CompositeServiceNotFoundException(const char* msg)
+                : ServiceRuntimeException("CompositeServiceNotFoundException", Error,
                 msg)
             {
             }
         private:
-        }; // End CompositeServiceTypeNotFoundException class definition
+        }; // End CompositeServiceNotFoundException class definition
 
         
         

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ComponentContextImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ComponentContextImpl.cpp?rev=437637&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ComponentContextImpl.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ComponentContextImpl.cpp Mon Aug 28 03:42:10 2006
@@ -0,0 +1,183 @@
+/*
+ *
+ *  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/util/Exceptions.h"
+#include "tuscany/sca/core/ComponentContextImpl.h"
+#include "tuscany/sca/model/Composite.h"
+#include "tuscany/sca/model/Component.h"
+#include "tuscany/sca/model/Reference.h"
+#include "tuscany/sca/model/ReferenceBinding.h"
+#include "tuscany/sca/model/ReferenceType.h"
+#include "tuscany/sca/model/Service.h"
+#include "tuscany/sca/model/ServiceBinding.h"
+#include "tuscany/sca/core/ServiceProxy.h"
+#include "tuscany/sca/core/ServiceWrapper.h"
+
+using namespace tuscany::sca;
+using namespace tuscany::sca::model;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        // ===========
+        // Constructor
+        // ===========
+        ComponentContextImpl::ComponentContextImpl(Component* comp)
+            : ComponentContext(0),  component(comp)
+        {
+            LOGENTRY(1, "ComponentContextImpl::constructor");
+            LOGEXIT(1, "ComponentContextImpl::constructor");
+        }
+        
+        // ==========
+        // Destructor
+        // ==========
+        ComponentContextImpl::~ComponentContextImpl()
+        {
+            // --------------------------------------------
+            // Delete the proxies served up by this context
+            // --------------------------------------------
+            for (PROXIES::iterator iter = proxies.begin(); iter != proxies.end(); iter++)
+            {
+                delete (ServiceProxy*)*iter;
+            }
+        }
+        
+        
+        // ==========================================================================
+        // getServices: return a list of Proxies for services wired to this reference
+        // ==========================================================================
+        ServiceList ComponentContextImpl::getServices(const char* referenceName)
+        {
+            LOGENTRY(1, "ComponentContextImpl::getServices");
+            
+            // --------------------------------------------------------------
+            // locate reference in the current component and determine target
+            // --------------------------------------------------------------
+            Reference* reference = component->findReference(referenceName);
+            if (!reference)
+            {
+                string message = "Reference not defined: ";
+                message = message + referenceName;
+                throw ServiceNotFoundException(message.c_str());
+            }
+
+            // Get a service proxy from the binding configured on the reference
+            ServiceProxy* serviceProxy =  reference->getBinding()->getServiceProxy();
+            if (serviceProxy == NULL)
+            {
+                string message = "Reference ";
+                message = message + referenceName + " not wired";
+                throw ServiceNotFoundException(message.c_str());
+            }
+            proxies.push_back(serviceProxy);
+            
+            ServiceProxy::PROXIES proxies = serviceProxy->getProxies();
+            ServiceList services(proxies.size());
+            for (ServiceProxy::PROXIES::const_iterator iter = proxies.begin();
+            iter!=proxies.end();
+            iter++)
+            {
+                services.addService(*iter);
+            }
+            
+            return services;
+            
+        } // End getServices()
+        
+        
+        // ===================================================================
+        // getService: return a Proxy for the services wired to this reference
+        // ===================================================================
+        void* ComponentContextImpl::getService(const char* referenceName)
+        {
+            LOGENTRY(1, "ComponentContextImpl::getService");
+            
+            // --------------------------------------------------------------
+            // locate reference in the current component and determine target
+            // --------------------------------------------------------------
+            Reference* reference = component->findReference(referenceName);
+            if (!reference)
+            {
+                string message = "Reference not defined: ";
+                message = message + referenceName;
+                throw ServiceNotFoundException(message.c_str());
+            }
+            
+            // --------------------
+            // Validate the request
+            // --------------------
+            switch (reference->getType()->getMultiplicity())
+            {
+            case ReferenceType::ZERO_MANY:
+            case ReferenceType::ONE_MANY:
+                {
+                    string message = "getService() called for reference with multiplicity >1 :";
+                    message = message + referenceName;
+                    throw ServiceNotFoundException(message.c_str());                    
+                }
+            default:
+                {
+                }
+            } // end switch
+
+            // Get a service proxy from the binding configured on the reference
+            ServiceProxy* serviceProxy =  reference->getBinding()->getServiceProxy();
+            if (serviceProxy == NULL)
+            {
+                string message = "Reference ";
+                message = message + referenceName + " not wired";
+                throw ServiceNotFoundException(message.c_str());
+            }
+            
+            void* service = serviceProxy->getProxy();
+            proxies.push_back(serviceProxy);
+            return service;
+            
+        } // End getService()
+        
+        // ==============================================
+        // getProperties: return the component properties
+        // ==============================================
+        DataObjectPtr ComponentContextImpl::getProperties()
+        {
+            LOGENTRY(1, "ComponentContextImpl::getProperties");
+            DataObjectPtr properties = component->getProperties();
+            
+            LOGEXIT(1, "ComponentContextImpl::getProperties");
+            return properties;
+        }
+
+        // ==============================================
+        // getDataFactory: return the data factory for the composite in which
+        // this component resides
+        // ==============================================
+        DataFactoryPtr ComponentContextImpl::getDataFactory()
+        {
+            LOGENTRY(1, "ComponentContextImpl::getProperties");
+            DataFactoryPtr dataFactory = component->getComposite()->getDataFactory();
+            
+            LOGEXIT(1, "ComponentContextImpl::getDataFactory");
+            return dataFactory;
+        }
+        
+    } // End namespace sca
+} // End namespace tuscany

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

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

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ComponentContextImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ComponentContextImpl.h?rev=437637&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ComponentContextImpl.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ComponentContextImpl.h Mon Aug 28 03:42:10 2006
@@ -0,0 +1,127 @@
+/*
+ *
+ *  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_core_componentcontextimpl_h
+#define tuscany_sca_core_componentcontextimpl_h
+
+#include <vector>
+using std::vector;
+
+#include "osoa/sca/ServiceList.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/core/ServiceProxy.h"
+
+using namespace osoa::sca;
+using namespace tuscany::sca::model;
+        
+
+namespace tuscany
+{
+    namespace sca
+    {
+        
+        /** 
+         * Contains the actual implementation of a ComponentContext interface.
+         */
+        class ComponentContextImpl : public ComponentContext  
+        {
+        
+        public:
+            /** 
+             * Constructor that takes a Component which represents the runtime
+             * model for this context.
+             */
+            ComponentContextImpl(Component* component);
+
+            /**
+             * Default constructor.
+             */
+            virtual ~ComponentContextImpl();
+
+            /** 
+             * See ComponentContext.
+             */
+            virtual void* getService(const char* referenceName);
+
+            /** 
+             * See ComponentContext.
+             */
+            virtual ServiceList getServices(const char* referenceName);
+
+            /** 
+             * See ComponentContext.
+             */
+            virtual DataObjectPtr getProperties();
+
+            /** 
+             * See ComponentContext.
+             */
+            virtual commonj::sdo::DataFactoryPtr getDataFactory();
+
+            /** 
+             * Returns the contained Component.
+             * @return The Component to which this context refers.
+             */
+            virtual Component* getComponent() {return component;}
+            
+        private:
+            ComponentContextImpl(const ComponentContextImpl&);
+            ComponentContextImpl& operator=(const ComponentContextImpl&);
+
+            /**
+             * Pointer to the runtime model Component to which this 
+             * context refers.
+             */
+            Component* component;
+
+            /**
+             * Helper method to return a proxy to a service.
+             * @param serviceReference The source reference.
+             * @param target The target to which this source reference is wired.
+             * @return A pointer to an object which can be cast to the business
+             * class representing the target.
+             */
+            void* getServiceProxy(
+                Reference* serviceReference,
+                Service* target);
+
+            /**
+             * Helper method to return a wrapper for a target service.
+             * @param target The target for which this wrapper is to be created.
+             * @return The service wrapper.
+             */
+            ServiceWrapper* getServiceWrapper(Service* target);
+
+            
+            typedef vector<ServiceProxy*> PROXIES;
+            /**
+             * A vector of the proxies created by this ComponentContext. The 
+             * proxies will be destroyed when the ComponentContext is destroyed.
+             */
+            PROXIES proxies;
+        };
+
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_core_componentcontextimpl_h

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

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

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeContextImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeContextImpl.cpp?rev=437637&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeContextImpl.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeContextImpl.cpp Mon Aug 28 03:42:10 2006
@@ -0,0 +1,109 @@
+/*
+ *
+ *  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/util/Exceptions.h"
+#include "tuscany/sca/core/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/core/DefaultServiceProxy.h"
+#include "commonj/sdo/SDO.h"
+
+using namespace tuscany::sca::model;
+using namespace osoa::sca;
+using namespace commonj::sdo;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        // ===========
+        // Constructor 
+        // ===========
+        CompositeContextImpl::CompositeContextImpl(Component* component)
+            : CompositeContext(0), component(component),  composite((Composite*)component->getType())
+        {
+        }
+
+        // ==========
+        // Destructor
+        // ==========
+        CompositeContextImpl::~CompositeContextImpl()
+        {
+            // --------------------------------------------
+            // Delete the proxies served up by this context
+            // --------------------------------------------
+            for (PROXIES::iterator iter = proxies.begin(); iter != proxies.end(); iter++)
+            {
+                delete (ServiceProxy*)*iter;
+            }
+        }
+
+        // ===========================================================================
+        // locateService: return a proxy connected to a wrapper for the target service
+        // ===========================================================================
+        void* CompositeContextImpl::locateService(const char* serviceName)
+        {
+            LOGENTRY(1, "CompositeContextImpl::locateService");
+
+            // ----------------------------
+            // Locate the component service
+            // ----------------------------
+            Service* service = composite->findComponentService(serviceName);
+            string msg;
+            if (!service)
+            {
+                msg = "Service not found: ";
+                msg = msg + serviceName;
+                throw ServiceNotFoundException(msg.c_str());
+            }
+
+            // ----------------------------
+            // Get a Proxy for this service
+            // ----------------------------
+
+            // The locate service API is used from CPP clients so we are using
+            // our default service proxy here
+            //TODO is that right?
+            ServiceProxy* serviceProxy =  new DefaultServiceProxy(service);
+            proxies.push_back(serviceProxy);
+            LOGEXIT(1, "CompositeContextImpl::locateService");
+            return serviceProxy->getProxy();
+
+        }
+        
+        // ==============================================
+        // getDataFactory: return the data factory for the current composite
+        // ==============================================
+        DataFactoryPtr CompositeContextImpl::getDataFactory()
+        {
+            LOGENTRY(1, "CompositeContextImpl::getDataFactory");
+            DataFactoryPtr dataFactory = composite->getDataFactory();
+            
+            LOGEXIT(1, "CompositeContextImpl::getDataFactory");
+            return dataFactory;
+        }
+
+    } // End namespace sca
+} // End namespace tuscany

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

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

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeContextImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeContextImpl.h?rev=437637&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeContextImpl.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeContextImpl.h Mon Aug 28 03:42:10 2006
@@ -0,0 +1,96 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date$ */
+
+#ifndef tuscany_sca_core_compositecontextimpl_h
+#define tuscany_sca_core_compositecontextimpl_h
+
+#include <vector>
+using std::vector;
+
+#include "osoa/sca/CompositeContext.h"
+#include "tuscany/sca/model/Composite.h"
+#include "tuscany/sca/model/Component.h"
+#include "tuscany/sca/core/ServiceProxy.h"
+#include "commonj/sdo/SDO.h"
+
+using namespace osoa::sca;
+using namespace commonj::sdo;
+using namespace tuscany::sca::model;
+
+namespace tuscany
+{
+    namespace sca
+    {
+       
+        /** 
+         * Contains the actual implementation of a CompositeContext interface.
+         */
+        class CompositeContextImpl : public CompositeContext
+        {
+        
+        public:
+            /** 
+             * Constructor that takes a Composite which represents the runtime
+             * model for this context.
+             */
+            CompositeContextImpl(Component* component);
+
+            /**
+             * See CompositeContext#locateService.
+             */
+            virtual void* locateService(const char* serviceName);
+            
+            /** 
+             * See CompositeContext.
+             */
+            virtual commonj::sdo::DataFactoryPtr getDataFactory();
+
+            /**
+             * Destructor.
+             */
+            virtual ~CompositeContextImpl();
+            
+        private:
+            CompositeContextImpl(const CompositeContextImpl&);
+            CompositeContextImpl& operator=(const CompositeContextImpl&);
+
+            /**
+             * Pointer to the runtime model Composite object to which this
+             * context refers.
+             */
+            Composite* composite;
+
+            /**
+             * Pointer to the runtime model Component object to which this
+             * context refers.
+             */
+            Component* component;
+
+            /**
+             * Vector of proxies created from calls to the locateService
+             * method.
+             */
+            typedef vector<tuscany::sca::ServiceProxy*> PROXIES;
+            PROXIES proxies;
+        };
+
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_core_compositecontextimpl_h

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

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

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeServiceHelper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeServiceHelper.cpp?rev=437637&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeServiceHelper.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeServiceHelper.cpp Mon Aug 28 03:42:10 2006
@@ -0,0 +1,193 @@
+/*
+ *
+ *  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/core/CompositeServiceHelper.h"
+
+#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/util/Utils.h"
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/core/SCARuntime.h"
+#include "tuscany/sca/model/Composite.h"
+#include "tuscany/sca/model/CompositeService.h"
+#include "tuscany/sca/model/Component.h"
+#include "tuscany/sca/core/ServiceWrapper.h"
+#include "tuscany/sca/model/Service.h"
+ 
+using namespace osoa::sca;
+using namespace tuscany::sca::model;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        // ===========
+        // Constructor
+        // ===========
+        CompositeServiceHelper::CompositeServiceHelper(const char* compositeServiceName)
+            : compositeService(0), composite(0)
+        {
+            LOGENTRY(1,"CompositeServiceHelper::constructor");
+
+//TODO fix this
+    
+//            // initialize the system if necessary
+//            Composite* system = SCARuntime::getInstance()->getSystem();
+//
+//            // ---------------------
+//            // locate the CompositeService
+//            // ---------------------
+//            CompositeService compositeService =  system->findComponent(compositeServiceName);
+//            if (!compositeService)
+//            {
+//                throw CompositeServiceNotFoundException(compositeServiceName);
+//            }
+//            
+//            // -----------------------------------
+//            // Get the composite and corresponding data factory
+//            // -----------------------------------
+//            Composite* composite = compositeService->getComposite();
+//            if (composite)
+//            {
+//                dataFactory = composite->getDataFactory();
+//                compositeService = composite->findCompositeService(compositeServiceName);
+//            }
+//
+//            // ---------------------------------
+//            // Get Wrappers for each wire target
+//            // ---------------------------------
+//
+//            // Get the target services from the CompositeService
+//            const CompositeService::TARGETS& targets = compositeService->getTargets();
+//            
+//            // --------------------
+//            // Validate the request
+//            // --------------------
+//            switch (compositeService->getMultiplicity())
+//            {
+//            case CompositeService::ONE_MANY:
+//            case CompositeService::ONE_ONE:
+//                {
+//                    if (targets.size() == 0)
+//                    {
+//                        message = "CompositeService " + compositeService->getName() + " not wired";
+//                        throw ServiceNotFoundException(message.c_str());
+//                    }
+//                }
+//            default:
+//                {
+//                }
+//            } // end switch
+//
+//            for (CompositeService::TARGETS::const_iterator iter = targets.begin();
+//            iter!=targets.end();
+//            iter++)
+//            {
+//                ServiceWrapper* service = getServiceWrapper(*iter);
+//                if (service)
+//                {
+//                    services.push_back(service);
+//                }
+//            }
+        
+            LOGEXIT(1,"CompositeServiceHelper::constructor");
+        }
+        
+        // ==========
+        // Destructor
+        // ==========
+        CompositeServiceHelper::~CompositeServiceHelper()
+        {
+            LOGENTRY(1,"CompositeServiceHelper::destructor");
+
+            // Delete any ServiceWrappers
+            for (SERVICES::iterator iter = services.begin(); iter < services.end(); iter++)
+            {                
+                delete (*iter);
+            }
+            LOGEXIT(1,"CompositeServiceHelper::destructor");
+        }
+        
+
+        // ======================================================================
+        // invoke: 
+        // ======================================================================
+        SCA_API void CompositeServiceHelper::invoke(Operation& operation)
+        {
+            LOGENTRY(1,"CompositeServiceHelper::invoke");
+            string message;
+
+            // --------------------
+            // Validate the request
+            // --------------------
+            if (services.size() == 0)
+            {
+                string message = "CompositeService " + ((Component*)compositeService)->getName() + " not wired";
+                throw ServiceNotFoundException(message.c_str());
+            }
+
+            // -------------------
+            // Invoke each target
+            // -------------------
+            for (SERVICES::iterator iter = services.begin(); iter < services.end(); iter++)
+            {                
+                (*iter)->invoke(operation);
+            }
+            LOGEXIT(1,"CompositeServiceHelper::invoke");
+        }
+
+
+        // ======================================================================
+        // getServiceWrapper: Create and return an instance of the ServiceWrapper
+        // ======================================================================
+        ServiceWrapper* CompositeServiceHelper::getServiceWrapper(Service* service)
+        {    
+//            // -------------------------
+//            // Determine type of Service
+//            // -------------------------
+//            switch (target->getServiceType())
+//            {
+//            case WireTarget::CompositeReferenceType:
+//                {
+//                    // ----------------
+//                    // External Service
+//                    // ----------------
+//                    return CompositeReferenceWrapper::getServiceWrapper((CompositeReference*)target);
+//                }
+//                
+//            case WireTarget::ComponentServiceType:
+//                {
+//                    // -----------------
+//                    // Component Service
+//                    // -----------------
+//                    return CPPServiceWrapper::getServiceWrapper((Service*)target);
+//                }
+//                
+//            default:
+//                {
+//                    string message = "Undefined wire target type for : ";
+//                    message = message + target->getName();
+//                    throw ServiceNotFoundException(message.c_str());
+//                }
+//            } // end switch
+
+            return NULL;
+        }
+        
+    } // End namespace sca
+} // End namespace tuscany

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

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

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeServiceHelper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeServiceHelper.h?rev=437637&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeServiceHelper.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/CompositeServiceHelper.h Mon Aug 28 03:42:10 2006
@@ -0,0 +1,123 @@
+/*
+ *
+ *  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_core_compositeservicehelper_h
+#define tuscany_sca_core_compositeservicehelper_h
+
+#include "osoa/sca/export.h"
+#include "tuscany/sca/model/Composite.h"
+#include "tuscany/sca/model/CompositeService.h"
+#include "tuscany/sca/model/Service.h"
+#include "tuscany/sca/core/Operation.h"
+#include "tuscany/sca/core/ServiceWrapper.h"
+
+#include <vector>
+using std::vector;
+
+#include "commonj/sdo/SDO.h"
+using namespace commonj::sdo;
+using namespace tuscany::sca::model;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        
+        /**
+         * A runtime class which is used by external bindings to provide the entry
+         * point into the SCA runtime. An entry point will be defined in an SCA
+         * composite, and a binding class will be provided to service the
+         * communication between the external binding (e.g. for web services the
+         * SOAP/HTTP communication) and the SCA runtime. The binding class will
+         * use CompositeService to call into the SCA runtime.
+         */
+        class  CompositeServiceHelper
+        {
+        public:
+            /**
+             * Constructor to create a new instance which will be associated with
+             * a given entry point in an SCA composite.
+             * @param compositeServiceName The qualified name of the entry point in an 
+             * SCA composite. It is of the form 
+             * "subsystem name"/"composite component name"/"entry point name".
+             */
+            SCA_API CompositeServiceHelper(const char* compositeServiceName);
+            
+            /**
+             * Destructor.
+             */
+            SCA_API virtual ~CompositeServiceHelper();
+
+            /**
+             * Invokes an operation on the component to which the SCA entry point
+             * is wired in the SCA composite.
+             * @param operation. The operation request
+             */
+            SCA_API virtual void invoke(Operation& operation);
+
+            /**
+             * Returns a SDO data factory from which all the types associated with the entry point
+             * and composite can be created.
+             */
+            SCA_API DataFactoryPtr getDataFactory() const { return dataFactory; }
+
+        protected:
+
+        private:
+            /**
+             * The subsystem in which this entry point is found.
+             */ 
+            Composite* subsystem;
+
+            /**
+             * The entry point in the composite.
+             */
+            CompositeService* compositeService;
+
+            /**
+             * The composite component in the subsystem.
+             */
+            Composite* composite;
+
+            /**
+             * Cached data factory which has all the types defined for the composite in which
+             * this entry point is found.
+             */
+            DataFactoryPtr dataFactory;
+
+            typedef vector<ServiceWrapper*> SERVICES;
+            /**
+             * Vector of all the service wrappers created for this entry point. 
+             * Used to destroy the wrappers when this class is destroyed.
+             */
+            SERVICES services;
+
+            /**
+             * Creates and returns the service wrapper for a given target.
+             * @param target The target of the wire for which a service wrapper is
+             * to be created.
+             * @return A service wrapper to be used for invoking the target implementation.
+             */
+            ServiceWrapper* getServiceWrapper(Service* service);
+            
+        };
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_core_compositeservicehelper_h

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

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

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/DefaultServiceProxy.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/DefaultServiceProxy.cpp?rev=437637&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/DefaultServiceProxy.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/DefaultServiceProxy.cpp Mon Aug 28 03:42:10 2006
@@ -0,0 +1,216 @@
+/*
+ *
+ *  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/core/DefaultServiceProxy.h"
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/util/Exceptions.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"
+
+using namespace osoa::sca;
+
+//TODO Remove this hack, we keep a definition of CPPImplementation
+// here to be able to get the CPP implementation info from a CPP
+// implementation and create a corresponding proxy
+// To remove this hack we just need to add a getServiceProxy method
+// to ServiceBinding...
+namespace tuscany
+{
+    namespace sca
+    {
+        namespace cpp
+        {
+            class CPPImplementation : public ComponentType
+            {
+                
+            public:
+                CPPImplementation(const string& library, const string& header,
+                    const string&headerPath, const string& headerStub, const string& className);
+                virtual ~CPPImplementation();
+                virtual void initializeComponent(Component* component);
+                const string& getLibrary() const { return library; }
+                const string& getHeader() const { return header; }
+                const string& getHeaderStub() const { return headerStub; }
+                const string& getHeaderPath() const { return headerPath; }
+                const string& getClass() const { return className; }
+                
+            private:
+                string library;
+                string header;
+                string headerStub;
+                string headerPath;
+                string className;
+            };
+            
+            CPPImplementation::CPPImplementation(const string& library, const string& header,
+                    const string&headerPath, const string& headerStub, const string& className)
+                : ComponentType("")
+            {
+            }
+
+            CPPImplementation::~CPPImplementation()
+            {
+            }
+            
+            void CPPImplementation::initializeComponent(Component* component)
+            {
+            }
+            
+        } // End namespace cpp
+    } // End namespace sca
+} // End namespace tuscany
+
+
+namespace tuscany
+{
+    namespace sca
+    {
+        using tuscany::sca::cpp::CPPImplementation;
+        
+        // ============================
+        // Constructor: Create a proxy
+        // ============================
+        DefaultServiceProxy::DefaultServiceProxy(Service* service)
+            : ServiceProxy(0)
+        {
+            LOGENTRY(1,"DefaultServiceProxy::constructor");
+            
+            // ----------------------
+            // Get the component
+            // ----------------------
+            Component* component = service->getComponent();
+            string name = service->getType()->getName();
+            
+            // Get the service wrapper
+            ServiceWrapper* serviceWrapper = service->getBinding()->getServiceWrapper();
+
+            createProxy(component, name, serviceWrapper);
+
+            LOGEXIT(1,"DefaultServiceProxy::constructor");
+        }
+        
+        void DefaultServiceProxy::createProxy(Component* component, const string& name, ServiceWrapper* serviceWrapper)
+        {
+            LOGENTRY(1,"DefaultServiceProxy::createProxy");
+            
+            ComponentType* componentType = component->getType();
+            if (!componentType)
+            {
+                string msg = "Component " + component->getName() + " has no implementation defined";
+                throw ServiceNotFoundException(msg.c_str());
+            }
+
+            // If we got here we have a CPP implementation
+            CPPImplementation* impl = (CPPImplementation *)componentType;
+            
+            // ----------------------------------------------------
+            // Get implementation dll name and service factory name
+            // ----------------------------------------------------
+            string libraryName = impl->getLibrary();
+            string headerStub = impl->getHeaderStub();
+
+            string fullLibraryName = component->getComposite()->getRoot() + "/" + libraryName;
+            string proxyFactoryName = headerStub + "_" + name + "_Proxy_Factory";
+            string proxyDestructorName = headerStub + "_" + name + "_Proxy_Destructor";        
+            typedef void* (* PROXYFACTORY) (ServiceWrapper*);
+            
+            // ------------
+            // Load the dll
+            // ------------
+            proxyLibrary = Library(fullLibraryName);
+
+            // -------------------------
+            // Locate the factory method
+            // -------------------------
+            PROXYFACTORY proxyFactory = (PROXYFACTORY)proxyLibrary.getSymbol(proxyFactoryName);        
+            if (!proxyFactory)
+            {
+                LOGERROR_2(1, "DefaultServiceProxy::createProxy: Unable to locate %s in library %s",
+                    proxyFactoryName.c_str(), fullLibraryName.c_str());
+                string msg = "Unable to locate " + proxyFactoryName + " in library " + fullLibraryName;
+                throw ServiceNotFoundException(msg.c_str());
+            }
+            
+            // -----------------------------------
+            // Now create an instance of the proxy                
+            // -----------------------------------
+            void* proxy = proxyFactory(serviceWrapper); 
+            if (!proxy)
+            {
+                LOGERROR_2(1, "DefaultServiceProxy::createProxy: Factory method %s in library %s returned null",
+                    proxyFactoryName.c_str(), fullLibraryName.c_str());
+                string msg = "Factory method " + proxyFactoryName + " in library " + fullLibraryName + " returned null";
+                throw ServiceNotFoundException(msg.c_str());
+            }
+            else
+            {
+                proxies.push_back(proxy);
+            }
+
+            // -------------------------
+            // Get the destructor method
+            // -------------------------
+            destructor  = (PROXYDESTRUCTOR)proxyLibrary.getSymbol(proxyDestructorName);        
+            
+            LOGEXIT(1,"DefaultServiceProxy::createProxy");
+        }
+
+        // ==========
+        // Destructor
+        // ==========
+        DefaultServiceProxy::~DefaultServiceProxy()
+        {
+            LOGENTRY(1,"DefaultServiceProxy::destructor");
+
+            // Delete the proxies
+            if (destructor != NULL && proxies.size() != 0)
+            {
+                destructor(proxies[0]);
+            }
+            LOGEXIT(1,"DefaultServiceProxy::destructor");
+        }
+        
+        ServiceProxy::PROXIES DefaultServiceProxy::getProxies()
+        {
+            return proxies;
+        }
+        
+        void* DefaultServiceProxy::getProxy()
+        {
+            if (proxies.size() != 0)
+            {
+                return proxies[0];
+            }
+            else
+            {
+                return NULL;
+            }
+        }
+    
+    } // End namespace sca
+} // End namespace tuscany
+

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

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

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/DefaultServiceProxy.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/DefaultServiceProxy.h?rev=437637&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/DefaultServiceProxy.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/DefaultServiceProxy.h Mon Aug 28 03:42:10 2006
@@ -0,0 +1,108 @@
+/*
+ *
+ *  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_core_defaultserviceproxy_h
+#define tuscany_sca_core_defaultserviceproxy_h
+
+#include "osoa/sca/export.h"
+#include "tuscany/sca/core/ServiceProxy.h" 
+#include "tuscany/sca/core/ServiceWrapper.h" 
+#include "tuscany/sca/model/Component.h" 
+#include "tuscany/sca/model/Service.h" 
+#include "tuscany/sca/model/Reference.h" 
+#include "tuscany/sca/util/Library.h"
+
+using namespace tuscany::sca::model;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        
+        /**
+         * Holds a proxy for a given component and reference.
+         * The proxy which is held inside a ServiceProxy will be specific to the component
+         * and reference and will have been code generated and be contained in a dll 
+         * created by a developer of an SCA application.
+         */
+        class DefaultServiceProxy : 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.
+             */
+            DefaultServiceProxy(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.
+             */
+            DefaultServiceProxy(Service* service);
+
+            /**
+             * Destructor.
+             */
+            virtual ~DefaultServiceProxy();
+
+            /**
+             * 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.
+             */
+            virtual PROXIES getProxies();
+
+        private:
+
+            /**
+             * Create the proxy
+             */        
+            void createProxy(Component* component, const string& name, ServiceWrapper* serviceWrapper);
+        
+            /**
+             * Holds the instances of the code generated proxies.
+             */ 
+            PROXIES proxies;
+
+            /**
+             * A function pointer to the destructor of the proxy.
+             */
+            typedef void (* PROXYDESTRUCTOR) (void*);
+            PROXYDESTRUCTOR destructor;
+            
+            /**
+             * The library which contains the code for the proxy.
+             */
+            Library proxyLibrary;
+
+        };
+            
+    } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_core_defaultserviceproxy_h



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