Commit 8523ce50 authored by Pavel Vainerman's avatar Pavel Vainerman

(UniSetObject): добавил std::terminate() если активация не удалась.

parent 2ed9e086
......@@ -277,23 +277,60 @@ void UniSetManager::managers( OManagerCommand cmd )
}
catch( const uniset::Exception& ex )
{
ucrit << myname << "(managers): " << ex << endl
<< " Не смог зарегистрировать (разрегистрировать) объект -->" << li->getName() << endl;
ostringstream err;
err << myname << "(managers): " << ex << endl
<< " Не смог зарегистрировать (разрегистрировать) объект -->"
<< li->getName();
ucrit << err.str() << endl;
if( cmd == activ )
{
cerr << err.str();
std::terminate();
}
}
catch( const CORBA::SystemException& ex )
{
ucrit << myname << "(managers): поймали CORBA::SystemException:" << ex.NP_minorString() << endl;
ostringstream err;
err << myname << "(managers): поймали CORBA::SystemException:" << ex.NP_minorString();
ucrit << err.str() << endl;
if( cmd == activ )
{
cerr << err.str();
std::terminate();
}
}
catch( const CORBA::Exception& ex )
{
ucrit << myname << "(managers): Caught CORBA::Exception. " << ex._name() << endl;
ostringstream err;
err << myname << "(managers): Caught CORBA::Exception. "
<< ex._name()
<< " (" << li->getName() << ")";
ucrit << err.str() << endl;
if( cmd == activ )
{
cerr << err.str();
std::terminate();
}
}
catch( const omniORB::fatalException& fe )
{
ucrit << myname << "(managers): Caught omniORB::fatalException:" << endl;
ucrit << myname << "(managers): file: " << fe.file()
<< " line: " << fe.line()
<< " mesg: " << fe.errmsg() << endl;
ostringstream err;
err << myname << "(managers): Caught omniORB::fatalException:" << endl
<< myname << "(managers): file: " << fe.file()
<< " line: " << fe.line()
<< " mesg: " << fe.errmsg();
ucrit << err.str() << endl;
if( cmd == activ )
{
cerr << err.str();
std::terminate();
}
}
}
} // unlock
......@@ -355,13 +392,30 @@ void UniSetManager::objects(OManagerCommand cmd)
}
catch( const CORBA::SystemException& ex )
{
ucrit << myname << "(objects): поймали CORBA::SystemException:" << ex.NP_minorString() << endl;
ostringstream err;
err << myname << "(objects): поймали CORBA::SystemException:" << ex.NP_minorString();
ucrit << err.str() << endl;
if( cmd == activ )
{
cerr << err.str();
std::terminate();
}
}
catch( const CORBA::Exception& ex )
{
ucrit << myname << "(objects): Caught CORBA::Exception. "
ostringstream err;
err << myname << "(objects): Caught CORBA::Exception. "
<< ex._name()
<< " (" << li->getName() << ")" << endl;
<< " (" << li->getName() << ")";
ucrit << err.str() << endl;
if( cmd == activ )
{
cerr << err.str();
std::terminate();
}
}
catch( const omniORB::fatalException& fe )
{
......
......@@ -283,6 +283,7 @@ void UniSetObject::registered()
catch( ORepFailed )
{
string err(myname + ": don`t registration in object reposotory");
uwarn << myname << "(registered): " << err << endl;
throw ORepFailed(err);
}
catch( const uniset::Exception& ex )
......@@ -570,33 +571,48 @@ bool UniSetObject::activate()
throw ORepFailed(err);
}
if( uniset_conf()->isTransientIOR() )
{
// activate witch generate id
poa->activate_object(static_cast<PortableServer::ServantBase*>(this));
}
else
try
{
// А если myid==uniset::DefaultObjectId
// то myname = noname. ВСЕГДА!
if( myid == uniset::DefaultObjectId )
if( uniset_conf()->isTransientIOR() )
{
ucrit << myname << "(activate): Не задан ID!!! activate failure..." << endl;
// вызываем на случай если она переопределена в дочерних классах
// Например в UniSetManager, если здесь не вызвать, то не будут инициализированы подчинённые объекты.
// (см. UniSetManager::activateObject)
activateObject();
return false;
// activate witch generate id
poa->activate_object(static_cast<PortableServer::ServantBase*>(this));
}
else
{
// А если myid==uniset::DefaultObjectId
// то myname = noname. ВСЕГДА!
if( myid == uniset::DefaultObjectId )
{
ucrit << myname << "(activate): Не задан ID!!! activate failure..." << endl;
// вызываем на случай если она переопределена в дочерних классах
// Например в UniSetManager, если здесь не вызвать, то не будут инициализированы подчинённые объекты.
// (см. UniSetManager::activateObject)
activateObject();
return false;
}
// Always use the same object id.
PortableServer::ObjectId_var oid =
PortableServer::string_to_ObjectId(myname.c_str());
// Always use the same object id.
PortableServer::ObjectId_var oid =
PortableServer::string_to_ObjectId(myname.c_str());
// cerr << myname << "(activate): " << _refcount_value() << endl;
// cerr << myname << "(activate): " << _refcount_value() << endl;
// Activate object...
poa->activate_object_with_id(oid, this);
}
}
catch( const CORBA::Exception& ex )
{
if( string(ex._name()) != "ObjectAlreadyActive" )
{
ostringstream err;
err << myname << "(activate): ACTIVATE ERROR: " << ex._name();
ucrit << myname << "(activate): " << err.str() << endl;
throw uniset::SystemError(err.str());
}
// Activate object...
poa->activate_object_with_id(oid, this);
uwarn << myname << "(activate): IGNORE.. catch " << ex._name() << endl;
}
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment