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 2006/08/27 17:42:56 UTC
svn commit: r437388 - in /incubator/tuscany/cpp/sca: projects/tuscany_sca/
projects/tuscany_sca/tuscany_sca/ projects/tuscany_sca/tuscany_sca_cpp/
runtime/core/src/tuscany/sca/core/ runtime/core/src/tuscany/sca/extension/
runtime/core/src/tuscany/sca/m...
Author: robbinspg
Date: Sun Aug 27 08:42:54 2006
New Revision: 437388
URL: http://svn.apache.org/viewvc?rev=437388&view=rev
Log:
Handles the <interface.cpp> in cpp extension
Added:
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/InterfaceExtension.cpp (with props)
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/InterfaceExtension.h (with props)
incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPInterfaceExtension.cpp (with props)
incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPInterfaceExtension.h (with props)
incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPImplementation.cpp
- copied, changed from r437369, incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/ImplementationCPP.cpp
incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPImplementation.h
- copied, changed from r437369, incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/ImplementationCPP.h
incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPInterface.cpp (with props)
incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPInterface.h (with props)
Removed:
incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/ImplementationCPP.cpp
incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/ImplementationCPP.h
Modified:
incubator/tuscany/cpp/sca/projects/tuscany_sca/tuscany_sca.ncb
incubator/tuscany/cpp/sca/projects/tuscany_sca/tuscany_sca.opt
incubator/tuscany/cpp/sca/projects/tuscany_sca/tuscany_sca/tuscany_sca.dsp
incubator/tuscany/cpp/sca/projects/tuscany_sca/tuscany_sca_cpp/tuscany_sca_cpp.dsp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ImplementationExtension.h
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.h
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.h
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp
incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPExtension.cpp
incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPImplementationExtension.cpp
incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPImplementationExtension.h
Modified: incubator/tuscany/cpp/sca/projects/tuscany_sca/tuscany_sca.ncb
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/projects/tuscany_sca/tuscany_sca.ncb?rev=437388&r1=437387&r2=437388&view=diff
==============================================================================
Binary files - no diff available.
Modified: incubator/tuscany/cpp/sca/projects/tuscany_sca/tuscany_sca.opt
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/projects/tuscany_sca/tuscany_sca.opt?rev=437388&r1=437387&r2=437388&view=diff
==============================================================================
Binary files - no diff available.
Modified: incubator/tuscany/cpp/sca/projects/tuscany_sca/tuscany_sca/tuscany_sca.dsp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/projects/tuscany_sca/tuscany_sca/tuscany_sca.dsp?rev=437388&r1=437387&r2=437388&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/projects/tuscany_sca/tuscany_sca/tuscany_sca.dsp (original)
+++ incubator/tuscany/cpp/sca/projects/tuscany_sca/tuscany_sca/tuscany_sca.dsp Sun Aug 27 08:42:54 2006
@@ -495,6 +495,14 @@
SOURCE=..\..\..\runtime\core\src\tuscany\sca\extension\ImplementationExtension.h
# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\runtime\core\src\tuscany\sca\extension\InterfaceExtension.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\runtime\core\src\tuscany\sca\extension\InterfaceExtension.h
+# End Source File
# End Group
# End Group
# Begin Group "xsd"
Modified: incubator/tuscany/cpp/sca/projects/tuscany_sca/tuscany_sca_cpp/tuscany_sca_cpp.dsp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/projects/tuscany_sca/tuscany_sca_cpp/tuscany_sca_cpp.dsp?rev=437388&r1=437387&r2=437388&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/projects/tuscany_sca/tuscany_sca_cpp/tuscany_sca_cpp.dsp (original)
+++ incubator/tuscany/cpp/sca/projects/tuscany_sca/tuscany_sca_cpp/tuscany_sca_cpp.dsp Sun Aug 27 08:42:54 2006
@@ -106,11 +106,19 @@
# End Source File
# Begin Source File
+SOURCE=..\..\..\runtime\extensions\cpp\model\CPPImplementation.cpp
+# End Source File
+# Begin Source File
+
SOURCE=..\..\..\runtime\extensions\cpp\CPPImplementationExtension.cpp
# End Source File
# Begin Source File
-SOURCE=..\..\..\runtime\extensions\cpp\model\ImplementationCPP.cpp
+SOURCE=..\..\..\runtime\extensions\cpp\model\CPPInterface.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\runtime\extensions\cpp\CPPInterfaceExtension.cpp
# End Source File
# End Group
# Begin Group "Header Files"
@@ -122,11 +130,19 @@
# End Source File
# Begin Source File
+SOURCE=..\..\..\runtime\extensions\cpp\model\CPPImplementation.h
+# End Source File
+# Begin Source File
+
SOURCE=..\..\..\runtime\extensions\cpp\CPPImplementationExtension.h
# End Source File
# Begin Source File
-SOURCE=..\..\..\runtime\extensions\cpp\model\ImplementationCPP.h
+SOURCE=..\..\..\runtime\extensions\cpp\model\CPPInterface.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\runtime\extensions\cpp\CPPInterfaceExtension.h
# End Source File
# End Group
# End Target
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp?rev=437388&r1=437387&r2=437388&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp Sun Aug 27 08:42:54 2006
@@ -227,6 +227,27 @@
// ======================================
+ // register an interfaceExtension
+ // ======================================
+ void SCARuntime::registerInterfaceExtension(InterfaceExtension* extension)
+ {
+ LOGENTRY(1, "SCARuntime::registerInterfaceExtension");
+ if (extension)
+ {
+ interfaceExtensions[extension->getExtensionTypeQName()] = extension;
+ }
+ LOGEXIT(1, "SCARuntime::registerInterfaceExtension");
+ }
+
+ // ======================================
+ // find an InterfaceExtension
+ // ======================================
+ InterfaceExtension* SCARuntime::getInterfaceExtension(const string& extensionTypeQName)
+ {
+ return interfaceExtensions[extensionTypeQName];
+ }
+
+ // ======================================
// register an implementationExtension
// ======================================
void SCARuntime::registerImplementationExtension(ImplementationExtension* extension)
@@ -234,7 +255,7 @@
LOGENTRY(1, "SCARuntime::registerImplementationExtension");
if (extension)
{
- implementationExtensions[extension->getImplementationTypeQName()] = extension;
+ implementationExtensions[extension->getExtensionTypeQName()] = extension;
}
LOGEXIT(1, "SCARuntime::registerImplementationExtension");
}
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h?rev=437388&r1=437387&r2=437388&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h Sun Aug 27 08:42:54 2006
@@ -29,6 +29,7 @@
#include "tuscany/sca/model/System.h"
using namespace tuscany::sca::model;
+#include "tuscany/sca/extension/InterfaceExtension.h"
#include "tuscany/sca/extension/ImplementationExtension.h"
#include "tuscany/sca/util/Library.h"
@@ -131,6 +132,11 @@
SCA_API ImplementationExtension* getImplementationExtension(const string& typeQname);
+
+ SCA_API void registerInterfaceExtension(InterfaceExtension* extension);
+
+ SCA_API InterfaceExtension* getInterfaceExtension(const string& typeQname);
+
private:
/**
* Default constructor is private to prevent more than one instance.
@@ -188,9 +194,11 @@
*/
COMPONENTS_MAP components;
- typedef map<string, ImplementationExtension*> IMPLEMENTATIONS_MAP;
+ typedef map<string, ImplementationExtension*> IMPLEMENTATION_EXTENSIONS_MAP;
+ IMPLEMENTATION_EXTENSIONS_MAP implementationExtensions;
- IMPLEMENTATIONS_MAP implementationExtensions;
+ typedef map<string, InterfaceExtension*> INTERFACE_EXTENSIONS_MAP;
+ INTERFACE_EXTENSIONS_MAP interfaceExtensions;
// Runtime Extensions
void loadExtensions();
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ImplementationExtension.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ImplementationExtension.h?rev=437388&r1=437387&r2=437388&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ImplementationExtension.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/ImplementationExtension.h Sun Aug 27 08:42:54 2006
@@ -56,7 +56,7 @@
* return the QName of schema elemant for this implementation extension
* (e.g. "http://www.osoa.org/xmlns/sca/1.0#implementation.cpp")
*/
- virtual const string& getImplementationTypeQName() = 0;
+ virtual const string& getExtensionTypeQName() = 0;
virtual void loadModelElement(commonj::sdo::DataObjectPtr scdlImplementation, model::Component* component) = 0;
Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/InterfaceExtension.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/InterfaceExtension.cpp?rev=437388&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/InterfaceExtension.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/InterfaceExtension.cpp Sun Aug 27 08:42:54 2006
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "tuscany/sca/extension/InterfaceExtension.h"
+#include "tuscany/sca/util/Logging.h"
+namespace tuscany
+{
+ namespace sca
+ {
+ // ===================================================================
+ // Constructor for the InterfaceExtension class.
+ // ===================================================================
+ InterfaceExtension::InterfaceExtension()
+ {
+ LOGENTRY(1, "InterfaceExtension::constructor");
+ LOGEXIT(1, "InterfaceExtension::constructor");
+ }
+
+ // ===================================================================
+ // Destructor for the InterfaceExtension class.
+ // ===================================================================
+ InterfaceExtension::~InterfaceExtension()
+ {
+ LOGENTRY(1, "InterfaceExtension::destructor");;
+ LOGEXIT(1, "InterfaceExtension::destructor");
+ }
+
+
+ } // End namespace sca
+} // End namespace tuscany
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/InterfaceExtension.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/InterfaceExtension.cpp
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/InterfaceExtension.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/InterfaceExtension.h?rev=437388&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/InterfaceExtension.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/InterfaceExtension.h Sun Aug 27 08:42:54 2006
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef tuscany_sca_extension_interfaceextension_h
+#define tuscany_sca_extension_interfaceextension_h
+
+#include "osoa/sca/export.h"
+#include <string>
+using std::string;
+
+#include <tuscany/sca/model/Interface.h>
+#include <commonj/sdo/SDO.h>
+
+namespace tuscany
+{
+ namespace sca
+ {
+ class SCA_API InterfaceExtension
+ {
+ public:
+ /**
+ * Default constructor
+ */
+ InterfaceExtension();
+
+ /**
+ * Destructor
+ */
+ virtual ~InterfaceExtension();
+
+ /**
+ * return the name of the extension (e.g. "cpp" "php")
+ */
+ virtual const string& getExtensionName() = 0;
+
+ /**
+ * return the QName of schema elemant for this interface extension
+ * (e.g. "http://www.osoa.org/xmlns/sca/1.0#interface.cpp")
+ */
+ virtual const string& getExtensionTypeQName() = 0;
+
+ virtual tuscany::sca::model::Interface* getInterface(commonj::sdo::DataObjectPtr scdlInterface) = 0;
+ };
+
+
+ } // End namespace sca
+} // End namespace tuscany
+
+
+#endif // tuscany_sca_extension_interfaceextension_h
+
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/InterfaceExtension.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/extension/InterfaceExtension.h
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.h?rev=437388&r1=437387&r2=437388&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.h Sun Aug 27 08:42:54 2006
@@ -66,7 +66,8 @@
* Return the type of the interface.
* @return Always returns CPP.
*/
- virtual Type getInterfaceType() {return CPP;}
+ virtual const std::string getInterfaceType() {return "cpp";}
+
/**
* Get the name of the header file.
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.h?rev=437388&r1=437387&r2=437388&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.h Sun Aug 27 08:42:54 2006
@@ -32,19 +32,10 @@
* Information about an interface. Subtypes will hold information
* specific to a type of interface.
*/
- class Interface
+ class SCA_API Interface
{
- public:
- /**
- * The supported types of interface.
- */
- enum Type
- {
- CPP,
- JAVA
- };
-
+ public:
Interface();
virtual ~Interface();
@@ -52,7 +43,7 @@
* Returns the type of the interface.
* @return Will depend on the subtype.
*/
- virtual Type getInterfaceType() = 0;
+ virtual const std::string getInterfaceType() = 0;
private:
};
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp?rev=437388&r1=437387&r2=437388&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp Sun Aug 27 08:42:54 2006
@@ -22,7 +22,6 @@
#include "tuscany/sca/util/Exceptions.h"
#include "tuscany/sca/util/Logging.h"
#include "tuscany/sca/model/ModelLoader.h"
-#include "tuscany/sca/model/CPPImplementation.h"
#include "tuscany/sca/model/CPPInterface.h"
#include "tuscany/sca/core/SCARuntime.h"
#include "tuscany/sca/model/WSBinding.h"
@@ -366,19 +365,7 @@
}
else
{
- // This logic will move to the CPP extension
-
- // Determine the type
- string implType = impl->getType().getName();
- if (implType == "CPPImplementation")
- {
- string library = impl->getCString("library");
- string header = impl->getCString("header");
- string className = impl->getCString("class");
- CPPImplementation* cppImpl = new CPPImplementation(library, header, className);
- component->setImplementation(cppImpl);
-
- }
+ LOGERROR_1(0, "ModelLoader::addComponent: Unsupported implementation type: %s", implTypeQname.c_str());
}
// -----------------------
@@ -502,24 +489,21 @@
throw SystemConfigurationException(message.c_str());
}
- // Determine the type
- string componentTypeName;
- string ifType = iface->getType().getName();
- if (ifType == "CPPInterface")
- {
- string header = iface->getCString("header");
- string className = iface->getCString("class");
- string scope = iface->getCString("scope");
- bool remotable = iface->getBoolean("remotable");
-
- return new CPPInterface(header, className, scope, remotable);
+ string typeQname = iface->getType().getURI();
+ typeQname += "#";
+ typeQname += iface->getType().getName();
+
+ // Locate extension that handles this implementation type
+ InterfaceExtension* ifaceExtension = runtime->getInterfaceExtension(typeQname);
+ if (ifaceExtension)
+ {
+ return ifaceExtension->getInterface(iface);
}
else
{
- //TODO add support for other interface types
- //string message = "Interface type not yet supported: ";
- //message = message + ifType;
- //throw SystemConfigurationException(message.c_str());
+ // log this for now.
+ // We currently do not handle <interface.wsdl>
+ LOGERROR_1(1, "ModelLoader::getInterface: Unsupported interface type: %s", typeQname.c_str());
return 0;
}
}
Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPExtension.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPExtension.cpp?rev=437388&r1=437387&r2=437388&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPExtension.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPExtension.cpp Sun Aug 27 08:42:54 2006
@@ -21,6 +21,7 @@
#include "tuscany/sca/util/Logging.h"
#include "tuscany/sca/core/SCARuntime.h"
#include "CPPImplementationExtension.h"
+#include "CPPInterfaceExtension.h"
@@ -63,6 +64,7 @@
{
LOGENTRY(1, "CPPExtension::initialize");;
SCARuntime::getInstance()->registerImplementationExtension(new CPPImplementationExtension());
+ SCARuntime::getInstance()->registerInterfaceExtension(new CPPInterfaceExtension());
LOGEXIT(1, "CPPExtension::initialize");;
}
Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPImplementationExtension.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPImplementationExtension.cpp?rev=437388&r1=437387&r2=437388&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPImplementationExtension.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPImplementationExtension.cpp Sun Aug 27 08:42:54 2006
@@ -18,7 +18,7 @@
*/
#include "CPPImplementationExtension.h"
-#include "ImplementationCPP.h"
+#include "CPPImplementation.h"
#include "tuscany/sca/util/Logging.h"
@@ -61,9 +61,9 @@
string library = scdlImplementation->getCString("library");
string header = scdlImplementation->getCString("header");
string className = scdlImplementation->getCString("class");
- // The following works for now ONLY bacause ImplementationCPP is identical
+ // The following works for now ONLY bacause CPPImplementation is identical
// to tusscany::sca::model::CPPIplementation
- ImplementationCPP* cppImpl = new ImplementationCPP(library, header, className);
+ CPPImplementation* cppImpl = new CPPImplementation(library, header, className);
component->setImplementation(cppImpl);
}
}
Modified: incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPImplementationExtension.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPImplementationExtension.h?rev=437388&r1=437387&r2=437388&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPImplementationExtension.h (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPImplementationExtension.h Sun Aug 27 08:42:54 2006
@@ -51,7 +51,7 @@
* return the QName of schema elemant for this implementation extension
* (e.g. "http://www.osoa.org/xmlns/sca/1.0#implementation.cpp")
*/
- virtual const string& getImplementationTypeQName() {return typeQName;}
+ virtual const string& getExtensionTypeQName() {return typeQName;}
virtual void loadModelElement(commonj::sdo::DataObjectPtr scdlImplementation, model::Component* component);
Added: incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPInterfaceExtension.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPInterfaceExtension.cpp?rev=437388&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPInterfaceExtension.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPInterfaceExtension.cpp Sun Aug 27 08:42:54 2006
@@ -0,0 +1,73 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+#include "CPPInterfaceExtension.h"
+#include "CPPInterface.h"
+#include "tuscany/sca/util/Logging.h"
+
+
+namespace tuscany
+{
+ namespace sca
+ {
+ namespace cpp
+ {
+ // ===================================================================
+ // Constructor for the CPPInterfaceExtension class.
+ // ===================================================================
+ CPPInterfaceExtension::CPPInterfaceExtension()
+ {
+ LOGENTRY(1, "CPPInterfaceExtension::constructor");
+ LOGEXIT(1, "CPPInterfaceExtension::constructor");
+ }
+
+ // ===================================================================
+ // Destructor for the CPPInterfaceExtension class.
+ // ===================================================================
+ CPPInterfaceExtension::~CPPInterfaceExtension()
+ {
+ LOGENTRY(1, "CPPInterfaceExtension::destructor");;
+ LOGEXIT(1, "CPPInterfaceExtension::destructor");
+ }
+
+ const string CPPInterfaceExtension::extensionName("cpp");
+ const string CPPInterfaceExtension::typeQName("http://www.osoa.org/xmlns/sca/1.0#CPPInterface");
+
+ // ===================================================================
+ // loadModelElement - load the info from implementation.cpp
+ // ===================================================================
+ tuscany::sca::model::Interface* CPPInterfaceExtension::getInterface(commonj::sdo::DataObjectPtr scdlInterface)
+ {
+ // Determine the type
+ string ifType = scdlInterface->getType().getName();
+ if (ifType == "CPPInterface")
+ {
+ string header = scdlInterface->getCString("header");
+ string className = scdlInterface->getCString("class");
+ string scope = scdlInterface->getCString("scope");
+ bool remotable = scdlInterface->getBoolean("remotable");
+
+ return new CPPInterface(header, className, scope, remotable);
+ }
+ return 0;
+ }
+
+ } // End namespace cpp
+ } // End namespace sca
+} // End namespace tuscany
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPInterfaceExtension.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPInterfaceExtension.cpp
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPInterfaceExtension.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPInterfaceExtension.h?rev=437388&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPInterfaceExtension.h (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPInterfaceExtension.h Sun Aug 27 08:42:54 2006
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef tuscany_sca_extension_cppinterfaceextension_h
+#define tuscany_sca_extension_cppinterfaceextension_h
+
+#include "tuscany/sca/extension/InterfaceExtension.h"
+
+namespace tuscany
+{
+ namespace sca
+ {
+ namespace cpp
+ {
+
+ class CPPInterfaceExtension : public InterfaceExtension
+ {
+ public:
+ /**
+ * Default constructor
+ */
+ CPPInterfaceExtension();
+
+ /**
+ * Destructor
+ */
+ virtual ~CPPInterfaceExtension();
+
+ /**
+ * return the name of the extension
+ */
+ virtual const string& getExtensionName() {return extensionName;}
+
+ /**
+ * return the QName of schema elemant for this implementation extension
+ * (e.g. "http://www.osoa.org/xmlns/sca/1.0#implementation.cpp")
+ */
+ virtual const string& getExtensionTypeQName() {return typeQName;}
+
+ virtual tuscany::sca::model::Interface* getInterface(commonj::sdo::DataObjectPtr scdlInterface);
+
+ private:
+ static const string extensionName;
+ static const string typeQName;
+
+ };
+
+
+ } // End namespace cpp
+ } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_extension_cppinterfaceextension_h
+
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPInterfaceExtension.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/cpp/CPPInterfaceExtension.h
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPImplementation.cpp (from r437369, incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/ImplementationCPP.cpp)
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPImplementation.cpp?p2=incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPImplementation.cpp&p1=incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/ImplementationCPP.cpp&r1=437369&r2=437388&rev=437388&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/ImplementationCPP.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPImplementation.cpp Sun Aug 27 08:42:54 2006
@@ -18,7 +18,7 @@
*/
#include "tuscany/sca/util/Logging.h"
-#include "ImplementationCPP.h"
+#include "CPPImplementation.h"
#include "tuscany/sca/util/Utils.h"
namespace tuscany
@@ -30,7 +30,7 @@
{
// Constructor
- ImplementationCPP::ImplementationCPP(const string& libraryName, const string& head, const string& classN)
+ CPPImplementation::CPPImplementation(const string& libraryName, const string& head, const string& classN)
: Implementation(), library(libraryName), header(head), className(classN)
{
// Separate any path element
@@ -45,7 +45,7 @@
Utils::rTokeniseString(".h", headerStub, headerStub, tmp);
}
- ImplementationCPP::~ImplementationCPP()
+ CPPImplementation::~CPPImplementation()
{
}
} // End namespace cpp
Copied: incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPImplementation.h (from r437369, incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/ImplementationCPP.h)
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPImplementation.h?p2=incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPImplementation.h&p1=incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/ImplementationCPP.h&r1=437369&r2=437388&rev=437388&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/ImplementationCPP.h (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPImplementation.h Sun Aug 27 08:42:54 2006
@@ -17,8 +17,8 @@
* under the License.
*/
-#ifndef tuscany_sca_model_ImplementationCPP_h
-#define tuscany_sca_model_ImplementationCPP_h
+#ifndef tuscany_sca_cpp_model_cppimplementation_h
+#define tuscany_sca_cpp_model_cppimplementation_h
#include "tuscany/sca/model/Implementation.h"
@@ -34,9 +34,9 @@
namespace cpp
{
/**
- * Holds informatio about an SCA implementation written in C++
+ * Holds information about an SCA implementation written in C++
*/
- class ImplementationCPP : public model::Implementation
+ class CPPImplementation : public model::Implementation
{
public:
@@ -48,12 +48,12 @@
* @param className Name of the class in the header file (could be a blank string
* if this is not specified).
*/
- ImplementationCPP(const string& libraryName, const string& header, const string& className);
+ CPPImplementation(const string& libraryName, const string& header, const string& className);
/**
* Destructor
*/
- virtual ~ImplementationCPP();
+ virtual ~CPPImplementation();
/**
* Return the implementation type.
@@ -124,5 +124,5 @@
} // End namespace sca
} // End namespace tuscany
-#endif // tuscany_sca_model_cppimplementation_h
+#endif // tuscany_sca_cpp_model_cppimplementation_h
Added: incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPInterface.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPInterface.cpp?rev=437388&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPInterface.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPInterface.cpp Sun Aug 27 08:42:54 2006
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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 "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/util/Utils.h"
+#include "CPPInterface.h"
+
+
+namespace tuscany
+{
+ namespace sca
+ {
+
+ namespace cpp
+ {
+
+ // Constructor
+ CPPInterface::CPPInterface(
+ const string& head,
+ const string& classN,
+ const string& scop,
+ bool remote)
+ : header(head), className(classN), remotable(remote)
+ {
+ Utils::breakpoint();
+ string::size_type dot = header.rfind(".h"); // this will also find .hpp
+ if (dot != string::npos)
+ {
+ headerStub = header.substr(0, dot);
+ }
+ else
+ {
+ headerStub = header;
+ }
+
+ if (scop == "composite")
+ {
+ scope = COMPOSITE;
+ }
+ else
+ {
+ scope = STATELESS;
+ }
+ }
+
+ CPPInterface::~CPPInterface()
+ {
+ }
+
+ } // End namespace cpp
+
+ } // End namespace sca
+} // End namespace tuscany
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPInterface.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPInterface.cpp
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPInterface.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPInterface.h?rev=437388&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPInterface.h (added)
+++ incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPInterface.h Sun Aug 27 08:42:54 2006
@@ -0,0 +1,143 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef tuscany_sca_cpp_model_cppinterface_h
+#define tuscany_sca_cpp_model_cppinterface_h
+
+#include "tuscany/sca/model/Interface.h"
+
+
+#include <map>
+using std::map;
+#include <string>
+using std::string;
+
+namespace tuscany
+{
+ namespace sca
+ {
+ namespace cpp
+ {
+ /**
+ * Holds information about an interface described using a C++
+ * header file.
+ */
+ class CPPInterface : public model::Interface
+ {
+
+ public:
+ /**
+ * Constuctor.
+ * @param header Name of the header file containing the class that
+ * describes the interface.
+ * @param className Name of the class in the header file that
+ * describes the interface.
+ * @param scope The scope of the interface (stateless or composite).
+ * @param remotable True if the interface is remotable.
+ */
+ CPPInterface(
+ const string& header,
+ const string& className,
+ const string& scope,
+ bool remotable);
+
+ /**
+ * Destructor.
+ */
+ virtual ~CPPInterface();
+
+ /**
+ * Return the type of the interface.
+ * @return Always returns CPP.
+ */
+ virtual const std::string getInterfaceType() {return "cpp";}
+
+ /**
+ * Get the name of the header file.
+ * @return The name of the header file containing the definition of the
+ * interface.
+ */
+ const string& getHeader() {return header;}
+
+ /**
+ * Return the name of the header file without the extension.
+ * @return Header file name without any extension.
+ */
+ const string& getHeaderStub() {return headerStub;}
+
+ /**
+ * Get the name of the class.
+ * @return The name of the class defining the interface.
+ */
+ const string& getClass() {return className;}
+
+ /**
+ * Scope of interface.
+ */
+ enum SCOPE
+ {
+ COMPOSITE,
+ STATELESS
+ };
+
+ /**
+ * Get the scope of the interface.
+ * @return The scope of the interface.
+ */
+ SCOPE getScope() {return scope;}
+
+ /**
+ * Return whether the interface is remotable or local.
+ * @return True if the interface is remotable, otherwise false.
+ */
+ bool getRemotable() {return remotable;}
+
+ private:
+ /**
+ * Name of the header file containing the definition of the interface.
+ */
+ string header;
+
+ /**
+ * Name of the header file without the extension.
+ */
+ string headerStub;
+
+ /**
+ * Name of the class in the header file.
+ */
+ string className;
+
+ /**
+ * Scope of the interface.
+ */
+ SCOPE scope;
+
+ /**
+ * Remotable interface or not.
+ */
+ bool remotable;
+ };
+
+ } // End namespace cpp
+ } // End namespace sca
+} // End namespace tuscany
+
+#endif // tuscany_sca_cpp_model_cppinterface_h
+
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPInterface.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/extensions/cpp/model/CPPInterface.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