Return-Path: Delivered-To: apmail-ws-tuscany-commits-archive@locus.apache.org Received: (qmail 32510 invoked from network); 12 Oct 2006 11:08:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Oct 2006 11:08:09 -0000 Received: (qmail 48974 invoked by uid 500); 12 Oct 2006 11:08:08 -0000 Delivered-To: apmail-ws-tuscany-commits-archive@ws.apache.org Received: (qmail 48953 invoked by uid 500); 12 Oct 2006 11:08:08 -0000 Mailing-List: contact tuscany-commits-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: tuscany-dev@ws.apache.org Delivered-To: mailing list tuscany-commits@ws.apache.org Received: (qmail 48944 invoked by uid 99); 12 Oct 2006 11:08:08 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Oct 2006 04:08:08 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Oct 2006 04:08:07 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 20ABB1A981A; Thu, 12 Oct 2006 04:07:47 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r463188 - in /incubator/tuscany/cpp/sca: projectsvc7/tuscany_sca/tuscany_sca_python/ runtime/extensions/python/src/tuscany/sca/python/ Date: Thu, 12 Oct 2006 11:07:46 -0000 To: tuscany-commits@ws.apache.org From: ajborley@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061012110747.20ABB1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: ajborley Date: Thu Oct 12 04:07:45 2006 New Revision: 463188 URL: http://svn.apache.org/viewvc?view=rev&rev=463188 Log: Removed use of osoa::sca namespace for exceptions in python extension Added: incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceRuntimeException.h (with props) Modified: incubator/tuscany/cpp/sca/projectsvc7/tuscany_sca/tuscany_sca_python/tuscany_sca_python.vcproj incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.cpp incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp Modified: incubator/tuscany/cpp/sca/projectsvc7/tuscany_sca/tuscany_sca_python/tuscany_sca_python.vcproj URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/projectsvc7/tuscany_sca/tuscany_sca_python/tuscany_sca_python.vcproj?view=diff&rev=463188&r1=463187&r2=463188 ============================================================================== --- incubator/tuscany/cpp/sca/projectsvc7/tuscany_sca/tuscany_sca_python/tuscany_sca_python.vcproj (original) +++ incubator/tuscany/cpp/sca/projectsvc7/tuscany_sca/tuscany_sca_python/tuscany_sca_python.vcproj Thu Oct 12 04:07:45 2006 @@ -150,6 +150,9 @@ RelativePath="..\..\..\runtime\extensions\python\src\tuscany\sca\python\PythonServiceProxy.h"> + + - - - - Modified: incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.cpp URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.cpp?view=diff&rev=463188&r1=463187&r2=463188 ============================================================================== --- incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.cpp (original) +++ incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceProxy.cpp Thu Oct 12 04:07:45 2006 @@ -21,7 +21,7 @@ #include "tuscany/sca/python/PythonServiceProxy.h" #include "tuscany/sca/util/Logging.h" -#include "osoa/sca/ServiceRuntimeException.h" +#include "tuscany/sca/python/PythonServiceRuntimeException.h" #include "tuscany/sca/core/SCARuntime.h" #include "tuscany/sca/model/Reference.h" #include "tuscany/sca/model/ReferenceType.h" @@ -35,7 +35,6 @@ #include "tuscany/sca/python/model/PythonImplementation.h" #include "tuscany/sca/python/model/PythonReferenceBinding.h" -using namespace osoa::sca; using namespace tuscany::sca::model; namespace tuscany Added: incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceRuntimeException.h URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceRuntimeException.h?view=auto&rev=463188 ============================================================================== --- incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceRuntimeException.h (added) +++ incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceRuntimeException.h Thu Oct 12 04:07:45 2006 @@ -0,0 +1,100 @@ +/* + * 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_pythonserviceruntimeexception_h +#define tuscany_sca_python_pythonserviceruntimeexception_h + +#include "export.h" + +#include "tuscany/sca/util/Exceptions.h" +using tuscany::sca::TuscanyRuntimeException; +namespace tuscany +{ + namespace sca + { + namespace python + { + /** + * Exception to represent a failure in a Python call. + */ + class SCA_PYTHON_API PythonServiceRuntimeException : public TuscanyRuntimeException + { + public: + PythonServiceRuntimeException( + const char *name="PythonServiceRuntimeException", + severity_level sev=Severe, + const char* msg_text="") + : TuscanyRuntimeException(name, sev, msg_text) + { + } + }; // End PythonServiceRuntimeException class definition + + /** + * The target of a wire cannot be found, or the reference has not been + * configured. + */ + class SCA_PYTHON_API PythonServiceNotFoundException: public PythonServiceRuntimeException + { + public: + PythonServiceNotFoundException(const char* msg) + : PythonServiceRuntimeException("PythonServiceNotFoundException", Error, + msg) + { + } + private: + }; // End PythonServiceNotFoundException class definition + + + /** + * There is no current component (for example, if a non-SCA component + * tries to get the current ComponentContext). + */ + class SCA_PYTHON_API PythonComponentContextException: public PythonServiceRuntimeException + { + public: + PythonComponentContextException(const char* msg) + : PythonServiceRuntimeException("PythonComponentContextException", Error, + msg) + { + } + private: + }; // End PythonComponentContextException class definition + + /** + * There is no current component (for example, if a non-SCA component + * tries to get the current ComponentContext). + */ + class SCA_PYTHON_API PythonComponentInvocationException: public PythonServiceRuntimeException + { + public: + PythonComponentInvocationException(const char* msg) + : PythonServiceRuntimeException("ComponentInvocationException", Error, + msg) + { + } + private: + }; // End PythonComponentInvocationException class definition + + } // End namespace python + } // End namespace sca +} // End namespace tuscany + +#endif // tuscany_sca_python_pythonserviceruntimeexception_h Propchange: incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceRuntimeException.h ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceRuntimeException.h ------------------------------------------------------------------------------ svn:keywords = Rev Date Modified: incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp?view=diff&rev=463188&r1=463187&r2=463188 ============================================================================== --- incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp (original) +++ incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp Thu Oct 12 04:07:45 2006 @@ -19,7 +19,7 @@ /* $Rev$ $Date$ */ -#include "osoa/sca/ServiceRuntimeException.h" +#include "tuscany/sca/python/PythonServiceRuntimeException.h" #include "tuscany/sca/python/PythonServiceWrapper.h" #include "tuscany/sca/util/Logging.h" @@ -31,8 +31,6 @@ #include "tuscany/sca/core/SCARuntime.h" #include "tuscany/sca/python/model/PythonImplementation.h" -using namespace osoa::sca; - #include "commonj/sdo/SDO.h" using namespace commonj::sdo; @@ -81,7 +79,7 @@ if (!impl) { string msg = "Component " + component->getName() + " has no implementation defined"; - throw ServiceNotFoundException(msg.c_str()); + throw PythonServiceNotFoundException(msg.c_str()); } LOGINFO_1(3,"PythonServiceWrapper::constructor module %s", impl->getModule().c_str()); @@ -131,7 +129,7 @@ } string msg = "Failed to load module named " + impl->getModule(); LOGERROR(0, msg.c_str()); - throw ComponentContextException(msg.c_str()); + throw PythonComponentContextException(msg.c_str()); } //else //{ @@ -182,7 +180,7 @@ } string msg = "Cannot find class named " + className + " in Python module"; LOGERROR(0, msg.c_str()); - throw new ComponentInvocationException(msg.c_str()); + throw new PythonComponentInvocationException(msg.c_str()); } pClassInstance = PyInstance_New(pClass, NULL, NULL); @@ -195,7 +193,7 @@ } string msg = "Could not create new instance of class named " + className + " in Python module"; LOGERROR(0, msg.c_str()); - throw new ComponentInvocationException(msg.c_str()); + throw new PythonComponentInvocationException(msg.c_str()); } Py_XDECREF(pClass); } @@ -294,7 +292,7 @@ // Can't get the function from the class or module - throw exception string msg = "Python module or class instance has not been created"; LOGERROR(0, msg.c_str()); - throw new ComponentInvocationException(msg.c_str()); + throw new PythonComponentInvocationException(msg.c_str()); } if (pFunc && PyCallable_Check(pFunc)) @@ -375,7 +373,7 @@ pValue = PyString_FromString((*(string*)parm.getValue()).c_str()); break; } - default: throw new ComponentInvocationException("Operation parameter type not supported"); + default: throw new PythonComponentInvocationException("Operation parameter type not supported"); } if (!pValue) @@ -389,7 +387,7 @@ string msg = "Error converting parameter into Python type"; LOGERROR(0, msg.c_str()); - throw new ComponentInvocationException(msg.c_str()); + throw new PythonComponentInvocationException(msg.c_str()); } //printPyObject("Param value", pValue); @@ -766,7 +764,7 @@ } string msg = "Error whilst calling Python module"; LOGERROR(0, msg.c_str()); - throw new ComponentInvocationException(msg.c_str()); + throw new PythonComponentInvocationException(msg.c_str()); } } else @@ -777,7 +775,7 @@ } string msg = "Cannot find the operation named " + operation.getName() + " in the Python module"; LOGERROR(0, msg.c_str()); - throw new ComponentInvocationException(msg.c_str()); + throw new PythonComponentInvocationException(msg.c_str()); } Py_XDECREF(pFunc); --------------------------------------------------------------------- To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org For additional commands, e-mail: tuscany-commits-help@ws.apache.org