You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2006/12/16 08:48:31 UTC
svn commit: r487770 [1/3] - in /incubator/tuscany/cpp/sca/runtime: core/src/
core/src/tuscany/sca/core/ core/src/tuscany/sca/model/
core/src/tuscany/sca/util/ extensions/cpp/src/osoa/sca/
extensions/cpp/src/tuscany/sca/cpp/ extensions/php/src/tuscany/s...
Author: jsdelfino
Date: Fri Dec 15 23:48:29 2006
New Revision: 487770
URL: http://svn.apache.org/viewvc?view=rev&rev=487770
Log:
Moved Exceptions.cpp to tuscany/sca/core. Changed namespace of util/*.cpp to tuscany::sca::util.
Added:
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Exceptions.cpp (with props)
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Exceptions.h (with props)
Removed:
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Exceptions.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Exceptions.h
Modified:
incubator/tuscany/cpp/sca/runtime/core/src/Makefile.am
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Operation.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ComponentType.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Composite.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.h
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Reference.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ReferenceType.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLOperation.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wire.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/DefaultLogWriter.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/DefaultLogWriter.h
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/File.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/File.h
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/FileLogWriter.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/FileLogWriter.h
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Library.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Library.h
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/LogWriter.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/LogWriter.h
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Logger.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Logger.h
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Logging.h
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/SDOUtils.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/SDOUtils.h
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Utils.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Utils.h
incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/osoa/sca/ServiceRuntimeException.h
incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPImplementationExtension.cpp
incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceProxy.h
incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/CPPServiceWrapper.h
incubator/tuscany/cpp/sca/runtime/extensions/cpp/src/tuscany/sca/cpp/TuscanyRuntime.cpp
incubator/tuscany/cpp/sca/runtime/extensions/php/src/tuscany/sca/php/PHPServiceWrapper.cpp
incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp
incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp
incubator/tuscany/cpp/sca/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.cpp
incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp
incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/RESTServiceProxy.cpp
incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp
incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp
incubator/tuscany/cpp/sca/runtime/extensions/ws/reference/axis2c/src/tuscany/sca/ws/Axis2Client.cpp
incubator/tuscany/cpp/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/Axis2Service.cpp
incubator/tuscany/cpp/sca/runtime/extensions/ws/service/axis2c/src/tuscany/sca/ws/WSServiceProxy.cpp
Modified: incubator/tuscany/cpp/sca/runtime/core/src/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/Makefile.am?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/Makefile.am (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/Makefile.am Fri Dec 15 23:48:29 2006
@@ -28,6 +28,7 @@
## ls -1 tuscany/sca/util/*.cpp tuscany/sca/extension/*.cpp tuscany/sca/model/*.cpp tuscany/sca/core/*.cpp tuscany/sca/cpp/*.cpp tuscany/sca/ws/*.cpp | awk '{ print $1 " \\" }'
## and copy/paste the output below
libtuscany_sca_la_SOURCES = \
+tuscany/sca/core/Exceptions.cpp \
tuscany/sca/core/Operation.cpp \
tuscany/sca/core/SCARuntime.cpp \
tuscany/sca/core/ServiceProxy.cpp \
@@ -57,7 +58,6 @@
tuscany/sca/model/WSDLInterface.cpp \
tuscany/sca/model/WSDLOperation.cpp \
tuscany/sca/util/DefaultLogWriter.cpp \
-tuscany/sca/util/Exceptions.cpp \
tuscany/sca/util/File.cpp \
tuscany/sca/util/FileLogWriter.cpp \
tuscany/sca/util/Library.cpp \
@@ -72,4 +72,4 @@
-I${TUSCANY_SDOCPP}/include
AM_CPPFLAGS = $(CPPFLAGS) -D_DEBUG
-
\ No newline at end of file
+
Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Exceptions.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Exceptions.cpp?view=auto&rev=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Exceptions.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Exceptions.cpp Fri Dec 15 23:48:29 2006
@@ -0,0 +1,306 @@
+/*
+ * 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/core/Exceptions.h"
+#include "tuscany/sca/util/Logging.h"
+
+#if defined(WIN32) || defined (_WINDOWS)
+#else
+#include "tuscany_sca_config.h"
+#endif
+
+using namespace std;
+
+#include <sstream>
+
+#if defined(WIN32) || defined (_WINDOWS) || defined (IS_DARWIN)
+#else
+#include <execinfo.h>
+#endif
+
+namespace tuscany
+{
+ namespace sca
+ {
+
+ // ========================================================================
+ // Constructor
+ // ========================================================================
+ TuscanyRuntimeException :: TuscanyRuntimeException(const char* name,
+ severity_level sev,
+ const char* msg_text)
+ {
+ severity = sev;
+ location_set = 0;
+ class_name = new char[strlen(name) + 1];
+ strcpy(class_name,name);
+ message_text = new char[strlen(msg_text)+1];
+ strcpy(message_text,msg_text);
+
+#if defined(WIN32) || defined (_WINDOWS) || defined (IS_DARWIN)
+#else
+ void* array[25];
+ stacktrace_size = backtrace(array, 25);
+ stacktrace_symbols = backtrace_symbols(array, stacktrace_size);
+#endif
+
+ logwarning("%s raised: %s", class_name, message_text);
+
+ } // end TuscanyRuntimeException constuctor
+
+ // ========================================================================
+ // Constructor
+ // ========================================================================
+ TuscanyRuntimeException :: TuscanyRuntimeException(const TuscanyRuntimeException& c)
+ {
+ severity = c.getSeverity();
+ location_set = c.location_set;
+ class_name = new char[strlen(c.getEClassName()) + 1];
+ strcpy(class_name, c.getEClassName());
+ message_text = new char[strlen(c.getMessageText())+1];
+ strcpy(message_text,c.getMessageText());
+
+ for (int i=0; i < location_set; i++)
+ {
+ locations[i].file = new char[strlen(c.locations[i].file) + 1];
+ strcpy(locations[i].file,c.locations[i].file);
+ locations[i].line = c.locations[i].line;
+ locations[i].function = new char[strlen(c.locations[i].function) + 1];
+ strcpy(locations[i].function, c.locations[i].function);
+ }
+
+#if defined(WIN32) || defined (_WINDOWS) || defined (IS_DARWIN)
+#else
+ void* array[25];
+ stacktrace_size = backtrace(array, 25);
+ stacktrace_symbols = backtrace_symbols(array, stacktrace_size);
+#endif
+
+ logwarning("%s raised: %s", class_name, message_text);
+ }
+
+ // ========================================================================
+ // Constructor
+ // ========================================================================
+ TuscanyRuntimeException :: TuscanyRuntimeException(const SDORuntimeException& c)
+ {
+ class_name = new char[strlen(c.getEClassName()) + 1];
+ strcpy(class_name, c.getEClassName());
+ message_text = new char[strlen(c.getMessageText())+1];
+ strcpy(message_text,c.getMessageText());
+ switch (c.getSeverity())
+ {
+ case SDORuntimeException::Normal:
+ severity = Normal;
+ break;
+ case SDORuntimeException::Warning:
+ severity = Warning;
+ break;
+ case SDORuntimeException::Error:
+ severity = Error;
+ break;
+ default:
+ severity = Severe;
+ break;
+ }
+
+ const char* file = c.getFileName();
+ unsigned long line = c.getLineNumber();
+ const char* function = c.getFunctionName();
+ location_set = 0;
+ if (file)
+ {
+ setLocation(file, line, function);
+ }
+
+#if defined(WIN32) || defined (_WINDOWS) || defined (IS_DARWIN)
+#else
+ void* array[25];
+ stacktrace_size = backtrace(array, 25);
+ stacktrace_symbols = backtrace_symbols(array, stacktrace_size);
+#endif
+
+ logwarning("%s raised: %s", class_name, message_text);
+ }
+
+ // ========================================================================
+ // Destructor
+ // ========================================================================
+ TuscanyRuntimeException :: ~TuscanyRuntimeException()
+ {
+ if (class_name) delete class_name;
+ if (message_text) delete message_text;
+ for (int i=0;i<location_set;i++)
+ {
+ if (locations[i].file) delete locations[i].file;
+ if (locations[i].function) delete locations[i].function;
+ }
+
+#if defined(WIN32) || defined (_WINDOWS) || defined (IS_DARWIN)
+#else
+ free(stacktrace_symbols);
+#endif
+
+ } // end TuscanyRuntimeException destructor
+
+ // ========================================================================
+ // Return class name of this exception
+ // ========================================================================
+ const char* TuscanyRuntimeException :: getEClassName() const
+ {
+ return class_name;
+ } // end getClassName()
+
+ // ========================================================================
+ // Return severity
+ // ========================================================================
+ TuscanyRuntimeException::severity_level TuscanyRuntimeException :: getSeverity() const
+ {
+ return severity;
+ } // end getSeverity()
+
+ // ========================================================================
+ // Return message text associated with exception
+ // ========================================================================
+ const char* TuscanyRuntimeException :: getMessageText() const
+ {
+ return message_text;
+ } // end getMessageText()
+
+ // ========================================================================
+ // Return file name where exception was raised
+ // ========================================================================
+ const char* TuscanyRuntimeException :: getFileName() const
+ {
+ return locations[0].file;
+ } // end getFileName()
+
+ // ========================================================================
+ // Return line number where exception was raised
+ // ========================================================================
+ unsigned long TuscanyRuntimeException :: getLineNumber() const
+ {
+ return locations[0].line;
+ } // end getLineNumber()
+
+ // ========================================================================
+ // Return function name where exception was raised
+ // ========================================================================
+ const char* TuscanyRuntimeException :: getFunctionName() const
+ {
+ return locations[0].function;
+ } // end getFunctionName()
+
+
+ // ========================================================================
+ // set severity of exception
+ // ========================================================================
+ void TuscanyRuntimeException :: setSeverity(severity_level sev)
+ {
+ severity = sev;
+ } // end setSeverity(severity_level sev) const
+
+ // ========================================================================
+ // set message text associated with exception
+ // ========================================================================
+ void TuscanyRuntimeException :: setMessageText(const char* msg_text)
+ {
+ if (message_text != 0) delete message_text;
+ message_text = new char[strlen(msg_text) + 1];
+ strcpy(message_text,msg_text);
+ } // end setMessageText(const string &msg_text) const
+
+ // ========================================================================
+ // set location of most recent handling of the exception
+ // ========================================================================
+ void TuscanyRuntimeException :: setLocation(const char* file,
+ unsigned long line,
+ const char* function)
+ {
+ if (location_set < num_locations)
+ {
+ locations[location_set].file = new char[strlen(file) + 1];
+ strcpy(locations[location_set].file,file);
+ locations[location_set].line = line;
+ locations[location_set].function = new char[strlen(function) + 1];
+ strcpy(locations[location_set].function,function);
+
+ location_set++;
+ }
+ } // end setLocation()
+
+
+ // ========================================================================
+ // print self
+ // ========================================================================
+ ostream& TuscanyRuntimeException :: PrintSelf(ostream &os) const
+ {
+
+ os << "Exception" << endl;
+ os << " Class: " << class_name << endl;
+ os << " Description: " << message_text << endl;
+ if (location_set != 0)
+ {
+ os << " Origin:" << endl;
+ os << " File: " << locations[0].file << endl;
+ char lineNumber[100];
+ sprintf(lineNumber, "%lu",locations[0].line);
+ os << " Line: " << lineNumber << endl;
+ os << " Function: " << locations[0].function << endl;
+
+ if (location_set >1)
+ {
+ os << " Path:" << endl;
+ int i=1;
+ while (i < location_set)
+ {
+ os << " File: " << locations[i].file << endl;
+ os << " Line: " << locations[i].line << endl;
+ os << " Function: " << locations[i].function << endl;
+ i++;
+ }
+ }
+ }
+#if defined(WIN32) || defined (_WINDOWS) || defined (IS_DARWIN)
+#else
+ if (stacktrace_size != 0)
+ {
+ os << " Backtrace:" << endl;
+ for (int j = 0; j < stacktrace_size; j++)
+ {
+ os << " " << stacktrace_symbols[j] << endl;
+ }
+ }
+#endif
+ return os;
+ } // end ostream operator <<
+
+
+ // ========================================================================
+ // ostream operator <<
+ // ========================================================================
+ SCA_API ostream& operator<< (ostream &os, const TuscanyRuntimeException &except)
+ {
+ return except.PrintSelf(os);
+ } // end ostream operator <<
+
+ } // End namespace sca
+} // End namespace tuscany
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Exceptions.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Exceptions.cpp
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Exceptions.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Exceptions.h?view=auto&rev=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Exceptions.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Exceptions.h Fri Dec 15 23:48:29 2006
@@ -0,0 +1,346 @@
+/*
+ * 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_core_exceptions_h
+#define tuscany_sca_core_exceptions_h
+
+
+#include "tuscany/sca/export.h"
+
+#include <ostream>
+#include "commonj/sdo/SDO.h"
+
+
+namespace tuscany
+{
+ namespace sca
+ {
+ /**
+ * Top level exception to represent all the exceptions that may be
+ * thrown by an SCA runtime implementation.
+ */
+ class SCA_API TuscanyRuntimeException
+ {
+ public:
+ /**
+ * Represents the possible severity levels for an exception.
+ */
+ enum severity_level
+ {
+ Normal,
+ Warning,
+ Error,
+ Severe
+ };
+
+ /**
+ * Constructor.
+ * @param name Class name of the exception.
+ * @param sev Severity level.
+ * @param msg_text Detailed description of the exception.
+ */
+ TuscanyRuntimeException(
+ const char *name = "TuscanyRuntimeException",
+ severity_level sev = Severe,
+ const char* msg_text = "");
+
+ TuscanyRuntimeException(const TuscanyRuntimeException& c);
+ TuscanyRuntimeException(const SDORuntimeException& c);
+
+ // Destructor
+ virtual ~TuscanyRuntimeException();
+
+ /**
+ * Return class name of this exception.
+ */
+ const char* getEClassName() const;
+
+ /**
+ * Return severity.
+ */
+ severity_level getSeverity() const;
+
+ /**
+ * Return message text associated with exception.
+ */
+ const char* getMessageText() const;
+
+ /*
+ * Return file name where the exception was raised.
+ */
+ const char* getFileName() const;
+
+ /**
+ * Return line number where the exception was raised.
+ */
+ unsigned long getLineNumber() const;
+
+ /**
+ * Return function name where the exception was raised.
+ */
+ const char* getFunctionName() const;
+
+ /**
+ * Set the exception severity.
+ */
+ void setSeverity(severity_level sev);
+
+ /**
+ * Set the message text associated with exception.
+ */
+ void setMessageText(const char* msg_text);
+
+ /**
+ * Set the location where the exception was raised.
+ * @param file Name of the file.
+ * @param line Line number in the file.
+ * @param function Name of the function.
+ */
+ void setLocation(const char* file,
+ unsigned long line,
+ const char* function="");
+
+ /**
+ * Append exception details to ostream.
+ */
+ virtual std::ostream& PrintSelf(std::ostream &os) const;
+
+ /**
+ * Operator to send exceptions details to a stream.
+ */
+ SCA_API friend std::ostream& operator<< (std::ostream &os, const TuscanyRuntimeException &except);
+
+ protected:
+
+ private:
+ /**
+ * Class name of the exception.
+ */
+ char* class_name;
+
+ /**
+ * Severity level of the exception.
+ */
+ severity_level severity;
+
+ /**
+ * Description of the exception.
+ */
+ char* message_text; // Description of exception
+
+ /**
+ * Location where the exception was thrown or handled and thrown.
+ */
+ class location
+ {
+ public:
+ char* file; // File name (from __FILE__)
+ unsigned long line; // Line number (from __LINE__)
+ char* function; // Function name
+ };
+
+
+ enum {num_locations=5};
+ /**
+ * Array of locations where the exception has been handled and thrown.
+ */
+ location locations[num_locations];
+
+ /**
+ * The current location (index into TuscanyRuntimeException#location).
+ */
+ int location_set;
+
+ /**
+ * A snapshot of the stack when the exception was constructed
+ */
+#if defined(WIN32) || defined (_WINDOWS)
+#else
+ int stacktrace_size;
+ char** stacktrace_symbols;
+#endif
+
+ }; // End TuscanyRuntimeException class definition
+
+
+ /**
+ * Indicates a problem in the consistency of the SCA model provided to the
+ * Tuscany runtime.
+ */
+ class SCA_API SystemConfigurationException: public TuscanyRuntimeException
+ {
+ public:
+ SystemConfigurationException(const char* msg)
+ : TuscanyRuntimeException("SystemConfigurationException", Severe,
+ msg)
+ {
+ }
+
+ SystemConfigurationException(
+ const char *name,
+ severity_level sev,
+ const char* msg_text)
+ : TuscanyRuntimeException(name, sev, msg_text)
+ {
+ }
+
+ SystemConfigurationException(const SDORuntimeException& c)
+ : TuscanyRuntimeException(c)
+ {
+ }
+ private:
+ };
+
+ /**
+ * Indicates a problem while invoking a service.
+ */
+ class SCA_API ServiceInvocationException: public TuscanyRuntimeException
+ {
+ public:
+ ServiceInvocationException(const char* msg)
+ : TuscanyRuntimeException("ServiceInvocationException", Severe, msg)
+ {
+ }
+
+ ServiceInvocationException(
+ const char *name,
+ severity_level sev,
+ const char* msg_text)
+ : TuscanyRuntimeException(name, sev, msg_text)
+ {
+ }
+
+ ServiceInvocationException(const SDORuntimeException& c)
+ : TuscanyRuntimeException(c)
+ {
+ }
+
+ private:
+ };
+
+ /**
+ * Indicates a problem while working with service data.
+ */
+ class SCA_API ServiceDataException: public TuscanyRuntimeException
+ {
+ public:
+ ServiceDataException(const char* msg)
+ : TuscanyRuntimeException("ServiceDataException", Severe,
+ msg)
+ {
+ }
+
+ ServiceDataException(
+ const char *name,
+ severity_level sev,
+ const char* msg_text)
+ : TuscanyRuntimeException(name, sev, msg_text)
+ {
+ }
+
+ ServiceDataException(const SDORuntimeException& c)
+ : TuscanyRuntimeException(c)
+ {
+ }
+ private:
+ };
+
+ } // End namespace sca
+} // End namespace tuscany
+
+
+/**
+ * =========================================================================
+ * Macro - throwException
+ *
+ * adds the current file name, line number and function name to the exception.
+ * then throws the exception.
+ * The parameter 'function_name' should be the name of the function throwing
+ * this exception.
+ * The parameter 'type' is the class of exception to throw and must be a
+ * SDORuntimeException or a class derived from SDORuntimeException.
+ * The parameter 'parameter' is the construction parameter for the exception
+ * =========================================================================
+*/
+
+#if defined(WIN32) || defined (_WINDOWS)
+#define throwException(type, parameter) \
+{\
+ type __TuscanyThrownException__(parameter); \
+ __TuscanyThrownException__.setLocation(__FILE__,__LINE__,__FUNCTION__); \
+ throw __TuscanyThrownException__;\
+}
+#else
+#define throwException(type, parameter) \
+{\
+ type __TuscanyThrownException__(parameter); \
+ __TuscanyThrownException__.setLocation(__FILE__,__LINE__,__PRETTY_FUNCTION__); \
+ throw __TuscanyThrownException__;\
+}
+#endif
+
+/**
+ =========================================================================
+ * Macro - rethrowException
+ *
+ * adds the current file name, line number and function name to the exception.
+ * then re-throws the exception.
+ * The parameter 'function_name' should be the name of the function throwing
+ * this exception.
+ * =========================================================================
+*/
+#if defined(WIN32) || defined (_WINDOWS)
+#define rethrowException(exception) \
+{\
+ (exception).setLocation(__FILE__,__LINE__,__FUNCTION__); \
+ throw (exception);\
+}
+#else
+#define rethrowException(exception) \
+{\
+ (exception).setLocation(__FILE__,__LINE__,__PRETTY_FUNCTION__); \
+ throw (exception);\
+}
+#endif
+
+/**
+ * =========================================================================
+ * Macro - handleException
+ *
+ * adds the current file name, line number and function name to the exception.
+ * Writes an exception trace entry then continues.
+ * The parameter 'function_name' should be the name of the function handling
+ * this exception.
+ * =========================================================================
+*/
+#if defined(WIN32) || defined (_WINDOWS)
+#define handleException(__PRETTY_FUNCTION__, exception) \
+{\
+ (exception).setLocation(__FILE__,__LINE__,__FUNCTION__); \
+}
+#else
+#define handleException(__PRETTY_FUNCTION__, exception) \
+{\
+ (exception).setLocation(__FILE__,__LINE__,__PRETTY_FUNCTION__); \
+}
+#endif
+
+#endif // tuscany_sca_core_exceptions_h
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Exceptions.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Exceptions.h
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Operation.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Operation.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Operation.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/Operation.cpp Fri Dec 15 23:48:29 2006
@@ -25,7 +25,7 @@
#include <sstream>
#include "tuscany/sca/util/Logging.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "tuscany/sca/core/SCARuntime.h"
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.cpp Fri Dec 15 23:48:29 2006
@@ -24,7 +24,7 @@
#include "tuscany/sca/util/Utils.h"
#include "tuscany/sca/model/ModelLoader.h"
#include "tuscany/sca/util/File.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "tuscany/sca/model/Composite.h"
#include "tuscany/sca/model/Component.h"
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/SCARuntime.h Fri Dec 15 23:48:29 2006
@@ -45,6 +45,7 @@
using namespace std;
using namespace tuscany::sca::model;
+using namespace tuscany::sca::util;
namespace tuscany
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/ServiceProxy.cpp Fri Dec 15 23:48:29 2006
@@ -21,7 +21,7 @@
#include "tuscany/sca/core/ServiceProxy.h"
#include "tuscany/sca/util/Logging.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
namespace tuscany
{
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp Fri Dec 15 23:48:29 2006
@@ -20,7 +20,7 @@
/* $Rev$ $Date$ */
#include "tuscany/sca/util/Logging.h"
-#include "tuscany/sca/util/Exceptions.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"
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ComponentType.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ComponentType.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ComponentType.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ComponentType.cpp Fri Dec 15 23:48:29 2006
@@ -20,7 +20,7 @@
/* $Rev$ $Date$ */
#include "tuscany/sca/util/Logging.h"
-#include "tuscany/sca/util/Exceptions.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"
@@ -34,6 +34,7 @@
using namespace commonj::sdo;
using namespace std;
+using namespace tuscany::sca::util;
namespace tuscany
{
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Composite.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Composite.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Composite.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Composite.cpp Fri Dec 15 23:48:29 2006
@@ -26,7 +26,6 @@
#include "tuscany/sca/model/CompositeReference.h"
#include "tuscany/sca/model/CompositeReferenceBinding.h"
#include "tuscany/sca/model/CompositeService.h"
-//#include "tuscany/sca/model/CompositeServiceBinding.h"
#include "tuscany/sca/model/ServiceType.h"
#include "tuscany/sca/model/ReferenceType.h"
#include "tuscany/sca/model/Wire.h"
@@ -35,6 +34,8 @@
#include "tuscany/sca/model/Reference.h"
#include "tuscany/sca/model/ServiceBinding.h"
#include "tuscany/sca/model/ReferenceBinding.h"
+
+using namespace tuscany::sca::util;
namespace tuscany
{
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.h?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Interface.h Fri Dec 15 23:48:29 2006
@@ -24,14 +24,14 @@
#include <string>
-using namespace std;
-
namespace tuscany
{
namespace sca
{
namespace model
{
+ using namespace std;
+
/**
* Information about an interface. Subtypes will hold information
* specific to a type of interface.
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp Fri Dec 15 23:48:29 2006
@@ -21,7 +21,7 @@
#include "tuscany/sca/export.h"
#include "tuscany/sca/util/Utils.h"
-#include "tuscany/sca/util/Exceptions.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"
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Reference.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Reference.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Reference.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Reference.cpp Fri Dec 15 23:48:29 2006
@@ -20,7 +20,7 @@
/* $Rev$ $Date$ */
#include "tuscany/sca/util/Logging.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "tuscany/sca/model/Reference.h"
#include "tuscany/sca/model/ReferenceType.h"
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ReferenceType.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ReferenceType.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ReferenceType.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ReferenceType.cpp Fri Dec 15 23:48:29 2006
@@ -20,7 +20,7 @@
/* $Rev$ $Date$ */
#include "tuscany/sca/util/Logging.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "tuscany/sca/model/ReferenceType.h"
namespace tuscany
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Service.cpp Fri Dec 15 23:48:29 2006
@@ -20,7 +20,7 @@
/* $Rev$ $Date$ */
#include "tuscany/sca/util/Logging.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "tuscany/sca/model/Service.h"
namespace tuscany
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLDefinition.cpp Fri Dec 15 23:48:29 2006
@@ -23,10 +23,9 @@
#include "tuscany/sca/model/WSDLOperation.h"
#include "tuscany/sca/util/Logging.h"
#include "tuscany/sca/util/Utils.h"
-#include "tuscany/sca/util/Exceptions.h"
-
-using namespace tuscany::sca;
+#include "tuscany/sca/core/Exceptions.h"
+using namespace tuscany::sca::util;
using namespace commonj::sdo;
namespace tuscany
@@ -35,7 +34,6 @@
{
namespace model
{
-
// Constructor
WSDLDefinition::WSDLDefinition(DataObjectPtr wsdlModel)
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLOperation.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLOperation.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLOperation.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/WSDLOperation.cpp Fri Dec 15 23:48:29 2006
@@ -23,6 +23,8 @@
#include "tuscany/sca/util/Logging.h"
#include "tuscany/sca/util/Utils.h"
+using namespace tuscany::sca::util;
+
namespace tuscany
{
namespace sca
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wire.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wire.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wire.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Wire.cpp Fri Dec 15 23:48:29 2006
@@ -23,6 +23,8 @@
#include "tuscany/sca/util/Utils.h"
#include "tuscany/sca/model/Wire.h"
+using namespace tuscany::sca::util;
+
namespace tuscany
{
namespace sca
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/DefaultLogWriter.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/DefaultLogWriter.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/DefaultLogWriter.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/DefaultLogWriter.cpp Fri Dec 15 23:48:29 2006
@@ -27,20 +27,23 @@
{
namespace sca
{
- DefaultLogWriter::~DefaultLogWriter()
+ namespace util
{
- }
-
- void DefaultLogWriter::log(int level, const char* pid, const char* msg)
- {
- cout << pid << " ";
- for (int i=0; i < level; i++)
+ DefaultLogWriter::~DefaultLogWriter()
+ {
+ }
+
+ void DefaultLogWriter::log(int level, const char* pid, const char* msg)
{
- cout << " ";
+ cout << pid << " ";
+ for (int i=0; i < level; i++)
+ {
+ cout << " ";
+ }
+ cout << msg <<endl;
}
- cout << msg <<endl;
- }
+ } // End namespace util
} // End namespace sca
} // End namespace tuscany
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/DefaultLogWriter.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/DefaultLogWriter.h?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/DefaultLogWriter.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/DefaultLogWriter.h Fri Dec 15 23:48:29 2006
@@ -28,21 +28,24 @@
{
namespace sca
{
- /**
- * Log writer to write out to standard out.
- */
- class DefaultLogWriter : public LogWriter
+ namespace util
{
- public:
- virtual ~DefaultLogWriter();
-
/**
- * Will write to the console.
- * See LogWriter#log.
+ * Log writer to write out to standard out.
*/
- virtual void log(int level, const char* pid, const char* msg);
- };
+ class DefaultLogWriter : public LogWriter
+ {
+ public:
+ virtual ~DefaultLogWriter();
+
+ /**
+ * Will write to the console.
+ * See LogWriter#log.
+ */
+ virtual void log(int level, const char* pid, const char* msg);
+ };
+ } // End namespace util
} // End namespace sca
} // End namespace tuscany
#endif // tuscany_sca_util_defaultlogwriter_h
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/File.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/File.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/File.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/File.cpp Fri Dec 15 23:48:29 2006
@@ -25,7 +25,7 @@
#include "tuscany/sca/util/File.h"
#include "tuscany/sca/util/Utils.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "tuscany/sca/util/Logging.h"
#include <iostream>
@@ -45,180 +45,182 @@
{
namespace sca
{
- File::File(const string& dir, const string& file)
- : directory(dir), fileName(file)
+ namespace util
{
- }
- File::~File()
- {
- }
-
-
- Files::Files(const string& rootDir, const string& pattern, bool subdirectories)
- : rootDirectory(rootDir)
- {
- findFiles(rootDirectory, pattern, subdirectories);
- }
-
- Files::~Files()
- {
- }
-
- unsigned int Files::size()
- {
- return files.size();
- }
-
- const File& Files::operator[] (unsigned int index)
- {
- if (size() <= index)
+ File::File(const string& dir, const string& file)
+ : directory(dir), fileName(file)
{
- throwException(SystemConfigurationException, "Index of of bounds");
}
-
- FILES::iterator iter = files.begin();
- for (unsigned int i=0; i<index; i++)
+ File::~File()
{
- iter++;
}
- return *iter;
- }
-
-
- void Files::findFiles(const string& rootDir, const string& pattern, bool subdirectories)
- {
-
-#if defined(WIN32) || defined (_WINDOWS)
- char currentDir[ _MAX_FNAME];
-
-
- GetCurrentDirectory(_MAX_FNAME, currentDir);
- // Set current directory, from which to search.
- if (!SetCurrentDirectory(rootDir.c_str()))
+ Files::Files(const string& rootDir, const string& pattern, bool subdirectories)
+ : rootDirectory(rootDir)
{
- cout << "Unable to set current directory to: " << rootDir.c_str() << endl;
- return;
+ findFiles(rootDirectory, pattern, subdirectories);
}
- char fullDirname[ _MAX_FNAME];
- GetCurrentDirectory(_MAX_FNAME, fullDirname);
- // First, look for all files in this directory that meet the pattern
- char search[ _MAX_FNAME];
- strcpy(search, pattern.c_str());
+ Files::~Files()
+ {
+ }
- // Find the first file in the directory
- WIN32_FIND_DATA data;
- HANDLE searchHandle = FindFirstFile(search, &data);
+ unsigned int Files::size()
+ {
+ return files.size();
+ }
- int more = TRUE;
- if (searchHandle != INVALID_HANDLE_VALUE)
+ const File& Files::operator[] (unsigned int index)
{
- // Found some matching files, so call the function with the details of each one
- while (more)
+ if (size() <= index)
{
- // Skip over directories
- if (!(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
- {
- // Add the file to our list
- files.push_back(File(fullDirname, data.cFileName));
- }
-
- more = FindNextFile(searchHandle, &data);
+ throwException(SystemConfigurationException, "Index of of bounds");
}
+
+ FILES::iterator iter = files.begin();
+ for (unsigned int i=0; i<index; i++)
+ {
+ iter++;
+ }
+
+ return *iter;
}
- if (!subdirectories)
- return;
-
- // Now recurse down all the directories
- // Find the first file in the directory
- searchHandle = FindFirstFile( "*.*", &data);
- more = TRUE;
-
- if (searchHandle != INVALID_HANDLE_VALUE)
+ void Files::findFiles(const string& rootDir, const string& pattern, bool subdirectories)
{
- // Found some files in the directory.
- while (more)
+
+#if defined(WIN32) || defined (_WINDOWS)
+ char currentDir[ _MAX_FNAME];
+
+
+ GetCurrentDirectory(_MAX_FNAME, currentDir);
+
+ // Set current directory, from which to search.
+ if (!SetCurrentDirectory(rootDir.c_str()))
{
- // If directory
- if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
- {
- // Skip over '.' and '..'
- if ((strcmp(data.cFileName, ".")) && (strcmp("..", data.cFileName)))
+ cout << "Unable to set current directory to: " << rootDir.c_str() << endl;
+ return;
+ }
+ char fullDirname[ _MAX_FNAME];
+ GetCurrentDirectory(_MAX_FNAME, fullDirname);
+
+ // First, look for all files in this directory that meet the pattern
+ char search[ _MAX_FNAME];
+ strcpy(search, pattern.c_str());
+
+ // Find the first file in the directory
+ WIN32_FIND_DATA data;
+ HANDLE searchHandle = FindFirstFile(search, &data);
+
+ int more = TRUE;
+ if (searchHandle != INVALID_HANDLE_VALUE)
+ {
+ // Found some matching files, so call the function with the details of each one
+ while (more)
+ {
+ // Skip over directories
+ if (!(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
- // Recurse
- findFiles(data.cFileName, pattern, subdirectories);
+ // Add the file to our list
+ files.push_back(File(fullDirname, data.cFileName));
}
+
+ more = FindNextFile(searchHandle, &data);
}
-
- more = FindNextFile(searchHandle, &data);
}
- }
- SetCurrentDirectory(currentDir);
+
+
+ if (!subdirectories)
+ return;
+
+ // Now recurse down all the directories
+ // Find the first file in the directory
+ searchHandle = FindFirstFile( "*.*", &data);
+ more = TRUE;
+
+ if (searchHandle != INVALID_HANDLE_VALUE)
+ {
+ // Found some files in the directory.
+ while (more)
+ {
+ // If directory
+ if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ {
+ // Skip over '.' and '..'
+ if ((strcmp(data.cFileName, ".")) && (strcmp("..", data.cFileName)))
+ {
+ // Recurse
+ findFiles(data.cFileName, pattern, subdirectories);
+ }
+ }
+
+ more = FindNextFile(searchHandle, &data);
+ }
+ }
+ SetCurrentDirectory(currentDir);
#else
- // Linux
- //char fullDirname[MAX_PATH];
- //getcwd(fullDirname, MAX_PATH);
-
- DIR* root = opendir(rootDir.c_str());
- if (!root)
- {
- logwarning("Unable to open directory: %s", rootDir.c_str());
- return;
- }
-
- bool exactMatch = true;
- string token1, token2;
- if (pattern.find('*') != string::npos)
- {
- exactMatch = false;
- Utils::tokeniseString("*", pattern, token1, token2);
- }
-
- struct dirent *entry=0;
- while ((entry = readdir(root)))
- {
- string entryName = rootDir + "/" + entry->d_name;
- struct stat statbuf;
- if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)
- continue;
- if (stat(entryName.c_str(), &statbuf) != 0)
+ // Linux
+ //char fullDirname[MAX_PATH];
+ //getcwd(fullDirname, MAX_PATH);
+
+ DIR* root = opendir(rootDir.c_str());
+ if (!root)
{
- logwarning("Unable to stat entry: %s", entryName.c_str());
+ logwarning("Unable to open directory: %s", rootDir.c_str());
+ return;
}
- else
+
+ bool exactMatch = true;
+ string token1, token2;
+ if (pattern.find('*') != string::npos)
{
- if (S_ISDIR(statbuf.st_mode))
+ exactMatch = false;
+ Utils::tokeniseString("*", pattern, token1, token2);
+ }
+
+ struct dirent *entry=0;
+ while ((entry = readdir(root)))
+ {
+ string entryName = rootDir + "/" + entry->d_name;
+ struct stat statbuf;
+ if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)
+ continue;
+ if (stat(entryName.c_str(), &statbuf) != 0)
{
- if (subdirectories)
- {
- findFiles(entryName, pattern, subdirectories);
- }
+ logwarning("Unable to stat entry: %s", entryName.c_str());
}
- else if (S_ISREG(statbuf.st_mode))
+ else
{
- string filename = entry->d_name;
-
- if ((exactMatch && filename == pattern) ||
- (!exactMatch &&
- ((filename.find(token1) == 0)
- && (filename.length() >= token2.length())
- && (filename.rfind(token2) == (filename.length() - token2.length())) )))
+ if (S_ISDIR(statbuf.st_mode))
{
- // Add the file to our list
- files.push_back(File(rootDir, filename));
+ if (subdirectories)
+ {
+ findFiles(entryName, pattern, subdirectories);
+ }
}
- }
- }
- }
- closedir(root);
+ else if (S_ISREG(statbuf.st_mode))
+ {
+ string filename = entry->d_name;
+
+ if ((exactMatch && filename == pattern) ||
+ (!exactMatch &&
+ ((filename.find(token1) == 0)
+ && (filename.length() >= token2.length())
+ && (filename.rfind(token2) == (filename.length() - token2.length())) )))
+ {
+ // Add the file to our list
+ files.push_back(File(rootDir, filename));
+ }
+ }
+ }
+ }
+ closedir(root);
#endif
- }
-
-
+ }
+
+ } // End namespace util
} // End namespace sca
} // End namespace tuscany
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/File.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/File.h?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/File.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/File.h Fri Dec 15 23:48:29 2006
@@ -31,105 +31,108 @@
{
namespace sca
{
- /**
- * File access methods. Provides platform independent
- * access to files.
- */
- class File
+ namespace util
{
- public:
/**
- * Constructor.
- * @param directory Name of the directory in which this file is located.
- * Either / or \ can be used interchangeably for separating directory elements.
- * @param fileName Name of the file in the dirctory.
+ * File access methods. Provides platform independent
+ * access to files.
*/
- File(const string& directory, const string& fileName);
-
- /**
- * Destructor.
- */
- virtual ~File();
-
- /**
- * Return the directory in which this file is located.
- * @return Name of the directory.
- */
- const string& getDirectory() const {return directory;}
-
- /**
- * Name of the file.
- * @return Name of the file.
- */
- const string& getFileName() const {return fileName;}
- private:
- /**
- * Name of the directory.
- */
- string directory;
-
- /**
- * Name of the file.
- */
- string fileName;
- };
-
- /**
- * Collection of File to provide platform independent access
- * to files and directories.
- */
- class Files
- {
- public:
- /**
- * Constructor which will search a given directory with a pattern and return a
- * new instance of this collection class.
- * @param rootDirectory The directory in which to search.
- * @param pattern A pattern for matching file names. Can include * and ?.
- * @param subdirectories Whether subdirectories should be searched too.
- */
- Files(const string& rootDirectory, const string& pattern, bool subdirectories = false);
-
- /**
- * Destructor.
- */
- virtual ~Files();
-
- /**
- * Return the number of files found.
- * @return The number of files found.
- */
- unsigned int size();
-
- /**
- * Return a File at this position in the collection.
- * @param index The index into the collection.
- * @return The File at this index in the collection.
- */
- const File& operator[] (unsigned int index);
-
- private:
- /**
- * Search the given directory and pattern for matching files.
- * @param rootDirectory The directory in which to search.
- * @param pattern A pattern for matching file names. Can include * and ?.
- * @param subdirectories Whether subdirectories should be searched too.
- */
- void findFiles(const string& rootDirectory, const string& pattern, bool subdirectories);
+ class File
+ {
+ public:
+ /**
+ * Constructor.
+ * @param directory Name of the directory in which this file is located.
+ * Either / or \ can be used interchangeably for separating directory elements.
+ * @param fileName Name of the file in the dirctory.
+ */
+ File(const string& directory, const string& fileName);
+
+ /**
+ * Destructor.
+ */
+ virtual ~File();
+
+ /**
+ * Return the directory in which this file is located.
+ * @return Name of the directory.
+ */
+ const string& getDirectory() const {return directory;}
+
+ /**
+ * Name of the file.
+ * @return Name of the file.
+ */
+ const string& getFileName() const {return fileName;}
+ private:
+ /**
+ * Name of the directory.
+ */
+ string directory;
+
+ /**
+ * Name of the file.
+ */
+ string fileName;
+ };
/**
- * The top level directory to search.
- */
- string rootDirectory;
-
- typedef vector<File> FILES;
-
- /**
- * Vector of File.
- */
- FILES files;
- };
+ * Collection of File to provide platform independent access
+ * to files and directories.
+ */
+ class Files
+ {
+ public:
+ /**
+ * Constructor which will search a given directory with a pattern and return a
+ * new instance of this collection class.
+ * @param rootDirectory The directory in which to search.
+ * @param pattern A pattern for matching file names. Can include * and ?.
+ * @param subdirectories Whether subdirectories should be searched too.
+ */
+ Files(const string& rootDirectory, const string& pattern, bool subdirectories = false);
+
+ /**
+ * Destructor.
+ */
+ virtual ~Files();
+
+ /**
+ * Return the number of files found.
+ * @return The number of files found.
+ */
+ unsigned int size();
+
+ /**
+ * Return a File at this position in the collection.
+ * @param index The index into the collection.
+ * @return The File at this index in the collection.
+ */
+ const File& operator[] (unsigned int index);
+
+ private:
+ /**
+ * Search the given directory and pattern for matching files.
+ * @param rootDirectory The directory in which to search.
+ * @param pattern A pattern for matching file names. Can include * and ?.
+ * @param subdirectories Whether subdirectories should be searched too.
+ */
+ void findFiles(const string& rootDirectory, const string& pattern, bool subdirectories);
+
+ /**
+ * The top level directory to search.
+ */
+ string rootDirectory;
+
+ typedef vector<File> FILES;
+
+ /**
+ * Vector of File.
+ */
+ FILES files;
+ };
+ } // End namespace util
} // End namespace sca
} // End namespace tuscany
#endif // tuscany_sca_util_file_h
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/FileLogWriter.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/FileLogWriter.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/FileLogWriter.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/FileLogWriter.cpp Fri Dec 15 23:48:29 2006
@@ -27,26 +27,29 @@
{
namespace sca
{
- FileLogWriter::FileLogWriter(const char* logfile)
+ namespace util
{
- logFile.open(logfile, ios_base::app);
- }
-
- FileLogWriter::~FileLogWriter()
- {
- logFile.close();
- }
-
- void FileLogWriter::log(int level, const char*pid, const char* msg)
- {
- logFile << pid << " ";
- for (int i=0; i < level; i++)
+ FileLogWriter::FileLogWriter(const char* logfile)
+ {
+ logFile.open(logfile, ios_base::app);
+ }
+
+ FileLogWriter::~FileLogWriter()
+ {
+ logFile.close();
+ }
+
+ void FileLogWriter::log(int level, const char*pid, const char* msg)
{
- logFile << " ";
+ logFile << pid << " ";
+ for (int i=0; i < level; i++)
+ {
+ logFile << " ";
+ }
+ logFile << msg <<endl;
}
- logFile << msg <<endl;
- }
+ } // End namespace util
} // End namespace sca
} // End namespace tuscany
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/FileLogWriter.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/FileLogWriter.h?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/FileLogWriter.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/FileLogWriter.h Fri Dec 15 23:48:29 2006
@@ -31,25 +31,28 @@
{
namespace sca
{
- /**
- * Log writer to write out to standard out.
- */
- class FileLogWriter : public LogWriter
+ namespace util
{
- public:
- FileLogWriter(const char* logfile);
-
- virtual ~FileLogWriter();
-
/**
- * Will write to the console.
- * See LogWriter#log.
+ * Log writer to write out to standard out.
*/
- virtual void log(int level, const char* pid, const char* msg);
- private:
- ofstream logFile;
- };
+ class FileLogWriter : public LogWriter
+ {
+ public:
+ FileLogWriter(const char* logfile);
+
+ virtual ~FileLogWriter();
+
+ /**
+ * Will write to the console.
+ * See LogWriter#log.
+ */
+ virtual void log(int level, const char* pid, const char* msg);
+ private:
+ ofstream logFile;
+ };
+ } // End namespace util
} // End namespace sca
} // End namespace tuscany
#endif // tuscany_sca_util_defaultlogwriter_h
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Library.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Library.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Library.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Library.cpp Fri Dec 15 23:48:29 2006
@@ -27,7 +27,7 @@
#include "tuscany/sca/util/Library.h"
#include "tuscany/sca/util/Utils.h"
-#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/Exceptions.h"
#include "tuscany/sca/util/Logging.h"
@@ -35,140 +35,141 @@
{
namespace sca
{
- Library::Library()
- : hDLL(NULL)
+ namespace util
{
- }
-
- Library::Library(const string& libraryName)
- : name(libraryName), hDLL(NULL)
- {
- logentry();
- load();
- }
-
- Library::Library(const Library& lib)
- : name(lib.name), hDLL(NULL)
- {
- logentry();
- if (lib.hDLL)
+ Library::Library()
+ : hDLL(NULL)
{
- load();
}
- }
-
- Library& Library::operator=(const Library& lib)
- {
- logentry();
- if (&lib != this)
+
+ Library::Library(const string& libraryName)
+ : name(libraryName), hDLL(NULL)
{
- unload();
- name = lib.name;
+ logentry();
load();
}
- return *this;
- }
-
- Library::~Library()
- {
- logentry();
- unload();
- }
-
-
- void Library::load()
- {
- logentry();
- loginfo("Library: %s", name.c_str());
-
- string msg;
-#if defined(WIN32) || defined (_WINDOWS)
- int l = name.length();
- string dllName;
- if (l>=4 && name.substr(l-4, 4)==".dll")
+
+ Library::Library(const Library& lib)
+ : name(lib.name), hDLL(NULL)
{
- dllName = name;
+ logentry();
+ if (lib.hDLL)
+ {
+ load();
+ }
}
- else
+
+ Library& Library::operator=(const Library& lib)
{
- dllName = name+".dll";
+ logentry();
+ if (&lib != this)
+ {
+ unload();
+ name = lib.name;
+ load();
+ }
+ return *this;
}
- SetErrorMode(SEM_FAILCRITICALERRORS);
- hDLL = LoadLibrary(dllName.c_str());
- if (hDLL == NULL)
+
+ Library::~Library()
{
- msg = "Unable to load library: " + dllName;
+ logentry();
+ unload();
}
+
+
+ void Library::load()
+ {
+ logentry();
+ loginfo("Library: %s", name.c_str());
+
+ string msg;
+#if defined(WIN32) || defined (_WINDOWS)
+ int l = name.length();
+ string dllName;
+ if (l>=4 && name.substr(l-4, 4)==".dll")
+ {
+ dllName = name;
+ }
+ else
+ {
+ dllName = name+".dll";
+ }
+ SetErrorMode(SEM_FAILCRITICALERRORS);
+ hDLL = LoadLibrary(dllName.c_str());
+ if (hDLL == NULL)
+ {
+ msg = "Unable to load library: " + dllName;
+ }
#else
- int l = name.length();
- string libName;
+ int l = name.length();
+ string libName;
#ifdef IS_DARWIN
- string suffix = ".dylib";
+ string suffix = ".dylib";
#else
- string suffix = ".so";
+ string suffix = ".so";
#endif
- unsigned int suffixLength = suffix.length();
- if (l>=suffixLength && name.substr(l-suffixLength, suffixLength)==suffix)
- {
- libName = name;
- }
- else
- {
- int s = name.rfind("/");
- if (s == name.length())
+ unsigned int suffixLength = suffix.length();
+ if (l>=suffixLength && name.substr(l-suffixLength, suffixLength)==suffix)
{
- libName = name + suffix;
+ libName = name;
}
- else
+ else
+ {
+ int s = name.rfind("/");
+ if (s == name.length())
+ {
+ libName = name + suffix;
+ }
+ else
+ {
+ s++;
+ libName = name.substr(0, s) + "lib" + name.substr(s, name.length()-s) + suffix;
+ }
+ }
+ hDLL = dlopen(libName.c_str(), RTLD_NOW);
+ if (hDLL == NULL)
{
- s++;
- libName = name.substr(0, s) + "lib" + name.substr(s, name.length()-s) + suffix;
+ msg = "Unable to load library: " + libName + ": " + dlerror();
}
- }
- hDLL = dlopen(libName.c_str(), RTLD_NOW);
- if (hDLL == NULL)
- {
- msg = "Unable to load library: " + libName + ": " + dlerror();
- }
#endif
- if (hDLL == NULL)
- {
- throwException(SystemConfigurationException, msg.c_str());
- }
- }
-
- void Library::unload()
- {
- logentry();
- loginfo("Library: %s", name.c_str());
+ if (hDLL == NULL)
+ {
+ throwException(SystemConfigurationException, msg.c_str());
+ }
+ }
- if (hDLL != NULL)
+ void Library::unload()
{
+ logentry();
+ loginfo("Library: %s", name.c_str());
+
+ if (hDLL != NULL)
+ {
#if defined(WIN32) || defined (_WINDOWS)
- FreeLibrary(hDLL);
+ FreeLibrary(hDLL);
#else
- dlclose(hDLL);
+ dlclose(hDLL);
#endif
- hDLL = NULL;
+ hDLL = NULL;
+ }
}
- }
-
- void* Library::getSymbol(const string& symbol)
- {
- logentry();
- loginfo("Symbol: %s", symbol.c_str());
- if (!hDLL)
+
+ void* Library::getSymbol(const string& symbol)
{
- return 0;
- }
+ logentry();
+ loginfo("Symbol: %s", symbol.c_str());
+ if (!hDLL)
+ {
+ return 0;
+ }
#if defined(WIN32) || defined (_WINDOWS)
- return GetProcAddress(hDLL, symbol.c_str());
+ return GetProcAddress(hDLL, symbol.c_str());
#else
- return dlsym(hDLL, symbol.c_str());
+ return dlsym(hDLL, symbol.c_str());
#endif
- }
+ }
+ } // End namespace util
} // End namespace sca
} // End namespace tuscany
-
-
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Library.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Library.h?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Library.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/Library.h Fri Dec 15 23:48:29 2006
@@ -37,62 +37,65 @@
{
namespace sca
{
- /**
- * Information about shared libraries and methods to
- * access these shared libraries.
- */
- class SCA_API Library
+ namespace util
{
- public:
- Library();
-
- /**
- * Constructor. Will load the library.
- * @param libraryName Fully qualified name of the library.
- */
- Library(const string& libraryName);
-
- /**
- * Destructor. Will unload the library.
- */
- virtual ~Library();
-
- Library(const Library& lib);
- Library& operator=(const Library& lib);
-
- /**
- * Find an externalized symbol in the library.
- * @param symbol The name of the symbol to be found.
- * @return The pointer to the symbol if found, otherwise 0.
- */
- void* getSymbol(const string& symbol);
- private:
/**
- * Name of the library.
- */
- string name;
-
- /**
- * Handle to the loaded library.
- */
+ * Information about shared libraries and methods to
+ * access these shared libraries.
+ */
+ class SCA_API Library
+ {
+ public:
+ Library();
+
+ /**
+ * Constructor. Will load the library.
+ * @param libraryName Fully qualified name of the library.
+ */
+ Library(const string& libraryName);
+
+ /**
+ * Destructor. Will unload the library.
+ */
+ virtual ~Library();
+
+ Library(const Library& lib);
+ Library& operator=(const Library& lib);
+
+ /**
+ * Find an externalized symbol in the library.
+ * @param symbol The name of the symbol to be found.
+ * @return The pointer to the symbol if found, otherwise 0.
+ */
+ void* getSymbol(const string& symbol);
+ private:
+ /**
+ * Name of the library.
+ */
+ string name;
+
+ /**
+ * Handle to the loaded library.
+ */
#if defined(WIN32) || defined (_WINDOWS)
- HINSTANCE hDLL;
+ HINSTANCE hDLL;
#else
- void* hDLL;
+ void* hDLL;
#endif
-
- /**
- * Load the library.
- */
- void load();
-
- /**
- * Unload the library, if successfully loaded.
- */
- void unload();
-
- };
+
+ /**
+ * Load the library.
+ */
+ void load();
+
+ /**
+ * Unload the library, if successfully loaded.
+ */
+ void unload();
+
+ };
+ } // End namespace util
} // End namespace sca
} // End namespace tuscany
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/LogWriter.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/LogWriter.cpp?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/LogWriter.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/LogWriter.cpp Fri Dec 15 23:48:29 2006
@@ -25,10 +25,13 @@
{
namespace sca
{
- LogWriter::~LogWriter()
+ namespace util
{
- }
+ LogWriter::~LogWriter()
+ {
+ }
+ } // End namespace util
} // End namespace sca
} // End namespace tuscany
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/LogWriter.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/LogWriter.h?view=diff&rev=487770&r1=487769&r2=487770
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/LogWriter.h (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/LogWriter.h Fri Dec 15 23:48:29 2006
@@ -28,23 +28,26 @@
{
namespace sca
{
- /**
- * Abstract class for extending logging to other destinations.
- */
- class SCA_API LogWriter
+ namespace util
{
- public:
- virtual ~LogWriter();
-
/**
- * Log a message.
- * @param level The level of logging for this message.
- * @param pid The current process id.
- * @param msg The message to log.
+ * Abstract class for extending logging to other destinations.
*/
- virtual void log(int level, const char* pid, const char* msg) = 0;
- };
-
+ class SCA_API LogWriter
+ {
+ public:
+ virtual ~LogWriter();
+
+ /**
+ * Log a message.
+ * @param level The level of logging for this message.
+ * @param pid The current process id.
+ * @param msg The message to log.
+ */
+ virtual void log(int level, const char* pid, const char* msg) = 0;
+ };
+
+ } // End namespace util
} // End namespace sca
} // End namespace tuscany
#endif // tuscany_sca_util_logwriter_h
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org