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 09:38:39 UTC
svn commit: r437319 - in
/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca:
core/SCARuntime.cpp core/SCARuntime.h extension/ImplementationExtension.h
Author: robbinspg
Date: Sun Aug 27 00:38:37 2006
New Revision: 437319
URL: http://svn.apache.org/viewvc?rev=437319&view=rev
Log:
First pass at extension loading:
Call simple init method on extension library. The extension will call back to register what it extends
Modified:
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
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=437319&r1=437318&r2=437319&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 00:38:37 2006
@@ -97,7 +97,6 @@
// load extensions
loadExtensions();
- loadImplementationExtensions();
LOGEXIT(1, "SCARuntime::constructor");
}
@@ -208,7 +207,14 @@
{
try
{
- extensionsList.push_back(Library(files[i].getFileName()));
+ Library lib = Library(files[i].getFileName());
+ extensionsList.push_back(lib);
+ TUSCANY_IMPLEMENTATION_EXTENSION_INITIALIZE extension =
+ (TUSCANY_IMPLEMENTATION_EXTENSION_INITIALIZE)lib.getSymbol("tuscany_sca_extension_initialize");
+ if (extension)
+ {
+ extension();
+ }
}
catch (ServiceRuntimeException &)
{
@@ -219,33 +225,7 @@
LOGEXIT(1, "SCARuntime::loadExtensions");
}
- // ======================================
- // Find implemenation extension handlers
- // ======================================
- void SCARuntime::loadImplementationExtensions()
- {
- LOGENTRY(1, "SCARuntime::loadImplementationExtensions");
-
-
- for (EXTENSIONS_LIST::iterator iter = extensionsList.begin();
- iter != extensionsList.end();
- iter++)
- {
- TUSCANY_IMPLEMENTATION_EXTENSION_FACTORY impl =
- (TUSCANY_IMPLEMENTATION_EXTENSION_FACTORY)iter->getSymbol("tuscany_sca_extension_getImplementation");
- if (impl)
- {
- ImplementationExtension* extension = impl();
- if (extension)
- {
- registerImplementationExtension(*extension);
- }
- }
- }
-
- LOGEXIT(1, "SCARuntime::loadImplementationExtensions");
- }
-
+
// ======================================
// register an implementationExtension
// ======================================
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=437319&r1=437318&r2=437319&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 00:38:37 2006
@@ -194,7 +194,6 @@
// Runtime Extensions
void loadExtensions();
- void loadImplementationExtensions();
typedef list<Library> EXTENSIONS_LIST;
EXTENSIONS_LIST extensionsList;
@@ -205,6 +204,7 @@
} // End namespace sca
} // End namespace tuscany
+typedef void* (* TUSCANY_IMPLEMENTATION_EXTENSION_INITIALIZE) ();
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=437319&r1=437318&r2=437319&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 00:38:37 2006
@@ -68,7 +68,5 @@
} // End namespace tuscany
-typedef tuscany::sca::ImplementationExtension* (* TUSCANY_IMPLEMENTATION_EXTENSION_FACTORY) ();
-
#endif // tuscany_sca_extension_implementationextension_h
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org