Problems detected on geometry and mesh scripts executed in YACS foreach loop with multiple branches.
// note: in KERNEL _DEBUG_ is not defined by default
#ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
#else
static int MYDEBUG = 0;
#endif
else {
myPOA = PortableServer::POA::_duplicate(thePOA);
}
+ MESSAGE("GenericObj_i::GenericObj_i thePOA: " << thePOA << " myPOA: " << myPOA);
}
/*!
*/
PortableServer::POA_ptr GenericObj_i::_default_POA()
{
+ MESSAGE("GenericObj_i::_default_POA: " << myPOA);
return PortableServer::POA::_duplicate(myPOA);
}
#include "SALOMEDSClient_IParameters.hxx"
#include "SALOMEDS_IParameters.hxx"
#include "SALOMEDS_StudyManager_i.hxx"
+#include "utilities.h"
#include "SALOMEDS_Defines.hxx"
SALOME_NamingService namingService(orb);
CORBA::Object_var obj = namingService.Resolve( "/myStudyManager" );
SALOMEDS::StudyManager_var theManager = SALOMEDS::StudyManager::_narrow( obj );
- if( CORBA::is_nil(theManager) ) {
- SALOMEDS_StudyManager_i * aStudyManager_i = new SALOMEDS_StudyManager_i(orb, root_poa);
+ if( CORBA::is_nil(theManager) )
+ {
+ PortableServer::POAManager_var pman = root_poa->the_POAManager();
+ CORBA::PolicyList policies;
+ policies.length(2);
+ PortableServer::ThreadPolicy_var threadPol(root_poa->create_thread_policy(PortableServer::SINGLE_THREAD_MODEL));
+ PortableServer::ImplicitActivationPolicy_var implicitPol(root_poa->create_implicit_activation_policy(PortableServer::IMPLICIT_ACTIVATION));
+ policies[0] = PortableServer::ThreadPolicy::_duplicate(threadPol);
+ policies[1] = PortableServer::ImplicitActivationPolicy::_duplicate(implicitPol);
+ PortableServer::POA_var poa = root_poa->create_POA("KERNELStudySingleThreadPOA",pman,policies);
+ MESSAGE("CreateStudyManager: KERNELStudySingleThreadPOA: "<< poa);
+ threadPol->destroy();
+
+ SALOMEDS_StudyManager_i * aStudyManager_i = new SALOMEDS_StudyManager_i(orb, poa);
// Activate the objects. This tells the POA that the objects are ready to accept requests.
- PortableServer::ObjectId_var aStudyManager_iid = root_poa->activate_object(aStudyManager_i);
+ PortableServer::ObjectId_var aStudyManager_iid = poa->activate_object(aStudyManager_i);
//give ownership to the poa : the object will be deleted by the poa
aStudyManager_i->_remove_ref();
aStudyManager_i->register_name((char*)"/myStudyManager");
// Module : SALOME
//
#include "SALOMEDS_ChildIterator_i.hxx"
+#include "SALOMEDS_StudyManager_i.hxx"
#include "SALOMEDS_SObject_i.hxx"
#include "SALOMEDS.hxx"
#include "SALOMEDSImpl_SObject.hxx"
*/
//============================================================================
SALOMEDS_ChildIterator_i::SALOMEDS_ChildIterator_i(const SALOMEDSImpl_ChildIterator& theImpl,
- CORBA::ORB_ptr orb)
- : _it(theImpl.GetPersistentCopy())
+ CORBA::ORB_ptr orb) :
+ GenericObj_i(SALOMEDS_StudyManager_i::GetThePOA()),
+ _it(theImpl.GetPersistentCopy())
{
SALOMEDS::Locker lock;
_orb = CORBA::ORB::_duplicate(orb);
if(_it) delete _it;
}
+//============================================================================
+/*!
+ \brief Get default POA for the servant object.
+
+ This function is implicitly called from "_this()" function.
+ Default POA can be set via the constructor.
+
+ \return reference to the default POA for the servant
+*/
+//============================================================================
+PortableServer::POA_ptr SALOMEDS_ChildIterator_i::_default_POA()
+{
+ myPOA = PortableServer::POA::_duplicate(SALOMEDS_StudyManager_i::GetThePOA());
+ MESSAGE("SALOMEDS_ChildIterator_i::_default_POA: " << myPOA);
+ return PortableServer::POA::_duplicate(myPOA);
+}
+
//============================================================================
/*! Function :Init
*
//! standard destructor
~SALOMEDS_ChildIterator_i();
+
+ virtual PortableServer::POA_ptr _default_POA();
virtual void Init();
virtual void InitEx(CORBA::Boolean);
//
#include "utilities.h"
#include "SALOMEDS_GenericAttribute_i.hxx"
+#include "SALOMEDS_StudyManager_i.hxx"
#include "SALOMEDS_Attributes.hxx"
#include "SALOMEDS.hxx"
#include "SALOMEDSImpl_SObject.hxx"
UNEXPECT_CATCH(GALockProtection, SALOMEDS::GenericAttribute::LockProtection);
-SALOMEDS_GenericAttribute_i::SALOMEDS_GenericAttribute_i(DF_Attribute* theImpl, CORBA::ORB_ptr theOrb)
+SALOMEDS_GenericAttribute_i::SALOMEDS_GenericAttribute_i(DF_Attribute* theImpl, CORBA::ORB_ptr theOrb) :
+ GenericObj_i(SALOMEDS_StudyManager_i::GetThePOA())
{
_orb = CORBA::ORB::_duplicate(theOrb);
_impl = theImpl;
{
}
+//============================================================================
+/*!
+ \brief Get default POA for the servant object.
+
+ This function is implicitly called from "_this()" function.
+ Default POA can be set via the constructor.
+
+ \return reference to the default POA for the servant
+*/
+//============================================================================
+PortableServer::POA_ptr SALOMEDS_GenericAttribute_i::_default_POA()
+{
+ myPOA = PortableServer::POA::_duplicate(SALOMEDS_StudyManager_i::GetThePOA());
+ MESSAGE("SALOMEDS_GenericAttribute_i::_default_POA: " << myPOA);
+ return PortableServer::POA::_duplicate(myPOA);
+}
+
void SALOMEDS_GenericAttribute_i::CheckLocked() throw (SALOMEDS::GenericAttribute::LockProtection)
{
SALOMEDS::Locker lock;
SALOMEDS_GenericAttribute_i(DF_Attribute* theImpl, CORBA::ORB_ptr theOrb);
virtual ~SALOMEDS_GenericAttribute_i();
+ virtual PortableServer::POA_ptr _default_POA();
+
void CheckLocked() throw (SALOMEDS::GenericAttribute::LockProtection);
virtual char* Type();
#include "SALOMEDS_SComponentIterator_i.hxx"
#include "SALOMEDS.hxx"
#include "SALOMEDSImpl_SComponent.hxx"
+#include "SALOMEDS_StudyManager_i.hxx"
+#include "utilities.h"
//============================================================================
/*! Function : constructor
//============================================================================
SALOMEDS_SComponentIterator_i::SALOMEDS_SComponentIterator_i(const SALOMEDSImpl_SComponentIterator& theImpl,
- CORBA::ORB_ptr orb)
+ CORBA::ORB_ptr orb) :
+ GenericObj_i(SALOMEDS_StudyManager_i::GetThePOA())
{
_orb = CORBA::ORB::_duplicate(orb);
_impl = theImpl.GetPersistentCopy();
if(_impl) delete _impl;
}
+//============================================================================
+/*!
+ \brief Get default POA for the servant object.
+
+ This function is implicitly called from "_this()" function.
+ Default POA can be set via the constructor.
+
+ \return reference to the default POA for the servant
+*/
+//============================================================================
+PortableServer::POA_ptr SALOMEDS_SComponentIterator_i::_default_POA()
+{
+ myPOA = PortableServer::POA::_duplicate(SALOMEDS_StudyManager_i::GetThePOA());
+ MESSAGE("SALOMEDS_SComponentIterator_i::_default_POA: " << myPOA);
+ return PortableServer::POA::_duplicate(myPOA);
+}
+
//============================================================================
/*! Function : Init
*
SALOMEDS_SComponentIterator_i(const SALOMEDSImpl_SComponentIterator& theImpl, CORBA::ORB_ptr);
~SALOMEDS_SComponentIterator_i();
+
+ virtual PortableServer::POA_ptr _default_POA();
virtual void Init();
virtual CORBA::Boolean More();
* Purpose :
*/
//============================================================================
-SALOMEDS_SObject_i::SALOMEDS_SObject_i(const SALOMEDSImpl_SObject& impl, CORBA::ORB_ptr orb)
+SALOMEDS_SObject_i::SALOMEDS_SObject_i(const SALOMEDSImpl_SObject& impl, CORBA::ORB_ptr orb) :
+ GenericObj_i(SALOMEDS_StudyManager_i::GetThePOA())
{
_impl = 0;
if(!impl.IsNull()) {
if(_impl) delete _impl;
}
+//============================================================================
+/*!
+ \brief Get default POA for the servant object.
+
+ This function is implicitly called from "_this()" function.
+ Default POA can be set via the constructor.
+
+ \return reference to the default POA for the servant
+*/
+//============================================================================
+PortableServer::POA_ptr SALOMEDS_SObject_i::_default_POA()
+{
+ myPOA = PortableServer::POA::_duplicate(SALOMEDS_StudyManager_i::GetThePOA());
+ MESSAGE("SALOMEDS_SObject_i::_default_POA: " << myPOA);
+ return PortableServer::POA::_duplicate(myPOA);
+}
+
//================================================================================
/*!
* \brief Returns true if the %SObject does not belong to any %Study
SALOMEDS_SObject_i(const SALOMEDSImpl_SObject&, CORBA::ORB_ptr);
virtual ~SALOMEDS_SObject_i();
+
+ virtual PortableServer::POA_ptr _default_POA();
virtual CORBA::Boolean IsNull();
virtual char* GetID();
ts_rem.tv_nsec=0;
ts_rem.tv_sec=0;
CosNaming::NamingContext_var inc;
+ PortableServer::POA_var defaultPoa;
PortableServer::POA_var poa;
CORBA::Object_var theObj;
CORBA::Object_var obj;
{
obj = orb->resolve_initial_references("RootPOA");
if(!CORBA::is_nil(obj))
- poa = PortableServer::POA::_narrow(obj);
- if(!CORBA::is_nil(poa))
- pman = poa->the_POAManager();
+ defaultPoa = PortableServer::POA::_narrow(obj);
+ if(!CORBA::is_nil(defaultPoa))
+ pman = defaultPoa->the_POAManager();
+
+ PortableServer::POAManager_var pman = defaultPoa->the_POAManager();
+ CORBA::PolicyList policies;
+ policies.length(2);
+ PortableServer::ThreadPolicy_var threadPol(defaultPoa->create_thread_policy(PortableServer::SINGLE_THREAD_MODEL));
+ PortableServer::ImplicitActivationPolicy_var implicitPol(defaultPoa->create_implicit_activation_policy(PortableServer::IMPLICIT_ACTIVATION));
+ policies[0] = PortableServer::ThreadPolicy::_duplicate(threadPol);
+ policies[1] = PortableServer::ImplicitActivationPolicy::_duplicate(implicitPol);
+ poa = defaultPoa->create_POA("KERNELStandaloneStudySingleThreadPOA",pman,policies);
+ threadPol->destroy();
+
if(!CORBA::is_nil(orb))
theObj = orb->resolve_initial_references("NameService");
if (!CORBA::is_nil(theObj)){
//
#include "utilities.h"
#include "SALOMEDS_StudyBuilder_i.hxx"
+#include "SALOMEDS_StudyManager_i.hxx"
#include "SALOMEDS_Study_i.hxx"
#include "SALOMEDS_SObject_i.hxx"
#include "SALOMEDS_SComponent_i.hxx"
SALOMEDS_StudyBuilder_i::~SALOMEDS_StudyBuilder_i()
{}
+//============================================================================
+/*!
+ \brief Get default POA for the servant object.
+
+ This function is implicitly called from "_this()" function.
+ Default POA can be set via the constructor.
+
+ \return reference to the default POA for the servant
+*/
+//============================================================================
+PortableServer::POA_ptr SALOMEDS_StudyBuilder_i::_default_POA()
+{
+ PortableServer::POA_ptr poa = SALOMEDS_StudyManager_i::GetThePOA();
+ MESSAGE("SALOMEDS_StudyBuilder_i::_default_POA: " << poa);
+ return PortableServer::POA::_duplicate(poa);
+}
+
//============================================================================
/*! Function : NewComponent
* Purpose : Create a new component (Scomponent)
~SALOMEDS_StudyBuilder_i();
+ virtual PortableServer::POA_ptr _default_POA();
+
//! NewComponent
/*!
\param ComponentDataType
{
_orb = CORBA::ORB::_duplicate(orb);
_poa = PortableServer::POA::_duplicate(thePOA);
+ MESSAGE("thePOA, _poa="<<_poa);
+ if (_mapOfPOA.empty())
+ _mapOfPOA[0] = _poa;
+ else
+ MESSAGE("_mapOfPOA[0] already contains: " << _mapOfPOA[0]);
_name_service = new SALOME_NamingService(_orb);
// Study directory creation in the naming service : to register all
// open studies in the session
delete _impl;
}
+//============================================================================
+/*!
+ \brief Get default POA for the servant object.
+
+ This function is implicitly called from "_this()" function.
+ Default POA can be set via the constructor.
+
+ \return reference to the default POA for the servant
+*/
+//============================================================================
+PortableServer::POA_ptr SALOMEDS_StudyManager_i::_default_POA()
+{
+ MESSAGE("SALOMEDS_StudyManager_i::_default_POA: " << _poa);
+ return PortableServer::POA::_duplicate(_poa);
+}
+
//============================================================================
/*! Function : register_name
* Purpose : Register the study Manager in the naming service under the
return PortableServer::POA::_nil();
}
+PortableServer::POA_ptr SALOMEDS_StudyManager_i::GetThePOA()
+{
+ std::map<int, PortableServer::POA_ptr>::iterator iter = _mapOfPOA.begin();
+ if (iter != _mapOfPOA.end())
+ {
+ PortableServer::POA_ptr aPoa = iter->second;
+ MESSAGE("GetThePOA(): "<< aPoa);
+ return aPoa;
+ }
+ MESSAGE("GetThePOA(): _nil !");
+ return PortableServer::POA::_nil();
+}
+
CORBA::Long SALOMEDS_StudyManager_i::getPID()
{
#ifdef WIN32
//! standard destructor
virtual ~SALOMEDS_StudyManager_i();
+ virtual PortableServer::POA_ptr _default_POA();
+
//! method to Register study Manager in the naming service
/*!
\param char* arguments, the context to register the study manager in the NS
virtual CORBA::LongLong GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
static PortableServer::POA_ptr GetPOA(const SALOMEDS::Study_ptr theStudy);
+ static PortableServer::POA_ptr GetThePOA();
void Shutdown() { if(!CORBA::is_nil(_orb)) _orb->shutdown(0); }
};
_mapOfStudies.erase(_impl);
}
+//============================================================================
+/*!
+ \brief Get default POA for the servant object.
+
+ This function is implicitly called from "_this()" function.
+ Default POA can be set via the constructor.
+
+ \return reference to the default POA for the servant
+*/
+//============================================================================
+PortableServer::POA_ptr SALOMEDS_Study_i::_default_POA()
+{
+ PortableServer::POA_ptr poa = SALOMEDS_StudyManager_i::GetThePOA();
+ MESSAGE("SALOMEDS_Study_i::_default_POA: " << poa);
+ return PortableServer::POA::_duplicate(poa);
+}
+
//============================================================================
/*! Function : GetPersistentReference
* Purpose : Get persistent reference of study (idem URL())
#include <stdio.h>
//SALOMEDS headers
+#include "SALOMEDS_StudyManager_i.hxx"
#include "SALOMEDS_SComponentIterator_i.hxx"
#include "SALOMEDS_StudyBuilder_i.hxx"
#include "SALOMEDS_SObject_i.hxx"
//! standard destructor
virtual ~SALOMEDS_Study_i();
+
+ virtual PortableServer::POA_ptr _default_POA();
//! method to Get persistent reference of study (idem URL())
/*!
#include "SALOMEDS_UseCaseIterator_i.hxx"
#include "SALOMEDS_SObject_i.hxx"
#include "SALOMEDS.hxx"
+#include "SALOMEDS_StudyManager_i.hxx"
#include "utilities.h"
*/
//============================================================================
SALOMEDS_UseCaseBuilder_i::SALOMEDS_UseCaseBuilder_i(SALOMEDSImpl_UseCaseBuilder* theImpl,
- CORBA::ORB_ptr orb)
+ CORBA::ORB_ptr orb) :
+ GenericObj_i(SALOMEDS_StudyManager_i::GetThePOA())
{
_orb = CORBA::ORB::_duplicate(orb);
_impl = theImpl;
{
}
+//============================================================================
+/*!
+ \brief Get default POA for the servant object.
+
+ This function is implicitly called from "_this()" function.
+ Default POA can be set via the constructor.
+
+ \return reference to the default POA for the servant
+*/
+//============================================================================
+PortableServer::POA_ptr SALOMEDS_UseCaseBuilder_i::_default_POA()
+{
+ myPOA = PortableServer::POA::_duplicate(SALOMEDS_StudyManager_i::GetThePOA());
+ MESSAGE("SALOMEDS_UseCaseBuilder_i::_default_POA: " << myPOA);
+ return PortableServer::POA::_duplicate(myPOA);
+}
+
//============================================================================
/*! Function : Append
//! standard destructor
~SALOMEDS_UseCaseBuilder_i();
+
+ virtual PortableServer::POA_ptr _default_POA();
virtual CORBA::Boolean Append(SALOMEDS::SObject_ptr theObject);
#include "SALOMEDS_UseCaseIterator_i.hxx"
#include "SALOMEDS_SObject_i.hxx"
#include "SALOMEDS.hxx"
+#include "SALOMEDS_StudyManager_i.hxx"
#include "SALOMEDSImpl_SObject.hxx"
#include "utilities.h"
*/
//============================================================================
SALOMEDS_UseCaseIterator_i::SALOMEDS_UseCaseIterator_i(const SALOMEDSImpl_UseCaseIterator& theImpl,
- CORBA::ORB_ptr orb)
+ CORBA::ORB_ptr orb) :
+ GenericObj_i(SALOMEDS_StudyManager_i::GetThePOA())
{
_orb = CORBA::ORB::_duplicate(orb);
_impl = theImpl.GetPersistentCopy();
if(_impl) delete _impl;
}
+//============================================================================
+/*!
+ \brief Get default POA for the servant object.
+
+ This function is implicitly called from "_this()" function.
+ Default POA can be set via the constructor.
+
+ \return reference to the default POA for the servant
+*/
+//============================================================================
+PortableServer::POA_ptr SALOMEDS_UseCaseIterator_i::_default_POA()
+{
+ myPOA = PortableServer::POA::_duplicate(SALOMEDS_StudyManager_i::GetThePOA());
+ MESSAGE("SALOMEDS_UseCaseIterator_i::_default_POA: " << myPOA);
+ return PortableServer::POA::_duplicate(myPOA);
+}
+
//============================================================================
/*! Function :Init
*
//! standard destructor
~SALOMEDS_UseCaseIterator_i();
+
+ virtual PortableServer::POA_ptr _default_POA();
virtual void Init(CORBA::Boolean);
virtual CORBA::Boolean More();