From 1c2df9a2458897ff6c2393913b2723457e42a0da Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Mon, 23 Nov 2009 05:48:11 +0000 Subject: Simplified the automake build using configure options instead of environment variables and cleaned up some of the makefile.am files. Adjusted build instructions. Moved directories that don't yet build or work out of the main build dir and obsolete docs to a contrib dir. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@883254 13f79535-47bb-0310-9956-ffa450edef68 --- .../sample.calculator/Add.componentType | 29 ++++ .../samples/PHPCalculator/sample.calculator/Add.h | 34 +++++ .../PHPCalculator/sample.calculator/Add.php | 32 ++++ .../sample.calculator/Calculator.componentType | 43 ++++++ .../PHPCalculator/sample.calculator/Calculator.h | 34 +++++ .../PHPCalculator/sample.calculator/Calculator.php | 97 +++++++++++++ .../sample.calculator/Calculator.wsdl | 161 +++++++++++++++++++++ .../sample.calculator/CalculatorImpl.componentType | 31 ++++ .../sample.calculator/CalculatorImpl.cpp | 90 ++++++++++++ .../sample.calculator/CalculatorImpl.h | 41 ++++++ .../CalculatorImpl_CalculatorService_Proxy.cpp | 98 +++++++++++++ .../CalculatorImpl_CalculatorService_Proxy.h | 44 ++++++ .../CalculatorImpl_CalculatorService_Wrapper.cpp | 135 +++++++++++++++++ .../CalculatorImpl_CalculatorService_Wrapper.h | 43 ++++++ .../CalculatorImpl_divideService_Proxy.cpp | 65 +++++++++ .../CalculatorImpl_divideService_Proxy.h | 41 ++++++ .../sample.calculator/Divide.componentType | 41 ++++++ .../PHPCalculator/sample.calculator/Divide.h | 34 +++++ .../PHPCalculator/sample.calculator/Divide.php | 71 +++++++++ .../sample.calculator/DivideImpl.componentType | 27 ++++ .../PHPCalculator/sample.calculator/DivideImpl.cpp | 48 ++++++ .../PHPCalculator/sample.calculator/DivideImpl.h | 39 +++++ .../DivideImpl_DivideService_Proxy.cpp | 65 +++++++++ .../DivideImpl_DivideService_Proxy.h | 41 ++++++ .../DivideImpl_DivideService_Wrapper.cpp | 84 +++++++++++ .../DivideImpl_DivideService_Wrapper.h | 43 ++++++ .../sample.calculator/Log.componentType | 25 ++++ .../samples/PHPCalculator/sample.calculator/Log.h | 34 +++++ .../PHPCalculator/sample.calculator/Log.php | 36 +++++ .../PHPCalculator/sample.calculator/Makefile.am | 56 +++++++ .../sample.calculator/Multiply.componentType | 28 ++++ .../PHPCalculator/sample.calculator/Multiply.h | 34 +++++ .../PHPCalculator/sample.calculator/Multiply.php | 33 +++++ .../sample.calculator/Subtract.componentType | 29 ++++ .../PHPCalculator/sample.calculator/Subtract.h | 34 +++++ .../PHPCalculator/sample.calculator/Subtract.php | 30 ++++ .../PHPCalculator/sample.calculator/runwsserver.sh | 45 ++++++ .../sample.calculator/sample.calculator.composite | 81 +++++++++++ 38 files changed, 1976 insertions(+) create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.componentType create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.php create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.componentType create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.php create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.wsdl create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.componentType create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.cpp create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.componentType create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.php create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.componentType create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.cpp create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.cpp create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.cpp create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.componentType create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.php create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Makefile.am create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.componentType create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.php create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.componentType create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.h create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.php create mode 100755 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/runwsserver.sh create mode 100644 sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/sample.calculator.composite (limited to 'sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator') diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.componentType b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.componentType new file mode 100644 index 0000000000..aca0b2a6e4 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.componentType @@ -0,0 +1,29 @@ + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.h new file mode 100644 index 0000000000..4abfe9af6b --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.h @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + + +#ifndef sample_add_h +#define sample_add_h + +class Add +{ + public: + virtual float add(float num1, float num2) = 0; +}; + +#endif // sample_add_h + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.php b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.php new file mode 100644 index 0000000000..4b5747e10f --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Add.php @@ -0,0 +1,32 @@ +log_message($result); + +echo $result; +?> diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.componentType b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.componentType new file mode 100644 index 0000000000..7767c663bf --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.componentType @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.h new file mode 100644 index 0000000000..90e97b5319 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.h @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#ifndef sample_calculator_h +#define sample_calculator_h + +class Calculator +{ +public: + virtual float add(float arg1, float arg2) = 0; + virtual float sub(float arg1, float arg2) = 0; + virtual float mul(float arg1, float arg2) = 0; + virtual float div(float arg1, float arg2) = 0; +}; + +#endif // sample_calculator_h diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.php b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.php new file mode 100644 index 0000000000..ce8f7899da --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.php @@ -0,0 +1,97 @@ +mul_service->add($num1, $num2); + } + + /** + * Subtraction + * + * @param float $num1 (the first number) + * @param float $num2 (the second number) + * @return float The result + */ + function sub($num1, $num2) { + return $this->mul_service->sub($num1, $num2); + } + + /** + * Multiplication + * + * @param float $num1 (the first number) + * @param float $num2 (the second number) + * @return float The result + */ + function mul($num1, $num2) { + return $this->mul_service->mul($num1, $num2); + } + + /** + * Division + * + * @param float $num1 (the first number) + * @param float $num2 (the second number) + * @return float The result + */ + function div($num1, $num2) { + return $this->div_service->div($num1, $num2); + } +} + +?> diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.wsdl b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.wsdl new file mode 100644 index 0000000000..331b996ba2 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Calculator.wsdl @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.componentType b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.componentType new file mode 100644 index 0000000000..e2799af955 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.componentType @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.cpp b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.cpp new file mode 100644 index 0000000000..2d880de72d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.cpp @@ -0,0 +1,90 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#include + +#include "osoa/sca/ComponentContext.h" +#include "osoa/sca/ServiceRuntimeException.h" + +#include "CalculatorImpl.h" +#include "Divide.h" + +CalculatorImpl::CalculatorImpl() +{ +} + +CalculatorImpl::~CalculatorImpl() +{ +} + +// Calculator interface +float CalculatorImpl::add(float arg1, float arg2) +{ + float result = arg1 + arg2; + + printf("CalculatorImpl::add %f + %f = %f\n", arg1, arg2, result); + return result; +} + +float CalculatorImpl::sub(float arg1, float arg2) +{ + float result = arg1 - arg2; + printf("CalculatorImpl::sub %f - %f = %f\n", arg1, arg2, result); + return result; +} + +float CalculatorImpl::mul(float arg1, float arg2) +{ + float result = arg1 * arg2; + printf("CalculatorImpl::mul %f * %f = %f\n", arg1, arg2, result); + return result; +} + +float CalculatorImpl::div(float arg1, float arg2) +{ + float result = 0; + + // This method shows how to invoke a service on a different component from within a component + + // First, get the current ComponentContext + osoa::sca::ComponentContext myContext = osoa::sca::ComponentContext::getCurrent(); + + try + { + // Find the required service, as referenced in CalculatorImpl.componentType + Divide* divideService = (Divide*)myContext.getService("divideService"); + + // Finally, invoke the service + result = divideService->div(arg1, arg2); + + printf("CalculatorImpl::div Divide returned result: %f\n", result); + + } + catch (osoa::sca::ServiceRuntimeException& e) + { + // Print out error message and carry on + printf("CalculatorImpl::div Error whilst invoking Divide: %s", e.getMessageText()); + } + + return result; +} + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.h new file mode 100644 index 0000000000..af8a5eeab1 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl.h @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#ifndef sample_calculatorimpl_h +#define sample_calculatorimpl_h + +#include "Calculator.h" + +class CalculatorImpl : public Calculator +{ +public: + CalculatorImpl(); + virtual ~CalculatorImpl(); + + // Calculator interface + virtual float add(float arg1, float arg2); + virtual float sub(float arg1, float arg2); + virtual float mul(float arg1, float arg2); + virtual float div(float arg1, float arg2); +}; + +#endif // sample_calculatorimpl_h + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.cpp b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.cpp new file mode 100644 index 0000000000..084e6fbf2f --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.cpp @@ -0,0 +1,98 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "CalculatorImpl_CalculatorService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CalculatorImpl_CalculatorService_Proxy* CalculatorImpl_CalculatorService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new CalculatorImpl_CalculatorService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void CalculatorImpl_CalculatorService_Proxy_Destructor(void* proxy) + { + delete (CalculatorImpl_CalculatorService_Proxy*)proxy; + } +} + +CalculatorImpl_CalculatorService_Proxy::CalculatorImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +CalculatorImpl_CalculatorService_Proxy::~CalculatorImpl_CalculatorService_Proxy() +{ + if (target) + delete target; +} + +float CalculatorImpl_CalculatorService_Proxy::add( float arg0, float arg1) +{ + tuscany::sca::Operation operation("add"); + operation.addParameter("arg1", &arg0); + operation.addParameter("arg2", &arg1); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + +float CalculatorImpl_CalculatorService_Proxy::sub( float arg0, float arg1) +{ + tuscany::sca::Operation operation("sub"); + operation.addParameter("arg1", &arg0); + operation.addParameter("arg2", &arg1); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + +float CalculatorImpl_CalculatorService_Proxy::mul( float arg0, float arg1) +{ + tuscany::sca::Operation operation("mul"); + operation.addParameter("arg1", &arg0); + operation.addParameter("arg2", &arg1); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + +float CalculatorImpl_CalculatorService_Proxy::div( float arg0, float arg1) +{ + tuscany::sca::Operation operation("div"); + operation.addParameter("arg1", &arg0); + operation.addParameter("arg2", &arg1); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.h new file mode 100644 index 0000000000..700a060636 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Proxy.h @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#ifndef CalculatorImpl_CalculatorService_Proxy_h +#define CalculatorImpl_CalculatorService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "Calculator.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class CalculatorImpl_CalculatorService_Proxy : public Calculator +{ +public: + CalculatorImpl_CalculatorService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~CalculatorImpl_CalculatorService_Proxy(); + virtual float add( float arg1, float arg2); + virtual float sub( float arg1, float arg2); + virtual float mul( float arg1, float arg2); + virtual float div( float arg1, float arg2); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // CalculatorImpl_CalculatorService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.cpp b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.cpp new file mode 100644 index 0000000000..82114b4d6d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.cpp @@ -0,0 +1,135 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "CalculatorImpl_CalculatorService_Wrapper.h" + +#include "osoa/sca/sca.h" + + + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CalculatorImpl_CalculatorService_Wrapper* CalculatorImpl_CalculatorService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new CalculatorImpl_CalculatorService_Wrapper(target); + } +} + +CalculatorImpl_CalculatorService_Wrapper::CalculatorImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (CalculatorImpl*)getImplementation(); +} + +CalculatorImpl_CalculatorService_Wrapper::~CalculatorImpl_CalculatorService_Wrapper() +{ + releaseImplementation(); +} + +void* CalculatorImpl_CalculatorService_Wrapper::newImplementation() +{ + return new CalculatorImpl; +} + +void CalculatorImpl_CalculatorService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void CalculatorImpl_CalculatorService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "add") + { + float& p0 = *( float*)operation.getParameterValue(0); + float& p1 = *( float*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->add(p0, p1); + } + else + { + float* ret = new float; + *ret = impl->add(p0, p1); + operation.setReturnValue((const float*)ret); + } + return; + } + if (operationName == "sub") + { + float& p0 = *( float*)operation.getParameterValue(0); + float& p1 = *( float*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->sub(p0, p1); + } + else + { + float* ret = new float; + *ret = impl->sub(p0, p1); + operation.setReturnValue((const float*)ret); + } + return; + } + if (operationName == "mul") + { + float& p0 = *( float*)operation.getParameterValue(0); + float& p1 = *( float*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->mul(p0, p1); + } + else + { + float* ret = new float; + *ret = impl->mul(p0, p1); + operation.setReturnValue((const float*)ret); + } + return; + } + if (operationName == "div") + { + float& p0 = *( float*)operation.getParameterValue(0); + float& p1 = *( float*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->div(p0, p1); + } + else + { + float* ret = new float; + *ret = impl->div(p0, p1); + operation.setReturnValue((const float*)ret); + } + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.h new file mode 100644 index 0000000000..63bae2f75c --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_CalculatorService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#ifndef CalculatorImpl_CalculatorService_Wrapper_h +#define CalculatorImpl_CalculatorService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "CalculatorImpl.h" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class CalculatorImpl_CalculatorService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + CalculatorImpl_CalculatorService_Wrapper(tuscany::sca::model::Service* target); + virtual ~CalculatorImpl_CalculatorService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + CalculatorImpl* impl; +}; + +#endif // CalculatorImpl_CalculatorService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.cpp b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.cpp new file mode 100644 index 0000000000..510069c331 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.cpp @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "CalculatorImpl_divideService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + CalculatorImpl_divideService_Proxy* CalculatorImpl_divideService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new CalculatorImpl_divideService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void CalculatorImpl_divideService_Proxy_Destructor(void* proxy) + { + delete (CalculatorImpl_divideService_Proxy*)proxy; + } +} + +CalculatorImpl_divideService_Proxy::CalculatorImpl_divideService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +CalculatorImpl_divideService_Proxy::~CalculatorImpl_divideService_Proxy() +{ + if (target) + delete target; +} + +float CalculatorImpl_divideService_Proxy::div( float arg0, float arg1) +{ + tuscany::sca::Operation operation("div"); + operation.addParameter("num1", &arg0); + operation.addParameter("num2", &arg1); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.h new file mode 100644 index 0000000000..0459e70f33 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/CalculatorImpl_divideService_Proxy.h @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#ifndef CalculatorImpl_divideService_Proxy_h +#define CalculatorImpl_divideService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "Divide.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class CalculatorImpl_divideService_Proxy : public Divide +{ +public: + CalculatorImpl_divideService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~CalculatorImpl_divideService_Proxy(); + virtual float div( float num1, float num2); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // CalculatorImpl_divideService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.componentType b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.componentType new file mode 100644 index 0000000000..428d19f8bc --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.componentType @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.h new file mode 100644 index 0000000000..c2ab3b816c --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.h @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + + +#ifndef sample_divide_h +#define sample_divide_h + +class Divide +{ + public: + virtual float div(float num1, float num2) = 0; +}; + +#endif // sample_divide_h + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.php b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.php new file mode 100644 index 0000000000..c2e9adda70 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Divide.php @@ -0,0 +1,71 @@ +add_service->add(12.0, 27.0); + //$this->subtract_service->sub(12.0, 27.0); + $this->multiply_service->mul(12.0, 27.0); + + $result = $this->another_divide->div($num1, $num2); + + return $result; + } + +} + +?> diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.componentType b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.componentType new file mode 100644 index 0000000000..d7369e3ff0 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.componentType @@ -0,0 +1,27 @@ + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.cpp b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.cpp new file mode 100644 index 0000000000..88b9065171 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.cpp @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + +#include + +#include "DivideImpl.h" + +DivideImpl::DivideImpl() +{ +} + +DivideImpl::~DivideImpl() +{ +} + +// Divide interface +float DivideImpl::div(float arg1, float arg2) +{ + if(arg2 == 0.0) + { + printf("DivideImpl::div %f / %f !! Cannot divide by zero, so returning 0\n", arg1, arg2); + return 0; + } + + float result = arg1 / arg2; + printf("DivideImpl::div %f / %f = %f\n", arg1, arg2, result); + return result; +} + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.h new file mode 100644 index 0000000000..42cf47b1d4 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl.h @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + + +#ifndef sample_divideimpl_h +#define sample_divideimpl_h + +#include "Divide.h" + +class DivideImpl : public Divide +{ +public: + DivideImpl(); + virtual ~DivideImpl(); + + // Divide interface + virtual float div(float arg1, float arg2); +}; + +#endif // sample_divideimpl_h + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.cpp b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.cpp new file mode 100644 index 0000000000..e8dbeb2e0d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.cpp @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "DivideImpl_DivideService_Proxy.h" + +#include "osoa/sca/sca.h" + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + DivideImpl_DivideService_Proxy* DivideImpl_DivideService_Proxy_Factory(tuscany::sca::ServiceWrapper* target) + { + return new DivideImpl_DivideService_Proxy(target); + } + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + void DivideImpl_DivideService_Proxy_Destructor(void* proxy) + { + delete (DivideImpl_DivideService_Proxy*)proxy; + } +} + +DivideImpl_DivideService_Proxy::DivideImpl_DivideService_Proxy(tuscany::sca::ServiceWrapper* targ) : target(targ) +{ +} + +DivideImpl_DivideService_Proxy::~DivideImpl_DivideService_Proxy() +{ + if (target) + delete target; +} + +float DivideImpl_DivideService_Proxy::div( float arg0, float arg1) +{ + tuscany::sca::Operation operation("div"); + operation.addParameter("num1", &arg0); + operation.addParameter("num2", &arg1); + float ret; + operation.setReturnValue(&ret); + target->invoke(operation); + return *(float*)operation.getReturnValue(); +} + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.h new file mode 100644 index 0000000000..d66cde1c06 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Proxy.h @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#ifndef DivideImpl_DivideService_Proxy_h +#define DivideImpl_DivideService_Proxy_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "Divide.h" +#include "tuscany/sca/core/ServiceWrapper.h" + +class DivideImpl_DivideService_Proxy : public Divide +{ +public: + DivideImpl_DivideService_Proxy(tuscany::sca::ServiceWrapper*); + virtual ~DivideImpl_DivideService_Proxy(); + virtual float div( float num1, float num2); +private: + tuscany::sca::ServiceWrapper* target; +}; + +#endif // DivideImpl_DivideService_Proxy_h + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.cpp b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.cpp new file mode 100644 index 0000000000..9c6f2101fe --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.cpp @@ -0,0 +1,84 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "DivideImpl_DivideService_Wrapper.h" + +#include "osoa/sca/sca.h" + + + +extern "C" +{ + + #if defined(WIN32) || defined(_WINDOWS) + __declspec(dllexport) + #endif + DivideImpl_DivideService_Wrapper* DivideImpl_DivideService_Wrapper_Factory(tuscany::sca::model::Service* target) + { + return new DivideImpl_DivideService_Wrapper(target); + } +} + +DivideImpl_DivideService_Wrapper::DivideImpl_DivideService_Wrapper(tuscany::sca::model::Service* target) : tuscany::sca::cpp::CPPServiceWrapper(target) +{ + impl = (DivideImpl*)getImplementation(); +} + +DivideImpl_DivideService_Wrapper::~DivideImpl_DivideService_Wrapper() +{ + releaseImplementation(); +} + +void* DivideImpl_DivideService_Wrapper::newImplementation() +{ + return new DivideImpl; +} + +void DivideImpl_DivideService_Wrapper::deleteImplementation() +{ + delete impl; +} + +void DivideImpl_DivideService_Wrapper::invokeService(tuscany::sca::Operation& operation) +{ + const std::string& operationName = operation.getName(); + + if (operationName == "div") + { + float& p0 = *( float*)operation.getParameterValue(0); + float& p1 = *( float*)operation.getParameterValue(1); + + if(operation.getReturnValue() != NULL) + { + *(float*)operation.getReturnValue() = impl->div(p0, p1); + } + else + { + float* ret = new float; + *ret = impl->div(p0, p1); + operation.setReturnValue((const float*)ret); + } + return; + } + + + throw osoa::sca::ServiceRuntimeException("Invalid operation"); + +} + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.h new file mode 100644 index 0000000000..5cd10f5188 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/DivideImpl_DivideService_Wrapper.h @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#ifndef DivideImpl_DivideService_Wrapper_h +#define DivideImpl_DivideService_Wrapper_h + +#if defined(WIN32) || defined (_WINDOWS) +#pragma warning(disable: 4786) +#endif + +#include "DivideImpl.h" +#include "tuscany/sca/cpp/CPPServiceWrapper.h" + +class DivideImpl_DivideService_Wrapper : public tuscany::sca::cpp::CPPServiceWrapper +{ +public: + DivideImpl_DivideService_Wrapper(tuscany::sca::model::Service* target); + virtual ~DivideImpl_DivideService_Wrapper(); + virtual void invokeService(tuscany::sca::Operation& operation); + virtual void* newImplementation(); + virtual void deleteImplementation(); +private: + DivideImpl* impl; +}; + +#endif // DivideImpl_DivideService_Wrapper_h + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.componentType b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.componentType new file mode 100644 index 0000000000..0b4423300d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.componentType @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.h new file mode 100644 index 0000000000..c21da1bddf --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.h @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + + +#ifndef sample_log_h +#define sample_log_h + +class Log +{ + public: + virtual void div(char *message) = 0; +}; + +#endif // sample_log_h + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.php b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.php new file mode 100644 index 0000000000..0a955f36d3 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Log.php @@ -0,0 +1,36 @@ +toLog('>>> ' . $message); + } +} + +?> diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Makefile.am b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Makefile.am new file mode 100644 index 0000000000..84567a5add --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Makefile.am @@ -0,0 +1,56 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +deploydir=$(prefix)/PHPCalculator/deploy +compositedir=$(deploydir)/sample.calculator + +BUILT_SOURCES = scagen + +noinst_HEADERS = *.h + +scagen: + java -jar $(TUSCANY_SCACPP)/bin/scagen.jar -dir . -output . + +composite_SCRIPTS = runwsserver.sh + +composite_LTLIBRARIES = libCalculator.la +composite_DATA = *.composite *.componentType *.wsdl *.php +EXTRA_DIST = *.composite *.componentType *.wsdl *.php runwsserver.sh + +dist_libCalculator_la_SOURCES = \ +CalculatorImpl.cpp \ +DivideImpl.cpp + +nodist_libCalculator_la_SOURCES = \ +CalculatorImpl_CalculatorService_Proxy.cpp \ +CalculatorImpl_CalculatorService_Wrapper.cpp \ +CalculatorImpl_divideService_Proxy.cpp \ +DivideImpl_DivideService_Proxy.cpp \ +DivideImpl_DivideService_Wrapper.cpp + + +libCalculator_la_LIBADD = \ +-L${TUSCANY_SCACPP}/lib \ + -ltuscany_sca \ +-L${TUSCANY_SCACPP}/extensions/cpp/lib \ + -ltuscany_sca_cpp + +INCLUDES = \ +-I$(TUSCANY_SCACPP)/extensions/cpp/include \ +-I$(TUSCANY_SCACPP)/include \ +-I${TUSCANY_SDOCPP}/include + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.componentType b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.componentType new file mode 100644 index 0000000000..af1631518a --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.componentType @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.h new file mode 100644 index 0000000000..94de825f62 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.h @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + + +#ifndef sample_multiply_h +#define sample_multiply_h + +class Multiply +{ + public: + virtual float mul(float num1, float num2) = 0; +}; + +#endif // sample_multiply_h + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.php b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.php new file mode 100644 index 0000000000..8ffe02675d --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Multiply.php @@ -0,0 +1,33 @@ +log_message($result); + + return $result; + } +} + +?> diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.componentType b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.componentType new file mode 100644 index 0000000000..35dab8bb9b --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.componentType @@ -0,0 +1,29 @@ + + + + + + + + + + + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.h b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.h new file mode 100644 index 0000000000..a50b79ccc6 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.h @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* $Rev$ $Date$ */ + + +#ifndef sample_subtract_h +#define sample_subtract_h + +class Subtract +{ + public: + virtual float sub(float num1, float num2) = 0; +}; + +#endif // sample_subtract_h + + diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.php b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.php new file mode 100644 index 0000000000..8d3a1b3ddf --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/Subtract.php @@ -0,0 +1,30 @@ +log_message($result); + + return $result; +} +?> diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/runwsserver.sh b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/runwsserver.sh new file mode 100755 index 0000000000..069d734fea --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/runwsserver.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +APFULLDIR=`pwd` + +if [ x$TUSCANY_SCACPP = x ]; then +echo "TUSCANY_SCACPP not set" +exit; +fi +echo "Using SCA installed at $TUSCANY_SCACPP" + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$AXIS2C_HOME = x ]; then +echo "AXIS2C_HOME not set" +exit; +fi +echo "Using Axis2C installed at $AXIS2C_HOME" + +export LD_LIBRARY_PATH=$TUSCANY_SCACPP/lib:$TUSCANY_SCACPP/extensions/cpp/lib:$TUSCANY_SDOCPP/lib:$AXIS2C_HOME/lib:$LD_LIBRARY_PATH + +export TUSCANY_SCACPP_ROOT=$APFULLDIR/../ + +cd $AXIS2C_HOME/bin +./axis2_http_server diff --git a/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/sample.calculator.composite b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/sample.calculator.composite new file mode 100644 index 0000000000..09b7070fb8 --- /dev/null +++ b/sca-cpp/trunk/contrib/samples/PHPCalculator/sample.calculator/sample.calculator.composite @@ -0,0 +1,81 @@ + + + + + + + + + DivideComponent/DivideService + + + + + AddComponent + SubtractComponent + MultiplyComponent + DivideComponent + + + + + LogComponent + + + + + LogComponent + + + + + LogComponent + + + + + DivideCPPComponent/DivideService + AddComponent + MultiplyComponent + SubtractComponent + AddComponent + + + + + + + + + + + + + + + + -- cgit v1.2.3