From e8e1283bb98aa13ef9aa896c542b782312a609be Mon Sep 17 00:00:00 2001 From: prascle Date: Wed, 20 Oct 2004 12:16:08 +0000 Subject: [PATCH] PR: Multithreaded traces, part 2 - with logger : orb as parameter of thread in charge of collecting traces in each server (to send trace to CORBA logger server) --- src/Container/SALOME_Container.cxx | 10 ++++------ src/DataTypeCatalog/SALOME_DataTypeCatalog_Server.cxx | 6 +++--- src/Loader/InquireServersQThread.cxx | 2 +- src/Loader/SALOME_Session_Loader.cxx | 8 ++++---- src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx | 8 +++----- src/Registry/SALOME_Registry_Server.cxx | 7 +++---- .../SALOME_RessourcesCatalog_Server.cxx | 8 +++----- src/Session/SALOME_Session_Server.cxx | 10 ++++------ 8 files changed, 25 insertions(+), 34 deletions(-) diff --git a/src/Container/SALOME_Container.cxx b/src/Container/SALOME_Container.cxx index 029b7ad09..ee3bf487f 100644 --- a/src/Container/SALOME_Container.cxx +++ b/src/Container/SALOME_Container.cxx @@ -52,7 +52,10 @@ static PyMethodDef MethodPyVoidMethod[] = int main(int argc, char* argv[]) { - LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(); + // Initialise the ORB. + ORB_INIT &init = *SINGLETON_::Instance() ; + CORBA::ORB_var &orb = init( argc , argv ) ; + LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(orb); INFOS_COMPILATION; BEGIN_OF(argv[0]) @@ -63,11 +66,6 @@ int main(int argc, char* argv[]) try { - // Initialise the ORB. - ORB_INIT &init = *SINGLETON_::Instance() ; - ASSERT(SINGLETON_::IsAlreadyExisting()) ; - CORBA::ORB_var &orb = init( argc , argv ) ; - // Obtain a reference to the root POA. // obtain the root poa manager // diff --git a/src/DataTypeCatalog/SALOME_DataTypeCatalog_Server.cxx b/src/DataTypeCatalog/SALOME_DataTypeCatalog_Server.cxx index 1cc8e9c31..988cd8961 100644 --- a/src/DataTypeCatalog/SALOME_DataTypeCatalog_Server.cxx +++ b/src/DataTypeCatalog/SALOME_DataTypeCatalog_Server.cxx @@ -36,12 +36,12 @@ using namespace std; int main(int argc,char **argv) { - LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(); + // initialize the ORB + CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv); + LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(orb); try { CosNaming::NamingContext_var _rootContext, catalogContext; - // initialize the ORB - CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv); // initialize POA // long TIMESleep = 250000000; diff --git a/src/Loader/InquireServersQThread.cxx b/src/Loader/InquireServersQThread.cxx index dcf0fb2a3..e40309918 100644 --- a/src/Loader/InquireServersQThread.cxx +++ b/src/Loader/InquireServersQThread.cxx @@ -231,7 +231,7 @@ InquireServersQThread::InquireServersQThread( InquireServersGUI* r ) myMessages[5] = str + "SALOME_Container FactoryServer" + "..."; myServersCount++; } - if (strcmp(_argv[i],"PYTHON")==0) { + if (strcmp(_argv[i],"PY")==0) { myMessages[6] = str + "SALOME_ContainerPy.py FactoryServerPy" + "..."; myServersCount++; } diff --git a/src/Loader/SALOME_Session_Loader.cxx b/src/Loader/SALOME_Session_Loader.cxx index dec6984f8..09cdad05e 100644 --- a/src/Loader/SALOME_Session_Loader.cxx +++ b/src/Loader/SALOME_Session_Loader.cxx @@ -31,7 +31,8 @@ using namespace std; int main(int argc, char **argv) { - LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(); + CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv) ; + LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(orb); //VRV: T2.4 - Trace management improvement QApplication myQApp(argc, argv) ; InquireServersGUI myIS; @@ -45,9 +46,7 @@ int main(int argc, char **argv) //VRV: T2.4 - Trace management improvement if (myIS.withGUI()) { try - { - CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv) ; - + { SALOME_NamingService &NS = *SINGLETON_::Instance() ; ASSERT(SINGLETON_::IsAlreadyExisting()) ; NS.init_orb( orb ) ; @@ -88,6 +87,7 @@ int main(int argc, char **argv) INFOS("Caught unknown exception."); } } + INFOS("Normal Exit"); // without this trace, Splash remains on screen ! delete myThreadTrace; return 0 ; } diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx index f6ddd8c83..942c8f33d 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx @@ -39,15 +39,13 @@ using namespace std; int main(int argc,char **argv) { - LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(); + // initialize the ORB + CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv); + LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(orb); try { CosNaming::NamingContext_var _rootContext, catalogContext; - // initialize the ORB - - CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv); - // initialize POA // long TIMESleep = 250000000; diff --git a/src/Registry/SALOME_Registry_Server.cxx b/src/Registry/SALOME_Registry_Server.cxx index d973b2c97..510366547 100644 --- a/src/Registry/SALOME_Registry_Server.cxx +++ b/src/Registry/SALOME_Registry_Server.cxx @@ -52,7 +52,9 @@ using namespace std; int main( int argc , char **argv ) { - LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(); + ORB_INIT &init = *SINGLETON_::Instance() ; + CORBA::ORB_var &orb = init( argc , argv ) ; + LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(orb); BEGIN_OF( argv[0] ) INFOS_COMPILATION SCRUTE(argc) @@ -75,9 +77,6 @@ int main( int argc , char **argv ) ASSERT(ptrSessionName) ; ASSERT(strlen( ptrSessionName )>0) ; const char *registryName = "Registry" ; - ORB_INIT &init = *SINGLETON_::Instance() ; - CORBA::ORB_var &orb = init( argc , argv ) ; - // long TIMESleep = 250000000; int NumberOfTries = 40; int a; diff --git a/src/RessourcesCatalog/SALOME_RessourcesCatalog_Server.cxx b/src/RessourcesCatalog/SALOME_RessourcesCatalog_Server.cxx index 0a4cb3b48..f8018d340 100644 --- a/src/RessourcesCatalog/SALOME_RessourcesCatalog_Server.cxx +++ b/src/RessourcesCatalog/SALOME_RessourcesCatalog_Server.cxx @@ -36,15 +36,13 @@ using namespace std; int main(int argc,char **argv) { - LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(); + // initialize the ORB + CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv); + LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(orb); try { CosNaming::NamingContext_var _rootContext, catalogContext; - // initialize the ORB - - CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv); - // initialize POA // long TIMESleep = 250000000; diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index e79efe6da..cd9a08d4e 100644 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -89,14 +89,12 @@ using namespace std; int main(int argc, char **argv) { - LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(); + ORB_INIT &init = *SINGLETON_::Instance() ; + int orbArgc = 1; + CORBA::ORB_var &orb = init( orbArgc , argv ) ; + LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(orb); try { - ORB_INIT &init = *SINGLETON_::Instance() ; - ASSERT(SINGLETON_::IsAlreadyExisting()) ; - int orbArgc = 1; - CORBA::ORB_var &orb = init( orbArgc , argv ) ; - CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); PortableServer::POA_var poa = PortableServer::POA::_narrow(obj); -- 2.39.2