-/**
- * If a study is already built and activated elsewhere (for example in GUI context)
- */
-void KERNEL::setStudyServantSA(SALOMEDS::Study_var study, PortableServer::POA_var poa)
+SALOMEDS::Study_var KERNEL::retrieveNewStudyServantSA()
+{
+ CORBA::ORB_ptr orb = KERNEL::getORB();
+ CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+ PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
+ if(CORBA::is_nil(_poa))
+ _poa = poa;
+ SALOME_Fake_NamingService *ns = new SALOME_Fake_NamingService;
+ SALOMEDS_Study_i *servant = new SALOMEDS_Study_i(orb,ns);
+ SALOMEDS::Study_var study = servant->_this();
+ servant->_remove_ref();
+ return study;
+}
+
+void KERNEL::killStudyServantSA()