Salome HOME
ADD a end user module (services.py) to help the manipulation of SALOME KERNEL service...
[modules/kernel.git] / src / SALOMETraceCollector / TraceCollector_WaitForServerReadiness.cxx
index dacb812487b1f9e9acf41734b164942fdec7f131..b67bce492786db5be6c6b895d352cd7a3f798790 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : TraceCollector_WaitForServerReadiness.cxx
 //  Author : Paul RASCLE (EDF)
 //  Module : KERNEL
@@ -32,8 +33,6 @@
 #include <omnithread/pthread_nt.h>
 #endif
 
-using namespace std;
-
 // ============================================================================
 /*!
  *  Wait until a server is registered in naming service.
@@ -48,7 +47,7 @@ using namespace std;
 // ============================================================================
 
 CORBA::Object_ptr TraceCollector_WaitForServerReadiness(CORBA::ORB_ptr orb,
-                                                        string serverName)
+                                                        std::string serverName)
 {
   long TIMESleep = 500000000;
   int NumberOfTries = 40;
@@ -85,14 +84,14 @@ CORBA::Object_ptr TraceCollector_WaitForServerReadiness(CORBA::ORB_ptr orb,
             }  
           catch( CORBA::SystemException& )
             {
-              cout << "TraceCollector_WaitForServerReadiness: "
+              std::cout << "TraceCollector_WaitForServerReadiness: "
                    << "CORBA::SystemException: "
-                   << "Unable to contact the Naming Service" << endl;
+                   << "Unable to contact the Naming Service" << std::endl;
             }
           catch(...)
             {
-              cout << "TraceCollector_WaitForServerReadiness: "
-                   << "Unknown exception dealing with Naming Service" << endl;
+              std::cout << "TraceCollector_WaitForServerReadiness: "
+                   << "Unknown exception dealing with Naming Service" << std::endl;
             }
           
           obj=CORBA::Object::_nil();
@@ -110,7 +109,7 @@ CORBA::Object_ptr TraceCollector_WaitForServerReadiness(CORBA::ORB_ptr orb,
                 }
               catch (const CosNaming::NamingContext::NotFound&)
                 {
-                  cout << "Caught exception: Naming Service can't found Logger";
+                  std::cout << "Caught exception: Naming Service can't found Logger";
                 }
             }
 #ifndef WIN32
@@ -118,29 +117,29 @@ CORBA::Object_ptr TraceCollector_WaitForServerReadiness(CORBA::ORB_ptr orb,
 #else
           Sleep(TIMESleep / 1000000);
 #endif
-          cout << "TraceCollector_WaitForServerReadiness: retry look for"
-               << serverName << endl;
+                 std::cout << "TraceCollector_WaitForServerReadiness: retry look for"
+               << serverName << std::endl;
         }          
     }
   catch (const CosNaming::NamingContext::NotFound&)
     {
-      cout << "Caught exception: Naming Service can't found Logger";
+      std::cout << "Caught exception: Naming Service can't found Logger";
     }
   catch (CORBA::COMM_FAILURE&)
     {
-      cout << "Caught CORBA::SystemException CommFailure.";
+      std::cout << "Caught CORBA::SystemException CommFailure.";
     }
   catch (CORBA::SystemException&)
     {
-      cout << "Caught CORBA::SystemException.";
+      std::cout << "Caught CORBA::SystemException.";
     }
   catch (CORBA::Exception&)
     {
-      cout << "Caught CORBA::Exception.";
+      std::cout << "Caught CORBA::Exception.";
     }
   catch (...)
     {
-      cout << "Caught unknown exception.";
+      std::cout << "Caught unknown exception.";
     }
   return obj._retn();
 }