diff options
Diffstat (limited to 'tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model')
40 files changed, 0 insertions, 6365 deletions
diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Binding.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Binding.cpp deleted file mode 100644 index a654b9f0f7..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Binding.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/model/Binding.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - - namespace model - { - - // Constructor - Binding::Binding(const string& uri) : uri(uri) - { - logentry(); - } - - // Destructor - Binding::~Binding() - { - logentry(); - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Binding.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Binding.h deleted file mode 100644 index 66dc66e853..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Binding.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_binding_h -#define tuscany_sca_model_binding_h - -#include <string> - -namespace tuscany -{ - namespace sca - { - namespace model - { - /** - * Represents a binding. - * Bindings are used by services and references. References use bindings - * to describe the access mechanism used to call an external service (which can - * be a service provided by another SCA composite). Services use bindings to describe - * the access mechanism that clients (which can be a client from another SCA composite) - * have to use to call the service. - * This interface will typically be extended by binding implementations to allow - * specification of binding/transport specific information. - */ - class Binding - { - - public: - - /** - * Constructor to create a new binding. - * @param uri The binding URI. - */ - SCA_API Binding(const std::string& uri); - - /** - * Destructor. - */ - SCA_API virtual ~Binding(); - - /** - * Returns the binding type - * @return The binding type. - */ - SCA_API virtual std::string getType() = 0; - - /** - * Returns the binding URI. - * @return The binding URI. - */ - SCA_API virtual const std::string& getURI() const { return uri; }; - - private: - - /** - * The binding URI. - */ - std::string uri; - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_binding_h diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Component.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Component.cpp deleted file mode 100644 index 11429193be..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Component.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include <iostream> - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/model/ComponentType.h" - -using namespace std; -using namespace commonj::sdo; - -namespace tuscany -{ - namespace sca - { - namespace model - { - // Constructor - Component::Component(Composite* composite, const std::string& componentName, ComponentType *componentType) - : name(componentName), composite(composite), type(componentType) - { - logentry(); - loginfo("Component name: %s", name.c_str()); - - // Initialize the component from its component type - componentType->initializeComponent(this); - - } - - Component::~Component() - { - logentry(); - } - - void Component::addService(Service* service) - { - logentry(); - services[service->getType()->getName()] = service; - } - - Service* Component::findService(const string& serviceName) - { - logentry(); - - // If serviceName is empty then return the ONLY service - if (serviceName == "" - && services.size() == 1) - { - return services.begin()->second; - } - else - { - Service* service = services[serviceName]; - if (service == NULL) - { - // A service with an empty name will match any service name - service = services[""]; - } - return service; - } - } - - void Component::addReference(Reference* reference) - { - logentry(); - references[reference->getType()->getName()] = reference; - } - - Reference* Component::findReference(const std::string& referenceName) - { - logentry(); - return references[referenceName]; - } - - DataObjectPtr Component::getProperties() - { - logentry(); - - if (!properties) - { - properties = type->getPropertyDataFactory()->create("org/osoa/sca", "Properties"); - } - return properties; - } - - void Component::setProperty(const string& name, DataObjectPtr value) - { - logentry(); - - DataObjectPtr props = getProperties(); - - // Get the property's type - try - { - const Property& propProperty = props->getProperty(name); - const Type& propType = propProperty.getType(); - if (propType.isDataType()) - { - if (propProperty.isMany()) - { - DataObjectList& dol = props->getList(propProperty); - dol.append(value->getCString("")); - } - else - { - props->setCString(propProperty, value->getCString("")); - } - } - else - { - // Create a new instance of the DO - // iterate over properties setting each one - - // for now: - props->setDataObject(propProperty, value); - } - } - catch (SDORuntimeException& ex) - { - // Configuration error: property is not defined - throwException(SystemConfigurationException, ex); - } - - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Component.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Component.h deleted file mode 100644 index 882d79a94c..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Component.h +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_component_h -#define tuscany_sca_model_component_h - -#include <string> -#include <map> - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/export.h" - - -namespace tuscany -{ - namespace sca - { - namespace model - { - - class Composite; - class ComponentType; - class Reference; - class ReferenceType; - class Service; - class ServiceType; - - /** - * A component is a configured instance of an implementation. Components provide - * and consume services. More than one component can use and configure the same - * implementation, where each component configures the implementation differently. - * For example each component may configure a reference of the same implementation - * to consume a different service. - */ - class Component - { - public: - - /** - * Constructor - * @param composite The composite containing the component. - * @param name The name of the component. - */ - SCA_API Component(Composite *composite, const std::string& name, ComponentType *type); - - /** - * Destructor. - */ - SCA_API virtual ~Component(); - - /** - * Returns the name of this component. - * @return the name of this component - */ - SCA_API const std::string& getName() const { return name; } - - /** - * Returns the composite containing this component. - * @return The composite containing this component. - */ - SCA_API Composite* getComposite() const { return composite; } - - /** - * Returns the type of this component. - * @return The type of this component. - */ - SCA_API ComponentType* getType() const { return type; } - - /** - * Add a new service to this component. - * @param service The service to add. - */ - SCA_API void addService(Service* service); - - /** - * Find an existing service on this component. - * @param serviceName The name of the service to find. - * If the serviceName is the zero length string then if there is - * only one service it will be returned. - * @return The found service, or 0 if not found. - */ - SCA_API Service* findService(const std::string& serviceName); - - /** - * Add a new reference to this component. - * @param reference The reference to add. - */ - SCA_API void addReference(Reference* reference); - - /** - * Find an existing reference on this component. - * @param referenceName The name of the reference to find. - * @return The found reference, or 0 if not found. - */ - SCA_API Reference* findReference(const std::string& referenceName); - - /** - * Returns all the services defined on this component. - * @return All the services defined on this component. - */ - typedef std::map<std::string, Service*> SERVICE_MAP; - SCA_API const SERVICE_MAP& getServices() const { return services; }; - - /** - * Returns all the references defined on this component. - * @return All the references defined on this component. - */ - typedef std::map<std::string, Reference*> REFERENCE_MAP; - SCA_API const REFERENCE_MAP& getReferences() const { return references; }; - - /** - * Set the value of a property defined on this component. The values - * will usually come from a component declaration in a composite file. - * @param name The name of the property. - * @param value The value of the property. - */ - SCA_API void setProperty(const std::string& name, commonj::sdo::DataObjectPtr value); - - /** - * Returns a data object from which all the properties of the component - * and their values can be accessed. - * @return A data object holding the property values. - */ - SCA_API commonj::sdo::DataObjectPtr getProperties(); - - private: - - /** - * Name of the component. - */ - std::string name; - - /** - * Composite containing the component. - */ - Composite* composite; - - /** - * Type of the component. - */ - ComponentType* type; - - /** - * Map of all the services defined on this component. - */ - SERVICE_MAP services; - - /** - * Map of all the references defined on this component. - */ - REFERENCE_MAP references; - - /** - * The properties and their values for this component. - */ - commonj::sdo::DataObjectPtr properties; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_component_h diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ComponentType.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ComponentType.cpp deleted file mode 100644 index 306455840c..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ComponentType.cpp +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include <iostream> - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/model/ComponentType.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/Reference.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::util; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - // Constructor - ComponentType::ComponentType(Composite* composite, const string& name) - : composite(composite), name(name) - { - logentry(); - } - - // Destructor - ComponentType::~ComponentType() - { - logentry(); - } - - void ComponentType::addServiceType(ServiceType* serviceType) - { - logentry(); - serviceTypes[serviceType->getName()] = serviceType; - } - - ServiceType* ComponentType::findServiceType(const string& serviceName) - { - logentry(); - - // If serviceName is empty then return the ONLY service - if (serviceName == "" - && serviceTypes.size() == 1) - { - return serviceTypes.begin()->second; - } - else - { - return serviceTypes[serviceName]; - } - } - - void ComponentType::addReferenceType(ReferenceType* referenceType) - { - logentry(); - - referenceTypes[referenceType->getName()] = referenceType; - } - - ReferenceType* ComponentType::findReferenceType(const string& referenceName) - { - logentry(); - - return referenceTypes[referenceName]; - } - - void ComponentType::addPropertyType(const string& name, - const string& type, - bool many, - DataObjectPtr* defaultValue) - { - logentry(); - - // Create a Type in the Properties dataFactory - DataFactoryPtr factory = getPropertyDataFactory(); - - string typeUri, typeName; - Utils::tokeniseQName(type, typeUri, typeName); - - if (typeUri == "http://www.w3.org/2001/XMLSchema") - { - typeUri = Type::SDOTypeNamespaceURI; - if (typeName == "string") - { - typeName = "String"; - } - else if (typeName == "anyType") - { - typeName = "DataObject"; - } - else if (typeName == "int") - { - typeName = "Integer"; - } - else if (typeName == "integer") - { - typeName = "Integer"; - } - else if (typeName == "negativeInteger") - { - typeName = "Integer"; - } - else if (typeName == "nonNegativeInteger") - { - typeName = "Integer"; - } - else if (typeName == "positiveInteger") - { - typeName = "Integer"; - } - else if (typeName == "nonPositiveInteger") - { - typeName = "Integer"; - } - else if (typeName == "unsignedLong") - { - typeName = "Integer"; - } - else if (typeName == "unsignedShort") - { - typeName = "Integer"; - } - else if (typeName == "unsignedInt") - { - typeName = "Long"; - } - else if (typeName == "long") - { - typeName = "Long"; - } - else if (typeName == "double") - { - typeName = "Double"; - } - else if (typeName == "short") - { - typeName = "Short"; - } - else if (typeName == "unsignedByte") - { - typeName = "Short"; - } - else if (typeName == "float") - { - typeName = "Float"; - } - else if (typeName == "boolean") - { - typeName = "Boolean"; - } - else if (typeName == "byte") - { - typeName = "Byte"; - } - else if (typeName == "base64Binary") - { - typeName = "Bytes"; - } - else if (typeName == "hexBinary") - { - typeName = "Bytes"; - } - else if (typeName == "anyURI") - { - typeName = "URI"; - } - else if (typeName == "QName") - { - typeName = "URI"; - } - else - { - // Default unknown xs: types to string?? - typeName = "String"; - } - } - else - { - // It's not an XML type - } - - factory->addPropertyToType( - "org/osoa/sca", - "Properties", - name.c_str(), - typeUri.c_str(), - typeName.c_str(), - many, - false, - true); - - // Set the default for a dataType - if (defaultValue!=NULL) - { - try - { - const Type& propType = factory->getType(typeUri.c_str(), typeName.c_str()); - if (propType.isDataType()) - { - factory->setDefault("org/osoa/sca", "Properties", - name.c_str(), - (char*)(*defaultValue)->getCString("")); - } - } - catch (SDOTypeNotFoundException&) - { - } - } - } - - const Property* ComponentType::findPropertyType(const string& propertyName) - { - logentry(); - const Property* property = NULL; - - DataFactoryPtr dataFactory = getPropertyDataFactory(); - const Type& propertiesType = dataFactory->getType("org/osoa/sca", "Properties"); - - try - { - const Property& prop = propertiesType.getProperty(propertyName); - property = ∝ - } - catch(SDOPropertyNotFoundException) - { - loginfo("Property named %s not found, returning null", propertyName.c_str()); - } - return property; - } - - DataFactoryPtr ComponentType::getPropertyDataFactory() - { - logentry(); - - if (!propertyFactory) - { - propertyFactory = DataFactory::getDataFactory(); - // Add the root type - propertyFactory->addType("org/osoa/sca", "Properties", false, false, false, false); - } - return propertyFactory; - } - - void ComponentType::initializeComponent(Component* component) - { - logentry(); - - for (SERVICETYPE_MAP::iterator iter = serviceTypes.begin(); - iter != serviceTypes.end(); - iter++) - { - Service* service = new Service(component, iter->second); - component->addService(service); - } - for (REFERENCETYPE_MAP::iterator refiter = referenceTypes.begin(); - refiter != referenceTypes.end(); - refiter++) - { - Reference* reference = new Reference(component, refiter->second); - component->addReference(reference); - } - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ComponentType.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ComponentType.h deleted file mode 100644 index 86f17890e9..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ComponentType.h +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_componenttype_h -#define tuscany_sca_model_componenttype_h - -#include <string> -#include <map> - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/model/ReferenceType.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - class ServiceType; - class ReferenceType; - class Interface; - class Component; - class Composite; - - /** - * Component type represents the configurable aspects of an implementation. - * A component type consists of services that are offered, references to other services - * that can be wired and properties that can be set. The settable properties and the settable - * references to services are configured by a component which uses the implementation. - * The component type can be thought of as the contract which is honoured by an implementation. - */ - class ComponentType - { - public: - - /** - * Constructor - */ - SCA_API ComponentType(Composite* composite, const std::string& name); - - /** - * Destructor. - */ - SCA_API virtual ~ComponentType(); - - /** - * Returns the name of the component type - */ - SCA_API const std::string& getName() const { return name; }; - - /** - * Returns the composite containing this component type - */ - SCA_API Composite* getComposite() const { return composite; }; - - /** - * Add a new service type to this component type. - * @param serviceType The service type to add. - */ - SCA_API virtual void addServiceType(ServiceType* serviceType); - - /** - * Find an existing service type on this component type. - * @param serviceName The name of the service type to find. - * If the serviceName is the zero length string then if there is - * only one service type it will be returned. - * @return The found service, or 0 if not found. - */ - SCA_API virtual ServiceType* findServiceType(const std::string& serviceName); - - /** - * Add a new reference type to this component type. - * @param referenceType The reference type to add. - */ - SCA_API virtual void addReferenceType(ReferenceType* referenceType); - - /** - * Find an existing reference type on this component type. - * @param referenceName The name of the reference type to find. - * @return The found reference type, or 0 if not found. - */ - SCA_API virtual ReferenceType* findReferenceType(const std::string& referenceName); - - /** - * Returns the service types defined on this component. - * @return The service types defined on this component. - */ - typedef std::map<std::string, ServiceType*> SERVICETYPE_MAP; - SERVICETYPE_MAP getServiceTypes() const { return serviceTypes; }; - - /** - * Returns the reference types defined on this component. - * @return The reference types defined on this component. - */ - typedef std::map<std::string, ReferenceType*> REFERENCETYPE_MAP; - REFERENCETYPE_MAP getReferenceTypes() const { return referenceTypes; }; - - /** - * Add a new property type to this component type. Property types are added - * one at a time. The property definitions usually come from a component type file. - * @param name The name of the property type. - * @param type The full name of the property data type (including uri and local name). - * @param many True if this is a many valued property. - * @param defaultValue The default value if the property does not have a - * value set. - */ - SCA_API virtual void addPropertyType(const std::string& name, - const std::string& type, - bool many, - commonj::sdo::DataObjectPtr* defaultValue); - - /** - * Find an existing property type on this component type. - * @param propertyName The name of the property type to find. - * @return The found property, or 0 if not found. - */ - SCA_API virtual const commonj::sdo::Property* findPropertyType(const std::string& propertyName); - - /** - * Return the SDO data factory which has the types of the properties defined - * in this component type. - * @return The data factory. - */ - SCA_API virtual commonj::sdo::DataFactoryPtr getPropertyDataFactory(); - - /** - * Initialize a component of this type. - * @param component The component to initialize. - */ - SCA_API virtual void initializeComponent(Component* component); - - private: - - /** - * The name of the component type - */ - std::string name; - - /** - * The composite containing this component type - */ - Composite* composite; - - /** - * Map of all the service types defined on this component. - */ - SERVICETYPE_MAP serviceTypes; - - /** - * Map of all the reference types defined on this component. - */ - REFERENCETYPE_MAP referenceTypes; - - /** - * SDO data factory which has all the types of the properties defined in - * this component type - */ - commonj::sdo::DataFactoryPtr propertyFactory; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_componenttype_h - diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Composite.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Composite.cpp deleted file mode 100644 index 7fcddd812a..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Composite.cpp +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/CompositeReference.h" -#include "tuscany/sca/model/CompositeReferenceBinding.h" -#include "tuscany/sca/model/CompositeService.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/model/Wire.h" -#include "tuscany/sca/model/WSDLDefinition.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/ServiceBinding.h" -#include "tuscany/sca/model/ReferenceBinding.h" - -using namespace std; -using namespace tuscany::sca::util; - -namespace tuscany -{ - namespace sca - { - - namespace model - { - - // Constructor - Composite::Composite(const string& name, const string& root) - : ComponentType(0, name), root(root) - { - logentry(); - } - - // Destructor - Composite::~Composite() - { - logentry(); - } - - void Composite::addComponent(Component* component) - { - logentry(); - components[component->getName()] = component; - } - - void Composite::addCompositeReference(CompositeReference* compositeReference) - { - logentry(); - components[compositeReference->getName()] = compositeReference; - - // Create a reference type describing the composite reference - ServiceType* serviceType = compositeReference->getType()->findServiceType(""); - ReferenceType* referenceType = new ReferenceType( - this, compositeReference->getName(), - serviceType->getInterface(), - serviceType->getCallbackInterface(), - compositeReference->getMultiplicity()); - addReferenceType(referenceType); - } - - void Composite::addCompositeService(CompositeService* compositeService) - { - logentry(); - components[compositeService->getName()] = compositeService; - - // Create a service type describing the composite service - ReferenceType* referenceType = compositeService->getType()->findReferenceType(""); - ServiceType* serviceType = new ServiceType( - this, compositeService->getName(), - referenceType->getInterface(), - referenceType->getCallbackInterface()); - addServiceType(serviceType); - } - - void Composite::initializeComponent(Component* component) - { - ComponentType::initializeComponent(component); - - // Create bindings for all the services - const Component::SERVICE_MAP& services = component->getServices(); - Component::SERVICE_MAP::const_iterator iter = services.begin(); - for (unsigned int i=0; i< services.size(); i++) - { - Service *service = iter->second; - //CompositeServiceBinding* binding = new CompositeServiceBinding(service); - //service->setBinding(binding); - iter++; - } - - // Create bindings for all the references - const Component::REFERENCE_MAP& references = component->getReferences(); - Component::REFERENCE_MAP::const_iterator refiter = references.begin(); - for (unsigned int ri=0; ri< references.size(); ri++) - { - Reference *reference = refiter->second; - CompositeReferenceBinding* binding = new CompositeReferenceBinding(reference); - reference->setBinding(binding); - refiter++; - } - } - - Component* Composite::findComponent(const std::string& name) - { - logentry(); - Component* component = components[name]; - return component; - } - - Service* Composite::findComponentService(const std::string& name) - { - logentry(); - - Service* service = 0; - - string componentName; - string serviceName; - Utils::tokeniseUri(name, componentName, serviceName); - - // Locate the component - Component* component = findComponent(componentName); - if (component) - { - // Locate the service - service = component->findService(serviceName); - } - return service; - } - - void Composite::addWire(const std::string& source, const std::string& target) - { - logentry(); - Wire* wire=new Wire(source, target); - wires.push_back(wire); - } - - void Composite::addInclude(Composite* composite) - { - logentry(); - includes.push_back(composite); - - for (COMPONENT_MAP::iterator iter = composite->components.begin(); - iter != composite->components.end(); - iter++) - { - components[iter->first] = iter->second; - } - } - - void Composite::resolveWires() - { - logentry(); - - for (WIRES::iterator iter = wires.begin(); - iter != wires.end(); - iter++) - { - Wire* wire = *iter; - - // Find the source component and reference - Component* component = findComponent(wire->getSourceComponent()); - Reference* reference; - if (component) - { - reference = component->findReference(wire->getSourceReference()); - if (!reference) - { - logerror("Wire source reference %s not found", wire->getSourceReference().c_str()); - } - } - else - { - reference = NULL; - logerror("Wire source %s not found", wire->getSourceComponent().c_str()); - } - - // Configure the reference binding with the wire target URI - if (reference) - { - reference->getBinding()->configure(wire->getTarget()); - } - } - } - - void Composite::addWSDLDefinition(commonj::sdo::DataObjectPtr wsdlModel) - { - logentry(); - WSDLDefinition* wsdlDefinition = new WSDLDefinition(wsdlModel); - - WSDLDefinition* existingDefinition = wsdlDefinitions[wsdlDefinition->getNamespace()]; - if (existingDefinition == NULL) - { - wsdlDefinitions[wsdlDefinition->getNamespace()] = wsdlDefinition; - } - else{ - existingDefinition->addWSDLModel(wsdlModel); - } - } - - WSDLDefinition* Composite::findWSDLDefinition(const std::string& wsdlNamespace ) - { - logentry(); - return wsdlDefinitions[wsdlNamespace]; - - } - - commonj::sdo::XSDHelperPtr Composite::getXSDHelper() - { - logentry(); - if (xsdHelper == 0) - { - xsdHelper = commonj::sdo::HelperProvider::getXSDHelper(); - } - - return xsdHelper; - } - - commonj::sdo::XMLHelperPtr Composite::getXMLHelper() - { - logentry(); - if (xmlHelper == 0) - { - xmlHelper = commonj::sdo::HelperProvider::getXMLHelper(getXSDHelper()->getDataFactory()); - } - - return xmlHelper; - } - - commonj::sdo::DataFactoryPtr Composite::getDataFactory() - { - logentry(); - return getXSDHelper()->getDataFactory(); - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Composite.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Composite.h deleted file mode 100644 index 5198e68f6d..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Composite.h +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_composite_h -#define tuscany_sca_model_composite_h - -#include <string> -#include <map> -#include <vector> - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/export.h" -#include "tuscany/sca/model/ComponentType.h" - - -namespace tuscany -{ - namespace sca - { - - namespace model - { - class Component; - class ComponentType; - class CompositeReference; - class CompositeService; - class Service; - class WSDLDefinition; - class Wire; - - /** - * Represents a composite. - * A composite is used to assemble SCA elements in logical groupings. - * It is the basic unit of composition within an SCA System. An SCA composite contains a - * set of components, services, references and the wires that interconnect them, plus a set - * of properties which can be used to configure components. - */ - class Composite : public ComponentType - { - public: - - /** - * Constructor. - * @param name the name of the composite. - * @param root the root of the composite in the file system. - */ - SCA_API Composite(const std::string& name, const std::string& root); - - /** - * Destructor. - */ - SCA_API virtual ~Composite(); - - /** - * Returns the root directory of the composite. - * @return The root of the composite in the file system. - */ - SCA_API const std::string& getRoot() const { return root; } - - /** - * Add a new component to the composite. - * @param component The component to add. - */ - SCA_API void addComponent(Component* component); - - /** - * Add a new composite reference to the composite. - * @param compositeReference The composite reference to add. - */ - SCA_API void addCompositeReference(CompositeReference* compositeReference); - - /** - * Add a new composite service to the composite. - * @param compositeService The composite service to add. - */ - SCA_API void addCompositeService(CompositeService* compositeService); - - /** - * Add/include a composite in this composite. - * @param composite The composite included in this composite. - */ - SCA_API void addInclude(Composite* composite); - - /** - * 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. - */ - SCA_API 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. - */ - SCA_API 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. - */ - SCA_API Service* findComponentService(const std::string& componentServiceName); - - /** - * Add a WSDL definition to the composite. - * @param wsdlModel A data object holding all the information about - * the WSDL definition from a WSDL file. - */ - SCA_API void addWSDLDefinition(commonj::sdo::DataObjectPtr wsdlModel); - - /** - * Find a WSDL definition by target namespace. - * @param wsdlNamespace The namespace of the WSDL definitions to find. - */ - SCA_API WSDLDefinition* findWSDLDefinition(const std::string& wsdlNamespace); - - /** - * Initialize a component of this type. - * @param component The component to initialize. - */ - virtual void initializeComponent(Component* component); - - /** - * Return a cached SDO XSDHelper. - */ - SCA_API commonj::sdo::XSDHelperPtr getXSDHelper(void); - - /** - * Return a cached SDO XMLHelper. - */ - SCA_API 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. - */ - SCA_API commonj::sdo::DataFactoryPtr getDataFactory(void); - - /** - * Work through the list of wires and connect the source and target uris. - */ - SCA_API void resolveWires(); - - private: - - /** - * Directory of the root of the composite. - */ - std::string root; - - /** - * Cached XSDHelper. - */ - commonj::sdo::XSDHelperPtr xsdHelper; - - /** - * Cached XMLHelper. - */ - commonj::sdo::XMLHelperPtr xmlHelper; - - /** - * Map (by name) of all the components in this composite. - */ - typedef std::map<std::string, Component*> COMPONENT_MAP; - COMPONENT_MAP components; - - /** - * Vector of all the composites included in this composite. - */ - typedef std::vector<Composite*> INCLUDES; - INCLUDES includes; - - /** - * Vector of all the wires in this composite. - */ - typedef std::vector<Wire*> WIRES; - WIRES wires; - - /** - * Map by namespace of all the wsdl definitions in this composite. - */ - typedef std::map<std::string, WSDLDefinition*> WSDL_MAP; - WSDL_MAP wsdlDefinitions; - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_composite_h diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/CompositeReference.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/CompositeReference.cpp deleted file mode 100644 index be0bf71a17..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/CompositeReference.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/model/CompositeReference.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/ComponentType.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/Service.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - - namespace model - { - - // Constructor - CompositeReference::CompositeReference(Composite* composite, const string& name, - Interface* intface, Interface* callbackInterface, bool conversational, ReferenceType::Multiplicity multiplicity) : - Component(composite, name, new ComponentType(composite, name)) - { - logentry(); - loginfo("Composite reference name: %s", name.c_str()); - - // Initialize the component type, service type and service - ComponentType* componentType = getType(); - ServiceType* serviceType = new ServiceType( - componentType, "", intface, callbackInterface); - componentType->addServiceType(serviceType); - - service = new Service(this, serviceType); - addService(service); - } - - // Destructor - CompositeReference::~CompositeReference() - { - logentry(); - } - - } // End namespace model - - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/CompositeReference.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/CompositeReference.h deleted file mode 100644 index f5e2166e06..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/CompositeReference.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_compositereferencetype_h -#define tuscany_sca_model_compositereferencetype_h - -#include <string> - -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/ReferenceType.h" - -namespace tuscany -{ - namespace sca - { - - namespace model - { - class ComponentType; - class Composite; - class Interface; - class Service; - - /** - * Represents a reference in a composite. - * Composite references represent dependencies that the composite has on services provided elsewhere, - * outside the composite. - */ - class CompositeReference : public Component - { - public: - - /** - * Constructor. - * @param name The name of the reference. - */ - SCA_API CompositeReference(Composite* composite, const std::string& name, - Interface* intface, Interface* callbackInterface, bool conversational, ReferenceType::Multiplicity multiplicity); - - /** - * Destructor. - */ - SCA_API virtual ~CompositeReference(); - - /** - * Returns the service exposed by this composite reference. - * @return The service exposed by this composite reference. - */ - SCA_API Service* getService() const { return service; }; - - /** - * Returns the multiplicity of this composite reference - * @return The multiplicity of the composite reference - */ - SCA_API ReferenceType::Multiplicity getMultiplicity() { return multiplicity; } - - private: - - /** - * The service exposed by this composite reference. - */ - Service* service; - - /** - * The multiplicity of this reference - */ - ReferenceType::Multiplicity multiplicity; - - }; - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_compositereferencetype_h - diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.cpp deleted file mode 100644 index 7f24328cf5..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/model/CompositeReferenceBinding.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - // Constructor - CompositeReferenceBinding::CompositeReferenceBinding(Reference* reference) - : ReferenceBinding(reference, ""), uri("") - { - } - - // Destructor - CompositeReferenceBinding::~CompositeReferenceBinding() - { - } - - void CompositeReferenceBinding::configure(ServiceBinding *binding) - { - targetServiceBinding = binding; - } - - ServiceProxy* CompositeReferenceBinding::getServiceProxy() - { - return serviceProxy; - } - - void CompositeReferenceBinding::configure(const string& uri) - { - this->uri = uri; - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.h deleted file mode 100644 index b9daa534c2..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/CompositeReferenceBinding.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_compositereferencebinding_h -#define tuscany_sca_model_compositereferencebinding_h - -#include <string> - -#include "tuscany/sca/model/ReferenceBinding.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - /** - * A default composite reference binding - */ - class CompositeReferenceBinding : public ReferenceBinding - { - public: - - /** - * Constructor. - * @param uri The uri of the binding. - */ - SCA_API CompositeReferenceBinding(Reference* reference); - - /** - * Destructor. - */ - SCA_API virtual ~CompositeReferenceBinding(); - - /** - * Returns the type of binding. - */ - virtual std::string getType() { return "http://www.osoa.org/xmlns/sca/1.0#CompositeServiceBinding"; }; - - /** - * Configure this binding from a service binding. - */ - SCA_API virtual void configure(ServiceBinding* serviceBinding); - - /** - * Configure this binding from a URI. - */ - SCA_API virtual void configure(const std::string& uri); - - /** - * Create a proxy representing the reference to the - * client component. - */ - SCA_API virtual ServiceProxy* getServiceProxy(); - - /** - * Returns the target service binding. - */ - ServiceBinding* getTargetServiceBinding() const { return targetServiceBinding; }; - - /** - * Returns the binding URI. - * @return The binding URI. - */ - SCA_API virtual const std::string& getURI() const { return uri; }; - - private: - - /** - * The proxy representing the reference to the client - * component. - */ - ServiceProxy* serviceProxy; - - /** - * The service binding of the target - */ - ServiceBinding* targetServiceBinding; - - /** - * The binding URI - */ - std::string uri; - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_compositereferencebinding_h diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/CompositeService.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/CompositeService.cpp deleted file mode 100644 index e06dc548c1..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/CompositeService.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/model/CompositeService.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/ComponentType.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/model/ServiceType.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - - namespace model - { - - // Constructor - CompositeService::CompositeService(Composite* composite, const string& name, - Interface* intface, Interface* callbackInterface, bool conversational, - ReferenceType::Multiplicity multiplicity) : - Component(composite, name, new ComponentType(composite, name)) - { - logentry(); - loginfo("Composite service name: %s", name.c_str()); - - // Initialize the component type, reference type and reference - ComponentType* componentType = getType(); - ReferenceType* referenceType = new ReferenceType( - componentType, "", intface, callbackInterface, multiplicity); - componentType->addReferenceType(referenceType); - - reference = new Reference(this, referenceType); - addReference(reference); - } - - // Destructor - CompositeService::~CompositeService() - { - logentry(); - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/CompositeService.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/CompositeService.h deleted file mode 100644 index 8c626ccac3..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/CompositeService.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_compositeservicetype_h -#define tuscany_sca_model_compositeservicetype_h - -#include <string> - -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/ReferenceType.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - class Composite; - class Component; - class Interface; - class Reference; - - /** - * Represents a service in a composite. - * Composite services define the public services provided by the composite, which can be - * accessed from outside the composite. - */ - class CompositeService : public Component - { - - public: - - /** - * Constructor. - * @param componentType The component type on which this service is defined. - * @param name The name of the service. - */ - SCA_API CompositeService(Composite* composite, const std::string& name, - Interface* intface, Interface* callbackInterface, bool conversational, ReferenceType::Multiplicity multiplicity); - - /** - * Destructor. - */ - SCA_API virtual ~CompositeService(); - - /** - * Returns the reference used by this composite service. - * @return The reference used by this composite service. - */ - SCA_API Reference* getReference() const { return reference; }; - - private: - - /** - * The reference used by this composite service. - */ - Reference* reference; - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_compositeservicetype_h - diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Contract.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Contract.cpp deleted file mode 100644 index 99a1d04dc2..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Contract.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/model/Contract.h" - - -namespace tuscany -{ - namespace sca - { - - namespace model - { - - // Constructor - Contract::Contract(Interface *intface, Interface* callbackInterface) : - iface(intface), callbackInterface(callbackInterface) - { - logentry(); - } - - // Destructor - Contract::~Contract() - { - logentry(); - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Contract.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Contract.h deleted file mode 100644 index e1d526f842..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Contract.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_contract_h -#define tuscany_sca_model_contract_h - -#include "tuscany/sca/model/Interface.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - /** - * Interface contracts define one or more business functions. These business functions are - * provided by services and are used by references. Services are defined by the interface which - * they implement. - * This interface will typically be extended to support concrete interface type systems, such as - * CPP classes, Java interfaces, WSDL 1.1 portTypes and WSDL 2.0 interfaces. - */ - class Contract - { - public: - - /** - * Constructor. - */ - SCA_API Contract(Interface* intface, Interface* callbackInterface); - - /** - * Destructor. - */ - SCA_API virtual ~Contract(); - - /** - * Returns the interface for invocations from the requestor to the provider. - * @return The interface for invocations from the requestor to the provider. - */ - SCA_API Interface* getInterface() const { return iface; } - - /** - * Returns the interface for invocations from the provider back to the requestor. - * @return The interface for invocations from the provider back to the requestor. - */ - SCA_API Interface* getCallbackInterface() const { return callbackInterface; } - - private: - - /** - * The interface for invocations from the requestor to the provider. - */ - Interface* iface; - - /** - * The interface for invocations from the provider back to the requestor. - */ - Interface* callbackInterface; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_contract_h - diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Interface.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Interface.cpp deleted file mode 100644 index f8dd02a74a..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Interface.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/model/Interface.h" - - -namespace tuscany -{ - namespace sca - { - - namespace model - { - - // Constructor - Interface::Interface(bool remotable, bool conversational) - : remotable(remotable), conversational(conversational) - { - logentry(); - } - - Interface::~Interface() - { - logentry(); - } - - } // End namespace model - - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Interface.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Interface.h deleted file mode 100644 index 5ac7736d43..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Interface.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_interface_h -#define tuscany_sca_model_interface_h - -#include <string> - -namespace tuscany -{ - namespace sca - { - namespace model - { - - /** - * Information about an interface. Subtypes will hold information - * specific to a type of interface. - */ - class Interface - { - - public: - - /** - * Constructor - */ - SCA_API Interface(bool remotable, bool conversational); - - /** - * Destructor - */ - SCA_API virtual ~Interface(); - - /** - * Returns true if the interface is remotable. - * @return True if the interface is remotable. - */ - SCA_API bool isRemotable() const { return remotable; }; - - /** - * Returns true if the interface is conversational. - * @return True if the interface is conversational. - */ - SCA_API bool isConversational() const { return conversational; }; - - /** - * return the QName of schema type for this interface type - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#WSDLInterface") - */ - SCA_API virtual const std::string& getInterfaceTypeQName() = 0; - - private: - - /** - * True if the interface is remotable - */ - bool remotable; - - /** - * True if the interface is conversational - */ - bool conversational; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_interface_h - diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ModelLoader.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ModelLoader.cpp deleted file mode 100644 index d22427c4d4..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ModelLoader.cpp +++ /dev/null @@ -1,1820 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include "commonj/sdo/TypeDefinitions.h" - -#include "tuscany/sca/export.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/model/ModelLoader.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/CompositeService.h" -#include "tuscany/sca/model/CompositeReference.h" -#include "tuscany/sca/model/ServiceType.h" -#include "tuscany/sca/model/ReferenceType.h" -#include "tuscany/sca/model/WSDLInterface.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/util/File.h" - - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::util; - - -#if defined(WIN32) || defined (_WINDOWS) -#define PATH_SEPARATOR ";" -#else -#define PATH_SEPARATOR ":" -#endif - -namespace tuscany -{ - namespace sca - { - - namespace model - { - // =========== - // Constructor - // =========== - ModelLoader::ModelLoader(SCARuntime* runtime, Composite* system) - : system(system), runtime(runtime) - { - logentry(); - } - - // ========== - // Destructor - // ========== - ModelLoader::~ModelLoader() - { - logentry(); - } - - // ========================================================= - // load: Load the runtime model from the deployed xml files - // This class has the responsibility for translating from - // the SCDL files to the SCA runtime's in memory model. - // ========================================================= - void ModelLoader::load(const string& systemRoot, const string& systemPath) - { - logentry(); - loginfo("System root: %s", systemRoot.c_str()); - loginfo("System path: %s", systemPath.c_str()); - - // Load composite implementations - // Composite implementations can occur anywhere on the given search path - if (systemPath != "") - { - loadComposites(systemRoot + PATH_SEPARATOR + systemPath); - } - else - { - loadComposites(systemRoot); - } - - // Load system composites - // Composites on the the system root path get included - // in the System composite - loadSystem(systemRoot); - - // Resolve the wires in the system composite - system->resolveWires(); - } - - // ======================================================================== - // loadSystem: - // Load all the composite files on the system root path - // Translate the composite information to composite model objects - // ======================================================================== - void ModelLoader::loadSystem(const string& systemRoot) - { - logentry(); - - // Get all the composite files on the system root path - // These composites are included in the system composite - for (string path = systemRoot; path != ""; ) - { - string dir; - Utils::tokeniseString(PATH_SEPARATOR, path, dir, path); - if (dir != "") - { - loginfo("System root directory: %s", dir.c_str()); - Files files(dir, "*.composite", false); - for (unsigned int i=0; i < files.size(); i++) - { - string fileName = files[i].getDirectory() + "/" + files[i].getFileName(); - Composite* composite = compositeFiles[fileName]; - if (composite) - { - // Include the composite in the system composite - system->addInclude(composite); - } - else - { - // We already got an error or warning indicating why the file - // didn't turn into a composite - } - } - } - } - } - - // ===================================================================== - // loadComposites: - // Load all the composites from any directory under the composite search path - // Translate the composite information to composite model objects - // ===================================================================== - void ModelLoader::loadComposites(const string& searchPath) - { - logentry(); - - // Get all the composite files on the composite search path - for (string path = searchPath; path != ""; ) - { - string dir; - Utils::tokeniseString(PATH_SEPARATOR, path, dir, path); - if (dir != "") - { - loginfo("Composite path directory: %s", dir.c_str()); - Files files(dir, "*.composite", true); - for (unsigned int i=0; i < files.size(); i++) - { - loadCompositeFile(files[i]); - } - } - } - - // Complete the mapping of the composites - for (COMPOSITE_DATAOBJECTS::iterator iter = compositeDataObjects.begin(); - iter != compositeDataObjects.end(); - iter++) - { - mapCompositePass2(iter->first, iter->second); - } - } - - // ==================================================================== - // loadCompositeFile: - // This method is called for each .composite file found under the composite search - // path. The location of this composite file will indicate the root of a composite. - // ==================================================================== - Composite* ModelLoader::loadCompositeFile(const File& file) - { - logentry(); - - loginfo("Composite file name: %s", file.getFileName().c_str()); - - Composite* composite = NULL; - try - { - string fileName = file.getDirectory() + "/" + file.getFileName(); - if (compositeFiles[fileName] == NULL) - { - XMLDocumentPtr compositeFile = getXMLHelper()->loadFile(fileName.c_str()); - if (compositeFile->getRootDataObject() == NULL) - { - logerror("Unable to load file: %s", fileName.c_str()); - } - else - { - // Map the SCDL - composite = mapCompositePass1(file, compositeFile->getRootDataObject()); - - // Load the xsd types and wsdl files in the composite - loadTypeMetadata(file.getDirectory(), composite); - } - } - - } catch (SDORuntimeException& ex) - { - logerror("Unable to load composite: %s", ex.getMessageText()); - } - return composite; - } - - // =========== - // mapCompositePass1 - // =========== - Composite* ModelLoader::mapCompositePass1(const File& file, DataObjectPtr root) - { - logentry(); - - const string& compositeRootDir = file.getDirectory(); - const string compositeName = root->getCString("name"); - loginfo("Composite: %s, root directory: %s", compositeName.c_str(), compositeRootDir.c_str()); - - Composite* composite = new Composite(compositeName, compositeRootDir); - compositeModels[compositeName] = composite; - compositeDataObjects[compositeName] = root; - compositeFiles[file.getDirectory() + "/" + file.getFileName()] = composite; - - // ------------ - // Composite services - // ------------ - DataObjectList& compositeServiceList = root->getList("service"); - for (unsigned int i = 0; i < compositeServiceList.size(); i++) - { - addCompositeService(composite, compositeServiceList[i]); - } - - // ----------------- - // Composite references - // ----------------- - DataObjectList& compositeReferenceList = root->getList("reference"); - for (unsigned int cri = 0; cri < compositeReferenceList.size(); cri++) - { - addCompositeReference(composite, compositeReferenceList[cri]); - } - - // ----- - // Wires - // ----- - DataObjectList& wireList = root->getList("wire"); - for (unsigned int l = 0; l < wireList.size(); l++) - { - string source = wireList[l]->getCString("source"); - string target = wireList[l]->getCString("target"); - composite->addWire(source, target); - } - - return composite; - } - - // =========== - // mapCompositePass2 - // =========== - Composite* ModelLoader::mapCompositePass2(const string& compositeName, DataObjectPtr root) - { - logentry(); - loginfo("Composite: %s", compositeName.c_str()); - - Composite* composite = compositeModels[compositeName]; - - // ---------------------------- - // Add components to the composite - // ---------------------------- - DataObjectList& componentList = root->getList("component"); - unsigned int i; - for (i=0; i < componentList.size(); i++) - { - addComponent(composite, componentList[i]); - } - - // Resolve all the wires inside the composite - composite->resolveWires(); - - return composite; - } - - // ================================= - // addComponent: - // ================================= - void ModelLoader::addComponent(Composite* composite, DataObjectPtr componentDO) - { - logentry(); - - // ------------------- - // Get the component implementation - // ------------------- - DataObjectPtr impl = componentDO->getDataObject("implementation"); - if (!impl) - { - string message = "No implementation for component: "; - message = message + componentDO->getCString("name"); - throwException(SystemConfigurationException, message.c_str()); - } - - // Create the component type - ComponentType* componentType; - string componentTypeName; - string componentTypePath; - - string implTypeQname = impl->getType().getURI(); - implTypeQname += "#"; - implTypeQname += impl->getType().getName(); - - if (implTypeQname == "http://www.osoa.org/xmlns/sca/1.0#SCAImplementation") - { - // Handle a composite implementation - Composite* composite = compositeModels[impl->getCString("name")]; - if (!composite) - { - string message = "Composite not found: "; - message = message + impl->getCString("name"); - throwException(SystemConfigurationException, message.c_str()); - } - componentType = composite; - } - else - { - - // Locate extension that handles this implementation type - ImplementationExtension* implExtension = runtime->getImplementationExtension(implTypeQname); - if (implExtension) - { - componentType = implExtension->getImplementation(composite, impl); - - // ----------------------- - // Load the .componentType - // ----------------------- - string typeFileName = composite->getRoot() + "/" + componentType->getName() + ".componentType"; - - // Check that the component type file exists - //TODO We need a better and portable way to do this - string dirName; - string fileName; - Utils::rTokeniseString("/", typeFileName, dirName, fileName); - Files files(dirName, fileName, false); - if (files.size() !=0) - { - try - { - XMLDocumentPtr componentTypeFile = getXMLHelper()->loadFile(typeFileName.c_str()); - if (!componentTypeFile || componentTypeFile->getRootDataObject() == 0) - { - // Component type files are optional - logerror("Unable to load file: %s", typeFileName.c_str()); - } - else - { - //Utils::printDO(componentTypeFile->getRootDataObject()); - //commonj::sdo::SDOUtils::printDataObject(componentTypeFile->getRootDataObject()); - addServiceTypes(composite, componentType, componentTypeFile->getRootDataObject()); - addReferenceTypes(composite, componentType, componentTypeFile->getRootDataObject()); - addPropertyTypes(componentType, componentTypeFile->getRootDataObject()); - } - } catch (SDORuntimeException& ex) - { - logerror("Unable to load file:%s", typeFileName.c_str()); - throwException(SystemConfigurationException, ex); - } - } - } - else - { - logerror("Unsupported implementation type: %s", implTypeQname.c_str()); - - string message = "Implementation type not supported: "; - message = message + implTypeQname; - throwException(SystemConfigurationException, message.c_str()); - } - } - - // First check that references and properties exist, some component types - // will create all used references & properties automatically - DataObjectList& refs = componentDO->getList("reference"); - for (unsigned int i=0; i<refs.size(); i++) - { - string refName = refs[i]->getCString("name"); - if (!componentType->findReferenceType(refName)) - { - // Configuration error: reference is not defined - string message = "Undefined reference: " + refName; - throwException(SystemConfigurationException, message.c_str()); - } - } - - DataObjectList& props = componentDO->getList("property"); - for (unsigned int pi=0; pi<props.size(); pi++) - { - string propName = props[pi]->getCString("name"); - if (!componentType->findPropertyType(propName)) - { - // Configuration error: property is not defined - string message = "Undefined property: " + propName; - throwException(SystemConfigurationException, message.c_str()); - } - } - - - // Create the component - Component* component = new Component(composite, componentDO->getCString("name"), componentType); - composite->addComponent(component); - - // ---------- - // Properties - // ---------- - for (unsigned int pi=0; pi<props.size(); pi++) - { - string propName = props[pi]->getCString("name"); - DataObjectPtr propValue = props[pi]->getDataObject("value"); - - component->setProperty(propName, propValue); - } - - // ---------- - // References - // ---------- - for (unsigned int ri=0; ri<refs.size(); ri++) - { - // ---------------------------------------------------------- - // Add the reference to the composite wires to be resolved later - // ---------------------------------------------------------- - string refName = refs[ri]->getCString("name"); - if (!component->findReference(refName)) - { - // Configuration error: reference is not defined - string message = "Undefined reference: " + refName; - throwException(SystemConfigurationException, message.c_str()); - } - - string src = component->getName() + "/" + refName; - - // Get the reference value - string refValue = refs[ri]->getCString("value"); - - composite->addWire(src, refValue); - } - } - - // ===================================================================== - // addServiceTypes: add the services to the component type - // ===================================================================== - void ModelLoader::addServiceTypes(Composite* composite, ComponentType* componentType, DataObjectPtr componentTypeDO) - { - logentry(); - - DataObjectList& serviceTypes = componentTypeDO->getList("service"); - for (unsigned int i=0; i<serviceTypes.size(); i++) - { - Interface* iface = getInterface(composite, serviceTypes[i]); - ServiceType* serviceType = new ServiceType( - componentType, serviceTypes[i]->getCString("name"), iface, NULL); - componentType->addServiceType(serviceType); - } - } - - // =================================================== - // addReferenceTypes: add the references to the component type - // =================================================== - void ModelLoader::addReferenceTypes(Composite* composite, ComponentType* componentType, DataObjectPtr componentTypeDO) - { - logentry(); - - DataObjectList& refs = componentTypeDO->getList("reference"); - for (unsigned int i=0; i<refs.size(); i++) - { - ReferenceType::Multiplicity multiplicity; - if (refs[i]->isSet("multiplicity")) - { - string s = refs[i]->getCString("multiplicity"); - multiplicity = ReferenceType::getMultiplicityFromString(s); - } - else - { - multiplicity = ReferenceType::ONE_ONE; - } - - Interface* iface = getInterface(composite, refs[i]); - - ReferenceType* referenceType = new ReferenceType( - componentType, refs[i]->getCString("name"), iface, NULL, multiplicity); - componentType->addReferenceType(referenceType); - - } - } - - - // ============== - // getInterface - // ============== - Interface* ModelLoader::getInterface(Composite* composite, DataObjectPtr obj) - { - logentry(); - - // ----------------- - // get the interface - // ----------------- - DataObjectPtr iface = obj->getDataObject("interface"); - if (!iface) - { - string message = "No interface for: "; - message = message + obj->getCString("name"); - throwException(SystemConfigurationException, message.c_str()); - } - - string typeQname = iface->getType().getURI(); - typeQname += "#"; - typeQname += iface->getType().getName(); - - if (typeQname == WSDLInterface::typeQName) - { - // Load a WSDL interface - string qname = iface->getCString("interface"); - - return new WSDLInterface(qname, true, false); - } - else - { - // Locate extension that handles this interface type - InterfaceExtension* ifaceExtension = runtime->getInterfaceExtension(typeQname); - if (ifaceExtension) - { - return ifaceExtension->getInterface(composite, iface); - } - else - { - // log this for now. - logerror("Unsupported interface type: %s", typeQname.c_str()); - return 0; - } - } - - } - - // ============================================== - // addProperties: add properties to the component type - // ============================================== - void ModelLoader::addPropertyTypes(ComponentType* componentType, DataObjectPtr componentTypeDO) - { - logentry(); - - DataObjectList& props = componentTypeDO->getList("property"); - for (unsigned int i=0; i<props.size(); i++) - { - //cout << "Property " << props[i]; - - string name = props[i]->getCString("name"); - string type = props[i]->getCString("type"); - bool many=false; - if (props[i]->isSet("many")) - { - many = props[i]->getBoolean("many"); - } - - //TODO need to add support for complex properties, need the SDO - // folks to help understand how to do this... - DataObjectPtr defaultValue = props[i]->getDataObject("value"); - - componentType->addPropertyType(name, type, many, &defaultValue); - } - } - - // =============================================== - // addCompositeService: add an CompositeService to the composite - // =============================================== - void ModelLoader::addCompositeService(Composite* composite, DataObjectPtr compositeServiceDO) - { - logentry(); - - string compositeServiceName = compositeServiceDO->getCString("name"); - - Interface* iface; - if (compositeServiceDO->getDataObject("interface")) - { - iface = getInterface(composite, compositeServiceDO); - } - else - { - iface = NULL; - } - - ReferenceType::Multiplicity multiplicity; - if (compositeServiceDO->isSet("multiplicity")) - { - string s = compositeServiceDO->getCString("multiplicity"); - multiplicity = ReferenceType::getMultiplicityFromString(s); - } - else - { - multiplicity = ReferenceType::ONE_ONE; - } - - CompositeService* compositeService = new CompositeService( - composite, compositeServiceName, iface, NULL, false, multiplicity); - - composite->addCompositeService(compositeService); - - DataObjectList& refs = compositeServiceDO->getList("reference"); - for (unsigned int i=0; i<refs.size(); i++) - { - // ---------------------------------------------------------- - // Add the reference to the composite wires to be resolved later - // ---------------------------------------------------------- - string targ = refs.getCString(i); - composite->addWire(compositeServiceName, targ); - } - - // Get binding, it will be the first and only binding - DataObjectList& bindings = compositeServiceDO->getList("binding"); - if (bindings.size()==0) - { - string message = "No binding for compositeService: "; - message = message + compositeServiceDO->getCString("name"); - throwException(SystemConfigurationException, message.c_str()); - } - DataObjectPtr binding = bindings[0]; - - // Determine the binding type - string bindingType = binding->getType().getName(); - string bindingTypeQname = binding->getType().getURI(); - bindingTypeQname += "#"; - bindingTypeQname += binding->getType().getName(); - - // Locate the extension that handles this binding type - ReferenceBindingExtension* bindingExtension = runtime->getReferenceBindingExtension(bindingTypeQname); - if (bindingExtension) - { - Reference* reference = compositeService->getReference(); - ReferenceBinding* referenceBinding = bindingExtension->getReferenceBinding(composite, reference, binding); - reference->setBinding(referenceBinding); - } - else - { - logerror("Unsupported binding type: %s", bindingTypeQname.c_str()); - - string message = "Binding type not supported: "; - message = message + bindingTypeQname; - throwException(SystemConfigurationException, message.c_str()); - } - } - - - // ========================================================= - // addCompositeReference: add a CompositeReference to the composite - // ========================================================= - void ModelLoader::addCompositeReference(Composite* composite, DataObjectPtr compositeReferenceDO) - { - logentry(); - - string compositeReferenceName = compositeReferenceDO->getCString("name"); - - Interface* iface; - if (compositeReferenceDO->getDataObject("interface")) - { - iface = getInterface(composite, compositeReferenceDO); - } - else - { - iface = NULL; - } - - CompositeReference* compositeReference = new CompositeReference( - composite, compositeReferenceName, iface, NULL, false, ReferenceType::ONE_ONE); - - composite->addCompositeReference(compositeReference); - - // Get binding, it will be the first and only binding - DataObjectList& bindings = compositeReferenceDO->getList("binding"); - if (bindings.size()==0) - { - string message = "No binding for compositeReference: "; - message = message + compositeReferenceDO->getCString("name"); - throwException(SystemConfigurationException, message.c_str()); - } - DataObjectPtr binding = bindings[0]; - - // Determine the binding type - string bindingType = binding->getType().getName(); - string bindingTypeQname = binding->getType().getURI(); - bindingTypeQname += "#"; - bindingTypeQname += binding->getType().getName(); - - // Locate the extension that handles this binding type - ServiceBindingExtension* bindingExtension = runtime->getServiceBindingExtension(bindingTypeQname); - if (bindingExtension) - { - Service *service = compositeReference->getService(); - ServiceBinding* serviceBinding = bindingExtension->getServiceBinding(composite, service, binding); - service->setBinding(serviceBinding); - } - else - { - logerror("Unsupported binding type: %s", bindingTypeQname.c_str()); - - string message = "Binding type not supported: "; - message = message + bindingTypeQname; - throwException(SystemConfigurationException, message.c_str()); - } - } - - - /// - /// Use the Tuscany.config file in the composite root directory to - /// determine which xsds and wsdls to load into a dataFactory. - /// - void ModelLoader::loadTypeMetadata(const string &compositeRootDir, Composite* composite) - { - logentry(); - - // Load the "Tuscany.config" file, if it exists - Files files(compositeRootDir, "Tuscany.config", false); - if (files.size() !=0) - { - for (unsigned int i=0; i < files.size(); i++) - { - string filename = compositeRootDir + "/" + files[i].getFileName(); - XMLDocumentPtr compositeConfigFile = getXMLHelper()->loadFile(filename.c_str()); - if (compositeConfigFile->getRootDataObject() == 0) - { - logerror("Unable to load file: %s", filename.c_str()); - } - else - { - loginfo("Composite config for: %s, root directory: %s", composite->getName().c_str(), compositeRootDir.c_str()); - - if(compositeConfigFile->getRootDataObject()->isSet("xsd")) - { - DataObjectList& xsds = compositeConfigFile->getRootDataObject()->getList("xsd/file"); - - for (unsigned int i=0; i<xsds.size(); i++) - { - if(xsds[i]->isSet("name")) - { - // Load a xsd file -> set the types in the compositeComponents data factory file - string xsdName = compositeRootDir + "/" +xsds[i]->getCString("name"); - loadXMLSchema(composite, xsdName.c_str()); - } - } - } - - - if( compositeConfigFile->getRootDataObject()->isSet("wsdl")) - { - DataObjectList& wsdls = compositeConfigFile->getRootDataObject()->getList("wsdl/file"); - for (unsigned int j=0; j<wsdls.size(); j++) - { - if(wsdls[i]->isSet("name")) - { - string wsdlName = compositeRootDir + "/" +wsdls[j]->getCString("name"); - // Load a wsdl file -> get the types, then the contents of the wsdl - loadXMLSchema(composite, wsdlName.c_str()); - - // Load the contents of the wsdl files - loadWSDLDefinition(composite, wsdlName.c_str()); - } - } - } - } - } - } - else - { - // The default scheme is to have no Tuscany.config file, then we simply load all - // WSDLs and XSDs that we find under the composite root - - Files xsdFiles(compositeRootDir, "*.xsd", true); - for (unsigned int i=0; i < xsdFiles.size(); i++) - { - // Load a xsd file -> set the types in the compositeComponents data factory file - string xsdName = xsdFiles[i].getDirectory() + "/" + xsdFiles[i].getFileName(); - loadXMLSchema(composite, xsdName.c_str()); - - } - - Files wsdlFiles(compositeRootDir, "*.wsdl", true); - for (unsigned int wi=0; wi < wsdlFiles.size(); wi++) - { - // Load a wsdl file -> get the types, then the contents of the wsdl - string wsdlName = wsdlFiles[wi].getDirectory() + "/" + wsdlFiles[wi].getFileName(); - loadXMLSchema(composite, wsdlName.c_str()); - - // Load the contents of the wsdl files - loadWSDLDefinition(composite, wsdlName.c_str()); - } - } - } - - - /// - /// Use the types from an xsd or wsdl file - /// - void ModelLoader::loadXMLSchema(Composite* composite, const char *fileName) - { - logentry(); - loginfo("Loading XML schema %s", fileName); - // Load a xsd file -> set the types in the data factory associated with - // the composite - try { - composite->getXSDHelper()->defineFile(fileName); - //Utils::printTypes(composite->getXSDHelper()->getDataFactory()); - - } catch (SDORuntimeException& ex) - { - logerror("Unable to load schema: %s", fileName); - throwException(SystemConfigurationException, ex); - } - } - - /// - /// Load the web services definition from a wsdl - /// - void ModelLoader::loadWSDLDefinition(Composite* composite, const char *fileName) - { - logentry(); - - try { - // Load the wsdl file - XMLDocumentPtr doc = getXMLHelper()->loadFile(fileName); - - if (doc!=0 && doc->getRootDataObject()!=0) - { - //Utils::printDO(doc->getRootDataObject()); - - // Add the root WSDL object to the composite - composite->addWSDLDefinition(doc->getRootDataObject()); - - } - else - { - logerror("Unable to load or parse WSDL: %s", fileName); - } - - } catch (SDORuntimeException& ex) - { - logerror("Unable to load or parse WSDL: %s", fileName); - throwException(SystemConfigurationException, ex); - } - } - - ////////////////////////////////////////////////////////////////////////////// - // Methods used to load the model into memory - ////////////////////////////////////////////////////////////////////////////// - - /// - /// Get an XSDHelper that has the appropriate XSDs already loaded - /// - const XSDHelperPtr ModelLoader::getXSDHelper() - { - logentry(); - - if (myXSDHelper == 0) - { - - // Create an xsd helper - myXSDHelper = HelperProvider::getXSDHelper(); - - try { - - // Load the Assembly model schema - string root = runtime->getInstallRoot(); - string filename = root + "/xsd/sca.xsd"; - - myXSDHelper->defineFile(filename.c_str()); - - // Tuscany specific xsd for config files - filename = root + "/xsd/tuscany.xsd"; - myXSDHelper->defineFile(filename.c_str()); - - initializeWSDLModel(myXSDHelper); - - // Load any schema from the extensions directory - string extensionsRoot = root + "/extensions"; - - Files files(extensionsRoot, "*.xsd", true); - for (unsigned int i=0; i < files.size(); i++) - { - string extensionSchema = files[i].getDirectory() + "/" + files[i].getFileName(); - myXSDHelper->defineFile(extensionSchema.c_str()); - } - - - } catch (SDORuntimeException& ex) - { - throwException(SystemConfigurationException, ex); - } - } - - return myXSDHelper; - } - - - /// - /// Get an XMLHelper to load files - /// - const XMLHelperPtr ModelLoader::getXMLHelper() - { - logentry(); - - if (myXMLHelper == 0) { - - // Create an xml helper - myXMLHelper = HelperProvider::getXMLHelper(getXSDHelper()->getDataFactory()); - - } - - return myXMLHelper; - } - - void ModelLoader::initializeWSDLModel(XSDHelperPtr xsdHelper) - { - logentry(); - - DataFactoryPtr dataFactory = xsdHelper->getDataFactory(); - - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "RootType", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tBinding", - false, true, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tBindingOperation", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tBindingOperationFault", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tBindingOperationMessage", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tDefinitions", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tDocumentation", - true, true, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tDocumented", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tExtensibilityElement", - false, false, true); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tExtensibleAttributesDocumented", - false, true, true); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tExtensibleDocumented", - false, true, true); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tFault", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tImport", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tMessage", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tOperation", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tParam", - false, false, false); - - - TypeDefinition tpart; - tpart.setUri("http://schemas.xmlsoap.org/wsdl/"); - tpart.setName("tPart"); - tpart.setParentType("http://schemas.xmlsoap.org/wsdl/", - "tExtensibleAttributesDocumented", false); - PropertyDefinition propdef; - propdef.setName("name"); - propdef.setLocalName("name"); - propdef.setType("commonj.sdo", "String"); - propdef.setIsContainment(true); - tpart.addPropertyDefinition(propdef); - propdef.setName("element"); - propdef.setLocalName("element"); - propdef.setIsQName(true); - tpart.addPropertyDefinition(propdef); - propdef.setName("type"); - propdef.setLocalName("type"); - tpart.addPropertyDefinition(propdef); - TypeDefinitions typedefs; - typedefs.addTypeDefinition(tpart); - xsdHelper->defineTypes(typedefs); - - //Utils::printTypes(dataFactory); - /*dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tPart", - false, false, false);*/ - - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tPort", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tPortType", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tService", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/", "tTypes", - false, false, false); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "RootType", - "definitions", - "http://schemas.xmlsoap.org/wsdl/", "tDefinitions", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "RootType", - "import", - "http://schemas.xmlsoap.org/wsdl/", "tImport", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "RootType", - "types", - "http://schemas.xmlsoap.org/wsdl/", "tTypes", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "RootType", - "message", - "http://schemas.xmlsoap.org/wsdl/", "tMessage", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "RootType", - "portType", - "http://schemas.xmlsoap.org/wsdl/", "tPortType", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "RootType", - "binding", - "http://schemas.xmlsoap.org/wsdl/", "tBinding", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "RootType", - "service", - "http://schemas.xmlsoap.org/wsdl/", "tService", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "RootType", - "input", - "http://schemas.xmlsoap.org/wsdl/", "tParam", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "RootType", - "output", - "http://schemas.xmlsoap.org/wsdl/", "tParam", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "RootType", - "fault", - "http://schemas.xmlsoap.org/wsdl/", "tFault", - true, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "RootType", - "output", - "http://schemas.xmlsoap.org/wsdl/", "tParam", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "RootType", - "input", - "http://schemas.xmlsoap.org/wsdl/", "tParam", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "RootType", - "fault", - "http://schemas.xmlsoap.org/wsdl/", "tFault", - true, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "RootType", - "arrayType", - "commonj.sdo", "String", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "RootType", - "required", - "commonj.sdo", "Boolean", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tBinding", - "operation", - "http://schemas.xmlsoap.org/wsdl/", "tBindingOperation", - true, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tBinding", - "name", - "commonj.sdo", "String", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tBinding", - "type", - "commonj.sdo", "URI", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/", "tBindingOperation", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibleDocumented"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tBindingOperation", - "input", - "http://schemas.xmlsoap.org/wsdl/", "tBindingOperationMessage", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tBindingOperation", - "output", - "http://schemas.xmlsoap.org/wsdl/", "tBindingOperationMessage", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tBindingOperation", - "fault", - "http://schemas.xmlsoap.org/wsdl/", "tBindingOperationFault", - true, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tBindingOperation", - "name", - "commonj.sdo", "String", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/", "tBindingOperationFault", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibleDocumented"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tBindingOperationFault", - "name", - "commonj.sdo", "String", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/", "tBindingOperationMessage", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibleDocumented"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tBindingOperationMessage", - "name", - "commonj.sdo", "String", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/", "tDefinitions", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibleDocumented"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tDefinitions", - "import", - "http://schemas.xmlsoap.org/wsdl/", "tImport", - true, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tDefinitions", - "types", - "http://schemas.xmlsoap.org/wsdl/", "tTypes", - true, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tDefinitions", - "message", - "http://schemas.xmlsoap.org/wsdl/", "tMessage", - true, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tDefinitions", - "portType", - "http://schemas.xmlsoap.org/wsdl/", "tPortType", - true, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tDefinitions", - "binding", - "http://schemas.xmlsoap.org/wsdl/", "tBinding", - true, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tDefinitions", - "service", - "http://schemas.xmlsoap.org/wsdl/", "tService", - true, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tDefinitions", - "targetNamespace", - "commonj.sdo", "URI", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tDefinitions", - "name", - "commonj.sdo", "String", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tDocumented", - "documentation", - "http://schemas.xmlsoap.org/wsdl/", "tDocumentation", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tExtensibilityElement", - "required", - "commonj.sdo", "Boolean", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/", "tExtensibleAttributesDocumented", - "http://schemas.xmlsoap.org/wsdl/", "tDocumented"); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/", "tExtensibleDocumented", - "http://schemas.xmlsoap.org/wsdl/", "tDocumented"); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/", "tFault", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibleAttributesDocumented"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tFault", - "name", - "commonj.sdo", "String", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tFault", - "message", - "commonj.sdo", "URI", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/", "tImport", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibleAttributesDocumented"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tImport", - "namespace", - "commonj.sdo", "URI", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tImport", - "location", - "commonj.sdo", "URI", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/", "tMessage", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibleDocumented"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tMessage", - "part", - "http://schemas.xmlsoap.org/wsdl/", "tPart", - true, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tMessage", - "name", - "commonj.sdo", "String", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/", "tOperation", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibleDocumented"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tOperation", - "input", - "http://schemas.xmlsoap.org/wsdl/", "tParam", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tOperation", - "output", - "http://schemas.xmlsoap.org/wsdl/", "tParam", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tOperation", - "fault", - "http://schemas.xmlsoap.org/wsdl/", "tFault", - true, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tOperation", - "name", - "commonj.sdo", "String", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tOperation", - "parameterOrder", - "commonj.sdo", "String", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/", "tParam", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibleAttributesDocumented"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tParam", - "name", - "commonj.sdo", "String", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tParam", - "message", - "commonj.sdo", "URI", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/", "tPart", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibleAttributesDocumented"); - /*dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tPart", - "name", - "commonj.sdo", "String", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tPart", - "element", - "commonj.sdo", "URI", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tPart", - "type", - "commonj.sdo", "URI", - false, false, true);*/ - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/", "tPort", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibleDocumented"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tPort", - "name", - "commonj.sdo", "String", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tPort", - "binding", - "commonj.sdo", "URI", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/", "tPortType", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibleAttributesDocumented"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tPortType", - "operation", - "http://schemas.xmlsoap.org/wsdl/", "tOperation", - true, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tPortType", - "name", - "commonj.sdo", "String", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/", "tService", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibleDocumented"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tService", - "port", - "http://schemas.xmlsoap.org/wsdl/", "tPort", - true, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/", "tService", - "name", - "commonj.sdo", "String", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/", "tTypes", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibleDocumented"); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap/", "RootType", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap/", "encodingStyle", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tAddress", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tBinding", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tBody", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tFault", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tFaultRes", - false, false, true); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tHeader", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tHeaderFault", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tOperation", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tStyleChoice", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap/", "useChoice", - false, false, false); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "RootType", - "binding", - "http://schemas.xmlsoap.org/wsdl/soap/", "tBinding", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "RootType", - "operation", - "http://schemas.xmlsoap.org/wsdl/soap/", "tOperation", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "RootType", - "body", - "http://schemas.xmlsoap.org/wsdl/soap/", "tBody", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "RootType", - "encodingStyle", - "http://schemas.xmlsoap.org/wsdl/soap/", "encodingStyle", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "RootType", - "use", - "http://schemas.xmlsoap.org/wsdl/soap/", "useChoice", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "RootType", - "namespace", - "commonj.sdo", "URI", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "RootType", - "fault", - "http://schemas.xmlsoap.org/wsdl/soap/", "tFault", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "RootType", - "header", - "http://schemas.xmlsoap.org/wsdl/soap/", "tHeader", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "RootType", - "message", - "commonj.sdo", "URI", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "RootType", - "part", - "commonj.sdo", "String", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "RootType", - "use", - "http://schemas.xmlsoap.org/wsdl/soap/", "useChoice", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "RootType", - "encodingStyle", - "http://schemas.xmlsoap.org/wsdl/soap/", "encodingStyle", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "RootType", - "namespace", - "commonj.sdo", "URI", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "RootType", - "headerfault", - "http://schemas.xmlsoap.org/wsdl/soap/", "tHeaderFault", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "RootType", - "address", - "http://schemas.xmlsoap.org/wsdl/soap/", "tAddress", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tAddress", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibilityElement"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tAddress", - "location", - "commonj.sdo", "URI", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tBinding", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibilityElement"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tBinding", - "transport", - "commonj.sdo", "URI", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tBinding", - "style", - "http://schemas.xmlsoap.org/wsdl/soap/", "tStyleChoice", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tBody", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibilityElement"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tBody", - "parts", - "commonj.sdo", "String", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tBody", - "encodingStyle", - "http://schemas.xmlsoap.org/wsdl/soap/", "encodingStyle", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tBody", - "use", - "http://schemas.xmlsoap.org/wsdl/soap/", "useChoice", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tBody", - "namespace", - "commonj.sdo", "URI", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tFault", - "http://schemas.xmlsoap.org/wsdl/soap/", "tFaultRes"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tFault", - "name", - "commonj.sdo", "String", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tFaultRes", - "http://schemas.xmlsoap.org/wsdl/soap/", "tBody"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tFaultRes", - "required", - "commonj.sdo", "Boolean", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tFaultRes", - "parts", - "commonj.sdo", "String", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tFaultRes", - "encodingStyle", - "http://schemas.xmlsoap.org/wsdl/soap/", "encodingStyle", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tFaultRes", - "use", - "http://schemas.xmlsoap.org/wsdl/soap/", "useChoice", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tFaultRes", - "namespace", - "commonj.sdo", "URI", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tHeader", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibilityElement"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tHeader", - "headerfault", - "http://schemas.xmlsoap.org/wsdl/soap/", "tHeaderFault", - true, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tHeader", - "message", - "commonj.sdo", "URI", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tHeader", - "part", - "commonj.sdo", "String", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tHeader", - "use", - "http://schemas.xmlsoap.org/wsdl/soap/", "useChoice", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tHeader", - "encodingStyle", - "http://schemas.xmlsoap.org/wsdl/soap/", "encodingStyle", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tHeader", - "namespace", - "commonj.sdo", "URI", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tHeaderFault", - "message", - "commonj.sdo", "URI", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tHeaderFault", - "part", - "commonj.sdo", "String", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tHeaderFault", - "use", - "http://schemas.xmlsoap.org/wsdl/soap/", "useChoice", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tHeaderFault", - "encodingStyle", - "http://schemas.xmlsoap.org/wsdl/soap/", "encodingStyle", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tHeaderFault", - "namespace", - "commonj.sdo", "URI", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tOperation", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibilityElement"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tOperation", - "soapAction", - "commonj.sdo", "URI", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tOperation", - "style", - "http://schemas.xmlsoap.org/wsdl/soap/", "tStyleChoice", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap/", "tStyleChoice", - "commonj.sdo", "String"); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap/", "useChoice", - "commonj.sdo", "String"); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/http/", "RootType", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/http/", "addressType", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/http/", "bindingType", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/http/", "operationType", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/http/", "urlEncoded", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/http/", "urlReplacement", - false, false, false); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/http/", "RootType", - "address", - "http://schemas.xmlsoap.org/wsdl/http/", "addressType", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/http/", "RootType", - "binding", - "http://schemas.xmlsoap.org/wsdl/http/", "bindingType", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/http/", "RootType", - "operation", - "http://schemas.xmlsoap.org/wsdl/http/", "operationType", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/http/", "RootType", - "urlEncoded", - "http://schemas.xmlsoap.org/wsdl/http/", "urlEncoded", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/http/", "RootType", - "urlReplacement", - "http://schemas.xmlsoap.org/wsdl/http/", "urlReplacement", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/http/", "addressType", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibilityElement"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/http/", "addressType", - "location", - "commonj.sdo", "URI", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/http/", "bindingType", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibilityElement"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/http/", "bindingType", - "verb", - "commonj.sdo", "String", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/http/", "operationType", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibilityElement"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/http/", "operationType", - "location", - "commonj.sdo", "URI", - false, false, true); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/mime/", "RootType", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/mime/", "contentType", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/mime/", "multipartRelatedType", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/mime/", "tMimeXml", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/mime/", "tPart", - false, true, false); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/mime/", "RootType", - "content", - "http://schemas.xmlsoap.org/wsdl/mime/", "contentType", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/mime/", "RootType", - "multipartRelated", - "http://schemas.xmlsoap.org/wsdl/mime/", "multipartRelatedType", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/mime/", "RootType", - "mimeXml", - "http://schemas.xmlsoap.org/wsdl/mime/", "tMimeXml", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/mime/", "contentType", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibilityElement"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/mime/", "contentType", - "type", - "commonj.sdo", "String", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/mime/", "contentType", - "part", - "commonj.sdo", "String", - false, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/mime/", "multipartRelatedType", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibilityElement"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/mime/", "multipartRelatedType", - "part", - "http://schemas.xmlsoap.org/wsdl/mime/", "tPart", - true, false, true); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/mime/", "tMimeXml", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibilityElement"); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/mime/", "tMimeXml", - "part", - "commonj.sdo", "String", - false, false, true); - dataFactory->addPropertyToType( - "http://schemas.xmlsoap.org/wsdl/mime/", "tPart", - "name", - "commonj.sdo", "String", - false, false, true); - - - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "RootType", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tAddress", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tBinding", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tBody", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tExtensibilityElementOpenAttrs", - false, true, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tFault", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tFaultRes", - false, false, true); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tHeader", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tHeaderFault", - false, true, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tOperation", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tParts", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tStyleChoice", - false, false, false); - dataFactory->addType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "useChoice", - false, false, false); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tAddress", - "http://schemas.xmlsoap.org/wsdl/soap12/", "tExtensibilityElementOpenAttrs"); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tBinding", - "http://schemas.xmlsoap.org/wsdl/soap12/", "tExtensibilityElementOpenAttrs"); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tBody", - "http://schemas.xmlsoap.org/wsdl/soap12/", "tExtensibilityElementOpenAttrs"); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tExtensibilityElementOpenAttrs", - "http://schemas.xmlsoap.org/wsdl/", "tExtensibilityElement"); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tFault", - "http://schemas.xmlsoap.org/wsdl/soap12/", "tFaultRes"); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tFaultRes", - "http://schemas.xmlsoap.org/wsdl/soap12/", "tBody"); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tHeader", - "http://schemas.xmlsoap.org/wsdl/soap12/", "tExtensibilityElementOpenAttrs"); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tOperation", - "http://schemas.xmlsoap.org/wsdl/soap12/", "tExtensibilityElementOpenAttrs"); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "tStyleChoice", - "commonj.sdo", "String"); - dataFactory->setBaseType( - "http://schemas.xmlsoap.org/wsdl/soap12/", "useChoice", - "commonj.sdo", "String"); - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ModelLoader.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ModelLoader.h deleted file mode 100644 index 68893e7ba3..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ModelLoader.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_modelloader_h -#define tuscany_sca_model_modelloader_h - -#include <map> - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/export.h" -#include "tuscany/sca/core/SCARuntime.h" -#include "tuscany/sca/model/Interface.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/ComponentType.h" -#include "tuscany/sca/util/File.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - - /** - * Provides methods to load the runtime model from the SCDL file. - */ - class ModelLoader { - - public: - /** - * Constructor. - * @param system The SCA system to load. - */ - ModelLoader(tuscany::sca::SCARuntime* runtime, Composite* system); - - /** - * Destructor. - */ - virtual ~ModelLoader(); - - /** - * Load the model from the configuration information. - * @param systemRoot The location of the system configuration - * @param systemPath The search path for composites - */ - void load(const std::string& systemRoot, const std::string& systemPath); - - private: - void loadSystem(const std::string& systemRoot); - - void loadComposites(const std::string& searchPath); - Composite* loadCompositeFile(const tuscany::sca::util::File& file); - Composite* mapCompositePass1(const tuscany::sca::util::File& file, commonj::sdo::DataObjectPtr rootDO); - Composite* mapCompositePass2(const std::string& compositeName, commonj::sdo::DataObjectPtr rootDO); - - void addComponent(Composite* composite, commonj::sdo::DataObjectPtr componentDO); - void addCompositeService(Composite* composite, commonj::sdo::DataObjectPtr compositeServiceDO); - void addCompositeReference(Composite* composite, commonj::sdo::DataObjectPtr referenceServiceDO); - - void addServiceTypes(Composite* composite, ComponentType* componentType, commonj::sdo::DataObjectPtr componentTypeDO); - void addReferenceTypes(Composite* composite, ComponentType* componentType, commonj::sdo::DataObjectPtr componentTypeDO); - void addPropertyTypes(ComponentType* componentType, commonj::sdo::DataObjectPtr componentTypeDO); - - void loadTypeMetadata(const std::string &compositeRootDir, Composite* composite); - - void loadXMLSchema(Composite* composite, const char *fileName); - void loadWSDLDefinition(Composite* composite, const char *fileName); - void initializeWSDLModel(commonj::sdo::XSDHelperPtr xsdHelper); - - Interface* getInterface(Composite* composite, commonj::sdo::DataObjectPtr obj); - - SCARuntime* runtime; - - commonj::sdo::XMLHelperPtr myXMLHelper; // Used to load scdl files - commonj::sdo::XSDHelperPtr myXSDHelper; // Used to load xsds - - const commonj::sdo::XSDHelperPtr getXSDHelper(void); - const commonj::sdo::XMLHelperPtr getXMLHelper(void); - - /** - * The composite describing the composition of the system - */ - Composite* system; - - /** - * Maps of all the composites installed on the system. - */ - typedef std::map<std::string, Composite*> COMPOSITE_MODELS; - COMPOSITE_MODELS compositeModels; - - typedef std::map<std::string, commonj::sdo::DataObjectPtr> COMPOSITE_DATAOBJECTS; - COMPOSITE_DATAOBJECTS compositeDataObjects; - - typedef std::map<std::string, Composite*> COMPOSITE_FILES; - COMPOSITE_FILES compositeFiles; - - }; - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_modelloader_h - diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Reference.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Reference.cpp deleted file mode 100644 index 8820379c4e..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Reference.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/ReferenceType.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - // Constructor - Reference::Reference(Component* component, ReferenceType* referenceType) - : component(component), type(referenceType), binding(0) - { - logentry(); - } - - // Destructor - Reference::~Reference() - { - logentry(); - } - - void Reference::setBinding(ReferenceBinding* binding) - { - this->binding = binding; - } - - ReferenceBinding* Reference::getBinding() const - { - return binding; - } - - void Reference::addTarget(Service* target) - { - logentry(); - - if (type->getMultiplicity() == ReferenceType::ONE_ONE || type->getMultiplicity() == ReferenceType::ZERO_ONE) - { - if (targets.size() > 0) - { - string message = "Duplicate wire for reference: " + type->getName(); - throwException(SystemConfigurationException, message.c_str()); - } - } - - targets.push_back(target); - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Reference.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Reference.h deleted file mode 100644 index 33413b488f..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Reference.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_reference_h -#define tuscany_sca_model_reference_h - -#include <vector> - -namespace tuscany -{ - namespace sca - { - namespace model - { - class Component; - class ReferenceType; - class ReferenceBinding; - class Service; - - /** - * An addressable instance of a reference type associated with a particular component. - * Each reference represents a configured version of a logical - * reference type defined in the component type. If the logical reference - * has a multiplicity greater than 1 (0..n or 1..n) then the configured - * reference many have multiple targets. - */ - class Reference - { - public: - /** - * Constructor. - * @param component The component on which the reference is defined. - * @param referenceType The reference type defining the characteristics of the reference. - */ - SCA_API Reference(Component* component, ReferenceType* referenceType); - - /** - * Destructor. - */ - SCA_API virtual ~Reference(); - - /** - * Returns the component on which this reference is defined. - * @return The component on which this reference is defined. - */ - SCA_API Component* getComponent() const { return component; } - - /** - * Returns the reference type defining the characteristics of the reference. - * @return The reference type defining the characteristics of the reference. - */ - SCA_API ReferenceType* getType() const { return type; } - - /** - * Returns the binding supported by the reference. - * @return The binding supported by the reference. - */ - SCA_API ReferenceBinding* getBinding() const; - - /** - * Sets the binding supported by the reference. - * @param binding The binding supported by the reference. - */ - SCA_API void setBinding(ReferenceBinding* binding); - - /** - * Add a target for this reference. There may be more than - * one if the multiplicity is 0..n or 1..n. - * @param target The target of the reference. - */ - SCA_API void addTarget(Service* target); - - typedef std::vector<Service*> TARGETS; - - /** - * Get a vector of all the targets from this reference. - * @return The targets of this reference. - */ - SCA_API const TARGETS& getTargets() const { return targets; } - - private: - - /** - * The component on which this reference is defined. - */ - Component* component; - - /** - * The reference type defining the characteristics of the reference. - */ - ReferenceType* type; - - /** - * The binding supported by this reference - */ - ReferenceBinding* binding; - - /** - * Vector of all the targets wired from this reference. - */ - TARGETS targets; - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_reference_h diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ReferenceBinding.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ReferenceBinding.cpp deleted file mode 100644 index 1f74dfbbb3..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ReferenceBinding.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/model/ReferenceBinding.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/model/Composite.h" -#include "tuscany/sca/model/Service.h" - - -using namespace std; - -namespace tuscany -{ - namespace sca - { - - namespace model - { - - // Constructor - ReferenceBinding::ReferenceBinding(Reference *reference, const string& uri) : - Binding(uri), reference(reference) - { - logentry(); - } - - // Destructor - ReferenceBinding::~ReferenceBinding() - { - logentry(); - } - - void ReferenceBinding::configure(const string& uri) - { - logentry(); - - // Find the target service - Component* component = reference->getComponent(); - Composite* composite = component->getComposite(); - Service* service; - service = composite->findComponentService(uri); - if (!service) - { - logerror("Wire target %s not found", uri.c_str()); - } - else - { - // Configure this binding from the target service binding - configure(service->getBinding()); - } - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ReferenceBinding.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ReferenceBinding.h deleted file mode 100644 index 4563f0a736..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ReferenceBinding.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_referencebinding_h -#define tuscany_sca_model_referencebinding_h - -#include <string> - -#include "tuscany/sca/model/Binding.h" - -namespace tuscany -{ - namespace sca - { - class ServiceProxy; - - - namespace model - { - class Reference; - class ServiceBinding; - - /** - * Represents a reference binding. - * Bindings are used by services and references. References use bindings - * to describe the access mechanism used to call an external service (which can - * be a service provided by another SCA composite). Services use bindings to describe - * the access mechanism that clients (which can be a client from another SCA composite) - * have to use to call the service. - * This interface will typically be extended by binding implementations to allow - * specification of binding/transport specific information. - */ - class ReferenceBinding : public Binding - { - public: - - /** - * Constructor to create a new binding. - */ - SCA_API ReferenceBinding(Reference* reference, const std::string& uri); - - /** - * Destructor. - */ - SCA_API virtual ~ReferenceBinding(); - - /** - * Create a proxy representing the reference to the - * client component. - */ - SCA_API virtual ServiceProxy* getServiceProxy() = 0; - - /** - * Configure this binding from a service binding. - */ - SCA_API virtual void configure(ServiceBinding* serviceBinding) = 0; - - /** - * Configure this binding from a URI. - */ - SCA_API virtual void configure(const std::string& uri); - - /** - * Returns the reference. - * @return The reference. - */ - SCA_API Reference* getReference() const { return reference; }; - - private: - - /** - * The reference configured with the binding. - */ - Reference* reference; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_referencebinding_h diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ReferenceType.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ReferenceType.cpp deleted file mode 100644 index 732a14cace..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ReferenceType.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/model/ReferenceType.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - - // Constructor - ReferenceType::ReferenceType(ComponentType* componentType, const string& name, - Interface* intface, Interface* callbackInterface, Multiplicity multiplicity) - : Contract(intface, callbackInterface), - componentType(componentType), name(name), multiplicity(multiplicity) - { - logentry(); - } - - ReferenceType::~ReferenceType() - { - logentry(); - } - - ReferenceType::Multiplicity ReferenceType::getMultiplicityFromString(const string& multip) - { - logentry(); - - if (multip == "0..1") - { - return ReferenceType::ZERO_ONE; - } - else if (multip == "1..1") - { - return ReferenceType::ONE_ONE; - } - else if (multip == "0..n") - { - return ReferenceType::ZERO_MANY; - } - else if (multip == "1..n") - { - return ReferenceType::ONE_MANY; - } - else - { - return ReferenceType::UNKNOWN; - } - } - - void ReferenceType::setBinding(Binding* binding) - { - this->binding = binding; - } - - Binding* ReferenceType::getBinding() const - { - return binding; - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ReferenceType.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ReferenceType.h deleted file mode 100644 index 87d38ab330..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ReferenceType.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_referencetype_h -#define tuscany_sca_model_referencetype_h - -#include <string> - -#include "tuscany/sca/model/Contract.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - class ComponentType; - class Interface; - class Binding; - - /** - * Represents an SCA reference. SCA references within an implementation represent - * links to services that the implementation uses that must be provided by other components - * in the SCA system. - */ - class ReferenceType : public Contract - { - public: - - /** - * Multiplicity (how many wires can be connected to this - * reference) - */ - enum Multiplicity - { - ZERO_ONE = 1, - ONE_ONE = 2, - ZERO_MANY = 3, - ONE_MANY = 4, - UNKNOWN = 0, - }; - - /** - * Constructor. - * @param name The name of the reference. - */ - SCA_API ReferenceType(ComponentType* componentType, const std::string& name, - Interface* intface, Interface* callbackInterface, Multiplicity multiplicity); - - /** - * Destructor. - */; - SCA_API virtual ~ReferenceType(); - - /** - * Returns the component type on which this reference is defined. - * @return The component type on which this reference is defined. - */ - SCA_API ComponentType* getComponentType() const { return componentType; } - - /** - * Returns the name of the reference. - * @return The name of the reference. - */ - SCA_API const std::string& getName() const { return name; } - - /** - * Returns the multiplicity allowed for wires connected to this reference. - * @return The multiplicity allowed for wires connected to this reference - */ - SCA_API Multiplicity getMultiplicity() const { return multiplicity; } - - /** - * Returns the binding supported by the reference. - * @return The binding supported by the reference. - */ - SCA_API Binding* getBinding() const; - - /** - * Sets the binding supported by the reference. - * @param binding The binding supported by the reference. - */ - SCA_API void setBinding(Binding* binding); - - /** - * Get the multiplicity corresponding to the given - * string. - */ - static Multiplicity getMultiplicityFromString(const std::string& multip); - - private: - - /** - * The component type on which this reference is defined. - */ - ComponentType *componentType; - - /** - * The name of the reference type. - */ - std::string name; - - /** - * The multiplicity allowed for wires connected to this reference. - */ - Multiplicity multiplicity; - - /** - * The binding supported by this reference type. - */ - Binding* binding; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_referencetype_h - diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Service.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Service.cpp deleted file mode 100644 index 4df1d1efc6..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Service.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/core/Exceptions.h" -#include "tuscany/sca/model/Service.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - - // Constructor - Service::Service(Component* component, ServiceType* serviceType) - : component(component), type(serviceType), binding(0) - { - logentry(); - } - - // Destructor - Service::~Service() - { - logentry(); - } - - void Service::setBinding(ServiceBinding* binding) - { - this->binding = binding; - } - - ServiceBinding* Service::getBinding() const - { - return binding; - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Service.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Service.h deleted file mode 100644 index a1f2c5d672..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Service.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_service_h -#define tuscany_sca_model_service_h - - -namespace tuscany -{ - namespace sca - { - namespace model - { - class Component; - class ServiceType; - class ServiceBinding; - - /** - * An addressable instance of a service type associated with a particular component. - */ - class Service - { - public: - /** - * Constructor. - * @param component The component on which the service is defined. - * @param serviceType The service type defining the characteristics of the service. - */ - SCA_API Service(Component* component, ServiceType* serviceType); - - /** - * Destructor. - */ - SCA_API virtual ~Service(); - - /** - * Returns the component on which this service is defined. - * @return The component on which this service is defined. - */ - SCA_API Component* getComponent() const { return component; } - - /** - * Returns the service type defining the characteristics of the service. - * @return The service type defining the characteristics of the service. - */ - SCA_API ServiceType* getType() const { return type; } - - /** - * Returns the binding supported by the service. - * @return The binding supported by the service. - */ - SCA_API ServiceBinding* getBinding() const; - - /** - * Sets the binding supported by the service. - * @param binding The binding supported by the service. - */ - SCA_API void setBinding(ServiceBinding* binding); - - private: - - /** - * The component on which this service is defined. - */ - Component* component; - - /** - * The service type defining the characteristics of the service. - */ - ServiceType* type; - - /** - * The binding supported by this service - */ - ServiceBinding* binding; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_service_h diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ServiceBinding.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ServiceBinding.cpp deleted file mode 100644 index ddc5e6a711..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ServiceBinding.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/model/ServiceBinding.h" - -using namespace std; - - -namespace tuscany -{ - namespace sca - { - - namespace model - { - - // Constructor - ServiceBinding::ServiceBinding(Service* service, const string& uri) : - Binding(uri), service(service) - { - logentry(); - } - - // Destructor - ServiceBinding::~ServiceBinding() - { - logentry(); - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ServiceBinding.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ServiceBinding.h deleted file mode 100644 index 4e68f492a3..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ServiceBinding.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_servicebinding_h -#define tuscany_sca_model_servicebinding_h - -#include <string> - -#include "tuscany/sca/model/Binding.h" - - -namespace tuscany -{ - namespace sca - { - class ServiceWrapper; - - namespace model - { - class Service; - - /** - * Represents a service binding. - * Bindings are used by services and references. References use bindings - * to describe the access mechanism used to call an external service (which can - * be a service provided by another SCA composite). Services use bindings to describe - * the access mechanism that clients (which can be a client from another SCA composite) - * have to use to call the service. - * This interface will typically be extended by binding implementations to allow - * specification of binding/transport specific information. - */ - class ServiceBinding : public Binding - { - public: - - /** - * Constructor to create a new binding. - */ - SCA_API ServiceBinding(Service* service, const std::string& uri); - - /** - * Destructor. - */ - SCA_API virtual ~ServiceBinding(); - - /** - * Create a service wrapper handling the interaction - * with the service configured with this binding. - */ - SCA_API virtual ServiceWrapper* getServiceWrapper() = 0; - - /** - * Returns the service - * @return The service. - */ - SCA_API Service* getService() const { return service; }; - - private: - - /** - * The service configured with the binding. - */ - Service* service; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_servicebinding_h diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ServiceType.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ServiceType.cpp deleted file mode 100644 index 819a832443..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ServiceType.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/model/ServiceType.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - - // Constructor - ServiceType::ServiceType(ComponentType* componentType, const string& name, - Interface* intface, Interface* callbackInterface) - : Contract(intface, callbackInterface), - componentType(componentType), name(name) - { - logentry(); - } - - // Destructor - ServiceType::~ServiceType() - { - logentry(); - } - - void ServiceType::setBinding(Binding* binding) - { - this->binding = binding; - } - - Binding* ServiceType::getBinding() const - { - return binding; - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ServiceType.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ServiceType.h deleted file mode 100644 index 08a76e3b3f..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/ServiceType.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_servicetype_h -#define tuscany_sca_model_servicetype_h - -#include <string> - -#include "tuscany/sca/model/Contract.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - class ComponentType; - class Binding; - class Interface; - - /** - * Represents a service type. Services are used to publish services provided by - * implementations, so that they are addressable by other components. - */ - class ServiceType : public Contract - { - public: - - /** - * Constructor. - * @param componentType The component type on which this service is defined. - * @param name The name of the service. - */ - SCA_API ServiceType(ComponentType* componentType, const std::string& name, - Interface* intface, Interface* callbackInterface); - - /** - * Destructor. - */ - SCA_API virtual ~ServiceType(); - - /** - * Returns the component type on which this service is defined. - * @return The component type on which this service is defined. - */ - SCA_API ComponentType* getComponentType() const { return componentType; } - - /** - * Returns the name of the service type. - * @return The name of the service type - */ - SCA_API const std::string& getName() const { return name; } - - /** - * Returns the binding supported by this service type. - * @return The binding supported by this service type - */ - SCA_API Binding* getBinding() const; - - /** - * Sets the binding supported by this service type. - * @param binding the binding supported by this service type - */ - SCA_API void setBinding(Binding* binding); - - private: - - /** - * The component type on which this service is defined. - */ - ComponentType* componentType; - - /** - * The name of the service type. - */ - std::string name; - - /** - * The binding supported by this service - */ - Binding* binding; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_servicetype_h - diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp deleted file mode 100644 index 5a98db3cdd..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp +++ /dev/null @@ -1,462 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/model/WSDLDefinition.h" -#include "tuscany/sca/model/WSDLOperation.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/core/Exceptions.h" - -using namespace std; -using namespace commonj::sdo; -using namespace tuscany::sca::util; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - // Constructor - WSDLDefinition::WSDLDefinition(DataObjectPtr wsdlModel) - { - logentry(); - - wsdlModels.insert(wsdlModels.end(), wsdlModel); - } - - WSDLDefinition::~WSDLDefinition() - { - logentry(); - } - - /// - /// The namespace of the service and other definitions defined in this wsdl definition - string WSDLDefinition::getNamespace() - { - logentry(); - return wsdlModels[0]->getCString("targetNamespace"); - } - - void WSDLDefinition::addWSDLModel(DataObjectPtr wsdlModel) - { - logentry(); - wsdlModels.insert(wsdlModels.end(), wsdlModel); - } - - /// - /// Find the operation defined in this wsdl - /// - const WSDLOperation& WSDLDefinition::findOperation(const string& serviceName, - const string& portName, - const string& operationName) - { - logentry(); - - string message; - - string operationKey = serviceName+"#"+portName+"#"+operationName; - OPERATION_MAP::iterator iter = operationMap.find(operationKey); - if (iter != operationMap.end()) - { - return iter->second; - } - - // Find the service - DataObjectPtr service = findService(serviceName); - if (!service) - { - // Service not found - message = "Unable to find service "; - message = message + serviceName; - message = message + " in the WSDL definition"; - throwException(SystemConfigurationException, message.c_str()); - } - else - { - - - // Found the service - DataObjectList& portList = service->getList("port"); - for (unsigned int j=0; j<portList.size();j++) - { - string portListName(portList[j]->getCString("name")); - if (portListName.compare(portName) == 0) - { - // found port - // Add address at this point - string targetAddress(portList[j]->getCString("address/location")); - - // find operation by traversing the binding, portType then operation - string wsBindingName(portList[j]->getCString("binding")); - - DataObjectPtr wsBinding = findBinding(wsBindingName); - if (!wsBinding) - { - message = "Unable to find binding "; - message = message + wsBindingName; - message = message + " in the WSDL definition"; - throwException(SystemConfigurationException, message.c_str()); - } - - - string soapAction = ""; - bool documentStyle = true; - bool wrappedStyle = true; - bool useEncoded = false; - WSDLOperation::soapVersion soapVer = WSDLOperation::SOAP11; - - // Find the binding operation - DataObjectList& bindingOperationList = wsBinding->getList("operation"); - for (unsigned int i=0; i<bindingOperationList.size(); i++) - { - string name(bindingOperationList[i]->getCString("name")); - - if (name.compare(operationName) == 0) - { - DataObjectPtr op = bindingOperationList[i]->getDataObject("operation"); - string opType = op->getType().getURI(); - if (opType == "http://schemas.xmlsoap.org/wsdl/soap12/") - { - soapVer = WSDLOperation::SOAP12; - } - - // Get the soapAction - soapAction = bindingOperationList[i]->getCString("operation/soapAction"); - - // Get the style - string style = bindingOperationList[i]->getCString("operation/style"); - if (style == "") - { - style = wsBinding->getCString("binding/style"); - } - if (style != "document") - { - documentStyle = false; - wrappedStyle = false; - } - - // get the use - string use = bindingOperationList[i]->getCString("input/body/use"); - if (use == "encoded") - { - useEncoded = true; - } - } - } - - - // TODO - get the style from the binding or operation???? - - // Found the binding, get the portType - string wsPortTypeName(wsBinding->getCString("type")); - DataObjectPtr wsPortType = findPortType(wsPortTypeName); - if (!wsPortType) - { - message = "Unable to find PortType "; - message = message + wsPortTypeName; - message = message + " in the WSDL definition"; - throwException(SystemConfigurationException, message.c_str()); - } - - //Utils::printDO(wsPortType); - - // Found the portType, find the operation - DataObjectList& operationList = wsPortType->getList("operation"); - for (unsigned int k=0; k< operationList.size(); k++) - { - string opName(operationList[k]->getCString("name")); - if( opName.compare(operationName) == 0) - { - // Found the operation - - // Find the type of the request message - string inputMessageType = string(operationList[k]->getCString("input/message")); - - DataObjectPtr wsMessageIn = findMessage(inputMessageType); - if (!wsMessageIn) - { - message = "Unable to find message "; - message = message + inputMessageType; - message = message + " in the WSDL definition"; - throwException(SystemConfigurationException, message.c_str()); - } - - string requestType(wsMessageIn->getList("part")[0]->getCString("element")); - - // Find the type of the response message - string outputMessageType = string(operationList[k]->getCString("output/message")); - - DataObjectPtr wsMessageOut = findMessage(outputMessageType); - if (!wsMessageOut) - { - message = "Unable to find message "; - message = message + outputMessageType; - message = message + " in the WSDL definition"; - throwException(SystemConfigurationException, message.c_str()); - } - - string responseType(wsMessageOut->getList("part")[0]->getCString("element")); - - WSDLOperation& wsdlOp = operationMap[operationKey]; - wsdlOp.setOperationName(operationName); - wsdlOp.setSoapAction(soapAction); - wsdlOp.setEndpoint(targetAddress); - wsdlOp.setSoapVersion(soapVer); - wsdlOp.setDocumentStyle(documentStyle); - wsdlOp.setWrappedStyle(wrappedStyle); - wsdlOp.setEncoded(useEncoded); - wsdlOp.setInputType(requestType); - wsdlOp.setOutputType(responseType); - return wsdlOp; - } - - } - - message = "Unable to find Operation "; - message = message + operationName; - message = message + " in the WSDL definition"; - throwException(SystemConfigurationException, message.c_str()); - } - } - // cannot find the port - message = "Unable to find port "; - message = message + portName; - message = message + " in the WSDL definition"; - throwException(SystemConfigurationException, message.c_str()); - } - - } - - /// - /// Find the operation defined in this wsdl - /// - const WSDLOperation& WSDLDefinition::findOperation(const string& portTypeName, - const string& operationName) - { - logentry(); - - string operationKey = portTypeName+"#"+operationName; - OPERATION_MAP::iterator iter = operationMap.find(operationKey); - if (iter != operationMap.end()) - { - return iter->second; - } - - string soapAction = getNamespace() + "#" + operationName; - bool documentStyle = true; - bool wrappedStyle = true; - bool useEncoded = false; - WSDLOperation::soapVersion soapVer = WSDLOperation::SOAP11; - - // Get the portType - DataObjectPtr wsPortType = findPortType(portTypeName); - if (!wsPortType) - { - string message = "Unable to find PortType "; - message = message + portTypeName; - message = message + " in the WSDL definition"; - throwException(SystemConfigurationException, message.c_str()); - } - - // Found the portType, find the operation - DataObjectList& operationList = wsPortType->getList("operation"); - for (unsigned int k=0; k< operationList.size(); k++) - { - string opName(operationList[k]->getCString("name")); - if( opName.compare(operationName) == 0) - { - // Found the operation - - // Find the type of the request message - string inputMessageType = string(operationList[k]->getCString("input/message")); - - DataObjectPtr wsMessageIn = findMessage(inputMessageType); - if (!wsMessageIn) - { - string message = "Unable to find message "; - message = message + inputMessageType; - message = message + " in the WSDL definition"; - throwException(SystemConfigurationException, message.c_str()); - } - - string requestType(wsMessageIn->getList("part")[0]->getCString("element")); - - // Find the type of the response message - string outputMessageType = string(operationList[k]->getCString("output/message")); - - DataObjectPtr wsMessageOut = findMessage(outputMessageType); - if (!wsMessageOut) - { - string message = "Unable to find message "; - message = message + outputMessageType; - message = message + " in the WSDL definition"; - throwException(SystemConfigurationException, message.c_str()); - } - - string responseType(wsMessageOut->getList("part")[0]->getCString("element")); - - WSDLOperation& wsdlOp = operationMap[operationKey]; - wsdlOp.setOperationName(operationName); - wsdlOp.setSoapAction(soapAction); - wsdlOp.setEndpoint(""); - wsdlOp.setSoapVersion(soapVer); - wsdlOp.setDocumentStyle(documentStyle); - wsdlOp.setWrappedStyle(wrappedStyle); - wsdlOp.setEncoded(useEncoded); - wsdlOp.setInputType(requestType); - wsdlOp.setOutputType(responseType); - return wsdlOp; - } - } - - string message = "Unable to find Operation "; - message = message + operationName; - message = message + " in the WSDL definition"; - throwException(SystemConfigurationException, message.c_str()); - - } - - /// - /// Find a service - /// - DataObjectPtr WSDLDefinition::findService(const string& serviceName) - { - logentry(); - - DataObjectPtr service = 0; - - // Find the binding - for (unsigned int m = 0; m < wsdlModels.size(); m++) - { - DataObjectList& serviceList = wsdlModels[m]->getList("service"); - for (unsigned int i=0; i<serviceList.size(); i++) - { - string name(serviceList[i]->getCString("name")); - - if (name.compare(serviceName) == 0) - { - return serviceList[i]; - } - } - } - - return service; - } - - - /// - /// Find a named binding - /// - DataObjectPtr WSDLDefinition::findBinding(const string& bindingName) - { - logentry(); - - DataObjectPtr binding = 0; - string uri; - string name; - - Utils::rTokeniseString(":", bindingName, uri, name); - - // Find the binding - for (unsigned int m = 0; m < wsdlModels.size(); m++) - { - DataObjectList& bindingList = wsdlModels[m]->getList("binding"); - for (unsigned int i=0; i<bindingList.size(); i++) - { - string nameBinding(bindingList[i]->getCString("name")); - - if (nameBinding.compare(name) == 0) - { - return bindingList[i]; - } - } - } - - return binding; - } - - /// - /// Find a named portType - /// - DataObjectPtr WSDLDefinition::findPortType(const string& portTypeName) - { - logentry(); - - DataObjectPtr portType = 0; - string uri; - string name; - - Utils::rTokeniseString(":", portTypeName, uri, name); - - // Find the binding - for (unsigned int m = 0; m < wsdlModels.size(); m++) - { - DataObjectList& portTypeList = wsdlModels[m]->getList("portType"); - for (unsigned int i=0; i<portTypeList.size(); i++) - { - string namePortType(portTypeList[i]->getCString("name")); - - if (namePortType.compare(name) == 0) - { - return portTypeList[i]; - } - } - } - - return portType; - } - - /// - /// Find a named message - /// - DataObjectPtr WSDLDefinition::findMessage(const string& messageName) - { - logentry(); - - DataObjectPtr message = 0; - string uri; - string name; - - Utils::rTokeniseString(":", messageName, uri, name); - - // Find the binding - for (unsigned int m = 0; m < wsdlModels.size(); m++) - { - DataObjectList& messageList = wsdlModels[m]->getList("message"); - for (unsigned int i=0; i<messageList.size(); i++) - { - string nameMessage(messageList[i]->getCString("name")); - - if (nameMessage.compare(name) == 0) - { - return messageList[i]; - } - } - } - - return message; - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/WSDLDefinition.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/WSDLDefinition.h deleted file mode 100644 index 9be553205a..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/WSDLDefinition.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_wsdldefinition_h -#define tuscany_sca_model_wsdldefinition_h - -#include <string> -#include <map> -#include <vector> - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/export.h" -#include "tuscany/sca/model/WSDLOperation.h" - - -namespace tuscany -{ - namespace sca - { - namespace model - { - - class WSDLOperation; - - /** - * Holds information about a WSDL definition loaded into the runtime. - */ - class WSDLDefinition - { - public: - /** - * Constructor. - * @param wsdlModel The data object representing the WSDL document - * defining a web service. - */ - SCA_API WSDLDefinition(commonj::sdo::DataObjectPtr wsdlModel); - - /** - * Destructor. - */ - SCA_API virtual ~WSDLDefinition(); - - /** - * Returns the target namespace of the WSDL definitions. - * @return The target namespace. - */ - SCA_API std::string getNamespace(void); - - /** - * Add a WSDL model. - */ - SCA_API void addWSDLModel(commonj::sdo::DataObjectPtr wsdlModel); - - /** - * Find an operation in the WSDL definitions. - * @param serviceName The name of the service on which this - * operation is defined. - * @param portName The name of the port in the service to - * use. - * @param operationName The name of the operation to find. - * @return The operation if found. Exception thrown if not found. - */ - SCA_API const WSDLOperation& findOperation(const std::string& serviceName, - const std::string& portName, - const std::string& operationName); - - /** - * Find an operation in the WSDL definitions. - * @param portTypeName The name of the portType on which this - * operation is defined. - * @param operationName The name of the operation to find. - * @return The operation if found. Exception thrown if not found. - */ - SCA_API const WSDLOperation& findOperation(const std::string& portTypeName, - const std::string& operationName); - - private: - - /** - * Find a service in the wsdl definition. - * @param serviceName The name of the service. - * @return A data object describing the service if found, otherwise - * a 0 if not found. - */ - commonj::sdo::DataObjectPtr findService(const std::string& serviceName); - - /** - * Find a binding in the wsdl definition. - * @param bindingName The name of the binding to find. - * @return A data object describing the binding if found, otherwise - * a 0 if not found. - */ - commonj::sdo::DataObjectPtr findBinding(const std::string& bindingName); - - /** - * Find a portType in the wsdl definition. - * @param portTypeName The name of the portType. - * @return A data object describing the portType if found, otherwise - * a 0 if not found. - */ - commonj::sdo::DataObjectPtr findPortType(const std::string& portTypeName); - - /** - * Find a message in the wsdl definition. - * @param messageName The name of the message. - * @return A data object describing the message if found, otherwise - * a 0 if not found. - */ - commonj::sdo::DataObjectPtr findMessage(const std::string& messageName); - - - /** - * The data object representation of the WSDL document. - */ - typedef std::vector<commonj::sdo::DataObjectPtr> MODEL_VECTOR; - MODEL_VECTOR wsdlModels; - - typedef std::map<std::string, WSDLOperation> OPERATION_MAP; - OPERATION_MAP operationMap; - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_wsdldefinition_h - diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/WSDLInterface.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/WSDLInterface.cpp deleted file mode 100644 index 5fa45a9967..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/WSDLInterface.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/model/WSDLInterface.h" - -using namespace std; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - const string WSDLInterface::typeQName("http://www.osoa.org/xmlns/sca/1.0#WSDLPortType"); - - // Constructor - WSDLInterface::WSDLInterface( - const string& qname, bool remotable, bool conversational) - : Interface(remotable, conversational) - { - logentry(); - parse(qname); - } - - void WSDLInterface::parse(const string& qname) - { - logentry(); - - // PortType is of the form: <wsdl-namepace-uri>#wsdl.interface(<portType-name>) - string::size_type hash = qname.find("#"); - if (hash != string::npos) - { - // Found a hash - - // Namepace is the part before the # - namespaceURI = qname.substr(0, hash); - - if ( (hash+1) < qname.length()) - { - // Check the next part is wsdl.interface( - int ending = hash+16; - string check = qname.substr(hash+1, 15); - if (check.compare("wsdl.interface(") == 0) - { - // Find the matching ) - int endBracket = qname.find(")",ending); - if (endBracket-1 > ending+1) - { - name = qname.substr(ending, endBracket-ending); - } - else - { - // Nothing between the () - name = ""; - } - } - else - { - // not the correct characters after the #, ignore the rest - name = ""; - } - - } - else - { - // Nothing after the hash - name = ""; - } - } - else - { - // No hash at all - namespaceURI = qname; - name = ""; - } - } - - - WSDLInterface::~WSDLInterface() - { - logentry(); - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/WSDLInterface.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/WSDLInterface.h deleted file mode 100644 index b071dd221e..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/WSDLInterface.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_wsdlinterface_h -#define tuscany_sca_model_wsdlinterface_h - -#include <string> - -#include "tuscany/sca/model/Interface.h" - -namespace tuscany -{ - namespace sca - { - namespace model - { - /** - * Holds information about an interface described using a WSDL - * port type. - */ - class WSDLInterface : public Interface - { - - public: - /** - * Constuctor. - * @param interfaceName Name of the WSDL interface. - */ - WSDLInterface(const std::string& qname, bool remotable, bool conversational); - - /** - * Destructor. - */ - virtual ~WSDLInterface(); - - /** - * Returns the WSDL namespace - */ - std::string getNamespaceURI() const { return namespaceURI; } - - /** - * Returns the interface name - */ - std::string getName() const { return name; } - - /** - * return the QName of the schema type for this interface type - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#interface.cpp") - */ - virtual const std::string& getInterfaceTypeQName() { return typeQName; }; - - /** - * The QName of the schema type for this interface type. - */ - SCA_API static const std::string typeQName; - - private: - - /** - * Parse the WSDL qname - */ - void parse(const std::string& qname); - - /** - * WSDL namespace. - */ - std::string namespaceURI; - - /** - * Name of the WSDL interface. - */ - std::string name; - - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_cpp_wsdlinterface_h - diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/WSDLOperation.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/WSDLOperation.cpp deleted file mode 100644 index 12a0b61fd2..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/WSDLOperation.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/model/WSDLOperation.h" -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" - -using namespace std; -using namespace tuscany::sca::util; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - - // Constructor - WSDLOperation::WSDLOperation() - { - logentry(); - } - - WSDLOperation::~WSDLOperation() - { - logentry(); - } - - - void WSDLOperation::setInputType(const string& inputType) - { - logentry(); - Utils::tokeniseQName(inputType, inputTypeUri, inputTypeName); - } - - void WSDLOperation::setOutputType(const string& outputType) - { - logentry(); - Utils::tokeniseQName(outputType, outputTypeUri, outputTypeName); - } - - } // End namespace model - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/WSDLOperation.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/WSDLOperation.h deleted file mode 100644 index 874da80450..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/WSDLOperation.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_wsdloperation_h -#define tuscany_sca_model_wsdloperation_h - -#include <string> - -#include "commonj/sdo/SDO.h" - -#include "tuscany/sca/export.h" - - -namespace tuscany -{ - namespace sca - { - namespace model - { - - /** - * Represents a single.,bound WSDL defined operation. - * This class includes information from the soapBinding - * in addition to the WSDL definition of the operation. - */ - class WSDLOperation - { - public: - /** - * Constructor. - * @param operation The name of the operation. - * @param soapAction The soapAction associated with this operation - * in the SOAP binding of the operation. - * @param endpoint The endpoint address of the operation. - * @param responseName The name of the response message. - */ - SCA_API WSDLOperation(); - - /** - * Destructor. - */ - SCA_API virtual ~WSDLOperation(); - - /** - * Return the name of the operation for use when serializing an - * outgoing message. - * @return The name of the element in the request message. - */ - SCA_API const std::string& getOperationName() const {return operationName;} - SCA_API void setOperationName(const std::string& opName) {operationName = opName;} - - /** - * The soap action string for this operation. - * @return The soap action. - */ - SCA_API const std::string& getSoapAction() const {return soapAction;} - SCA_API void setSoapAction(const std::string& soapAct) {soapAction = soapAct;} - - /** - * Return the endpoint address for the target web service. - * @return The endpoint address. - */ - SCA_API const std::string& getEndpoint() const {return endpoint;} - SCA_API void setEndpoint(const std::string& ep) {endpoint = ep;} - - enum soapVersion - { - SOAP11, - SOAP12 - }; - - SCA_API void setSoapVersion(soapVersion ver) {soapVer = ver;} - SCA_API soapVersion getSoapVersion() const {return soapVer;} - - SCA_API void setDocumentStyle(bool docStyle) {documentStyle = docStyle;} - SCA_API bool isDocumentStyle() const {return documentStyle;} - - SCA_API void setWrappedStyle(bool wrapStyle) {wrappedStyle = wrapStyle;} - SCA_API bool isWrappedStyle() const {return wrappedStyle;} - - SCA_API void setEncoded(bool enc) {encoded = enc;} - SCA_API bool isEncoded() const {return encoded;} - - - SCA_API void setInputType(const std::string& inputType); - SCA_API const std::string& getInputTypeUri() const {return inputTypeUri;} - SCA_API const std::string& getInputTypeName() const {return inputTypeName;} - SCA_API void setOutputType(const std::string& outputType); - SCA_API const std::string& getOutputTypeUri() const {return outputTypeUri;} - SCA_API const std::string& getOutputTypeName() const {return outputTypeName;} - - private: - /** - * The name of the operation for use when serializing an - * outgoing message. - */ - std::string operationName; - - /** - * The soap action string for this operation. - */ - std::string soapAction; - - /** - * The endpoint address of the target web service. - */ - std::string endpoint; - - bool documentStyle; - bool wrappedStyle; - bool encoded; - soapVersion soapVer; - - std::string inputTypeUri; - std::string inputTypeName; - - std::string outputTypeUri; - std::string outputTypeName; - - commonj::sdo::DataObjectPtr inputMessage; - commonj::sdo::DataObjectPtr outputMessage; - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_wsdloperation_h - diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Wire.cpp b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Wire.cpp deleted file mode 100644 index 03f475af09..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Wire.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#include "tuscany/sca/util/Logging.h" -#include "tuscany/sca/util/Utils.h" -#include "tuscany/sca/model/Wire.h" - -using namespace tuscany::sca::util; - -namespace tuscany -{ - namespace sca - { - namespace model - { - - // Constructor - Wire::Wire(const std::string& source, const std::string& targ) - { - logentry(); - - Utils::tokeniseUri(source, sourceComponent, sourceReference); - target = targ; - } - - Wire::~Wire() - { - logentry(); - } - - } // End namespace model - - - } // End namespace sca -} // End namespace tuscany diff --git a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Wire.h b/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Wire.h deleted file mode 100644 index ab136e9109..0000000000 --- a/tags/native-sca-1.0.incubating-M3-RC4/runtime/core/src/tuscany/sca/model/Wire.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* $Rev$ $Date$ */ - -#ifndef tuscany_sca_model_wire_h -#define tuscany_sca_model_wire_h - -#include <string> - -namespace tuscany -{ - namespace sca - { - namespace model - { - /** - * Information about a wire in the model. - */ - class Wire - { - public: - - /** - * Constructor. - * @param source The source of the wire. Either the component and - * reference name (optional) or an entry point. - * @param target The target of the wire. Either a component and service - * service name (optional) or an external sevice. - */ - SCA_API Wire(const std::string& source, const std::string& target); - - /** - * Destructor. - */ - SCA_API virtual ~Wire(); - - /** - * Get the component name defined by the source of the wire. - * @return The component name which is the source of the wire. - */ - SCA_API const std::string& getSourceComponent() const { return sourceComponent; } - - /** - * Get the reference name defined by the source of the wire. - * @return The reference name which is the source of the wire. - */ - SCA_API const std::string& getSourceReference() const { return sourceReference; } - - /** - * Get the target uri defined by the target of the wire. - * @return The target uri which is the source of the wire. - */ - SCA_API const std::string& getTarget() { return target; } - - private: - /** - * The source component of the wire. - */ - std::string sourceComponent; - - /** - * The source reference of the wire. - */ - std::string sourceReference; - - /** - * The target uri of the wire. - */ - std::string target; - }; - - } // End namespace model - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_model_wire_h - |