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 2007/07/13 21:33:48 UTC

svn commit: r556118 - in /incubator/tuscany/cpp/sca/tools/TuscanyDriver: ./ TuscanyServiceLoader.cpp TuscanyServiceLoader.h build.xml main.cpp

Author: robbinspg
Date: Fri Jul 13 12:33:47 2007
New Revision: 556118

URL: http://svn.apache.org/viewvc?view=rev&rev=556118
Log:
TUSCANY-1423 Apply Brady Johnson's patch

I have added the utility in to tuscany/cpp/sca/tools/TuscanyDriver

I have not added this to the Linux build or created an MSVC build. We can use this to try an ant build

Added:
    incubator/tuscany/cpp/sca/tools/TuscanyDriver/
    incubator/tuscany/cpp/sca/tools/TuscanyDriver/TuscanyServiceLoader.cpp   (with props)
    incubator/tuscany/cpp/sca/tools/TuscanyDriver/TuscanyServiceLoader.h   (with props)
    incubator/tuscany/cpp/sca/tools/TuscanyDriver/build.xml   (with props)
    incubator/tuscany/cpp/sca/tools/TuscanyDriver/main.cpp   (with props)

Added: incubator/tuscany/cpp/sca/tools/TuscanyDriver/TuscanyServiceLoader.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/tools/TuscanyDriver/TuscanyServiceLoader.cpp?view=auto&rev=556118
==============================================================================
--- incubator/tuscany/cpp/sca/tools/TuscanyDriver/TuscanyServiceLoader.cpp (added)
+++ incubator/tuscany/cpp/sca/tools/TuscanyDriver/TuscanyServiceLoader.cpp Fri Jul 13 12:33:47 2007
@@ -0,0 +1,297 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *   
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* $Rev$ $Date$ */
+
+#include <iostream>
+#include <string>
+#include <sstream>
+#include <list>
+
+#include <tuscany/sca/core/SCARuntime.h>
+#include <tuscany/sca/core/Exceptions.h>
+
+#include <tuscany/sca/model/Composite.h>
+#include <tuscany/sca/model/WSDLDefinition.h>
+#include <tuscany/sca/model/WSDLOperation.h>
+#include <tuscany/sca/model/WSDLMessagePart.h>
+
+#include <commonj/sdo/SDORuntimeException.h>
+
+#include "TuscanyServiceLoader.h"
+
+namespace tuscany
+{
+  namespace sca
+  {
+    namespace toys
+    {
+
+      TuscanyServiceLoader::TuscanyServiceLoader( const std::string &installRoot,
+                                                  const std::string &systemRoot,
+                                                  const std::string &systemPath,
+                                                  const std::string &baseURI,
+                                                  const std::string &defaultComponent,
+                                                  bool showModel,   // defaults false
+                                                  bool showWsdl ) : // defaults false
+        tuscanyRuntime_(0),
+        tuscanyInstallRoot_(installRoot),
+        tuscanySystemRoot_(systemRoot),
+        tuscanySystemPath_(systemPath),
+        tuscanyBaseURI_(baseURI),
+        tuscanyDefaultComponent_(defaultComponent),
+        showModel_(showModel),
+        showWsdl_(showWsdl)
+      {
+      }
+
+      TuscanyServiceLoader::~TuscanyServiceLoader()
+      {
+      }
+
+      void TuscanyServiceLoader::load( )
+      {
+        try
+        {
+          tuscanyRuntime_ =
+            tuscany::sca::SCARuntime::initializeSharedRuntime(
+                tuscanyInstallRoot_,
+                tuscanySystemRoot_,
+                tuscanySystemPath_,
+                tuscanyBaseURI_,
+                tuscanyDefaultComponent_ );
+
+          tuscany::sca::model::Composite* systemComposite = tuscanyRuntime_->getSystem();
+
+          // The system composite shouldnt ever have WSDL namespaces defined on it,
+          // Its basically a container of included composites
+
+          //
+          // Iterate through the System included composites
+          //
+          std::list<std::string> compositeNameList = systemComposite->getIncludedComposites();
+
+          if( compositeNameList.empty() )
+          {
+            log( "The SCARuntime system composite has no included composites.", DATA_BOTH );
+          }
+
+          std::stringstream logMsg;
+
+          std::list<std::string>::const_iterator cNameIter    = compositeNameList.begin();
+          std::list<std::string>::const_iterator cNameIterEnd = compositeNameList.end();
+
+          // Iterate through the Composites included in the System Composite
+          for( ; cNameIter != cNameIterEnd; ++cNameIter )
+          {
+            tuscany::sca::model::Composite *includedComposite =
+              systemComposite->findIncludedComposite( *cNameIter );
+
+            if( 0 == includedComposite )
+            {
+              logMsg << "Skipping NULL System Included composite: " << *cNameIter;
+              log( logMsg, DATA_BOTH );
+
+              continue;
+            }
+
+            logMsg << "System Included composite: " << includedComposite->getName();
+            log( logMsg, DATA_BOTH );
+
+            if( showWsdl_ )
+            {
+              getOperationsFromComposite( includedComposite );
+            }
+
+            if( showModel_ )
+            {
+              getComponentsFromComposite( includedComposite );
+            }
+          }
+        }
+        catch (const tuscany::sca::TuscanyRuntimeException &tuscanyE)
+        {
+          std::cerr << "Tuscany Runtime Exception: " << tuscanyE.getMessageText() << std::endl;
+        }
+        catch (const SDORuntimeException &sdoE)
+        {
+          std::cerr << "SDO Runtime Exception: " << sdoE.getMessageText() << std::endl;
+        }
+        catch (const std::exception &stdE)
+        {
+          std::cerr << "Standard Exception: " << stdE.what() << std::endl;
+        }
+      }
+
+      // private
+      void TuscanyServiceLoader::getOperationsFromComposite( tuscany::sca::model::Composite *composite )
+      {
+        std::stringstream logMsg;
+
+        std::list<std::string> namespaceList = composite->getWSDLNamespaces();
+        if( namespaceList.empty() )
+        {
+          logMsg << "Composite has no WSDLs to process: " << composite->getName();
+          log( logMsg, DATA_WSDL );
+
+          return;
+        }
+
+        std::list<std::string>::const_iterator nsIter    = namespaceList.begin();
+        std::list<std::string>::const_iterator nsIterEnd = namespaceList.end();
+
+        // Iterate through the composite namespaces
+        for( ; nsIter != nsIterEnd; ++nsIter )
+        {
+          tuscany::sca::model::WSDLDefinition *wsdlDef = composite->findWSDLDefinition( *nsIter );
+          if( 0 == wsdlDef )
+          {
+            logMsg << "Skipping NULL WSDLDefinition for WSDL namespace: " << *nsIter;
+            log( logMsg, DATA_WSDL );
+
+            continue;
+          }
+
+          logMsg << "\t WSDL namespace: " << *nsIter;
+          log( logMsg, DATA_WSDL );
+
+          std::list<std::string> ptNameList = wsdlDef->getPortTypes();
+          if( ptNameList.empty() )
+          {
+            log( "Skipping WSDLDefinition with no PortTypes defined", DATA_WSDL );
+
+            continue;
+          }
+
+          std::list<std::string>::const_iterator ptIter    = ptNameList.begin();
+          std::list<std::string>::const_iterator ptIterEnd = ptNameList.end();
+
+          // Iterate through the PortTypes in the WSDLDefinition
+          for( ; ptIter != ptIterEnd; ++ptIter )
+          {
+            logMsg << "\t\t PortType: " << *ptIter;
+            log( logMsg, DATA_WSDL );
+
+            std::list<std::string> operNameList = wsdlDef->getOperations( *ptIter );
+            if( operNameList.empty() )
+            {
+              log( "Skipping WSDL PortType with no operations defined", DATA_WSDL );
+
+              continue;
+            }
+
+            std::list<std::string>::const_iterator operNameIter    = operNameList.begin();
+            std::list<std::string>::const_iterator operNameIterEnd = operNameList.end();
+
+            // Iterate through the Operations in the PortType
+            for( ; operNameIter != operNameIterEnd; ++operNameIter )
+            {
+              const tuscany::sca::model::WSDLOperation &wsdlOper =
+                wsdlDef->findOperation( *ptIter, *operNameIter );
+
+              logMsg
+                << "\t\t\t Operation Info: "
+                << "\n\t\t\t\t OperationName:     " << wsdlOper.getOperationName()
+                << "\n\t\t\t\t SOAP Action:       " << wsdlOper.getSoapAction()
+                << "\n\t\t\t\t Endpoint:          " << wsdlOper.getEndpoint()
+                << "\n\t\t\t\t SOAP version:      " << wsdlOper.getSoapVersion()
+                << "\n\t\t\t\t Document Style:    " << wsdlOper.isDocumentStyle()
+                << "\n\t\t\t\t Wrapped Style:     " << wsdlOper.isWrappedStyle()
+                << "\n\t\t\t\t In Encoded Style:  " << wsdlOper.isInputEncoded()
+                << "\n\t\t\t\t Out Encoded Style: " << wsdlOper.isOutputEncoded()
+                << "\n\t\t\t\t InputMsgURI:       " << wsdlOper.getInputMessageUri()
+                << "\n\t\t\t\t InputMsgName:      " << wsdlOper.getInputMessageName()
+                << "\n\t\t\t\t OutputMsgURI:      " << wsdlOper.getOutputMessageUri()
+                << "\n\t\t\t\t OutputMsgName:     " << wsdlOper.getOutputMessageName();
+              log( logMsg, DATA_WSDL );
+
+              std::list<std::string> partList = wsdlOper.getInputMessagePartNames();
+              std::list<std::string>::const_iterator partListIter = partList.begin();
+              std::list<std::string>::const_iterator partListIterEnd = partList.end();
+              for( ; partListIter != partListIterEnd; ++partListIter )
+              {
+                tuscany::sca::model::WSDLMessagePart part =
+                  wsdlOper.getInputMessagePart( *partListIter );
+                logMsg
+                  << "\t\t\t\t Input Message Part: "
+                  << "\n\t\t\t\t\t Name: " << part.getPartName()
+                  << "\n\t\t\t\t\t Type: " << part.getPartType()
+                  << "\n\t\t\t\t\t URI:  " << part.getPartUri();
+                log( logMsg, DATA_WSDL );
+              }
+
+              partList = wsdlOper.getOutputMessagePartNames();
+              partListIter = partList.begin();
+              partListIterEnd = partList.end();
+              for( ; partListIter != partListIterEnd; ++partListIter )
+              {
+                tuscany::sca::model::WSDLMessagePart part =
+                  wsdlOper.getOutputMessagePart( *partListIter );
+                logMsg
+                  << "\t\t\t\t Output Message Part: "
+                  << "\n\t\t\t\t\t Name: " << part.getPartName()
+                  << "\n\t\t\t\t\t Type: " << part.getPartType()
+                  << "\n\t\t\t\t\t URI:  " << part.getPartUri();
+                log( logMsg, DATA_WSDL );
+              }
+            }
+          }
+        }
+      }
+
+      // private
+      void TuscanyServiceLoader::getComponentsFromComposite( tuscany::sca::model::Composite *composite )
+      {
+      }
+
+      // private
+      void TuscanyServiceLoader::log( std::stringstream &msg, TuscanyServiceLoader::DataType type )
+      {
+        log( msg.str(), type );
+        msg.str( "" ); // clear it to be able to use the same one again
+      }
+
+      // private
+      void TuscanyServiceLoader::log( const std::string &msg, TuscanyServiceLoader::DataType type )
+      {
+        bool doLog = false;
+
+        if( type == DATA_BOTH && (showModel_ || showWsdl_) )
+        {
+          doLog = true;
+        }
+        else if( type == DATA_WSDL && showWsdl_ )
+        {
+          doLog = true;
+        }
+        else if( type == DATA_MODEL && showModel_ )
+        {
+          doLog = true;
+        }
+
+        if( doLog )
+        {
+          std::cout << msg << std::endl;
+        }
+
+      }
+
+    } // namespace toys
+  } // namespace sca
+} // namespace tuscany

Propchange: incubator/tuscany/cpp/sca/tools/TuscanyDriver/TuscanyServiceLoader.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/tools/TuscanyDriver/TuscanyServiceLoader.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/cpp/sca/tools/TuscanyDriver/TuscanyServiceLoader.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/tools/TuscanyDriver/TuscanyServiceLoader.h?view=auto&rev=556118
==============================================================================
--- incubator/tuscany/cpp/sca/tools/TuscanyDriver/TuscanyServiceLoader.h (added)
+++ incubator/tuscany/cpp/sca/tools/TuscanyDriver/TuscanyServiceLoader.h Fri Jul 13 12:33:47 2007
@@ -0,0 +1,86 @@
+/*
+ * 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_toys_service_loader_h
+#define tuscany_sca_toys_service_loader_h
+
+#include <string>
+#include <sstream>
+
+#include <tuscany/sca/core/SCARuntime.h>
+#include <tuscany/sca/model/Composite.h>
+
+
+namespace tuscany
+{
+  namespace sca
+  {
+    namespace toys
+    {
+      class TuscanyServiceLoader
+      {
+        public:
+          TuscanyServiceLoader( const std::string &installRoot,
+                                const std::string &systemRoot,
+                                const std::string &systemPath,
+                                const std::string &baseURI,
+                                const std::string &defaultComponentName,
+                                bool showModel = false,
+                                bool showWsdl = false );
+
+          ~TuscanyServiceLoader();
+
+          void load();
+
+        private:
+          enum DataType
+          {
+            DATA_WSDL = 0,
+            DATA_MODEL,
+            DATA_BOTH
+          };
+
+          TuscanyServiceLoader();
+
+          void log( std::stringstream &msg, TuscanyServiceLoader::DataType type );
+          void log( const std::string &msg, TuscanyServiceLoader::DataType type );
+          void getOperationsFromComposite( tuscany::sca::model::Composite *composite );
+          void getComponentsFromComposite( tuscany::sca::model::Composite *composite );
+
+          tuscany::sca::SCARuntime *tuscanyRuntime_;
+
+          bool showModel_;
+          bool showWsdl_;
+          std::string tuscanyInstallRoot_;
+          std::string tuscanySystemRoot_;
+          std::string tuscanySystemPath_;
+          std::string tuscanyBaseURI_;
+          std::string tuscanyDefaultComponent_;
+      };
+
+    } // namespace toys
+
+  } // namespace sca
+
+} // namespace tuscany
+
+#endif // tuscany_sca_toys_service_loader_h
+

Propchange: incubator/tuscany/cpp/sca/tools/TuscanyDriver/TuscanyServiceLoader.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/tools/TuscanyDriver/TuscanyServiceLoader.h
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/cpp/sca/tools/TuscanyDriver/build.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/tools/TuscanyDriver/build.xml?view=auto&rev=556118
==============================================================================
--- incubator/tuscany/cpp/sca/tools/TuscanyDriver/build.xml (added)
+++ incubator/tuscany/cpp/sca/tools/TuscanyDriver/build.xml Fri Jul 13 12:33:47 2007
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   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.
+-->
+
+<project name="tuscanyDriver" default="build">
+
+  <taskdef resource='cpptasks.tasks'/>
+  <typedef resource='cpptasks.types'/>
+
+  <property environment="env"/>
+  <property name="TUSCANY_SCACPP" value="${env.TUSCANY_SCACPP}"/>
+  <property name="TUSCANY_SDOCPP" value="${env.TUSCANY_SDOCPP}"/>
+
+  <condition property='compiler-name' value='msvc'>
+    <os family='windows'/>
+  </condition>
+  <condition property='compiler-name' value='g++'>
+    <os name='linux'/>
+  </condition>
+
+  <compiler id='msvc-Compiler' name='msvc'/>
+  <compiler id='g++-Compiler' name='g++'/>
+
+  <linker id='BaseLinker'>
+    <syslibset if='windows' libs='kernel32,user32'/>
+  </linker>
+
+  <linker id='msvc-Linker' extends='BaseLinker' name='msvc'/>
+  <linker id='g++-Linker' extends='BaseLinker' name='g++'/>
+
+  <target name="build">
+    <sequential>
+      <mkdir dir="bin"/>
+      <cc
+        warnings='none'
+        debug='${debug}'
+        outtype='executable'
+        subsystem='console'
+        outfile='bin/tuscanyServiceLoader'
+        multithreaded='true'
+        exceptions='true'
+        objdir='bin'>
+          <compiler refid='${compiler-name}-Compiler'/>
+          <linker refid='${compiler-name}-Linker'/>
+          <libset dir='${TUSCANY_SCACPP}/lib' libs='tuscany_sca'/>
+          <includepath path='.'/>
+          <includepath path='${TUSCANY_SDOCPP}/include/'/>
+          <includepath path='${TUSCANY_SCACPP}/include/'/>
+          <fileset dir='.' includes='*.cpp'/>
+      </cc>
+    </sequential>
+  </target>
+
+  <target name="clean">
+    <sequential>
+      <delete dir="bin"/>
+    </sequential>
+  </target>
+
+</project>

Propchange: incubator/tuscany/cpp/sca/tools/TuscanyDriver/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/tools/TuscanyDriver/build.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/cpp/sca/tools/TuscanyDriver/main.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/tools/TuscanyDriver/main.cpp?view=auto&rev=556118
==============================================================================
--- incubator/tuscany/cpp/sca/tools/TuscanyDriver/main.cpp (added)
+++ incubator/tuscany/cpp/sca/tools/TuscanyDriver/main.cpp Fri Jul 13 12:33:47 2007
@@ -0,0 +1,181 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *   
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/* $Rev$ $Date$ */
+
+#include <iostream>
+#include <string>
+
+#include <tuscany/sca/core/Exceptions.h>
+#include <commonj/sdo/SDORuntimeException.h>
+
+#include "TuscanyServiceLoader.h"
+
+struct InputArgs
+{
+  std::string installRoot_;
+  std::string systemRoot_;
+  std::string systemPath_;
+  std::string baseURI_;
+  std::string defaultComponentName_;
+  bool showWsdl_;
+  bool showModel_;
+
+  InputArgs() :
+    showWsdl_(false),
+    showModel_(false)
+  {}
+};
+
+const std::string ARG_INSTALL_ROOT        = "-ir";
+const std::string ARG_SYSTEM_ROOT         = "-sr";
+const std::string ARG_SYSTEM_PATH         = "-sp";
+const std::string ARG_BASE_URI            = "-uri";
+const std::string ARG_DEFAULT_COMPONENT   = "-dc";
+const std::string ARG_VERBOSE             = "-v";
+const std::string ARG_SHOW_MODEL          = "-model";
+const std::string ARG_SHOW_WSDL           = "-wsdl";
+const std::string ARG_HELP_H              = "-h";
+const std::string ARG_HELP_HELP           = "-help";
+const std::string ARG_HELP_QMARK          = "-?";
+
+
+void
+printUsage()
+{
+  std::cout
+    << "\nUsage\ntuscanyDriver\n\t"
+    << ARG_INSTALL_ROOT         << " Mandatory: Installation root where extensions are located: ${TUSCANY_SCACPP}\n\t"
+    << ARG_SYSTEM_ROOT          << " Mandatory: System root where projects are located: ${TUSCANY_SCACPP}/samples\n\t"
+    << ARG_SYSTEM_PATH          << " Optional: System path\n\t"
+    << ARG_BASE_URI             << " Optional: Base URI\n\t"
+    << ARG_DEFAULT_COMPONENT    << " Optional: Default Component name\n\t"
+    << ARG_SHOW_MODEL           << " Optional: Display SCA Model Hierarchy\n\t"
+    << ARG_SHOW_WSDL            << " Optional: Display WSDL information\n\t"
+    << ARG_VERBOSE              << " Optional: Same as specifying both: "
+                                << ARG_SHOW_MODEL << " and " << ARG_SHOW_WSDL
+    << std::endl;
+}
+
+bool
+parseArgs( int argc, char *argv[], InputArgs &input )
+{
+  if( argc < 5 )
+  {
+    std::cerr << "\nInvalid number of input arguments: " << argc << std::endl;
+    printUsage();
+    return false;
+  }
+
+  for( int i = 1; i < argc; i++ )
+  {
+    if( argv[i] == ARG_INSTALL_ROOT )
+    {
+      input.installRoot_ = argv[++i];
+    }
+    else if( argv[i] == ARG_SYSTEM_ROOT )
+    {
+      input.systemRoot_ = argv[++i];
+    }
+    else if( argv[i] == ARG_SYSTEM_PATH )
+    {
+      input.systemPath_ = argv[++i];
+    }
+    else if( argv[i] == ARG_BASE_URI )
+    {
+      input.baseURI_ = argv[++i];
+    }
+    else if( argv[i] == ARG_DEFAULT_COMPONENT )
+    {
+      input.defaultComponentName_ = argv[++i];
+    }
+    else if( argv[i] == ARG_VERBOSE )
+    {
+      input.showWsdl_  = true;
+      input.showModel_ = true;
+    }
+    else if( argv[i] == ARG_SHOW_MODEL )
+    {
+      input.showModel_ = true;
+    }
+    else if( argv[i] == ARG_SHOW_WSDL )
+    {
+      input.showWsdl_  = true;
+    }
+    else if( argv[i] == ARG_HELP_H ||
+             argv[i] == ARG_HELP_QMARK ||
+             argv[i] == ARG_HELP_HELP )
+    {
+      printUsage();
+      return false;
+    }
+    else
+    {
+      std::cerr << "\nUnrecognized argument: " << argv[i];
+      printUsage();
+      return false;
+    }
+  }
+
+  if( input.installRoot_.empty() )
+  {
+    std::cerr << "\nMissing mandatory argument: Install root " << ARG_INSTALL_ROOT << std::endl;
+    return false;
+  }
+
+  if( input.systemRoot_.empty() )
+  {
+    std::cerr << "\nMissing mandatory argument: System root " << ARG_SYSTEM_ROOT << std::endl;
+    return false;
+  }
+
+  return true;
+}
+
+int
+main(int argc, char* argv[])
+{
+  try
+  {
+    InputArgs input;
+    if( ! parseArgs( argc, argv, input ) )
+    {
+      return 1;
+    }
+
+    tuscany::sca::toys::TuscanyServiceLoader
+      tuscany( input.installRoot_,
+               input.systemRoot_,
+               input.systemPath_,
+               input.baseURI_,
+               input.defaultComponentName_,
+               input.showModel_,
+               input.showWsdl_ );
+
+    tuscany.load( );
+  }
+  catch (...)
+  {
+    std::cerr << "Caught unknown exception." << std::endl;
+    return 1;
+  }
+
+  return 0;
+}
+

Propchange: incubator/tuscany/cpp/sca/tools/TuscanyDriver/main.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/cpp/sca/tools/TuscanyDriver/main.cpp
------------------------------------------------------------------------------
    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