Commit d2e0b4a1 authored by Pavel Vainerman's avatar Pavel Vainerman

minor optimization

parent f7cf85eb
......@@ -78,6 +78,7 @@ void UniversalInterface::init()
// NameSerivice
// . ޣ
// localIOR
localctx=CosNaming::NamingContext::_nil();
try
{
if( CORBA::is_nil(orb) )
......@@ -88,13 +89,20 @@ void UniversalInterface::init()
else
localctx = ORepHelpers::getRootNamingContext( orb, oind->getRealNodeName(uconf->getLocalNode()) );
}
catch(Exception& ex )
catch( Exception& ex )
{
if( !uconf->isLocalIOR() )
throw ex;
localctx=CosNaming::NamingContext::_nil();
}
catch( ... )
{
if( !uconf->isLocalIOR() )
throw;
localctx=CosNaming::NamingContext::_nil();
}
}
// ------------------------------------------------------------------------------------------------------------
void UniversalInterface::initBackId( UniSetTypes::ObjectId backid )
......@@ -1563,27 +1571,22 @@ void UniversalInterface::registered( UniSetTypes::ObjectId id, UniSetTypes::Obje
{
// ޣ
// IOR
// ݣ
// NameService (omniNames)
if( uconf->isLocalIOR() )
{
if( CORBA::is_nil(orb) )
orb = uconf->getORB();
string sior(orb->object_to_string(oRef));
uconf->iorfile.setIOR(id,node,sior);
uconf->iorfile.setIOR(id,node,orb->object_to_string(oRef));
return;
}
try
{
string nm=oind->getNameById(id, node);
rep.registration(nm,oRef,(bool)force);
rep.registration(oind->getNameById(id, node),oRef,(bool)force);
}
catch(Exception& ex )
{
if( !uconf->isLocalIOR() )
throw;
throw;
}
}
......@@ -1591,17 +1594,18 @@ void UniversalInterface::registered( UniSetTypes::ObjectId id, UniSetTypes::Obje
void UniversalInterface::unregister(UniSetTypes::ObjectId id, UniSetTypes::ObjectId node)throw(ORepFailed)
{
if( uconf->isLocalIOR() )
{
uconf->iorfile.unlinkIOR(id,node);
return;
}
try
{
string nm = oind->getNameById(id,node);
rep.unregistration(nm);
rep.unregistration(oind->getNameById(id,node));
}
catch(Exception& ex )
{
if( !uconf->isLocalIOR() )
throw;
throw;
}
}
......@@ -1638,14 +1642,17 @@ ObjectPtr UniversalInterface::resolve( ObjectId rid , ObjectId node, int timeout
{
// NameService ,
//
if( CORBA::is_nil(localctx) )
{
unideb[Debug::WARN] << " IOR- " << uconf->oind->getNameById(rid,node) << endl;
// if( CORBA::is_nil(localctx) )
// {
if( unideb.debugging(Debug::WARN) )
{
unideb[Debug::WARN] << " IOR- " << uconf->oind->getNameById(rid,node) << endl;
}
throw UniSetTypes::ResolveNameError();
}
// }
// NameService (omniNames)
unideb[Debug::WARN] << " IOR- " << uconf->oind->getNameById(rid,node)
<< " NameService \n";
// unideb[Debug::WARN] << " IOR- " << uconf->oind->getNameById(rid,node)
// << " NameService \n";
}
}
......
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