diff options
author | dims <dims@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-17 00:23:01 +0000 |
---|---|---|
committer | dims <dims@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-17 00:23:01 +0000 |
commit | bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a (patch) | |
tree | 38a92061c0793434c4be189f1d70c3458b6bc41d /tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule |
Move Tuscany from Incubator to top level.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule')
24 files changed, 1239 insertions, 0 deletions
diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/Calculator.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/Calculator.h new file mode 100644 index 0000000000..6f30e31550 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/Calculator.h @@ -0,0 +1,31 @@ +/* + * + * 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. + */ + +#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 + + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/Calculator.wsdl b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/Calculator.wsdl new file mode 100644 index 0000000000..6ec2df52bd --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/Calculator.wsdl @@ -0,0 +1,161 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+ -->
+
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="tuscany/c/Calculator"
+ targetNamespace="tuscany/c/Calculator">
+ <types>
+ <xs:schema targetNamespace="tuscany/c/Calculator"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="tuscany/c/Calculator"
+ elementFormDefault="qualified">
+
+ <xs:element name="add">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="param1" type="xs:float" minOccurs="1"/>
+ <xs:element name="param2" type="xs:float" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="sub">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="param1" type="xs:float" minOccurs="1"/>
+ <xs:element name="param2" type="xs:float" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="mul">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="param1" type="xs:float" minOccurs="1"/>
+ <xs:element name="param2" type="xs:float" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="div">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="param1" type="xs:float" minOccurs="1"/>
+ <xs:element name="param2" type="xs:float" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+<!-- The data that axis2c math client expects to be returned. -->
+<!-- SDOCPP currently doesn't support this XML. Jira TUSCANY-xxx -->
+<!-- <xs:element name="result"> -->
+<!-- <xs:simpleType> -->
+<!-- <xs:restriction base="xs:float"/> -->
+<!-- </xs:simpleType> -->
+<!-- </xs:element> -->
+ <xs:element name="result">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="data" type="xs:float" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ </xs:schema>
+ </types>
+
+ <message name="addRequestMsg">
+ <part name="body" element="tns:add"/>
+ </message>
+ <message name="subRequestMsg">
+ <part name="body" element="tns:sub"/>
+ </message>
+ <message name="mulRequestMsg">
+ <part name="body" element="tns:mul"/>
+ </message>
+ <message name="divRequestMsg">
+ <part name="body" element="tns:div"/>
+ </message>
+
+ <message name="calculatorResponseMsg">
+ <part name="body" element="tns:result"/>
+ </message>
+
+ <portType name="CalculatorServicePortType">
+ <operation name="add">
+ <input message="tns:addRequestMsg"/>
+ <output message="tns:calculatorResponseMsg"/>
+ </operation>
+ <operation name="sub">
+ <input message="tns:subRequestMsg"/>
+ <output message="tns:calculatorResponseMsg"/>
+ </operation>
+ <operation name="mul">
+ <input message="tns:mulRequestMsg"/>
+ <output message="tns:calculatorResponseMsg"/>
+ </operation>
+ <operation name="div">
+ <input message="tns:divRequestMsg"/>
+ <output message="tns:calculatorResponseMsg"/>
+ </operation>
+ </portType>
+
+ <binding name="CalculatorServiceBinding" type="tns:CalculatorServicePortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="add">
+ <soap:operation soapAction="CalculatorService#add"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="sub">
+ <soap:operation soapAction="CalculatorService#sub"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="mul">
+ <soap:operation soapAction="CalculatorService#nul"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="div">
+ <soap:operation soapAction="CalculatorService#div"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="CalculatorService">
+ <port name="CalculatorServicePort" binding="tns:CalculatorServiceBinding">
+ <soap:address location="http://localhost:9090/axis2/services/Calculator"/>
+ </port>
+ </service>
+</definitions>
diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl.componentType b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl.componentType new file mode 100644 index 0000000000..39d6698e02 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl.componentType @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + 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. + --> + +<componentType xmlns="http://www.osoa.org/xmlns/sca/0.9" + xmlns:xs="http://www.w3.org/2001/XMLSchema"> + + <service name="CalculatorService"> + <interface.cpp header="Calculator.h"/> + </service> + + <reference name="CalculatorDivideService"> + <interface.cpp header="DivideService.h"/> + </reference> + + +</componentType>
\ No newline at end of file diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl.cpp new file mode 100644 index 0000000000..746a1db689 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl.cpp @@ -0,0 +1,85 @@ +/* + * + * 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 "CalculatorImpl.h" +#include <stdio.h> + +#include "DivideService.h" +#include "osoa/sca/ComponentContext.h" +#include "osoa/sca/ServiceRuntimeException.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 + DivideService* divideService = (DivideService*)myContext.getService("CalculatorDivideService"); + + // Finally, invoke the service + result = divideService->divide(arg1, arg2); + + printf("CalculatorImpl::div DivideService returned result: %f\n", result); + + } + catch (osoa::sca::ServiceRuntimeException& e) + { + // Print out error message and carry on + printf("CalculatorImpl::div Error whilst invoking DivideService: %s", e.getMessageText()); + } + + return result; +} + + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl.h new file mode 100644 index 0000000000..2e4b6aa4dc --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl.h @@ -0,0 +1,37 @@ +/* + * + * 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. + */ + +#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 + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorDivideService_Proxy.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorDivideService_Proxy.cpp new file mode 100644 index 0000000000..0ff0891406 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorDivideService_Proxy.cpp @@ -0,0 +1,64 @@ +/* + * 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 "CalculatorImpl_CalculatorDivideService_Proxy.h" + +#include "osoa/sca/sca.h" +using namespace osoa::sca; +using namespace tuscany::sca; + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CalculatorImpl_CalculatorDivideService_Proxy* CalculatorImpl_CalculatorDivideService_Proxy_Factory(ServiceWrapper* target) + { + return new CalculatorImpl_CalculatorDivideService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void CalculatorImpl_CalculatorDivideService_Proxy_Destructor(void* proxy) + { + delete (CalculatorImpl_CalculatorDivideService_Proxy*)proxy; + } +} + +CalculatorImpl_CalculatorDivideService_Proxy::CalculatorImpl_CalculatorDivideService_Proxy(ServiceWrapper* targ) : target(targ) +{ +} + +CalculatorImpl_CalculatorDivideService_Proxy::~CalculatorImpl_CalculatorDivideService_Proxy() +{ + if (target) + delete target; +} + +float CalculatorImpl_CalculatorDivideService_Proxy::divide( float arg0, float arg1) +{ + Operation operation("divide"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return ret; +} + + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorDivideService_Proxy.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorDivideService_Proxy.h new file mode 100644 index 0000000000..3312005d32 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorDivideService_Proxy.h @@ -0,0 +1,38 @@ +/* + * 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 CalculatorImpl_CalculatorDivideService_Proxy_h +#define CalculatorImpl_CalculatorDivideService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "DivideService.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class CalculatorImpl_CalculatorDivideService_Proxy : public DivideService +{ +public: + CalculatorImpl_CalculatorDivideService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~CalculatorImpl_CalculatorDivideService_Proxy(); + virtual float divide( float arg1, float arg2); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // CalculatorImpl_CalculatorDivideService_Proxy_h + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.cpp new file mode 100644 index 0000000000..c601ebcdc2 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.cpp @@ -0,0 +1,97 @@ +/* + * 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 "CalculatorImpl_CalculatorService_Proxy.h" + +#include "osoa/sca/sca.h" +using namespace osoa::sca; +using namespace tuscany::sca; + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CalculatorImpl_CalculatorService_Proxy* CalculatorImpl_CalculatorService_Proxy_Factory(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(ServiceWrapper* targ) : target(targ) +{ +} + +CalculatorImpl_CalculatorService_Proxy::~CalculatorImpl_CalculatorService_Proxy() +{ + if (target) + delete target; +} + +float CalculatorImpl_CalculatorService_Proxy::add( float arg0, float arg1) +{ + Operation operation("add"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return ret; +} + +float CalculatorImpl_CalculatorService_Proxy::sub( float arg0, float arg1) +{ + Operation operation("sub"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return ret; +} + +float CalculatorImpl_CalculatorService_Proxy::mul( float arg0, float arg1) +{ + Operation operation("mul"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return ret; +} + +float CalculatorImpl_CalculatorService_Proxy::div( float arg0, float arg1) +{ + Operation operation("div"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return ret; +} + + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.h new file mode 100644 index 0000000000..d3de5a79c6 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Proxy.h @@ -0,0 +1,41 @@ +/* + * 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 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/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.cpp new file mode 100644 index 0000000000..97805d0e4b --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.cpp @@ -0,0 +1,94 @@ +/* + * 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 "CalculatorImpl_CalculatorService_Wrapper.h" + +#include "osoa/sca/sca.h" +using namespace osoa::sca; +using namespace tuscany::sca; + + + +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(Service* target) : ComponentServiceWrapper(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(Operation& operation) +{ + const string& operationName = operation.getName(); + + if (operationName == "add") + { + float& p0 = *( float*)operation.getParameterValue(0); + float& p1 = *( float*)operation.getParameterValue(1); + *(float*)operation.getReturnValue() = impl->add(p0, p1); + return; + } + if (operationName == "sub") + { + float& p0 = *( float*)operation.getParameterValue(0); + float& p1 = *( float*)operation.getParameterValue(1); + *(float*)operation.getReturnValue() = impl->sub(p0, p1); + return; + } + if (operationName == "mul") + { + float& p0 = *( float*)operation.getParameterValue(0); + float& p1 = *( float*)operation.getParameterValue(1); + *(float*)operation.getReturnValue() = impl->mul(p0, p1); + return; + } + if (operationName == "div") + { + float& p0 = *( float*)operation.getParameterValue(0); + float& p1 = *( float*)operation.getParameterValue(1); + *(float*)operation.getReturnValue() = impl->div(p0, p1); + return; + } + + + throw ServiceRuntimeException("Invalid operation"); + +} + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.h new file mode 100644 index 0000000000..c881576ca2 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/CalculatorImpl_CalculatorService_Wrapper.h @@ -0,0 +1,40 @@ +/* + * 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 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/core/ComponentServiceWrapper.h" + +class CalculatorImpl_CalculatorService_Wrapper : public tuscany::sca::ComponentServiceWrapper +{ +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/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideService.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideService.h new file mode 100644 index 0000000000..f6033c9020 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideService.h @@ -0,0 +1,29 @@ +/* + * + * 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. + */ + + +#ifndef DIVIDESERVICE_H +#define DIVIDESERVICE_H +class DivideService +{ +public: + virtual float divide(float arg1, float arg2) = 0; +}; + +#endif + + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl.componentType b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl.componentType new file mode 100644 index 0000000000..bda8aed044 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl.componentType @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="ASCII"?> +<componentType xmlns="http://www.osoa.org/xmlns/sca/0.9" + xmlns:xs="http://www.w3.org/2001/XMLSchema"> + + <service name="DivideService"> + <interface.cpp header="DivideService.h"> + </interface.cpp> + </service> + +</componentType> diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl.cpp new file mode 100644 index 0000000000..4797498103 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl.cpp @@ -0,0 +1,44 @@ +/* + * + * 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 "DivideServiceImpl.h" +#include <stdio.h> + +DivideServiceImpl::DivideServiceImpl() +{ +} + +DivideServiceImpl::~DivideServiceImpl() +{ +} + +// DivideService interface +float DivideServiceImpl::divide(float arg1, float arg2) +{ + if(arg2 == 0.0) + { + printf("DivideServiceImpl::div %f / %f !! Cannot divide by zero, so returning 0\n", arg1, arg2); + return 0; + } + + float result = arg1 / arg2; + printf("DivideServiceImpl::div %f / %f = %f\n", arg1, arg2, result); + return result; +} + + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl.h new file mode 100644 index 0000000000..00216b53b3 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl.h @@ -0,0 +1,34 @@ +/* + * + * 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. + */ + +#ifndef DIVIDESERVICEIMPL_H +#define DIVIDESERVICEIMPL_H + +#include "DivideService.h" + +class DivideServiceImpl : public DivideService +{ +public: + DivideServiceImpl(); + virtual ~DivideServiceImpl(); + + // DivideService interface + virtual float divide(float arg1, float arg2); +}; + +#endif + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl_DivideService_Proxy.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl_DivideService_Proxy.cpp new file mode 100644 index 0000000000..945f407327 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl_DivideService_Proxy.cpp @@ -0,0 +1,64 @@ +/* + * 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 "DivideServiceImpl_DivideService_Proxy.h" + +#include "osoa/sca/sca.h" +using namespace osoa::sca; +using namespace tuscany::sca; + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + DivideServiceImpl_DivideService_Proxy* DivideServiceImpl_DivideService_Proxy_Factory(ServiceWrapper* target) + { + return new DivideServiceImpl_DivideService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void DivideServiceImpl_DivideService_Proxy_Destructor(void* proxy) + { + delete (DivideServiceImpl_DivideService_Proxy*)proxy; + } +} + +DivideServiceImpl_DivideService_Proxy::DivideServiceImpl_DivideService_Proxy(ServiceWrapper* targ) : target(targ) +{ +} + +DivideServiceImpl_DivideService_Proxy::~DivideServiceImpl_DivideService_Proxy() +{ + if (target) + delete target; +} + +float DivideServiceImpl_DivideService_Proxy::divide( float arg0, float arg1) +{ + Operation operation("divide"); + operation.addParameter(&arg0); + operation.addParameter(&arg1); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return ret; +} + + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl_DivideService_Proxy.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl_DivideService_Proxy.h new file mode 100644 index 0000000000..957ad43168 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl_DivideService_Proxy.h @@ -0,0 +1,38 @@ +/* + * 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 DivideServiceImpl_DivideService_Proxy_h +#define DivideServiceImpl_DivideService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "DivideService.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class DivideServiceImpl_DivideService_Proxy : public DivideService +{ +public: + DivideServiceImpl_DivideService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~DivideServiceImpl_DivideService_Proxy(); + virtual float divide( float arg1, float arg2); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // DivideServiceImpl_DivideService_Proxy_h + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl_DivideService_Wrapper.cpp b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl_DivideService_Wrapper.cpp new file mode 100644 index 0000000000..4257caa46c --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl_DivideService_Wrapper.cpp @@ -0,0 +1,73 @@ +/* + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "DivideServiceImpl_DivideService_Wrapper.h" + +#include "osoa/sca/sca.h" +using namespace osoa::sca; +using namespace tuscany::sca; + + + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + DivideServiceImpl_DivideService_Wrapper* DivideServiceImpl_DivideService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new DivideServiceImpl_DivideService_Wrapper(target); + } +} + +DivideServiceImpl_DivideService_Wrapper::DivideServiceImpl_DivideService_Wrapper(Service* target) : ComponentServiceWrapper(target) +{ + impl = (DivideServiceImpl*)getImplementation(); +} + +DivideServiceImpl_DivideService_Wrapper::~DivideServiceImpl_DivideService_Wrapper() +{ + releaseImplementation(); +} + +void* DivideServiceImpl_DivideService_Wrapper::newImplementation() +{ + return new DivideServiceImpl; +} + +void DivideServiceImpl_DivideService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void DivideServiceImpl_DivideService_Wrapper::invokeService(Operation& operation) +{ + const string& operationName = operation.getName(); + + if (operationName == "divide") + { + float& p0 = *( float*)operation.getParameterValue(0); + float& p1 = *( float*)operation.getParameterValue(1); + *(float*)operation.getReturnValue() = impl->divide(p0, p1); + return; + } + + + throw ServiceRuntimeException("Invalid operation"); + +} + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl_DivideService_Wrapper.h b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl_DivideService_Wrapper.h new file mode 100644 index 0000000000..9be9796ee2 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/DivideServiceImpl_DivideService_Wrapper.h @@ -0,0 +1,40 @@ +/* + * 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 DivideServiceImpl_DivideService_Wrapper_h +#define DivideServiceImpl_DivideService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "DivideServiceImpl.h" +#include "tuscany/sca/core/ComponentServiceWrapper.h" + +class DivideServiceImpl_DivideService_Wrapper : public tuscany::sca::ComponentServiceWrapper +{ +public: + DivideServiceImpl_DivideService_Wrapper(tuscany::sca::model::Service* target); + virtual ~DivideServiceImpl_DivideService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + DivideServiceImpl* impl; +}; + +#endif // DivideServiceImpl_DivideService_Wrapper_h + diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/Makefile.am b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/Makefile.am new file mode 100644 index 0000000000..aff769b36a --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/Makefile.am @@ -0,0 +1,35 @@ +deploydir=$(prefix)/samples/Calculator/deploy +moduledir=$(deploydir)/modules/CalculatorModule + +BUILT_SOURCES = CalculatorImpl_CalculatorService_Proxy.cpp \ +CalculatorImpl_CalculatorService_Wrapper.cpp \ +CalculatorImpl_CalculatorDivideService_Proxy.cpp \ +DivideServiceImpl_DivideService_Proxy.cpp \ +DivideServiceImpl_DivideService_Wrapper.cpp + +noinst_HEADERS = *.h + +CalculatorImpl_CalculatorService_Proxy.cpp: + java -jar $(TUSCANY_SCACPP)/bin/scagen.jar -dir . -output . + +module_LTLIBRARIES = libCalculatorModule.la +module_DATA = sca.module.lin Tuscany-model.config *.componentType *.wsdl services.xml +EXTRA_DIST = sca.module.lin Tuscany-model.config *.componentType *.wsdl services.xml + +libCalculatorModule_la_SOURCES = \ +CalculatorImpl.cpp \ +CalculatorImpl_CalculatorService_Proxy.cpp \ +CalculatorImpl_CalculatorService_Wrapper.cpp \ +CalculatorImpl_CalculatorDivideService_Proxy.cpp \ +DivideServiceImpl.cpp \ +DivideServiceImpl_DivideService_Proxy.cpp \ +DivideServiceImpl_DivideService_Wrapper.cpp + +libCalculatorModule_la_LIBADD = -L${TUSCANY_SCACPP}/lib -ltuscany_sca + +INCLUDES = \ + -I$(TUSCANY_SCACPP)/include \ + -I${TUSCANY_SDOCPP}/include + +install-data-hook: + mv $(moduledir)/sca.module.lin $(moduledir)/sca.module
\ No newline at end of file diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/Tuscany-model.config b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/Tuscany-model.config new file mode 100644 index 0000000000..b8f96a01a1 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/Tuscany-model.config @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!-- + 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. + --> + +<tuscany-model xmlns="http://org.apache.tuscany/xmlns/cpp/1.0"> + <wsdl> + <file name="Calculator.wsdl"/> + </wsdl> + <xsd/> +</tuscany-model> diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/sca.module b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/sca.module new file mode 100644 index 0000000000..e07fbeb9e2 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/sca.module @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + 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. + --> + +<module xmlns="http://www.osoa.org/xmlns/sca/0.9" + xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9" + xmlns:cs="tuscany/c/Calculator/" + name="CalculatorModule"> + + <!-- Expose as a web service --> + <entryPoint name="WSCalculatorEntrypoint" multiplicity="1..1"> + <interface.wsdl interface="Calculator.wsdl" callbackInterface=""></interface.wsdl> + <binding.ws port="tuscany/c/Calculator#wsdl.endpoint(CalculatorService/CalculatorServicePort)"></binding.ws> + <reference>CalculatorServiceComponent</reference> + </entryPoint> + + + <component name="CalculatorServiceComponent"> + <implementation.cpp dll="Calculator.dll" header="CalculatorImpl.h"></implementation.cpp> + <properties> </properties> + <references> + <v:CalculatorDivideService>DivideServiceComponent/DivideService</v:CalculatorDivideService> + </references> + </component> + + <component name="DivideServiceComponent"> + <implementation.cpp dll="Calculator.dll" header="DivideServiceImpl.h"></implementation.cpp> + <properties> </properties> + <references> </references> + </component> + + + +</module>
\ No newline at end of file diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/sca.module.lin b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/sca.module.lin new file mode 100644 index 0000000000..4bd96ac774 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/sca.module.lin @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="ASCII"?> +<!-- + 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. + --> + +<module xmlns="http://www.osoa.org/xmlns/sca/0.9" + xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9" + name="CalculatorModule"> + + <!-- Expose as a web service --> + <entryPoint name="WSCalculatorEntrypoint" multiplicity="1..1"> + <interface.wsdl interface="Calculator.wsdl" callbackInterface=""></interface.wsdl> + <binding.ws port="tuscany/c/Calculator#wsdl.endpoint(CalculatorService/CalculatorServicePort)"></binding.ws> + <reference>CalculatorServiceComponent</reference> + </entryPoint> + + <component name="CalculatorServiceComponent"> + <implementation.cpp dll="libCalculatorModule.so" header="CalculatorImpl.h"></implementation.cpp> + <properties> </properties> + <references> + <v:CalculatorDivideService>DivideServiceComponent/DivideService</v:CalculatorDivideService> + </references> + </component> + + <component name="DivideServiceComponent"> + <implementation.cpp dll="libCalculatorModule.so" header="DivideServiceImpl.h"></implementation.cpp> + <properties> </properties> + <references> </references> + </component> +</module>
\ No newline at end of file diff --git a/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/services.xml b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/services.xml new file mode 100644 index 0000000000..b5f234e988 --- /dev/null +++ b/tags/cpp-0.1.incubating-M1-RC3/sca/samples/Calculator/CalculatorModule/services.xml @@ -0,0 +1,42 @@ + +<!-- + 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. + --> +<service name="Calculator"> + <parameter name="ServiceClass" locked="xsd:false">tuscany_sca_ws_service</parameter> + <parameter name="TuscanySystemRoot" locked="xsd:false">PATH-TO-THE-SYSTEM-ROOT</parameter> + <parameter name="TuscanyEntryPoint" locked="xsd:false">CalculatorSubsystem/CalculatorService/WSCalculatorEntrypoint</parameter> + + <description> + This is a testing service, named 'Calculator' to test multiple operations in the same service + </description> + + <operation name="add"> + <!--messageReceiver class="axis2_receivers" /--> + </operation> + + <operation name="sub"> + <!--messageReceiver class="axis2_receivers" /--> + </operation> + + <operation name="mul"> + <!--messageReceiver class="axis2_receivers" /--> + </operation> + + <operation name="div"> + <!--messageReceiver class="axis2_receivers" /--> + </operation> + +</service> |