You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2006/08/08 23:47:11 UTC
svn commit: r429833 [2/5] - in /incubator/tuscany/cpp/sca: ./ doc/
projects/tuscany_sca/ projects/tuscany_sca/tuscany_sca/
projects/tuscany_sca/tuscany_sca_test/
projects/tuscany_sca/tuscany_sca_test/testSCASystem/composites/
projects/tuscany_sca/tusca...
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ComponentServiceWrapper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ComponentServiceWrapper.h?rev=429833&r1=429832&r2=429833&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ComponentServiceWrapper.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ComponentServiceWrapper.h Tue Aug 8 14:47:01 2006
@@ -113,7 +113,7 @@
private:
/**
- * Holds an implementation instance if the scope is set to module.
+ * Holds an implementation instance if the scope is set to composite.
*/
static void* staticImpl;
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ExternalServiceWrapper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ExternalServiceWrapper.h?rev=429833&r1=429832&r2=429833&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ExternalServiceWrapper.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ExternalServiceWrapper.h Tue Aug 8 14:47:01 2006
@@ -42,7 +42,7 @@
public:
/**
* Factory method to create a new ExternaServiceWrapper for a given
- * external service described in the SCA module.
+ * external service described in the SCA composite.
*/
static ExternalServiceWrapper* createServiceWrapper(ExternalService* service);
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCAEntryPoint.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCAEntryPoint.cpp?rev=429833&r1=429832&r2=429833&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCAEntryPoint.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCAEntryPoint.cpp Tue Aug 8 14:47:01 2006
@@ -35,7 +35,7 @@
// Constructor
// ===========
SCAEntryPoint::SCAEntryPoint(const char* epName)
- : subsystem(0), entrypoint(0), module(0)
+ : subsystem(0), entrypoint(0), composite(0)
{
LOGENTRY(1,"SCAEntryPoint::constructor");
string message;
@@ -69,15 +69,15 @@
else
{
// -----------------------------------
- // locate the EntryPoint in the Module
+ // locate the EntryPoint in the Composite
// -----------------------------------
- string moduleComponentName;
- Utils::tokeniseUri(entrypointName, moduleComponentName, entrypointName);
- module = subsystem->findModuleByComponentName(moduleComponentName);
- if (module)
+ string compositeComponentName;
+ Utils::tokeniseUri(entrypointName, compositeComponentName, entrypointName);
+ composite = subsystem->findCompositeByComponentName(compositeComponentName);
+ if (composite)
{
- dataFactory = module->getDataFactory();
- entrypoint = module->findEntryPoint(entrypointName);
+ dataFactory = composite->getDataFactory();
+ entrypoint = composite->findEntryPoint(entrypointName);
}
}
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCAEntryPoint.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCAEntryPoint.h?rev=429833&r1=429832&r2=429833&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCAEntryPoint.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCAEntryPoint.h Tue Aug 8 14:47:01 2006
@@ -28,7 +28,7 @@
#include "tuscany/sca/model/WireTarget.h"
#include "tuscany/sca/model/Subsystem.h"
#include "tuscany/sca/model/EntryPoint.h"
-#include "tuscany/sca/model/Module.h"
+#include "tuscany/sca/model/Composite.h"
using namespace tuscany::sca::model;
#include "commonj/sdo/SDO.h"
using commonj::sdo::DataObjectPtr;
@@ -41,7 +41,7 @@
/**
* A runtime class which is used by external bindings to provide the entry
* point into the SCA runtime. An entry point will be defined in an SCA
- * module, and a binding class will be provided to service the
+ * composite, and a binding class will be provided to service the
* communication between the external binding (e.g. for web services the
* SOAP/HTTP communication) and the SCA runtime. The binding class will
* use SCAEntryPoint to call into the SCA runtime.
@@ -51,10 +51,10 @@
public:
/**
* Constructor to create a new instance which will be associated with
- * a given entry point in an SCA module.
+ * a given entry point in an SCA composite.
* @param entryPointName The qualified name of the entry point in an
- * SCA module. It is of the form
- * "subsystem name"/"module component name"/"entry point name".
+ * SCA composite. It is of the form
+ * "subsystem name"/"composite component name"/"entry point name".
*/
SCA_API SCAEntryPoint(const char* entryPointName);
@@ -65,14 +65,14 @@
/**
* Invokes an operation on the component to which the SCA entry point
- * is wired in the SCA module.
+ * is wired in the SCA composite.
* @param operation. The operation request
*/
SCA_API virtual void invoke(Operation& operation);
/**
* Returns a SDO data factory from which all the types associated with the entry point
- * and module can be created.
+ * and composite can be created.
*/
SCA_API DataFactoryPtr getDataFactory() {return dataFactory;}
@@ -85,17 +85,17 @@
Subsystem* subsystem;
/**
- * The entry point in the module.
+ * The entry point in the composite.
*/
EntryPoint* entrypoint;
/**
- * The module component in the subsystem.
+ * The composite component in the subsystem.
*/
- Module* module;
+ Composite* composite;
/**
- * Cached data factory which has all the types defined for the module in which
+ * Cached data factory which has all the types defined for the composite in which
* this entry point is found.
*/
DataFactoryPtr dataFactory;
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=429833&r1=429832&r2=429833&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 Tue Aug 8 14:47:01 2006
@@ -40,7 +40,7 @@
*/
static const char* TUSCANY_SCACPP = "TUSCANY_SCACPP";
static const char* TUSCANY_SCACPP_SYSTEM_ROOT = "TUSCANY_SCACPP_SYSTEM_ROOT";
- static const char* TUSCANY_SCACPP_DEFAULT_MODULE = "TUSCANY_SCACPP_DEFAULT_MODULE";
+ static const char* TUSCANY_SCACPP_DEFAULT_COMPOSITE = "TUSCANY_SCACPP_DEFAULT_COMPOSITE";
// ==========================================================
@@ -48,7 +48,7 @@
// ==========================================================
SCARuntime* SCARuntime::instance = 0;
string SCARuntime::systemRoot = "";
- string SCARuntime::defaultModuleName = "";
+ string SCARuntime::defaultCompositeName = "";
// ==========================================================
@@ -63,21 +63,21 @@
}
// ==========================================================
- // Set the default ModuleComponent name
+ // Set the default CompositeComponent name
// ==========================================================
- void SCARuntime::setDefaultModuleComponent(const string& moduleComponent)
+ void SCARuntime::setDefaultCompositeComponent(const string& compositeComponent)
{
- LOGENTRY(1, "SCARuntime::setDefaultModuleComponent");
- defaultModuleName = moduleComponent;
- LOGINFO_1(3, "SCARuntime::setDefaultModuleComponent - set to %s", moduleComponent.c_str());
- LOGEXIT(1, "SCARuntime::setDefaultModuleComponent");
+ LOGENTRY(1, "SCARuntime::setDefaultCompositeComponent");
+ defaultCompositeName = compositeComponent;
+ LOGINFO_1(3, "SCARuntime::setDefaultCompositeComponent - set to %s", compositeComponent.c_str());
+ LOGEXIT(1, "SCARuntime::setDefaultCompositeComponent");
}
// ===================================================================
// Constructor for the SCARuntime class. This will be a singleton that
// holds all the information about the current runtime.
// ===================================================================
- SCARuntime::SCARuntime() : system(new System()), defaultModule(0)
+ SCARuntime::SCARuntime() : system(new System()), defaultComposite(0)
{
LOGENTRY(1, "SCARuntime::constructor");
@@ -163,7 +163,7 @@
delete instance;
instance = 0;
systemRoot = "";
- defaultModuleName = "";
+ defaultCompositeName = "";
}
LOGEXIT(1, "SCARuntime::releaseInstance");
@@ -179,7 +179,7 @@
LOGINFO_1(2,"configuration root: %s", configurationRoot.c_str());
ModelLoader loader(system);
- // Load details of the module
+ // Load details of the composite
loader.load(configurationRoot);
LOGEXIT(1, "SCARuntime::load");
@@ -276,41 +276,41 @@
// ===========================================
- // getCurrentModule: return the current module
+ // getCurrentComposite: return the current composite
// ===========================================
- Module* SCARuntime::getCurrentModule()
+ Composite* SCARuntime::getCurrentComposite()
{
// ---------------------------------------------
- // Get module from current component if possible
+ // Get composite from current component if possible
// ---------------------------------------------
Component* comp = getCurrentComponent();
if (comp != 0)
{
- return comp->getModule();
+ return comp->getComposite();
}
// ----------------------
- // Get the default Module
+ // Get the default Composite
// ----------------------
string message;
- if (!defaultModule)
+ if (!defaultComposite)
{
// -------------------------------------------
- // Get the default module from the environment
+ // Get the default composite from the environment
// -------------------------------------------
- if (defaultModuleName == "")
+ if (defaultCompositeName == "")
{
- const char* defMod = getenv(TUSCANY_SCACPP_DEFAULT_MODULE);
+ const char* defMod = getenv(TUSCANY_SCACPP_DEFAULT_COMPOSITE);
if (!defMod)
{
- message = TUSCANY_SCACPP_DEFAULT_MODULE;
+ message = TUSCANY_SCACPP_DEFAULT_COMPOSITE;
message += " environment variable not set";
throw SystemConfigurationException(message.c_str());
}
- defaultModuleName = defMod;
+ defaultCompositeName = defMod;
}
- string subsystemName, moduleName;
- Utils::tokeniseUri(defaultModuleName, subsystemName, moduleName);
+ string subsystemName, compositeName;
+ Utils::tokeniseUri(defaultCompositeName, subsystemName, compositeName);
// ---------------------------
// Subsystem must be specified
@@ -323,32 +323,32 @@
}
// --------------------------------------------------------------------------
- // If module is not specified then get the default module for this subsystem.
- // This will be the ONLY module for this subsystem
+ // If composite is not specified then get the default composite for this subsystem.
+ // This will be the ONLY composite for this subsystem
// --------------------------------------------------------------------------
- if (moduleName == "")
+ if (compositeName == "")
{
- defaultModule = subsystem->getDefaultModule();
- if (!defaultModule)
+ defaultComposite = subsystem->getDefaultComposite();
+ if (!defaultComposite)
{
- message = "Default module not found for subsystem \'" + subsystemName + "\'";
+ message = "Default composite not found for subsystem \'" + subsystemName + "\'";
throw SystemConfigurationException(message.c_str());
}
}
else
{
// -----------------------------
- // get the named ModuleComponent
+ // get the named CompositeComponent
// -----------------------------
- defaultModule = subsystem->findModuleByComponentName(moduleName);
- if (!defaultModule)
+ defaultComposite = subsystem->findCompositeByComponentName(compositeName);
+ if (!defaultComposite)
{
- message = "Default module \'" + moduleName + "\' not found in subsystem \'" + subsystemName +"\'";
+ message = "Default composite \'" + compositeName + "\' not found in subsystem \'" + subsystemName +"\'";
throw SystemConfigurationException(message.c_str());
}
}
}
- return defaultModule;
+ return defaultComposite;
}
} // End namespace sca
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=429833&r1=429832&r2=429833&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 Tue Aug 8 14:47:01 2006
@@ -68,10 +68,10 @@
static void setSystemRoot(const string& root);
/**
- * Set the default ModuleComponent for the system
- * @param moduleComponent The name of the default moduleComponent.
+ * Set the default CompositeComponent for the system
+ * @param compositeComponent The name of the default compositeComponent.
*/
- static void setDefaultModuleComponent(const string& moduleComponent);
+ static void setDefaultCompositeComponent(const string& compositeComponent);
/**
* Set the current component for the current thread.
@@ -107,13 +107,13 @@
Component* getCurrentComponent();
/**
- * Get the current module. The current module will either
- * be the module in which the current component for this thread
- * is defined, or it will be the default module if there is no current
+ * Get the current composite. The current composite will either
+ * be the composite in which the current component for this thread
+ * is defined, or it will be the default composite if there is no current
* component. There will not be a current component if a client of
* the SCA runtime is making a call into the SCA runtime.
*/
- Module* getCurrentModule();
+ Composite* getCurrentComposite();
private:
/**
@@ -124,12 +124,12 @@
virtual ~SCARuntime();
/**
- * Load the SCA configuration from the scdl files (sca.module,
+ * Load the SCA configuration from the scdl files (sca.composite,
* *.fragment, etc).
* This will create the runtime model from which the SCA runtime
* will operate.
* @param configurationRoot The path to the configuration of the
- * SCA runtime. Under this root will be the subsystems and modules
+ * SCA runtime. Under this root will be the subsystems and composites
* directories.
*/
void load(const string& configurationRoot);
@@ -155,20 +155,20 @@
static string systemRoot;
/**
- * The default ModuleComponent.
+ * The default CompositeComponent.
*/
- static string defaultModuleName;
+ static string defaultCompositeName;
/**
- * Get the default module set for this runtime.
- * @return The default module.
+ * Get the default composite set for this runtime.
+ * @return The default composite.
*/
- Module* getDefaultModule() {return defaultModule;}
+ Composite* getDefaultComposite() {return defaultComposite;}
/**
- * The default module set for this runtime.
+ * The default composite set for this runtime.
*/
- Module* defaultModule;
+ Composite* defaultComposite;
typedef stack<Component*> COMPONENT_STACK;
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp?rev=429833&r1=429832&r2=429833&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp Tue Aug 8 14:47:01 2006
@@ -57,7 +57,7 @@
string dllName = ((CPPImplementation*)impl)->getDll();
string headerStub = ((CPPImplementation*)impl)->getHeaderStub();
- string fullDllName = component->getModule()->getRoot() + "/" + dllName;
+ string fullDllName = component->getComposite()->getRoot() + "/" + dllName;
string proxyFactoryName = headerStub + "_" + name + "_Proxy_Factory";
string proxyDestructorName = headerStub + "_" + name + "_Proxy_Destructor";
typedef void* (* PROXYFACTORY) (ServiceWrapper*);
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.cpp?rev=429833&r1=429832&r2=429833&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.cpp Tue Aug 8 14:47:01 2006
@@ -31,7 +31,7 @@
{
// ==========================================================
- // Set the default ModuleComponent name
+ // Set the default CompositeComponent name
// ==========================================================
void TuscanyRuntime::setSystemRoot(const string& root)
{
@@ -42,24 +42,24 @@
}
// ==========================================================
- // Set the default ModuleComponent name
+ // Set the default CompositeComponent name
// ==========================================================
- void TuscanyRuntime::setDefaultModuleComponent(const string& moduleComponent)
+ void TuscanyRuntime::setDefaultCompositeComponent(const string& compositeComponent)
{
- LOGENTRY(1, "TuscanyRuntime::setDefaultModuleComponent");
- defaultModuleComponent = moduleComponent;
- LOGINFO_1(3, "TuscanyRuntime::setDefaultModuleComponent - set to %s", moduleComponent.c_str());
- LOGEXIT(1, "TuscanyRuntime::setDefaultModuleComponent");
+ LOGENTRY(1, "TuscanyRuntime::setDefaultCompositeComponent");
+ defaultCompositeComponent = compositeComponent;
+ LOGINFO_1(3, "TuscanyRuntime::setDefaultCompositeComponent - set to %s", compositeComponent.c_str());
+ LOGEXIT(1, "TuscanyRuntime::setDefaultCompositeComponent");
}
// ===================================================================
// Constructor for the TuscanyRuntime class.
// ===================================================================
- TuscanyRuntime::TuscanyRuntime(const string& moduleComponent, const string& root)
+ TuscanyRuntime::TuscanyRuntime(const string& compositeComponent, const string& root)
{
LOGENTRY(1, "TuscanyRuntime::constructor");
setSystemRoot(root);
- setDefaultModuleComponent(moduleComponent);
+ setDefaultCompositeComponent(compositeComponent);
LOGEXIT(1, "TuscanyRuntime::constructor");
}
@@ -79,7 +79,7 @@
{
LOGENTRY(1, "TuscanyRuntime::start");
SCARuntime::setSystemRoot(systemRoot);
- SCARuntime::setDefaultModuleComponent(defaultModuleComponent);
+ SCARuntime::setDefaultCompositeComponent(defaultCompositeComponent);
SCARuntime::getInstance();
LOGEXIT(1, "TuscanyRuntime::start");
}
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.h?rev=429833&r1=429832&r2=429833&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.h Tue Aug 8 14:47:01 2006
@@ -38,7 +38,7 @@
/**
* Default constructor
*/
- TuscanyRuntime(const string& moduleComponent = "", const string& root = "");
+ TuscanyRuntime(const string& compositeComponent = "", const string& root = "");
/**
* Destructor
@@ -53,10 +53,10 @@
void setSystemRoot(const string& root);
/**
- * Set the default ModuleComponent for the system
- * @param moduleComponent The name of the default moduleComponent.
+ * Set the default CompositeComponent for the system
+ * @param compositeComponent The name of the default compositeComponent.
*/
- void setDefaultModuleComponent(const string& moduleComponent);
+ void setDefaultCompositeComponent(const string& compositeComponent);
/**
* start the runtime
@@ -71,7 +71,7 @@
private:
string systemRoot;
- string defaultModuleComponent;
+ string defaultCompositeComponent;
};
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.cpp?rev=429833&r1=429832&r2=429833&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/CPPInterface.cpp Tue Aug 8 14:47:01 2006
@@ -47,9 +47,9 @@
headerStub = header;
}
- if (scop == "module")
+ if (scop == "composite")
{
- scope = MODULE;
+ scope = COMPOSITE;
}
else
{
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=429833&r1=429832&r2=429833&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 Tue Aug 8 14:47:01 2006
@@ -48,7 +48,7 @@
* 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 module).
+ * @param scope The scope of the interface (stateless or composite).
* @param remotable True if the interface is remotable.
*/
CPPInterface(
@@ -92,7 +92,7 @@
*/
enum SCOPE
{
- MODULE,
+ COMPOSITE,
STATELESS
};
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp?rev=429833&r1=429832&r2=429833&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp Tue Aug 8 14:47:01 2006
@@ -33,8 +33,8 @@
namespace model
{
// Constructor
- Component::Component(const std::string& componentName, Module* module)
- : name(componentName), containingModule(module), implementation(0)
+ Component::Component(const std::string& componentName, Composite* composite)
+ : name(componentName), containingComposite(composite), implementation(0)
{
LOGENTRY(1, "Component::constructor");
LOGINFO_1(3, "Component::constructor: Component name: %s", name.c_str());
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.h?rev=429833&r1=429832&r2=429833&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.h Tue Aug 8 14:47:01 2006
@@ -40,7 +40,7 @@
namespace model
{
- class Module;
+ class Composite;
/**
* Information about an SCA component.
@@ -51,9 +51,9 @@
/**
* Constructor
* @param name The name of the component.
- * @param module The module containing this component.
+ * @param composite The composite containing this component.
*/
- Component(const std::string& name, Module* module);
+ Component(const std::string& name, Composite* composite);
/**
* Destructor.
@@ -67,10 +67,10 @@
const string& getName() {return name;}
/**
- * Get the module containing this component.
- * @return The containing module.
+ * Get the composite containing this component.
+ * @return The containing composite.
*/
- Module* getModule() {return containingModule;}
+ Composite* getComposite() {return containingComposite;}
/**
* Add a new service to this component.
@@ -133,7 +133,7 @@
/**
* Add the property values to the properties defined on this
- * component. The values will come from the sca.module file.
+ * component. The values will come from the sca.composite file.
* @param properties A data object representing all the values set
* for this component.
*/
@@ -152,9 +152,9 @@
string name;
/**
- * Module containing this component for navigating up the tree.
+ * Composite containing this component for navigating up the tree.
*/
- Module* containingModule;
+ Composite* containingComposite;
/**
* Information about the implementation of this component.
Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Composite.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Composite.cpp?rev=429833&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Composite.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Composite.cpp Tue Aug 8 14:47:01 2006
@@ -0,0 +1,235 @@
+/*
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/util/Utils.h"
+#include "tuscany/sca/model/Composite.h"
+
+
+namespace tuscany
+{
+ namespace sca
+ {
+
+ namespace model
+ {
+
+ // Constructor
+ Composite::Composite(const std::string& compositeName)
+ : name(compositeName)
+ {
+ LOGENTRY(1, "Composite::constructor");
+ LOGEXIT(1, "Composite::constructor");
+ }
+
+ Composite::~Composite()
+ {
+ }
+
+ void Composite::setRoot(const std::string& rootDirectory)
+ {
+ compositeRoot = rootDirectory;
+ }
+
+
+ ///
+ /// Add a new component to the composite component
+ ///
+ Component* Composite::addComponent(const std::string& name)
+ {
+ LOGENTRY(1, "Composite::addComponent");
+ Component* newComponent = new Component(name, this);
+ components[name] = newComponent;
+ LOGEXIT(1, "Composite::addComponent");
+ return newComponent;
+ }
+
+ Component* Composite::findComponent(const std::string& name)
+ {
+ LOGENTRY(1, "Composite::findComponent");
+ Component* foundComponent = components[name];
+ LOGEXIT(1, "Composite::findComponent");
+ return foundComponent;
+ }
+
+ Service* Composite::findComponentService(const std::string& name)
+ {
+ LOGENTRY(1, "Composite::findComponentService");
+
+ Service* service = 0;
+
+ string componentName;
+ string serviceName;
+ Utils::tokeniseUri(name, componentName, serviceName);
+
+ // Locate the component
+ Component* foundComponent = components[componentName];
+ if (foundComponent)
+ {
+ // Locate the service
+ service = foundComponent->findService(serviceName);
+ }
+ LOGEXIT(1, "Composite::findComponentService");
+ return service;
+ }
+
+ ExternalService* Composite::findExternalService(const std::string& name)
+ {
+ LOGENTRY(1, "Composite::findExternalService");
+ ExternalService* foundService = externalServices[name];
+ LOGEXIT(1, "Composite::findExternalService");
+ return foundService;
+ }
+
+
+ EntryPoint* Composite::addEntryPoint(const std::string& name)
+ {
+ LOGENTRY(1, "Composite::addEntryPoint");
+ EntryPoint* ep = new EntryPoint(name);
+ entryPoints[name] = ep;
+ LOGEXIT(1, "Composite::addEntryPoint");
+ return findEntryPoint(name);
+ }
+
+ EntryPoint* Composite::findEntryPoint(const std::string& name)
+ {
+ return entryPoints[name];
+ }
+
+
+ ExternalService* Composite::addExternalService(const std::string& name)
+ {
+ LOGENTRY(1, "Composite::addExternalService");
+ ExternalService* es = new ExternalService(name, this);
+ externalServices[name] = es;
+ LOGEXIT(1, "Composite::addExternalService");
+ return es;
+ }
+
+ void Composite::addWire(const std::string& source, const std::string& target)
+ {
+ LOGENTRY(1, "Composite::addWire");
+ wires.push_back(Wire(source, target));
+ LOGEXIT(1, "Composite::addWire");
+ }
+
+
+ void Composite::resolveWires()
+ {
+ LOGENTRY(1, "Composite::resolveWires");
+ for (WIRES::iterator iter = wires.begin();
+ iter != wires.end();
+ iter++)
+ {
+ // -----------------
+ // Locate the target
+ // -----------------
+ WireTarget* target = findComponentService(iter->getTarget());
+ if (!target)
+ {
+ target = findExternalService(iter->getTarget());
+ }
+ if (!target)
+ {
+ LOGERROR_1(0, "Composite::resolveWires: Wire target %s not found", iter->getTarget().c_str());
+ }
+ else
+ {
+ EntryPoint* entrypoint = findEntryPoint(iter->getSourceComponent());
+ if (entrypoint)
+ {
+ entrypoint->addTarget(target);
+ }
+ else
+ {
+ Component* component = findComponent(iter->getSourceComponent());
+ if (component)
+ {
+ ServiceReference* serviceReference = component->findReference(iter->getSourceReference());
+ if (serviceReference)
+ {
+ serviceReference->addTarget(target);
+ }
+ else
+ {
+ LOGERROR_1(0, "Composite::resolveWires: Wire source reference %s not found", iter->getSourceReference().c_str());
+ }
+ }
+ else
+ {
+ LOGERROR_1(0, "Composite::resolveWires: Wire source %s not found", iter->getSourceComponent().c_str());
+ }
+ }
+ }
+ }
+
+ LOGEXIT(1, "Composite::resolveWires");
+ }
+
+
+
+ void Composite::addWsdl(commonj::sdo::DataObjectPtr wsdlModel)
+ {
+ LOGENTRY(1, "Composite::addWsdl");
+ Wsdl* wsdl = new Wsdl(wsdlModel);
+ wsdls[wsdl->getNamespace()] = wsdl;
+ LOGEXIT(1, "Composite::addWsdl");
+
+ }
+
+ Wsdl* Composite::findWsdl(const std::string& wsdlNamespace )
+ {
+ return wsdls[wsdlNamespace];
+
+ }
+
+
+ // Get an XSDHelper - one will be created for each composite
+ commonj::sdo::XSDHelperPtr Composite::getXSDHelper()
+ {
+ if (xsdHelper == 0)
+ {
+ xsdHelper = commonj::sdo::HelperProvider::getXSDHelper();
+ }
+
+ return xsdHelper;
+ }
+
+ // Get an XMLHelper - one will be created for each composite
+ commonj::sdo::XMLHelperPtr Composite::getXMLHelper()
+ {
+ if (xmlHelper == 0)
+ {
+ xmlHelper = commonj::sdo::HelperProvider::getXMLHelper(getXSDHelper()->getDataFactory());
+ }
+
+ return xmlHelper;
+ }
+
+
+ // Get a data factory - the one in the xsd/xml helper
+ commonj::sdo::DataFactoryPtr Composite::getDataFactory()
+ {
+ return getXSDHelper()->getDataFactory();
+ }
+
+ } // End namespace model
+
+ } // End namespace sca
+} // End namespace tuscany
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Composite.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Composite.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Composite.h?rev=429833&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Composite.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Composite.h Tue Aug 8 14:47:01 2006
@@ -0,0 +1,235 @@
+/*
+ *
+ * Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#ifndef tuscany_sca_model_composite_h
+#define tuscany_sca_model_composite_h
+
+#include <string>
+using std::string;
+
+#include <map>
+using std::map;
+#include <vector>
+using std::vector;
+
+#include "commonj/sdo/SDO.h"
+
+
+#include "tuscany/sca/model/Component.h"
+#include "tuscany/sca/model/ExternalService.h"
+#include "tuscany/sca/model/EntryPoint.h"
+#include "tuscany/sca/model/Wire.h"
+#include "tuscany/sca/model/Wsdl.h"
+
+
+namespace tuscany
+{
+ namespace sca
+ {
+
+ namespace model
+ {
+ /**
+ * Information about a composite.
+ */
+ class Composite
+ {
+ public:
+ /**
+ * Constructor.
+ * @param name the name of the composite.
+ */
+ Composite(const std::string& name);
+
+ /**
+ * Destructor.
+ */
+ virtual ~Composite();
+
+ /**
+ * Set the root directory of the composite information.
+ * @param rootDirectory The root of the composite in the file system.
+ */
+ void setRoot(const std::string& rootDirectory);
+
+ /**
+ * Get the root directory of the composite.
+ * @return The root of the composite in the file system.
+ */
+ const std::string& getRoot() {return compositeRoot;}
+
+ /**
+ * Return the name of the composite.
+ * @return Name of the composite.
+ */
+ const std::string& getName() {return name;}
+
+ /**
+ * Add a new component to the composite.
+ * @param componentName The name of the new component.
+ * @return The Component added to the composite.
+ */
+ Component* addComponent(const std::string& componentName);
+
+ /**
+ * Add a new entry point to the composite.
+ * @param name The name of the new entry point.
+ * @return The entry point added to the composite.
+ */
+ EntryPoint* addEntryPoint(const std::string& name);
+
+ /**
+ * Find an entry point by name.
+ * @param name The name of the entry point to be found.
+ * @return The entry point that was found, or 0 if not found.
+ */
+ EntryPoint* findEntryPoint(const std::string& name);
+
+ /**
+ * Add a new external service to the composite.
+ * @param name The name of the new external service.
+ * @return The external service added to the composite.
+ */
+ ExternalService* addExternalService(const std::string& name);
+
+ /**
+ * Add a wire to the model.
+ * @param source The source location. Either the source component and
+ * reference (optional), or an entry point.
+ * @param target The target location. Either the target component and
+ * service (optional), or an external service.
+ */
+ void addWire(const std::string& source, const std::string& target);
+
+ /**
+ * Find a component by name.
+ * @param componentName The name of the component to be found.
+ * @return The component that was found, or 0 if not found.
+ */
+ Component* findComponent(const std::string& componentName);
+
+ /**
+ * Find a component and service by name.
+ * @param componentServiceName A string of the form
+ * "componentName"/"serviceName" where the service name is optional
+ * if there is only one service on the component.
+ * @return The Service that was found, or 0 if not found.
+ */
+ Service* findComponentService(const std::string& componentServiceName);
+
+ /**
+ * Find an external service by name.
+ * @param serviceName The name of the external service to be found.
+ * @return The external service that was found, or 0 if not found.
+ */
+ ExternalService* findExternalService(const std::string& serviceName);
+
+ /**
+ * Add a WSDL definition to the composite.
+ * @param wsdlModel A data object holding all the information about
+ * the WSDL definition from a WSDL file.
+ */
+ void addWsdl(commonj::sdo::DataObjectPtr wsdlModel);
+
+ /**
+ * Find a WSDL definition by target namespace.
+ * @param wsdlNamespace The namespace of the WSDL definitions to find.
+ */
+ Wsdl* findWsdl(const std::string& wsdlNamespace);
+
+ /**
+ * Return a cached SDO XSDHelper.
+ */
+ commonj::sdo::XSDHelperPtr getXSDHelper(void);
+
+ /**
+ * Return a cached SDO XMLHelper.
+ */
+ commonj::sdo::XMLHelperPtr getXMLHelper(void);
+
+ /**
+ * Return a data factory which has all the types defined in XSDs and
+ * WSDL files configured for this composite.
+ * @return The data factory for this composite.
+ */
+ commonj::sdo::DataFactoryPtr getDataFactory(void);
+
+ /**
+ * Work through the list of wires and connect the source and target uris.
+ */
+ void resolveWires();
+
+ private:
+ /**
+ * Name of the composite.
+ */
+ string name;
+
+ /**
+ * Directory of the root of the composite.
+ */
+ string compositeRoot;
+
+ /**
+ * Cached XSDHelper.
+ */
+ commonj::sdo::XSDHelperPtr xsdHelper;
+
+ /**
+ * Cached XMLHelper.
+ */
+ commonj::sdo::XMLHelperPtr xmlHelper;
+
+ typedef map<std::string, Component*> COMPONENT_MAP;
+ /**
+ * Map (by name) of all the components in this composite.
+ */
+ COMPONENT_MAP components;
+
+ typedef map<std::string, ExternalService*> EXTERNALSERVICE_MAP;
+ /**
+ * Map (by name) of all the external services in this composite.
+ */
+ EXTERNALSERVICE_MAP externalServices;
+
+ typedef map<std::string, EntryPoint*> ENTRYPOINT_MAP;
+ /**
+ * Map (by name) of all the entry points in this composite.
+ */
+ ENTRYPOINT_MAP entryPoints;
+
+ typedef vector<Wire> WIRES;
+ /**
+ * Vector of all the wires in this composite.
+ */
+ WIRES wires;
+
+ typedef map<std::string, Wsdl*> WSDL_MAP;
+ /**
+ * Map by namespace of all the wsdl definitions in this composite.
+ */
+ WSDL_MAP wsdls;
+ };
+
+ } // End namespace model
+ } // End namespace sca
+} // End namespace tuscany
+
+#endif // SCA_CompositeComponent_h
+
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Composite.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ExternalService.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ExternalService.cpp?rev=429833&r1=429832&r2=429833&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ExternalService.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ExternalService.cpp Tue Aug 8 14:47:01 2006
@@ -30,8 +30,8 @@
{
// Constructor
- ExternalService::ExternalService(const std::string& serviceName, Module *module)
- : WireTarget(serviceName), containingModule(module)
+ ExternalService::ExternalService(const std::string& serviceName, Composite *composite)
+ : WireTarget(serviceName), containingComposite(composite)
{
LOGENTRY(1, "ExternalService::constructor");
LOGINFO_1(2, "ExternalService::constructor: ExternalService name: %s", getName().c_str());
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ExternalService.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ExternalService.h?rev=429833&r1=429832&r2=429833&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ExternalService.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ExternalService.h Tue Aug 8 14:47:01 2006
@@ -32,7 +32,7 @@
namespace model
{
- class Module;
+ class Composite;
/**
* Information about an external service.
@@ -43,9 +43,9 @@
/**
* Constructor.
* @param name The name of the external service.
- * @param module The module containing this external service.
+ * @param composite The composite containing this external service.
*/
- ExternalService(const std::string& name, Module *module);
+ ExternalService(const std::string& name, Composite *composite);
/**
* Destructor.
@@ -71,10 +71,10 @@
virtual Binding* getBinding() {return binding;};
/**
- * Get the module containing this external service.
- * @return The containing module.
+ * Get the composite containing this external service.
+ * @return The containing composite.
*/
- Module* getContainingModule() {return containingModule;};
+ Composite* getContainingComposite() {return containingComposite;};
private:
/**
@@ -83,9 +83,9 @@
Binding* binding;
/**
- * The module containing this external service.
+ * The composite containing this external service.
*/
- Module* containingModule;
+ Composite* containingComposite;
};
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=429833&r1=429832&r2=429833&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 Tue Aug 8 14:47:01 2006
@@ -73,9 +73,9 @@
// structure.
loadSubsystems(configurationRoot);
- // sca.module files represent the root of a module, and can occur anywhere
+ // sca.composite files represent the root of a composite, and can occur anywhere
// under the directory structure
- loadModules(configurationRoot);
+ loadComposites(configurationRoot);
system->resolveWires();
LOGEXIT(1, "ModelLoader::load");
@@ -88,7 +88,7 @@
// ========================================================================
void ModelLoader::loadSubsystems(const string& configurationRoot)
{
- // Get all the sca.subsystem files in the module
+ // Get all the sca.subsystem files in the composite
LOGENTRY(1, "ModelLoader::loadSubsystems");
Files files(configurationRoot, "sca.subsystem", true);
for (unsigned int i=0; i < files.size(); i++)
@@ -101,7 +101,7 @@
// =====================================================================
// loadSubsystemFile:
- // This method is called for each sca.subsystem file found in the module
+ // This method is called for each sca.subsystem file found in the composite
// folder structure
// =====================================================================
void ModelLoader::loadSubsystemFile(const File& file)
@@ -142,15 +142,15 @@
Subsystem* subsystem;
subsystem = system->addSubsystem(root->getCString("name"));
- DataObjectList& Modules = root->getList("moduleComponent");
- LOGINFO_1(2, "ModelLoader::mapSubsystem: number of module components: %d", Modules.size());
+ DataObjectList& Composites = root->getList("compositeComponent");
+ LOGINFO_1(2, "ModelLoader::mapSubsystem: number of composite components: %d", Composites.size());
- // Iterate over module components
- for (int i=0; i<Modules.size(); i++)
+ // Iterate over composite components
+ for (int i=0; i<Composites.size(); i++)
{
- // Add each module component to the subsystem
- Module* Module;
- Module = subsystem->addModuleComponent(Modules[i]->getCString("name"), Modules[i]->getCString("module"));
+ // Add each composite component to the subsystem
+ Composite* Composite;
+ Composite = subsystem->addCompositeComponent(Composites[i]->getCString("name"), Composites[i]->getCString("composite"));
}
@@ -162,110 +162,110 @@
// =====================================================================
- // loadModules:
- // Load all the modules from any directory below the configuration root.
- // Translate the module information to the runtime information
+ // loadComposites:
+ // Load all the composites from any directory below the configuration root.
+ // Translate the composite information to the runtime information
// =====================================================================
- void ModelLoader::loadModules(const string& configurationRoot)
+ void ModelLoader::loadComposites(const string& configurationRoot)
{
- // Get all the sca.module files in the module
- LOGENTRY(1, "ModelLoader::loadModules");
- Files files(configurationRoot, "sca.module", true);
+ // Get all the sca.composite files in the composite
+ LOGENTRY(1, "ModelLoader::loadComposites");
+ Files files(configurationRoot, "sca.composite", true);
for (unsigned int i=0; i < files.size(); i++)
{
- loadModuleFile(files[i]);
+ loadCompositeFile(files[i]);
}
- LOGEXIT(1, "ModelLoader::loadModules");
+ LOGEXIT(1, "ModelLoader::loadComposites");
}
// ====================================================================
- // loadModuleFile:
- // This method is called for each sca.module file found in the module
+ // loadCompositeFile:
+ // This method is called for each sca.composite file found in the composite
// folder structure
- // The location of this module file will indicate the root of a module
+ // The location of this composite file will indicate the root of a composite
// ====================================================================
- void ModelLoader::loadModuleFile(const File& file)
+ void ModelLoader::loadCompositeFile(const File& file)
{
- LOGENTRY(1, "ModelLoader::loadModuleFile");
- LOGINFO_1(2, "module filename: %s", file.getFileName().c_str());
+ LOGENTRY(1, "ModelLoader::loadCompositeFile");
+ LOGINFO_1(2, "composite filename: %s", file.getFileName().c_str());
try
{
string filename = file.getDirectory() + "/" + file.getFileName();
- XMLDocumentPtr moduleFile = getXMLHelper()->loadFile(filename.c_str());
- if (moduleFile->getRootDataObject() == 0)
+ XMLDocumentPtr compositeFile = getXMLHelper()->loadFile(filename.c_str());
+ if (compositeFile->getRootDataObject() == 0)
{
- LOGERROR_1(0, "ModelLoader::loadModuleFile: Unable to load file: %s", filename.c_str());
+ LOGERROR_1(0, "ModelLoader::loadCompositeFile: Unable to load file: %s", filename.c_str());
}
else
{
- string moduleName = moduleFile->getRootDataObject()->getCString("name");
- mapModule(moduleName, moduleFile->getRootDataObject(), file.getDirectory());
+ string compositeName = compositeFile->getRootDataObject()->getCString("name");
+ mapComposite(compositeName, compositeFile->getRootDataObject(), file.getDirectory());
// --------------------------------------------------------------
- // Load any module Fragments in the same folder as the sca.module
+ // Load any composite Fragments in the same folder as the sca.composite
// --------------------------------------------------------------
Files files(file.getDirectory(), "*.fragment", false);
for (unsigned int i=0; i < files.size(); i++)
{
filename = file.getDirectory() + "/" + files[i].getFileName();
- moduleFile = getXMLHelper()->loadFile(filename.c_str());
- if (moduleFile->getRootDataObject() == 0)
+ compositeFile = getXMLHelper()->loadFile(filename.c_str());
+ if (compositeFile->getRootDataObject() == 0)
{
- LOGERROR_1(0, "ModelLoader::loadModuleFile: Unable to load file: %s", filename.c_str());
+ LOGERROR_1(0, "ModelLoader::loadCompositeFile: Unable to load file: %s", filename.c_str());
}
else
{
- mapModule(moduleName, moduleFile->getRootDataObject(), file.getDirectory());
+ mapComposite(compositeName, compositeFile->getRootDataObject(), file.getDirectory());
}
}
- // Load the xsd types and wsdl files in the module
- loadModuleConfig(file.getDirectory(), moduleName);
+ // Load the xsd types and wsdl files in the composite
+ loadCompositeConfig(file.getDirectory(), compositeName);
}
} catch (SDORuntimeException ex)
{
- LOGERROR_1(0, "ModelLoader::loadModuleFile: Exception caught: %s", ex.getMessageText());
+ LOGERROR_1(0, "ModelLoader::loadCompositeFile: Exception caught: %s", ex.getMessageText());
}
- LOGEXIT(1, "ModelLoader::loadModuleFile");
+ LOGEXIT(1, "ModelLoader::loadCompositeFile");
}
// ===========
- // mapModule
+ // mapComposite
// ===========
- void ModelLoader::mapModule(const string& moduleName, DataObjectPtr root, string moduleRootDir)
+ void ModelLoader::mapComposite(const string& compositeName, DataObjectPtr root, string compositeRootDir)
{
- LOGENTRY(1, "ModelLoader::mapModule");
+ LOGENTRY(1, "ModelLoader::mapComposite");
- LOGINFO_2(2, "ModelLoader::mapModule: Loading module: %s, root Dir: %s", moduleName.c_str(), moduleRootDir.c_str());
+ LOGINFO_2(2, "ModelLoader::mapComposite: Loading composite: %s, root Dir: %s", compositeName.c_str(), compositeRootDir.c_str());
- // Find the ModuleComponent(s) that refer to this module. If a ModuleComponent does not refer to this
- // module then ignore it
- MODULE_LIST moduleList = system->findModules(moduleName);
- MODULE_LIST::iterator moduleIter;
+ // Find the CompositeComponent(s) that refer to this composite. If a CompositeComponent does not refer to this
+ // composite then ignore it
+ COMPOSITE_LIST compositeList = system->findComposites(compositeName);
+ COMPOSITE_LIST::iterator compositeIter;
- for (moduleIter = moduleList.begin();
- moduleIter != moduleList.end();
- moduleIter++ )
+ for (compositeIter = compositeList.begin();
+ compositeIter != compositeList.end();
+ compositeIter++ )
{
- LOGINFO_1(2, "ModelLoader::mapModule: Loading module details for module component: %s", (*moduleIter)->getName().c_str());
+ LOGINFO_1(2, "ModelLoader::mapComposite: Loading composite details for composite component: %s", (*compositeIter)->getName().c_str());
string message; // for exceptions
- // Set module root
- (*moduleIter)->setRoot(moduleRootDir);
+ // Set composite root
+ (*compositeIter)->setRoot(compositeRootDir);
// ----------------------------
- // Add components to the module
+ // Add components to the composite
// ----------------------------
DataObjectList& componentList = root->getList("component");
int i;
for (i=0; i < componentList.size(); i++)
{
- addComponent(*moduleIter, componentList[i]);
+ addComponent(*compositeIter, componentList[i]);
}
// ------------
@@ -274,7 +274,7 @@
DataObjectList& entryPointList = root->getList("entryPoint");
for (i=0; i < entryPointList.size(); i++)
{
- addEntryPoint(*moduleIter, entryPointList[i]);
+ addEntryPoint(*compositeIter, entryPointList[i]);
}
@@ -284,7 +284,7 @@
DataObjectList& externalServiceList = root->getList("externalService");
for (i=0; i < externalServiceList.size(); i++)
{
- addExternalService(*moduleIter, externalServiceList[i]);
+ addExternalService(*compositeIter, externalServiceList[i]);
}
// -----
@@ -295,20 +295,20 @@
{
string source = wireList[l]->getCString("sourceUri");
string target = wireList[l]->getCString("targetUri");
- (*moduleIter)->addWire(source, target);
+ (*compositeIter)->addWire(source, target);
}
}
- LOGEXIT(1, "ModelLoader::mapModule");
+ LOGEXIT(1, "ModelLoader::mapComposite");
}
// =================================
// addComponent:
// =================================
- void ModelLoader::addComponent(Module* module, DataObjectPtr componentDO)
+ void ModelLoader::addComponent(Composite* composite, DataObjectPtr componentDO)
{
- Component* component = module->addComponent(componentDO->getCString("name"));
+ Component* component = composite->addComponent(componentDO->getCString("name"));
string message;
@@ -344,13 +344,13 @@
// -----------------------
// Load the .componentType
// -----------------------
- string typeFileName = module->getRoot() + "/" + componentTypePath + componentTypeName + ".componentType";
+ string typeFileName = composite->getRoot() + "/" + componentTypePath + componentTypeName + ".componentType";
try
{
XMLDocumentPtr componentTypeFile = getXMLHelper()->loadFile(typeFileName.c_str());
if (componentTypeFile->getRootDataObject() == 0)
{
- LOGERROR_1(0, "ModelLoader::mapModule: Unable to load file: %s", typeFileName.c_str());
+ LOGERROR_1(0, "ModelLoader::mapComposite: Unable to load file: %s", typeFileName.c_str());
}
else
{
@@ -362,7 +362,7 @@
}
} catch (SDORuntimeException& ex)
{
- LOGERROR_1(0, "ModelLoader::mapModule: Exception caught: %s", ex.getMessageText());
+ LOGERROR_1(0, "ModelLoader::mapComposite: Exception caught: %s", ex.getMessageText());
throw SystemConfigurationException(ex.getMessageText());
}
@@ -382,7 +382,7 @@
for (int refI=0; refI < pl.size(); refI++)
{
// ----------------------------------------------------------
- // Add the reference to the module wires to be resolved later
+ // Add the reference to the composite wires to be resolved later
// ----------------------------------------------------------
string refName = pl[refI].getName();
if (!component->findReference(pl[refI].getName()))
@@ -400,7 +400,7 @@
{
// Get the reference value
string refValue = reflist.getDataObject(refslistI)->getSequence()->getCStringValue(0);
- module->addWire(src, refValue);
+ composite->addWire(src, refValue);
}
}
}
@@ -508,14 +508,14 @@
}
// ===============================================
- // addEntryPoint: add an EntryPoint to the module
+ // addEntryPoint: add an EntryPoint to the composite
// ===============================================
- void ModelLoader::addEntryPoint(Module* module, DataObjectPtr entryPointDO)
+ void ModelLoader::addEntryPoint(Composite* composite, DataObjectPtr entryPointDO)
{
string message;
//Utils::printDO(entryPointDO);
- EntryPoint* entryPoint = module->addEntryPoint(entryPointDO->getCString("name"));
+ EntryPoint* entryPoint = composite->addEntryPoint(entryPointDO->getCString("name"));
string multiplicity = "1..1";
if (entryPointDO->isSet("multiplicity"))
@@ -530,10 +530,10 @@
for (int i=0; i<refs.size(); i++)
{
// ----------------------------------------------------------
- // Add the reference to the module wires to be resolved later
+ // Add the reference to the composite wires to be resolved later
// ----------------------------------------------------------
string targ = refs.getCString(i);
- module->addWire(entryPoint->getName(), targ);
+ composite->addWire(entryPoint->getName(), targ);
}
// Get binding, it will be the first and only binding
@@ -570,13 +570,13 @@
// =========================================================
- // addExternalService: add an ExternalService to the module
+ // addExternalService: add an ExternalService to the composite
// =========================================================
- void ModelLoader::addExternalService(Module* module, DataObjectPtr externalServiceDO)
+ void ModelLoader::addExternalService(Composite* composite, DataObjectPtr externalServiceDO)
{
string message;
- ExternalService* externalService = module->addExternalService(externalServiceDO->getCString("name"));
+ ExternalService* externalService = composite->addExternalService(externalServiceDO->getCString("name"));
// Add the interface
externalService->setInterface(getInterface(externalServiceDO));
@@ -612,56 +612,56 @@
///
- /// Use the Tuscany-model.config file in the module root directory to
+ /// Use the Tuscany-model.config file in the composite root directory to
/// determine which xsds and wsdls to load into a dataFactory.
///
- void ModelLoader::loadModuleConfig(const string &moduleRootDir, const string &moduleName)
+ void ModelLoader::loadCompositeConfig(const string &compositeRootDir, const string &compositeName)
{
- LOGENTRY(1, "ModelLoader::loadModuleConfig");
+ LOGENTRY(1, "ModelLoader::loadCompositeConfig");
// Load the "Tuscany-model.config" file, if it exists
- Files files(moduleRootDir, "Tuscany-model.config", false);
+ Files files(compositeRootDir, "Tuscany-model.config", false);
for (unsigned int i=0; i < files.size(); i++)
{
- string filename = moduleRootDir + "/" + files[i].getFileName();
- XMLDocumentPtr moduleConfigFile = getXMLHelper()->loadFile(filename.c_str());
- if (moduleConfigFile->getRootDataObject() == 0)
+ string filename = compositeRootDir + "/" + files[i].getFileName();
+ XMLDocumentPtr compositeConfigFile = getXMLHelper()->loadFile(filename.c_str());
+ if (compositeConfigFile->getRootDataObject() == 0)
{
- LOGERROR_1(0, "ModelLoader::loadModuleConfig: Unable to load file: %s", filename.c_str());
+ LOGERROR_1(0, "ModelLoader::loadCompositeConfig: Unable to load file: %s", filename.c_str());
}
else
{
- LOGINFO_2(2, "ModelLoader::loadModuleConfig: Loading module config for: %s, root Dir: %s", moduleName.c_str(), moduleRootDir.c_str());
+ LOGINFO_2(2, "ModelLoader::loadCompositeConfig: Loading composite config for: %s, root Dir: %s", compositeName.c_str(), compositeRootDir.c_str());
- if(moduleConfigFile->getRootDataObject()->isSet("xsd"))
+ if(compositeConfigFile->getRootDataObject()->isSet("xsd"))
{
- DataObjectList& xsds = moduleConfigFile->getRootDataObject()->getList("xsd/file");
+ DataObjectList& xsds = compositeConfigFile->getRootDataObject()->getList("xsd/file");
for (int i=0; i<xsds.size(); i++)
{
if(xsds[i]->isSet("name"))
{
- // Load a xsd file -> set the types in the moduleComponents data factory file
- string xsdName = moduleRootDir + "/" +xsds[i]->getCString("name");
- loadTypes(xsdName.c_str(), moduleName);
+ // Load a xsd file -> set the types in the compositeComponents data factory file
+ string xsdName = compositeRootDir + "/" +xsds[i]->getCString("name");
+ loadTypes(xsdName.c_str(), compositeName);
}
}
}
- if( moduleConfigFile->getRootDataObject()->isSet("wsdl"))
+ if( compositeConfigFile->getRootDataObject()->isSet("wsdl"))
{
- DataObjectList& wsdls = moduleConfigFile->getRootDataObject()->getList("wsdl/file");
+ DataObjectList& wsdls = compositeConfigFile->getRootDataObject()->getList("wsdl/file");
for (int j=0; j<wsdls.size(); j++)
{
if(wsdls[i]->isSet("name"))
{
- string wsdlName = moduleRootDir + "/" +wsdls[j]->getCString("name");
+ string wsdlName = compositeRootDir + "/" +wsdls[j]->getCString("name");
// Load a wsdl file -> get the types, then the contents of the wsdl
- loadTypes(wsdlName.c_str(), moduleName);
+ loadTypes(wsdlName.c_str(), compositeName);
// Load the contents of the wsdl files
- loadWsdl(wsdlName.c_str(), moduleName);
+ loadWsdl(wsdlName.c_str(), compositeName);
}
}
}
@@ -669,33 +669,33 @@
}
- LOGEXIT(1, "ModelLoader::loadModuleConfig");
+ LOGEXIT(1, "ModelLoader::loadCompositeConfig");
}
///
/// Use the types from an xsd or wsdl file
///
- void ModelLoader::loadTypes(const char *fileName, const string &moduleName)
+ void ModelLoader::loadTypes(const char *fileName, const string &compositeName)
{
LOGENTRY(1, "ModelLoader::loadTypes");
- // Load a xsd file -> set the types in the moduleComponents data factory file
+ // Load a xsd file -> set the types in the compositeComponents data factory file
- MODULE_LIST moduleList = system->findModules(moduleName);
- MODULE_LIST::iterator moduleIter;
+ COMPOSITE_LIST compositeList = system->findComposites(compositeName);
+ COMPOSITE_LIST::iterator compositeIter;
- for (moduleIter = moduleList.begin();
- moduleIter != moduleList.end();
- moduleIter++ )
+ for (compositeIter = compositeList.begin();
+ compositeIter != compositeList.end();
+ compositeIter++ )
{
try {
- (*moduleIter)->getXSDHelper()->defineFile(fileName);
- //Utils::printTypes((*moduleIter)->getXSDHelper()->getDataFactory());
+ (*compositeIter)->getXSDHelper()->defineFile(fileName);
+ //Utils::printTypes((*compositeIter)->getXSDHelper()->getDataFactory());
} catch (SDOTypeNotFoundException ex)
{
- LOGERROR_1(0, "ModuleLoader: Exception caught: %s", ex.getMessageText());
+ LOGERROR_1(0, "CompositeLoader: Exception caught: %s", ex.getMessageText());
throw ex;
}
}
@@ -705,7 +705,7 @@
///
/// Load the web services definition from a wsdl
///
- void ModelLoader::loadWsdl(const char *fileName, const string &moduleName)
+ void ModelLoader::loadWsdl(const char *fileName, const string &compositeName)
{
LOGENTRY(1, "ModelLoader::loadWsdl");
@@ -716,22 +716,22 @@
if (doc!=0 && doc->getRootDataObject()!=0)
{
//Utils::printDO(doc->getRootDataObject());
- MODULE_LIST moduleList = system->findModules(moduleName);
- MODULE_LIST::iterator moduleIter;
+ COMPOSITE_LIST compositeList = system->findComposites(compositeName);
+ COMPOSITE_LIST::iterator compositeIter;
- for (moduleIter = moduleList.begin();
- moduleIter != moduleList.end();
- moduleIter++ )
+ for (compositeIter = compositeList.begin();
+ compositeIter != compositeList.end();
+ compositeIter++ )
{
- // Add the root object to the module
- (*moduleIter)->addWsdl(doc->getRootDataObject());
+ // Add the root object to the composite
+ (*compositeIter)->addWsdl(doc->getRootDataObject());
}
}
else
{
- LOGERROR_1(0, "ModuleLoader: Unable to load or parse WSDL %s", fileName);
+ LOGERROR_1(0, "CompositeLoader: Unable to load or parse WSDL %s", fileName);
}
} catch (SDOTypeNotFoundException ex)
@@ -778,7 +778,7 @@
} catch (SDOTypeNotFoundException ex)
{
- LOGERROR_1(0, "ModuleLoader: Exception caught: %s", ex.getMessageText());
+ LOGERROR_1(0, "CompositeLoader: Exception caught: %s", ex.getMessageText());
throw ex;
}
}
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.h?rev=429833&r1=429832&r2=429833&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.h Tue Aug 8 14:47:01 2006
@@ -56,13 +56,13 @@
/**
* Load the model from the configuration information.
* @param configurationRoot The location of the deployed SCA
- * modules and subsystems.
+ * composites and subsystems.
*/
void load(const string& configurationRoot);
private:
System* system;
- void loadModule(const char *moduleRoot);
+ void loadComposite(const char *compositeRoot);
commonj::sdo::XMLHelperPtr myXMLHelper; // Used to load scdl files
@@ -74,22 +74,22 @@
void loadSubsystemFile(const File& file);
void mapSubsystem(commonj::sdo::DataObjectPtr rootDO);
- void loadModules(const string& configurationRoot);
- void loadModuleFile(const File& file);
- void mapModule(const string& moduleName, commonj::sdo::DataObjectPtr rootDO, std::string moduleRootDir);
+ void loadComposites(const string& configurationRoot);
+ void loadCompositeFile(const File& file);
+ void mapComposite(const string& compositeName, commonj::sdo::DataObjectPtr rootDO, std::string compositeRootDir);
- void addComponent(Module* module, DataObjectPtr componentDO);
- void addEntryPoint(Module* module, DataObjectPtr entryPointDO);
- void addExternalService(Module* module, DataObjectPtr externalServiceDO);
+ void addComponent(Composite* composite, DataObjectPtr componentDO);
+ void addEntryPoint(Composite* composite, DataObjectPtr entryPointDO);
+ void addExternalService(Composite* composite, DataObjectPtr externalServiceDO);
void addServices(Component* component, DataObjectPtr componentType);
void addReferences(Component* component, DataObjectPtr componentType);
void addProperties(Component* component, DataObjectPtr componentType);
- void loadModuleConfig(const string &moduleRootDir, const string &moduleName);
- void loadTypes(const char *fileName, const string &moduleName);
- void loadWsdl(const char *fileName, const string &moduleName);
+ void loadCompositeConfig(const string &compositeRootDir, const string &compositeName);
+ void loadTypes(const char *fileName, const string &compositeName);
+ void loadWsdl(const char *fileName, const string &compositeName);
void loadWSDLTypes(XSDHelperPtr xsdHelper);
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org