diff options
author | Benoit Foucher <benoit@zeroc.com> | 2013-07-03 13:32:02 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2013-07-03 13:32:02 +0200 |
commit | 811c0f63533cfa3bb89945c7792609ebde700777 (patch) | |
tree | dd7586cf1f6ee111334895ca65ae3ef8eb00b3bc /cpp/src/IceGrid/FreezeDB/FreezeDB.cpp | |
parent | Win32 build fixes with optional test (diff) | |
download | ice-811c0f63533cfa3bb89945c7792609ebde700777.tar.bz2 ice-811c0f63533cfa3bb89945c7792609ebde700777.tar.xz ice-811c0f63533cfa3bb89945c7792609ebde700777.zip |
Fixed ICE-5371 - fixed IceGrid registry executable to not require data property to be set to get help or the version with -h/-v
Diffstat (limited to 'cpp/src/IceGrid/FreezeDB/FreezeDB.cpp')
-rw-r--r-- | cpp/src/IceGrid/FreezeDB/FreezeDB.cpp | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/cpp/src/IceGrid/FreezeDB/FreezeDB.cpp b/cpp/src/IceGrid/FreezeDB/FreezeDB.cpp index 5cf4689416c..06faa62a020 100644 --- a/cpp/src/IceGrid/FreezeDB/FreezeDB.cpp +++ b/cpp/src/IceGrid/FreezeDB/FreezeDB.cpp @@ -131,36 +131,47 @@ FreezeConnectionPool::getInternalObjects(const IceDB::DatabaseConnectionPtr& con FreezeDBPlugin::FreezeDBPlugin(const Ice::CommunicatorPtr& communicator) : _communicator(communicator) { +} + +void +FreezeDBPlugin::initialize() +{ +} + +void +FreezeDBPlugin::destroy() +{ + _connectionPool = 0; +} + +bool +FreezeDBPlugin::initDB() +{ string dbPath = _communicator->getProperties()->getProperty("IceGrid.Registry.Data"); if(dbPath.empty()) { - throw Ice::PluginInitializationException(__FILE__, __LINE__, "property `IceGrid.Registry.Data' is not set"); + Ice::Error out(_communicator->getLogger()); + out << "property `IceGrid.Registry.Data' is not set"; + return false; } else { if(!IceUtilInternal::directoryExists(dbPath)) - { - ostringstream os; + { Ice::SyscallException ex(__FILE__, __LINE__); ex.error = IceInternal::getSystemErrno(); - os << "property `IceGrid.Registry.Data' is set to an invalid path:\n" << ex; - throw Ice::PluginInitializationException(__FILE__, __LINE__, os.str()); + + Ice::Error out(_communicator->getLogger()); + out << "property `IceGrid.Registry.Data' is set to an invalid path:\n" << ex; + return false; } } _communicator->getProperties()->setProperty("Freeze.DbEnv.Registry.DbHome", dbPath); -} -void -FreezeDBPlugin::initialize() -{ _connectionPool = new FreezeConnectionPool(_communicator); -} -void -FreezeDBPlugin::destroy() -{ - _connectionPool = 0; + return true; } ConnectionPoolPtr |