using namespace SALOMESDS;
-int BasicDataServer::POA_CNT=0;
-
BasicDataServer::BasicDataServer(DataScopeServerBase *father, const std::string& varName):_father(father),_var_name(varName)
{
- PortableServer::POA_var poa(_father->getPOA());
+ /*PortableServer::POA_var poa(_father->getPOA());
PortableServer::POAManager_var pman(poa->the_POAManager());
CORBA::Object_var obj(_father->getORB()->resolve_initial_references("RootPOA"));
PortableServer::POA_var rootPOA(PortableServer::POA::_narrow(obj));
policies[0]=PortableServer::ThreadPolicy::_duplicate(threadPol);
std::ostringstream poaName; poaName << "POA_" << POA_CNT++ << "_" << _var_name;
_poa=rootPOA->create_POA(poaName.str().c_str(),pman,policies);
- threadPol->destroy();
+ threadPol->destroy();*/
}
SALOME::DataScopeServer_ptr BasicDataServer::getMyDataScopeServer()
enforcedRelease();
}
+PortableServer::POA_var BasicDataServer::getPOA() const
+{
+ return _father->getPOA();
+}
_orb->shutdown(0);
else
{
- PortableServer::ObjectId_var oid(_poa->servant_to_id(this));
- _poa->deactivate_object(oid);
- ret->_remove_ref();
+ enforcedRelease();
}
}
return ret;
}
-CORBA::Object_var DataScopeServerBase::activateWithDedicatedPOA(BasicDataServer *ds)
-{
- PortableServer::ObjectId_var id(_poa->activate_object(ds));
- CORBA::Object_var ret(_poa->id_to_reference(id));
- return ret;
-}
-
void DataScopeServerBase::checkNotAlreadyExistingVar(const std::string& varName)
{
std::vector<std::string> allNames(getAllVarNames());
std::string varNameCpp(varName);
checkNotAlreadyExistingVar(varNameCpp);
PickelizedPyObjRdOnlyServer *tmp(new PickelizedPyObjRdOnlyServer(this,varNameCpp,constValue));
- CORBA::Object_var ret(activateWithDedicatedPOA(tmp));
+ CORBA::Object_var ret(tmp->activate());
std::pair< SALOME::BasicDataServer_var, BasicDataServer * > p(SALOME::BasicDataServer::_narrow(ret),tmp);
_vars.push_back(p);
return SALOME::PickelizedPyObjRdOnlyServer::_narrow(ret);
std::string varNameCpp(varName);
checkNotAlreadyExistingVar(varNameCpp);
PickelizedPyObjRdExtServer *tmp(new PickelizedPyObjRdExtServer(this,varNameCpp,constValue));
- CORBA::Object_var ret(activateWithDedicatedPOA(tmp));
+ CORBA::Object_var ret(tmp->activate());
std::pair< SALOME::BasicDataServer_var, BasicDataServer * > p(SALOME::BasicDataServer::_narrow(ret),tmp);
_vars.push_back(p);
return SALOME::PickelizedPyObjRdExtServer::_narrow(ret);
std::string varNameCpp(varName),typeNameCpp(typeName);
checkNotAlreadyExistingVar(varNameCpp);
PickelizedPyObjRdWrServer *tmp(new PickelizedPyObjRdWrServer(this,typeNameCpp,varNameCpp));
- CORBA::Object_var ret(activateWithDedicatedPOA(tmp));
+ CORBA::Object_var ret(tmp->activate());
std::pair< SALOME::BasicDataServer_var, BasicDataServer * > p(SALOME::BasicDataServer::_narrow(ret),tmp);
_vars.push_back(p);
return SALOME::PickelizedPyObjRdWrServer::_narrow(ret);
{
checkNotAlreadyExistingVar(varName);
PickelizedPyObjRdOnlyServer *tmp(new PickelizedPyObjRdOnlyServer(this,varName,constValue));
- CORBA::Object_var ret(activateWithDedicatedPOA(tmp));
+ CORBA::Object_var ret(tmp->activate());
std::pair< SALOME::BasicDataServer_var, BasicDataServer * > p(SALOME::BasicDataServer::_narrow(ret),tmp);
_vars.push_back(p);
}
{
checkNotAlreadyExistingVar(varName);
PickelizedPyObjRdExtServer *tmp(new PickelizedPyObjRdExtServer(this,varName,constValue));
- CORBA::Object_var ret(activateWithDedicatedPOA(tmp));
+ CORBA::Object_var ret(tmp->activate());
std::pair< SALOME::BasicDataServer_var, BasicDataServer * > p(SALOME::BasicDataServer::_narrow(ret),tmp);
_vars.push_back(p);
}
{
checkNotAlreadyExistingVar(varName);
PickelizedPyObjRdWrServer *tmp(new PickelizedPyObjRdWrServer(this,varName,constValue));
- CORBA::Object_var ret(activateWithDedicatedPOA(tmp));
+ CORBA::Object_var ret(tmp->activate());
std::pair< SALOME::BasicDataServer_var, BasicDataServer * > p(SALOME::BasicDataServer::_narrow(ret),tmp);
_vars.push_back(p);
}
{
TransactionRdOnlyVarCreate *ret(new TransactionRdOnlyVarCreate(this,varName,constValue));
ret->checkNotAlreadyExisting();
- PortableServer::ObjectId_var id(_poa->activate_object(ret));
- CORBA::Object_var obj(_poa->id_to_reference(id));
+ CORBA::Object_var obj(ret->activate());
return SALOME::Transaction::_narrow(obj);
}
{
TransactionRdExtVarCreate *ret(new TransactionRdExtVarCreate(this,varName,constValue));
ret->checkNotAlreadyExisting();
- PortableServer::ObjectId_var id(_poa->activate_object(ret));
- CORBA::Object_var obj(_poa->id_to_reference(id));
+ CORBA::Object_var obj(ret->activate());
return SALOME::Transaction::_narrow(obj);
}
{
TransactionRdWrVarCreate *ret(new TransactionRdWrVarCreate(this,varName,constValue));
ret->checkNotAlreadyExisting();
- PortableServer::ObjectId_var id(_poa->activate_object(ret));
- CORBA::Object_var obj(_poa->id_to_reference(id));
+ CORBA::Object_var obj(ret->activate());
return SALOME::Transaction::_narrow(obj);
}
{
TransactionAddKeyValueHard *ret(new TransactionAddKeyValueHard(this,varName,key,value));
ret->checkNotAlreadyExisting();
- PortableServer::ObjectId_var id(_poa->activate_object(ret));
- CORBA::Object_var obj(_poa->id_to_reference(id));
+ CORBA::Object_var obj(ret->activate());
return SALOME::Transaction::_narrow(obj);
}
}
elt->_remove_ref();
transactionsCpp[i]=elt;
- transactionsCpp[i].setHolder(this);
}
{// important do not merge loops !
std::vector<TrustTransaction> transactions2(sz);
}
//
std::string fullScopeName(DataServerManager::CreateAbsNameInNSFromScopeName(scopeName));
- std::ostringstream oss; oss << "SALOME_DataScopeServer" << " " << scopeName << " " << isTransactionInt;
+ std::ostringstream oss; oss << "SALOME_DataScopeServer" << " " << scopeName << " " << isTransactionInt << " ";
SALOME_ContainerManager::AddOmninamesParams(oss,&ns);
std::string command(oss.str());
SALOME_ContainerManager::MakeTheCommandToBeLaunchedASync(command);
typedef SALOME::DataScopeServer TheType;
static const bool IsTransaction=false;
static PtrType nil() { return SALOME::DataScopeServer::_nil(); }
- static VarType narrow(CORBA::Object_ptr obj) { return SALOME::DataScopeServer::_narrow(obj); }
+ static PtrType narrow(CORBA::Object_ptr obj) { return SALOME::DataScopeServer::_narrow(obj); }
static PtrType duplicate(PtrType obj) { return SALOME::DataScopeServer::_duplicate(obj); }
};
typedef SALOME::DataScopeServerTransaction TheType;
static const bool IsTransaction=true;
static PtrType nil() { return SALOME::DataScopeServerTransaction::_nil(); }
- static VarType narrow(CORBA::Object_ptr obj) { return SALOME::DataScopeServerTransaction::_narrow(obj); }
+ static PtrType narrow(CORBA::Object_ptr obj) { return SALOME::DataScopeServerTransaction::_narrow(obj); }
static PtrType duplicate(PtrType obj) { return SALOME::DataScopeServerTransaction::_duplicate(obj); }
};