// unlock Session mutex
_SessionMutex.unlock();
- if ( shutdownAll )
+ if ( myServerLauncher )
+ myServerLauncher->ShutdownAll(); // shutdown embedded servers
+
+ if ( shutdownAll ) // shutdown standalone servers
shutdownServers( _NS );
if ( myServerLauncher )
- myServerLauncher->KillAll(); // kill embedded servers
+ myServerLauncher->KillAll(); // kill embedded servers
// Unregister session server
SALOME_Session_i* sessionServant = dynamic_cast<SALOME_Session_i*>( poa->reference_to_servant( session.in() ) );
delete[] argv;
}
+void Session_ServerLauncher::ShutdownAll()
+{
+ MESSAGE("Session_ServerLauncher::ShutdownAll()");
+ std::list<Session_ServerThread*>::reverse_iterator itServ;
+ for (itServ = _serverThreads.rbegin(); itServ !=_serverThreads.rend(); itServ++)
+ {
+ (*itServ)->Shutdown();
+ }
+}
+
/*!
Destruction des classes serveur dans l'ordre inverse de creation
*/
QWaitCondition *SessionStarted);
virtual ~Session_ServerLauncher();
void run();
+ void ShutdownAll();
void KillAll();
protected:
_servType =-1;
_NS = new SALOME_NamingService(_orb); // one instance per server to limit
// multi thread coherence problems
+ _container = 0; // embedded container
}
/*!
}
}
+void Session_ServerThread::Shutdown()
+{
+ if ( _container ) _container->Shutdown();
+}
+
void Session_ServerThread::ActivateModuleCatalog(int argc,
char ** argv)
{
containerName = argv[1];
}
- new Engines_Container_i(_orb, _root_poa, containerName , argc , argv , true , false);
+ _container = new Engines_Container_i(_orb, _root_poa, containerName , argc , argv , true , false);
}
catch(CORBA::SystemException&) {
INFOS("Caught CORBA::SystemException.");
void WaitForServerReadiness(std::string serverName);
class SALOME_NamingService;
+class Engines_Container_i;
class SESSION_EXPORT Session_ServerThread
{
PortableServer::POA_ptr poa);
virtual ~Session_ServerThread();
void Init();
+ void Shutdown();
protected:
void ActivateModuleCatalog ( int argc, char ** argv );
void ActivateSALOMEDS ( int argc, char ** argv );
CORBA::ORB_var _orb;
PortableServer::POA_var _root_poa;
SALOME_NamingService * _NS;
+ Engines_Container_i* _container;
};
class QMutex;