You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ro...@apache.org on 2006/05/22 13:33:43 UTC

svn commit: r408644 - in /incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core: TuscanyRuntime.cpp TuscanyRuntime.h

Author: robbinspg
Date: Mon May 22 04:33:42 2006
New Revision: 408644

URL: http://svn.apache.org/viewvc?rev=408644&view=rev
Log:
TUSCANY-401 Add TuscanyRuntime class to control initialization

Added:
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.cpp   (with props)
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.h   (with props)

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.cpp?rev=408644&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.cpp (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.cpp Mon May 22 04:33:42 2006
@@ -0,0 +1,99 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#include "tuscany/sca/core/TuscanyRuntime.h"
+#include "tuscany/sca/util/Logging.h"
+#include "tuscany/sca/util/Utils.h"
+#include "tuscany/sca/util/Exceptions.h"
+#include "tuscany/sca/core/SCARuntime.h"
+
+#include "tuscany/sca/model/System.h"
+
+namespace tuscany
+{
+    namespace sca
+    {
+            
+        // ==========================================================
+        // Set the default ModuleComponent name
+        // ==========================================================
+        void TuscanyRuntime::setSystemRoot(const string& root)
+        {
+            LOGENTRY(1, "TuscanyRuntime::setSystemRoot");
+            systemRoot = root;
+            LOGINFO_1(3, "TuscanyRuntime::setSystemRoot - set to %s", root.c_str());
+            LOGEXIT(1, "TuscanyRuntime::setSystemRoot");
+        }
+
+        // ==========================================================
+        // Set the default ModuleComponent name
+        // ==========================================================
+        void TuscanyRuntime::setDefaultModuleComponent(const string& moduleComponent)
+        {
+            LOGENTRY(1, "TuscanyRuntime::setDefaultModuleComponent");
+            defaultModuleComponent = moduleComponent;
+            LOGINFO_1(3, "TuscanyRuntime::setDefaultModuleComponent - set to %s", moduleComponent.c_str());
+            LOGEXIT(1, "TuscanyRuntime::setDefaultModuleComponent");
+        }
+
+        // ===================================================================
+        // Constructor for the TuscanyRuntime class. 
+        // ===================================================================
+        TuscanyRuntime::TuscanyRuntime(const string& root, const string& moduleComponent)
+        { 
+            LOGENTRY(1, "TuscanyRuntime::constructor");
+            setSystemRoot(root);
+            setDefaultModuleComponent(moduleComponent);           
+            LOGEXIT(1, "TuscanyRuntime::constructor");
+        }
+
+        // ===================================================================
+        // Destructor for the TuscanyRuntime class.
+        // ===================================================================
+        TuscanyRuntime::~TuscanyRuntime()
+        { 
+            LOGENTRY(1, "TuscanyRuntime::destructor");;           
+            LOGEXIT(1, "TuscanyRuntime::destructor");
+        }
+
+        // ===================================================================
+        // Start the runtime. 
+        // ===================================================================
+        void TuscanyRuntime::start()
+        { 
+            LOGENTRY(1, "TuscanyRuntime::start");
+            SCARuntime::setSystemRoot(systemRoot);
+            SCARuntime::setDefaultModuleComponent(defaultModuleComponent);
+            SCARuntime::getInstance();
+            LOGEXIT(1, "TuscanyRuntime::start");
+        }
+
+        // ===================================================================
+        // Stop the runtime. 
+        // ===================================================================
+        void TuscanyRuntime::stop()
+        { 
+            LOGENTRY(1, "TuscanyRuntime::stop");          
+            LOGEXIT(1, "TuscanyRuntime::stop");
+        }
+
+
+                
+    } // End namespace sca
+} // End namespace tuscany

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.h?rev=408644&view=auto
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.h (added)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.h Mon May 22 04:33:42 2006
@@ -0,0 +1,85 @@
+/*
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/* $Rev$ $Date: 2005/12/22 11:33:21 $ */
+
+#ifndef tuscany_sca_core_tuscanyruntime_h
+#define tuscany_sca_core_tuscanyruntime_h
+
+#include "osoa/sca/export.h"
+#include <string>
+using std::string;
+
+namespace tuscany
+{
+    namespace sca
+    {
+        
+        /**
+         * A singleton which represents the executing SCA runtime.
+         */
+        class SCA_API TuscanyRuntime 
+        {
+        public:
+            /**
+            * Default constructor
+            */
+            TuscanyRuntime(const string& root = "", const string& moduleComponent = "");            
+            
+            /**
+            * Destructor
+            */
+            virtual ~TuscanyRuntime();            
+            
+            
+            /**
+            * Set the system rool
+            * @param root The path to the deployed system.
+            */
+            void setSystemRoot(const string& root);
+            
+            /**
+            * Set the default ModuleComponent for the system
+            * @param moduleComponent The name of the default moduleComponent.
+            */
+            void setDefaultModuleComponent(const string& moduleComponent);
+            
+            /**
+            * start the runtime
+            */
+            void start();       
+            
+            /**
+            * stop the runtime
+            */
+            void stop();            
+            
+            
+        private:
+            string systemRoot;
+            string defaultModuleComponent;
+        };
+
+        
+    } // End namespace sca
+} // End namespace tuscany
+
+
+
+
+#endif // tuscany_sca_core_tuscanyruntime_h
+

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/core/TuscanyRuntime.h
------------------------------------------------------------------------------
    svn:keywords = Rev,Date



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org