diff options
Diffstat (limited to 'tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model')
8 files changed, 0 insertions, 646 deletions
diff --git a/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp b/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp deleted file mode 100644 index 413d87173d..0000000000 --- a/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.cpp +++ /dev/null @@ -1,87 +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/python/model/PythonImplementation.h" -#include "tuscany/sca/python/model/PythonServiceBinding.h" -#include "tuscany/sca/python/model/PythonReferenceBinding.h" -#include "tuscany/sca/model/Component.h" -#include "tuscany/sca/model/Service.h" -#include "tuscany/sca/model/Reference.h" -#include "tuscany/sca/util/Utils.h" - -namespace tuscany -{ - namespace sca - { - - namespace python - { - - // Constructor - PythonImplementation::PythonImplementation( - Composite* composite, const string& module, const string& modulePath, const string& className, Scope scope) - : ComponentType(composite, modulePath + "/" + module), - module(module), modulePath(modulePath), className(className), scope(scope) - { - LOGENTRY(1,"PythonImplementation::constructor"); - LOGEXIT(1,"PythonImplementation::constructor"); - } - - PythonImplementation::~PythonImplementation() - { - LOGENTRY(1,"PythonImplementation::destructor"); - LOGEXIT(1,"PythonImplementation::destructor"); - } - - void PythonImplementation::initializeComponent(Component* component) - { - LOGENTRY(1,"PythonImplementation::initializeComponent"); - ComponentType::initializeComponent(component); - - // Create Python 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; - PythonServiceBinding* binding = new PythonServiceBinding(service); - service->setBinding(binding); - iter++; - } - - // Create Python bindings for all the references - const Component::REFERENCE_MAP& references = component->getReferences(); - Component::REFERENCE_MAP::const_iterator refiter = references.begin(); - for (int ri=0; ri< references.size(); ri++) - { - Reference *reference = refiter->second; - PythonReferenceBinding* binding = new PythonReferenceBinding(reference); - reference->setBinding(binding); - refiter++; - } - - LOGEXIT(1,"PythonImplementation::initializeComponent"); - } - - } // End namespace python - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h b/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h deleted file mode 100644 index 6d4cece5fd..0000000000 --- a/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonImplementation.h +++ /dev/null @@ -1,129 +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_python_model_pythonimplementation_h -#define tuscany_sca_python_model_pythonimplementation_h -#include "tuscany/sca/model/ComponentType.h" - -#include <map> -using std::map; -#include <string> -using std::string; - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace python - { - /** - * Holds information about an SCA implementation written in Python - */ - class PythonImplementation : public ComponentType - { - - public: - /** - * Scope of the component implementation. - */ - enum Scope - { - COMPOSITE, - STATELESS - }; - - /** - * Constructor. - * @param composite The composite containing this implementation. - * @param module Name of the module. - * @param modulePath Path to the module (could be a blank string - * if this is not specified). - * @param className Name of the class in the module (could be a blank string - * if this is not specified). - */ - PythonImplementation(Composite* composite, const string& module, const string& modulePath, const string& className, Scope scope); - - /** - * Destructor - */ - virtual ~PythonImplementation(); - - /** - * Initialize a component of this type. - * @param component The component to initialize. - */ - virtual void initializeComponent(Component* component); - - /** - * Returns the name of the module. - * @return The name of the module. - */ - const string& getModule() const { return module; } - - /** - * Get the header path. - * @return The pathe element of the header. - */ - const string& getModulePath() const { return modulePath; } - - /** - * Get the name of the class. - * @return The class name if specified. - */ - const string& getClass() const { return className; } - - /** - * Returns the implementation scope - */ - Scope getScope() const { return scope; } - - private: - - /** - * Name of the module. - */ - string module; - - /** - * Path to the module. - */ - string modulePath; - - /** - * Name of the class in the header file declaring the implementation. - * May be an empty string if not set in the SCDL file. - */ - string className; - - /** - * The implementation scope - */ - Scope scope; - }; - - } // End namespace python - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_python_model_pythonimplementation_h diff --git a/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.cpp b/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.cpp deleted file mode 100644 index 6836158e0d..0000000000 --- a/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.cpp +++ /dev/null @@ -1,52 +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/python/export.h" -#include "tuscany/sca/python/model/PythonInterface.h" - - -namespace tuscany -{ - namespace sca - { - namespace python - { - const string PythonInterface::typeQName("http://www.osoa.org/xmlns/sca/1.0#PythonInterface"); - - // Constructor - PythonInterface::PythonInterface( - bool remotable, - bool conversational) - : Interface(remotable, conversational) - { - LOGENTRY(1, "PythonInterface::constructor"); - LOGEXIT(1, "PythonInterface::constructor"); - } - - PythonInterface::~PythonInterface() - { - } - - } // End namespace python - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.h b/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.h deleted file mode 100644 index ed42a3920d..0000000000 --- a/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonInterface.h +++ /dev/null @@ -1,84 +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_python_model_pythoninterface_h -#define tuscany_sca_python_model_pythoninterface_h - -#include "tuscany/sca/python/export.h" -#include "tuscany/sca/model/Interface.h" - -#include <map> -using std::map; -#include <vector> -using std::vector; -#include <string> -using std::string; - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace python - { - /** - * Holds information about an interface described using a C++ - * header file. - */ - class PythonInterface : public Interface - { - - public: - /** - * Constuctor. - * @param scope The scope of the interface (stateless or composite). - * @param remotable True if the interface is remotable. - */ - PythonInterface( - bool remotable, - bool conversational); - - /** - * Destructor. - */ - virtual ~PythonInterface(); - - /** - * return the QName of the schema type for this interface type - * (e.g. "http://www.osoa.org/xmlns/sca/1.0#interface.cpp") - */ - const string& getInterfaceTypeQName() { return typeQName; }; - - /** - * The QName of the schema type for this interface type. - */ - SCA_PYTHON_API static const string typeQName; - - }; - - } // End namespace python - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_python_model_pythoninterface_h - diff --git a/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.cpp b/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.cpp deleted file mode 100644 index 82f5811203..0000000000 --- a/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.cpp +++ /dev/null @@ -1,59 +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/python/model/PythonReferenceBinding.h" -#include "tuscany/sca/python/PythonServiceProxy.h" - - -namespace tuscany -{ - namespace sca - { - namespace python - { - - // Constructor - PythonReferenceBinding::PythonReferenceBinding(Reference* reference) - : ReferenceBinding(reference, ""), serviceProxy(NULL) - { - } - - // Destructor - PythonReferenceBinding::~PythonReferenceBinding() - { - } - - ServiceProxy* PythonReferenceBinding::getServiceProxy() - { - return serviceProxy; - } - - void PythonReferenceBinding::configure(ServiceBinding* binding) - { - targetServiceBinding = binding; - - serviceProxy = new PythonServiceProxy(getReference()); - } - - } // End namespace python - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.h b/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.h deleted file mode 100644 index b37d261416..0000000000 --- a/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonReferenceBinding.h +++ /dev/null @@ -1,95 +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_python_model_pythonreferencebinding_h -#define tuscany_sca_python_model_pythonreferencebinding_h - -#include "tuscany/sca/model/ReferenceBinding.h" - - -#include <string> -using std::string; - -using namespace tuscany::sca::model; - -namespace tuscany -{ - namespace sca - { - namespace python - { - /** - * Information about a Python service binding for service or a reference. - */ - class PythonReferenceBinding : public ReferenceBinding - { - public: - - /** - * Constructor. - */ - PythonReferenceBinding(Reference* reference); - - /** - * Destructor. - */ - virtual ~PythonReferenceBinding(); - - /** - * Returns the type of binding. - */ - virtual string getType() { return "http://www.osoa.org/xmlns/sca/1.0#PythonImplementationBinding"; }; - - /** - * Create a proxy representing the reference to the - * client component. - */ - virtual ServiceProxy* getServiceProxy(); - - /** - * Configure this binding from a service binding. - */ - virtual void configure(ServiceBinding* serviceBinding); - - /** - * Returns the target service binding. - */ - ServiceBinding* getTargetServiceBinding() const { return targetServiceBinding; }; - - private: - - /** - * The proxy representing the reference to the client - * component. - */ - ServiceProxy* serviceProxy; - - /** - * The service binding of the target - */ - ServiceBinding* targetServiceBinding; - }; - - } // End namespace python - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_python_model_pythonreferencebinding_h diff --git a/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.cpp b/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.cpp deleted file mode 100644 index 544682c18e..0000000000 --- a/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.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/python/model/PythonServiceBinding.h" -#include "tuscany/sca/python/PythonServiceWrapper.h" - -namespace tuscany -{ - namespace sca - { - namespace python - { - - // Constructor - PythonServiceBinding::PythonServiceBinding(Service* service) - : ServiceBinding(service, "") - { - LOGENTRY(1,"PythonServiceBinding::constructor"); - serviceWrapper = new PythonServiceWrapper(service); - LOGEXIT(1,"PythonServiceBinding::constructor"); - } - - // Destructor - PythonServiceBinding::~PythonServiceBinding() - { - LOGENTRY(1,"PythonServiceBinding::destructor"); - LOGEXIT(1,"PythonServiceBinding::destructor"); - } - - ServiceWrapper* PythonServiceBinding::getServiceWrapper() - { - LOGENTRY(1,"PythonServiceBinding::getServiceWrapper"); - LOGEXIT(1,"PythonServiceBinding::getServiceWrapper"); - return (ServiceWrapper*)serviceWrapper; - } - - } // End namespace ws - } // End namespace sca -} // End namespace tuscany diff --git a/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.h b/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.h deleted file mode 100644 index f2d64b3edc..0000000000 --- a/tags/cpp-1.0-incubating-M2-final/sca/runtime/extensions/python/src/tuscany/sca/python/model/PythonServiceBinding.h +++ /dev/null @@ -1,82 +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_python_model_pythonservicebinding_h -#define tuscany_sca_python_model_pythonservicebinding_h - -#include "tuscany/sca/model/ServiceBinding.h" -using namespace tuscany::sca::model; -#include <string> -using std::string; - -namespace tuscany -{ - namespace sca - { - namespace python - { - /** - * Information about a Python service binding for service or a reference. - */ - class PythonServiceBinding : public ServiceBinding - { - public: - - /** - * Constructor. - * @param uri The uri of the binding. - * @param port The definition of the port to which the entrypoint - * or external service is to be bound. This is of the form - * "namespace"#endpoint("service"/"port") - */ - PythonServiceBinding(Service* service); - - /** - * Destructor. - */ - virtual ~PythonServiceBinding(); - - /** - * Returns the type of binding. - */ - virtual string getType() { return "http://www.osoa.org/xmlns/sca/1.0#PythonImplementationBinding"; }; - - /** - * Create a wrapper for the service configured by this - * binding. - */ - virtual ServiceWrapper* getServiceWrapper(); - - private: - - /** - * The wrapper for the service configured by this binding. - */ - ServiceWrapper* serviceWrapper; - - }; - - } // End namespace python - } // End namespace sca -} // End namespace tuscany - -#endif // tuscany_sca_python_model_pythonservicebinding_h |