Commit 7454a2de authored by Pavel Vainerman's avatar Pavel Vainerman

Убрал лишние логи. Добавил принудительную инициализация CORBA-ссылок.

Исправил ошибку в указании имени.
parent 88d63c0f
......@@ -1707,7 +1707,7 @@ ObjectPtr UniversalInterface::resolve( ObjectId rid , ObjectId node, int timeout
// {
if( unideb.debugging(Debug::WARN) )
{
unideb[Debug::WARN] << "не найден IOR-файл для " << uconf->oind->getNameById(rid,node) << endl;
unideb[Debug::WARN] << "not found IOR-file for " << uconf->oind->getNameById(rid,node) << endl;
}
throw UniSetTypes::ResolveNameError();
// }
......@@ -1720,7 +1720,6 @@ ObjectPtr UniversalInterface::resolve( ObjectId rid , ObjectId node, int timeout
if( node!=uconf->getLocalNode() )
{
cout << "******** Resolve REMOTE NODE ***" << endl;
// Получаем доступ к NameService на данном узле
ostringstream s;
s << uconf << oind->getRealNodeName(node);
......@@ -1758,7 +1757,6 @@ ObjectPtr UniversalInterface::resolve( ObjectId rid , ObjectId node, int timeout
}
else
{
cout << "******** Resolve LOCAL NODE ***" << endl;
if( CORBA::is_nil(localctx) )
{
ostringstream s;
......@@ -1776,8 +1774,6 @@ ObjectPtr UniversalInterface::resolve( ObjectId rid , ObjectId node, int timeout
ctx = localctx;
}
ctx = localctx;
cout << "***resolve oname=" << oind->getNameById(rid,node).c_str() << endl;
CosNaming::Name_var oname = omniURI::stringToName( oind->getNameById(rid,node).c_str() );
for (unsigned int i=0; i<uconf->getRepeatCount(); i++)
{
......@@ -1848,7 +1844,7 @@ void UniversalInterface::send( ObjectId name, TransportMessage& msg, ObjectId no
throw(IO_THROW_EXCEPTIONS)
{
if ( name == DefaultObjectId )
throw ORepFailed("UI(send): попытка обратиться к объекту с id=UniSetTypes::DefaultObjectId");
throw ORepFailed("UI(send): ERROR: id=UniSetTypes::DefaultObjectId");
try
{
......
......@@ -29,6 +29,7 @@
#include <sstream>
#include <iomanip>
#include <string>
#include <omniORB4/internal/initRefs.h>
#include "Configuration.h"
#include "Exceptions.h"
......@@ -335,13 +336,20 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
string name(oind->getRealNodeName(it->id));
ostringstream param;
param << this << name << "=corbaname::" << it->host << ":" << it->port;
param << this << name;
name = param.str();
param << "=corbaname::" << it->host << ":" << it->port;
new_argv[i+1] = strdup(param.str().c_str());
if( unideb.debugging(Debug::INFO) )
unideb[Debug::INFO] << "(Configuration): внесли параметр " << param.str() << endl;
i+=2;
ostringstream uri;
uri << "corbaname::" << it->host << ":" << it->port;
if( !omni::omniInitialReferences::setFromArgs(name.c_str(), uri.str().c_str()) )
cerr << "**********************!!!! FAILED ADD name=" << name << " uri=" << uri.str() << endl;
assert( i < _argc );
}
......@@ -369,6 +377,15 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
new_argv[i+1] = strdup(param.str().c_str());
if( unideb.debugging(Debug::INFO) )
unideb[Debug::INFO] << "(Configuration): внесли параметр " << param.str() << endl;
{
ostringstream ns_name;
ns_name << this << "NameService";
ostringstream uri;
uri << "corbaname::" << getProp(nsnode,"host") << ":" << defPort;
if( !omni::omniInitialReferences::setFromArgs(ns_name.str().c_str(), uri.str().c_str()) )
cerr << "**********************!!!! FAILED ADD name=" <<ns_name << " uri=" << uri.str() << endl;
}
}
_argv = new_argv;
......
......@@ -10,13 +10,13 @@ int main( int argc, const char **argv )
try
{
UniSetTypes::Configuration* myconf = new UniSetTypes::Configuration(argc,argv,"test.xml");
// UniversalInterface* ui = new UniversalInterface(myconf);
//cout << "************************ myconf=" << myconf << " conf=" << UniSetTypes::conf << endl;
UniversalInterface* ui = new UniversalInterface(myconf);
UniSetTypes::Configuration* myconf2 = new UniSetTypes::Configuration(argc,argv,"conf21300.xml");
UniversalInterface* ui2 = new UniversalInterface(myconf2);
cout << "************************ " << ui2->getValue(200033) << endl;
cout << "************************ conf1: " << ui->getValue(1) << endl;
cout << "************************ conf2: " << ui2->getValue(200033) << endl;
#if 0
uniset_init(argc,argv,"test.xml");
......
......@@ -4,5 +4,6 @@ SID=$1
[ -z "$SID" ] && SID=1
uniset-start.sh -f ./ui --confile test.xml --sid $SID --unideb-add-levels any -ORBtraceLevel 20
uniset-start.sh -f ./ui --confile test.xml --sid $SID --unideb-add-levels any
# -ORBtraceLevel 20
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