You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ro...@apache.org on 2007/03/07 13:31:23 UTC
svn commit: r515551 - in /incubator/tuscany/cpp/sca/runtime/extensions/php:
./ src/ src/tuscany/sca/php/ src/tuscany/sca/php/model/
Author: robbinspg
Date: Wed Mar 7 04:31:22 2007
New Revision: 515551
URL: http://svn.apache.org/viewvc?view=rev&rev=515551
Log:
Add PHPInterface extension
Added:
incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.cpp (with props)
incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.h (with props)
incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.cpp (with props)
incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.h (with props)
Modified:
incubator/tuscany/cpp/sca/runtime/extensions/php/Makefile.am
incubator/tuscany/cpp/sca/runtime/extensions/php/build.sh
incubator/tuscany/cpp/sca/runtime/extensions/php/configure.ac
incubator/tuscany/cpp/sca/runtime/extensions/php/src/Makefile.am
incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.cpp
incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp
Modified: incubator/tuscany/cpp/sca/runtime/extensions/php/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/php/Makefile.am?view=diff&rev=515551&r1=515550&r2=515551
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/php/Makefile.am (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/php/Makefile.am Wed Mar 7 04:31:22 2007
@@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
-SUBDIRS = src
+SUBDIRS = src samples
datadir=$(prefix)
Modified: incubator/tuscany/cpp/sca/runtime/extensions/php/build.sh
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/php/build.sh?view=diff&rev=515551&r1=515550&r2=515551
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/php/build.sh (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/php/build.sh Wed Mar 7 04:31:22 2007
@@ -45,7 +45,7 @@
#cd ${TUSCANY_SCACPP_HOME}/samples
#./autogen.sh
-cd SCA_PHP_EXTENSION_HOME
+cd ${SCA_PHP_EXTENSION_HOME}
./autogen.sh
Modified: incubator/tuscany/cpp/sca/runtime/extensions/php/configure.ac
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/php/configure.ac?view=diff&rev=515551&r1=515550&r2=515551
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/php/configure.ac (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/php/configure.ac Wed Mar 7 04:31:22 2007
@@ -70,6 +70,10 @@
AC_CONFIG_FILES([Makefile
src/Makefile
+ samples/Makefile
+ samples/PHPCalculator/Makefile
+ samples/PHPCalculator/sample.calculator/Makefile
+ samples/PHPCalculator/sample.calculator.client/Makefile
])
AC_OUTPUT
Modified: incubator/tuscany/cpp/sca/runtime/extensions/php/src/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/php/src/Makefile.am?view=diff&rev=515551&r1=515550&r2=515551
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/php/src/Makefile.am (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/php/src/Makefile.am Wed Mar 7 04:31:22 2007
@@ -25,10 +25,12 @@
libtuscany_sca_php_la_SOURCES = \
tuscany/sca/php/PHPExtension.cpp \
tuscany/sca/php/PHPImplementationExtension.cpp \
+tuscany/sca/php/PHPInterfaceExtension.cpp \
tuscany/sca/php/PHPServiceWrapper.cpp \
tuscany/sca/php/PHPServiceProxy.cpp \
tuscany/sca/php/sca.cpp \
tuscany/sca/php/model/PHPImplementation.cpp \
+tuscany/sca/php/model/PHPInterface.cpp \
tuscany/sca/php/model/PHPReferenceBinding.cpp \
tuscany/sca/php/model/PHPServiceBinding.cpp
Modified: incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.cpp?view=diff&rev=515551&r1=515550&r2=515551
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPExtension.cpp Wed Mar 7 04:31:22 2007
@@ -23,6 +23,7 @@
#include "tuscany/sca/util/Logging.h"
#include "tuscany/sca/core/SCARuntime.h"
#include "tuscany/sca/php/PHPImplementationExtension.h"
+#include "tuscany/sca/php/PHPInterfaceExtension.h"
extern "C"
@@ -62,7 +63,7 @@
{
logentry();
SCARuntime::getCurrentRuntime()->registerImplementationExtension(new PHPImplementationExtension());
- //SCARuntime::getInstance()->registerInterfaceExtension(new PHPInterfaceExtension());
+ SCARuntime::getCurrentRuntime()->registerInterfaceExtension(new PHPInterfaceExtension());
}
} // End namespace php
Added: incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.cpp?view=auto&rev=515551
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.cpp Wed Mar 7 04:31:22 2007
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* $Rev$ $Date$ */
+
+#include "tuscany/sca/php/PHPInterfaceExtension.h"
+#include "tuscany/sca/php/model/PHPInterface.h"
+#include "tuscany/sca/util/Logging.h"
+
+using namespace std;
+using namespace commonj::sdo;
+using namespace tuscany::sca::model;
+
+namespace tuscany
+{
+ namespace sca
+ {
+ namespace php
+ {
+ // ===================================================================
+ // Constructor for the PHPInterfaceExtension class.
+ // ===================================================================
+ PHPInterfaceExtension::PHPInterfaceExtension()
+ {
+ logentry();
+ }
+
+ // ===================================================================
+ // Destructor for the PHPInterfaceExtension class.
+ // ===================================================================
+ PHPInterfaceExtension::~PHPInterfaceExtension()
+ {
+ logentry();
+ }
+
+ const string PHPInterfaceExtension::extensionName("php");
+ const string PHPInterfaceExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#PHPInterface");
+
+ // ===================================================================
+ // loadModelElement - load the info from interface.php
+ // ===================================================================
+ tuscany::sca::model::Interface* PHPInterfaceExtension::getInterface(Composite* composite, DataObjectPtr scdlInterface)
+ {
+ logentry();
+
+ // Determine the type
+ string ifType = scdlInterface->getType().getName();
+ if (ifType == "PHPInterface")
+ {
+ bool remotable = scdlInterface->getBoolean("remotable");
+ bool conversational = scdlInterface->getBoolean("conversational");
+
+ return new PHPInterface(remotable, conversational);
+ }
+ return 0;
+ }
+
+ } // End namespace php
+ } // End namespace sca
+} // End namespace tuscany
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.cpp
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.h?view=auto&rev=515551
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.h (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.h Wed Mar 7 04:31:22 2007
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* $Rev$ $Date$ */
+
+#ifndef tuscany_sca_php_phpinterfaceextension_h
+#define tuscany_sca_php_phpinterfaceextension_h
+
+#include "tuscany/sca/extension/InterfaceExtension.h"
+
+namespace tuscany
+{
+ namespace sca
+ {
+ namespace php
+ {
+
+ class PHPInterfaceExtension : public InterfaceExtension
+ {
+ public:
+ /**
+ * Default constructor
+ */
+ PHPInterfaceExtension();
+
+ /**
+ * Destructor
+ */
+ virtual ~PHPInterfaceExtension();
+
+ /**
+ * return the name of the extension
+ */
+ virtual const std::string& getExtensionName() {return extensionName;}
+
+ /**
+ * return the QName of schema elemant for this implementation extension
+ * (e.g. "http://www.osoa.org/xmlns/sca/1.0#PHPInterface")
+ */
+ virtual const std::string& getExtensionTypeQName() {return typeQName;}
+
+ virtual tuscany::sca::model::Interface* getInterface(
+ tuscany::sca::model::Composite* composite,
+ commonj::sdo::DataObjectPtr scdlInterface);
+
+ private:
+ static const std::string extensionName;
+ static const std::string typeQName;
+
+ };
+
+
+ } // End namespace php
+ } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_php_phpinterfaceextension_h
+
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPInterfaceExtension.h
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp?view=diff&rev=515551&r1=515550&r2=515551
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp Wed Mar 7 04:31:22 2007
@@ -154,9 +154,6 @@
zval *params[5];
logentry();
-string temp;
-cout << "Press Key\n";
-cin >> temp;
// set the current component in the SCA runtime
// so that other things can get at it thorugh this
@@ -364,12 +361,16 @@
zend_eval_string((char *) script.c_str(),
NULL, //&retval,
"Include module" TSRMLS_CC);
+
+ loginfo(">>>> About to call SCA_TuscanyWrapper->invoke()");
/* Now call SCA_TuscanyWrapper->invoke() ... */
ZVAL_STRING(&z_func_name, "invoke", 1);
call_user_function(EG(function_table),
&pz_tuscany_wrapper, &z_func_name,
&retval, 0, NULL TSRMLS_CC);
+
+ loginfo("<<<< Return from SCA_TuscanyWrapper->invoke()");
zval_dtor(&z_func_name);
Added: incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.cpp?view=auto&rev=515551
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.cpp Wed Mar 7 04:31:22 2007
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* $Rev$ $Date$ */
+
+
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/php/export.h"
+#include "tuscany/sca/php/model/PHPInterface.h"
+
+using namespace std;
+
+namespace tuscany
+{
+ namespace sca
+ {
+ namespace php
+ {
+ const string PHPInterface::typeQName("http://www.osoa.org/xmlns/sca/1.0#PHPInterface");
+
+ // Constructor
+ PHPInterface::PHPInterface(
+ bool remotable,
+ bool conversational)
+ : Interface(remotable, conversational)
+ {
+ logentry();
+ }
+
+ PHPInterface::~PHPInterface()
+ {
+ logentry();
+ }
+
+ } // End namespace php
+ } // End namespace sca
+} // End namespace tuscany
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.cpp
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.h?view=auto&rev=515551
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.h (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.h Wed Mar 7 04:31:22 2007
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* $Rev$ $Date$ */
+
+
+#ifndef tuscany_sca_php_model_phpinterface_h
+#define tuscany_sca_php_model_phpinterface_h
+
+#include <string>
+
+#include "tuscany/sca/php/export.h"
+#include "tuscany/sca/model/Interface.h"
+
+namespace tuscany
+{
+ namespace sca
+ {
+ namespace php
+ {
+ /**
+ * Holds information about an interface described using a PHP
+ * header file.
+ */
+ class PHPInterface : public tuscany::sca::model::Interface
+ {
+
+ public:
+ /**
+ * Constuctor.
+ * @param scope The scope of the interface (stateless or composite).
+ * @param remotable True if the interface is remotable.
+ */
+ PHPInterface(
+ bool remotable,
+ bool conversational);
+
+ /**
+ * Destructor.
+ */
+ virtual ~PHPInterface();
+
+ /**
+ * return the QName of the schema type for this interface type
+ * (e.g. "http://www.osoa.org/xmlns/sca/1.0#interface.cpp")
+ */
+ const std::string& getInterfaceTypeQName() { return typeQName; };
+
+ /**
+ * The QName of the schema type for this interface type.
+ */
+ SCA_PHP_API static const std::string typeQName;
+
+ };
+
+ } // End namespace php
+ } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_php_model_phpinterface_h
+
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/model/PHPInterface.h
------------------------------------------------------------------------------
svn:keywords = Rev Date
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org