Commit 705c87b3 authored by Pavel Vainerman's avatar Pavel Vainerman

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

Убрал лишние логи. Добавил принудительную инициализация CORBA-ссылок. Исправил ошибку в указании имени.
parent 6bd9f0ec
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
#include <string> #include <string>
#include <omniORB4/internal/initRefs.h>
#include "Configuration.h" #include "Configuration.h"
#include "Exceptions.h" #include "Exceptions.h"
...@@ -335,13 +336,20 @@ void Configuration::initConfiguration( int argc, const char* const* argv ) ...@@ -335,13 +336,20 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
string name(oind->getRealNodeName(it->id)); string name(oind->getRealNodeName(it->id));
ostringstream param; 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()); new_argv[i+1] = strdup(param.str().c_str());
if( unideb.debugging(Debug::INFO) ) if( unideb.debugging(Debug::INFO) )
unideb[Debug::INFO] << "(Configuration): внесли параметр " << param.str() << endl; unideb[Debug::INFO] << "(Configuration): внесли параметр " << param.str() << endl;
i+=2; 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 ); assert( i < _argc );
} }
...@@ -369,6 +377,15 @@ void Configuration::initConfiguration( int argc, const char* const* argv ) ...@@ -369,6 +377,15 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
new_argv[i+1] = strdup(param.str().c_str()); new_argv[i+1] = strdup(param.str().c_str());
if( unideb.debugging(Debug::INFO) ) if( unideb.debugging(Debug::INFO) )
unideb[Debug::INFO] << "(Configuration): внесли параметр " << param.str() << endl; 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; _argv = new_argv;
......
...@@ -9,6 +9,16 @@ int main( int argc, const char **argv ) ...@@ -9,6 +9,16 @@ int main( int argc, const char **argv )
{ {
try try
{ {
UniSetTypes::Configuration* myconf = new UniSetTypes::Configuration(argc,argv,"test.xml");
UniversalInterface* ui = new UniversalInterface(myconf);
UniSetTypes::Configuration* myconf2 = new UniSetTypes::Configuration(argc,argv,"conf21300.xml");
UniversalInterface* ui2 = new UniversalInterface(myconf2);
cout << "************************ conf1: " << ui->getValue(1) << endl;
cout << "************************ conf2: " << ui2->getValue(200033) << endl;
#if 0
uniset_init(argc,argv,"test.xml"); uniset_init(argc,argv,"test.xml");
UniversalInterface ui; UniversalInterface ui;
...@@ -50,6 +60,7 @@ int main( int argc, const char **argv ) ...@@ -50,6 +60,7 @@ int main( int argc, const char **argv )
cout << "id=" << id cout << "id=" << id
<< " value=" << inf.value << " value=" << inf.value
<< " last changed: " << string(t_str) << endl; << " last changed: " << string(t_str) << endl;
#endif
} }
catch( Exception& ex ) catch( Exception& ex )
{ {
......
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