summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Freeze/ConnectionI.cpp12
-rw-r--r--cpp/src/Freeze/EvictorI.cpp42
-rw-r--r--cpp/src/Freeze/SharedDbEnv.cpp102
-rw-r--r--cpp/src/Freeze/TransactionalEvictorI.cpp142
-rw-r--r--cpp/src/FreezeScript/DumpDB.cpp4
-rw-r--r--cpp/src/FreezeScript/transformdb.cpp44
-rw-r--r--cpp/src/Ice/Application.cpp36
-rw-r--r--cpp/src/Ice/DefaultsAndOverrides.cpp4
-rw-r--r--cpp/src/Ice/Instance.cpp76
-rw-r--r--cpp/src/Ice/Service.cpp34
-rw-r--r--cpp/src/IceBox/ServiceManagerI.cpp52
-rw-r--r--cpp/src/IceGrid/RegistryI.cpp120
-rw-r--r--cpp/src/IceGrid/ServerI.cpp164
-rw-r--r--cpp/src/IceStorm/Service.cpp26
-rw-r--r--cpp/src/iceserviceinstall/Install.cpp2
-rw-r--r--cpp/src/iceserviceinstall/ServiceInstaller.cpp24
16 files changed, 442 insertions, 442 deletions
diff --git a/cpp/src/Freeze/ConnectionI.cpp b/cpp/src/Freeze/ConnectionI.cpp
index 5dc7cd7655a..804f542f574 100644
--- a/cpp/src/Freeze/ConnectionI.cpp
+++ b/cpp/src/Freeze/ConnectionI.cpp
@@ -85,10 +85,10 @@ Freeze::ConnectionI::close()
{
(*_mapList.begin())->close();
}
-
+
_dbEnv = 0;
}
-
+
CommunicatorPtr
Freeze::ConnectionI::getCommunicator() const
{
@@ -171,7 +171,7 @@ Freeze::ConnectionI::ConnectionI(const SharedDbEnvPtr& dbEnv) :
_envName(dbEnv->getEnvName()),
_trace(_communicator->getProperties()->getPropertyAsInt("Freeze.Trace.Map")),
_txTrace(_communicator->getProperties()->getPropertyAsInt("Freeze.Trace.Transaction")),
- _deadlockWarning(_communicator->getProperties()->getPropertyAsInt("Freeze.Warn.Deadlocks") != 0),
+ _deadlockWarning(_communicator->getProperties()->getPropertyAsInt("Freeze.Warn.Deadlocks") > 0),
_refCountMutex(new SharedMutex),
_refCount(0)
{
@@ -199,14 +199,14 @@ Freeze::ConnectionI::unregisterMap(MapHelperI* m)
_mapList.remove(m);
}
-Freeze::ConnectionPtr
+Freeze::ConnectionPtr
Freeze::createConnection(const CommunicatorPtr& communicator, const string& envName)
{
-
+
return new ConnectionI(SharedDbEnv::get(communicator, envName, 0));
}
-Freeze::ConnectionPtr
+Freeze::ConnectionPtr
Freeze::createConnection(const CommunicatorPtr& communicator, const string& envName, DbEnv& dbEnv)
{
return new ConnectionI(SharedDbEnv::get(communicator, envName, &dbEnv));
diff --git a/cpp/src/Freeze/EvictorI.cpp b/cpp/src/Freeze/EvictorI.cpp
index c9c4be90440..7bd912767e1 100644
--- a/cpp/src/Freeze/EvictorI.cpp
+++ b/cpp/src/Freeze/EvictorI.cpp
@@ -85,7 +85,7 @@ Freeze::DeactivateController::deactivate()
{
return false;
}
-
+
if(_deactivating)
{
//
@@ -140,9 +140,9 @@ Freeze::DeactivateController::deactivationComplete()
// EvictorIBase
//
-Freeze::EvictorIBase::EvictorIBase(const ObjectAdapterPtr& adapter,
- const string& envName,
- DbEnv* dbEnv,
+Freeze::EvictorIBase::EvictorIBase(const ObjectAdapterPtr& adapter,
+ const string& envName,
+ DbEnv* dbEnv,
const string& filename,
const FacetTypeMap& facetTypes,
const ServantInitializerPtr& initializer,
@@ -164,7 +164,7 @@ Freeze::EvictorIBase::EvictorIBase(const ObjectAdapterPtr& adapter,
_trace = _communicator->getProperties()->getPropertyAsInt("Freeze.Trace.Evictor");
_txTrace = _communicator->getProperties()->getPropertyAsInt("Freeze.Trace.Transaction");
- _deadlockWarning = (_communicator->getProperties()->getPropertyAsInt("Freeze.Warn.Deadlocks") != 0);
+ _deadlockWarning = (_communicator->getProperties()->getPropertyAsInt("Freeze.Warn.Deadlocks") > 0);
}
@@ -233,10 +233,10 @@ Freeze::EvictorIBase::locate(const Current& current, LocalObjectPtr& cookie)
if(_trace >= 3)
{
Trace out(_communicator->getLogger(), "Freeze.Evictor");
- out << "ice_ping found \"" << _communicator->identityToString(current.id)
+ out << "ice_ping found \"" << _communicator->identityToString(current.id)
<< "\" with facet \"" << current.facet + "\"";
}
-
+
cookie = 0;
return _pingObject;
}
@@ -245,7 +245,7 @@ Freeze::EvictorIBase::locate(const Current& current, LocalObjectPtr& cookie)
if(_trace >= 3)
{
Trace out(_communicator->getLogger(), "Freeze.Evictor");
- out << "ice_ping raises FacetNotExistException for \"" << _communicator->identityToString(current.id)
+ out << "ice_ping raises FacetNotExistException for \"" << _communicator->identityToString(current.id)
<< "\" with facet \"" << current.facet + "\"";
}
throw FacetNotExistException(__FILE__, __LINE__);
@@ -255,15 +255,15 @@ Freeze::EvictorIBase::locate(const Current& current, LocalObjectPtr& cookie)
if(_trace >= 3)
{
Trace out(_communicator->getLogger(), "Freeze.Evictor");
- out << "ice_ping will raise ObjectNotExistException for \""
+ out << "ice_ping will raise ObjectNotExistException for \""
<< _communicator->identityToString(current.id) << "\" with facet \"" << current.facet + "\"";
}
return 0;
}
}
-
+
ObjectPtr result = locateImpl(current, cookie);
-
+
if(result == 0)
{
if(hasAnotherFacet(current.id, current.facet))
@@ -275,7 +275,7 @@ Freeze::EvictorIBase::locate(const Current& current, LocalObjectPtr& cookie)
}
-void
+void
Freeze::EvictorIBase::initialize(const Identity& ident, const string& facet, const ObjectPtr& servant)
{
if(_initializer != 0)
@@ -284,7 +284,7 @@ Freeze::EvictorIBase::initialize(const Identity& ident, const string& facet, con
}
}
-void
+void
Freeze::EvictorIBase::updateStats(Statistics& stats, IceUtil::Int64 time)
{
IceUtil::Int64 diff = time - (stats.creationTime + stats.lastSaveTime);
@@ -311,7 +311,7 @@ vector<string>
Freeze::EvictorIBase::allDbs() const
{
vector<string> result;
-
+
try
{
Db db(_dbEnv->getEnv(), 0);
@@ -319,18 +319,18 @@ Freeze::EvictorIBase::allDbs() const
//
// Berkeley DB expects file paths to be UTF8 encoded.
//
- db.open(0, nativeToUTF8(_filename, IceUtil::getProcessStringConverter()).c_str(), 0, DB_UNKNOWN,
+ db.open(0, nativeToUTF8(_filename, IceUtil::getProcessStringConverter()).c_str(), 0, DB_UNKNOWN,
DB_RDONLY, 0);
Dbc* dbc = 0;
db.cursor(0, &dbc, 0);
-
+
Dbt dbKey;
dbKey.set_flags(DB_DBT_MALLOC);
-
+
Dbt dbValue;
dbValue.set_flags(DB_DBT_USERMEM | DB_DBT_PARTIAL);
-
+
bool more = true;
while(more)
{
@@ -338,7 +338,7 @@ Freeze::EvictorIBase::allDbs() const
if(more)
{
string dbName(static_cast<char*>(dbKey.get_data()), dbKey.get_size());
-
+
if(dbName.find(indexPrefix) != 0)
{
result.push_back(dbName);
@@ -346,7 +346,7 @@ Freeze::EvictorIBase::allDbs() const
free(dbKey.get_data());
}
}
-
+
dbc->close();
db.close(0);
}
@@ -359,7 +359,7 @@ Freeze::EvictorIBase::allDbs() const
throw ex;
}
}
-
+
return result;
}
diff --git a/cpp/src/Freeze/SharedDbEnv.cpp b/cpp/src/Freeze/SharedDbEnv.cpp
index f3cbc70ae20..7e8be10420e 100644
--- a/cpp/src/Freeze/SharedDbEnv.cpp
+++ b/cpp/src/Freeze/SharedDbEnv.cpp
@@ -40,7 +40,7 @@ public:
CheckpointThread(SharedDbEnv&, const Time&, Int, Int);
virtual void run();
-
+
void terminate();
private:
@@ -62,7 +62,7 @@ struct MapKey
Ice::CommunicatorPtr communicator;
};
-inline bool
+inline bool
operator<(const MapKey& lhs, const MapKey& rhs)
{
return (lhs.communicator < rhs.communicator) ||
@@ -79,11 +79,11 @@ dbErrCallback(const char* prefix, char* msg)
#else
void
dbErrCallback(const ::DbEnv* /*ignored*/, const char* prefix, const char* msg)
-#endif
+#endif
{
const Freeze::SharedDbEnv* env = reinterpret_cast<const Freeze::SharedDbEnv*>(prefix);
assert(env != 0);
-
+
Ice::Trace out(env->getCommunicator()->getLogger(), "Berkeley DB");
out << "DbEnv \"" << env->getEnvName() << "\": " << msg;
}
@@ -123,7 +123,7 @@ SharedDbEnvMap* sharedDbEnvMap;
}
-Freeze::SharedDbEnvPtr
+Freeze::SharedDbEnvPtr
Freeze::SharedDbEnv::get(const CommunicatorPtr& communicator, const string& envName, DbEnv* env)
{
IceUtilInternal::MutexPtrLock<IceUtil::Mutex> lock(mapMutex);
@@ -149,14 +149,14 @@ Freeze::SharedDbEnv::get(const CommunicatorPtr& communicator, const string& envN
// MapKey not found, let's create and open a new DbEnv
//
IceUtil::UniquePtr<SharedDbEnv> result(new SharedDbEnv(envName, communicator, env));
-
+
//
// Insert it into the map
//
pair<SharedDbEnvMap::iterator, bool> insertResult;
insertResult = sharedDbEnvMap->insert(SharedDbEnvMap::value_type(key, result.get()));
assert(insertResult.second);
-
+
return result.release();
}
@@ -179,7 +179,7 @@ Freeze::SharedDbEnv::~SharedDbEnv()
catch(...)
{
Error out(_communicator->getLogger());
- out << "Freeze DbEnv close error: unknown exception";
+ out << "Freeze DbEnv close error: unknown exception";
}
#ifdef _WIN32
@@ -199,7 +199,7 @@ Freeze::SharedDbEnv::~SharedDbEnv()
}
-Freeze::MapDb*
+Freeze::MapDb*
Freeze::SharedDbEnv::getSharedMapDb(const string& dbName,
const string& key,
const string& value,
@@ -210,7 +210,7 @@ Freeze::SharedDbEnv::getSharedMapDb(const string& dbName,
//
// We don't want to lock to retrieve the catalog or catalog index
//
-
+
if(dbName == _catalog->dbName())
{
_catalog->checkTypes(key, value);
@@ -221,7 +221,7 @@ Freeze::SharedDbEnv::getSharedMapDb(const string& dbName,
_catalogIndexList->checkTypes(key, value);
return _catalogIndexList;
}
-
+
IceUtil::Mutex::Lock lock(_mutex);
SharedDbMap::iterator p = _sharedDbMap.find(dbName);
@@ -232,7 +232,7 @@ Freeze::SharedDbEnv::getSharedMapDb(const string& dbName,
db->connectIndices(indices);
return db;
}
-
+
//
// key not found, let's create and open a new Db
@@ -242,19 +242,19 @@ Freeze::SharedDbEnv::getSharedMapDb(const string& dbName,
// Since we're going to put this SharedDb in the map no matter
// what, we use our own transaction and connection to do so
//
-
+
ConnectionIPtr insertConnection = new ConnectionI(this);
-
- IceUtil::UniquePtr<MapDb> result(new MapDb(insertConnection, dbName, key, value,
+
+ IceUtil::UniquePtr<MapDb> result(new MapDb(insertConnection, dbName, key, value,
keyCompare, indices, createDb));
-
+
//
// Insert it into the map
//
pair<SharedDbMap::iterator, bool> insertResult;
insertResult = _sharedDbMap.insert(SharedDbMap::value_type(dbName, result.get()));
assert(insertResult.second);
-
+
return result.release();
}
@@ -300,7 +300,7 @@ void Freeze::SharedDbEnv::__decRef()
lock.release();
mapLock.acquire();
lock.acquire();
-
+
//
// Now, maybe another thread has deleted 'this'; let's check
// we're still in the map
@@ -310,9 +310,9 @@ void Freeze::SharedDbEnv::__decRef()
{
return;
}
-
+
SharedDbEnvMap::iterator p = sharedDbEnvMap->find(key);
-
+
if(p == sharedDbEnvMap->end() || p->second != this)
{
//
@@ -353,7 +353,7 @@ void Freeze::SharedDbEnv::__decRef()
Freeze::TransactionalEvictorContextPtr
Freeze::SharedDbEnv::createCurrent()
-{
+{
assert(getCurrent() == 0);
Freeze::TransactionalEvictorContextPtr ctx = new TransactionalEvictorContext(this);
@@ -368,7 +368,7 @@ Freeze::SharedDbEnv::createCurrent()
throw IceUtil::ThreadSyscallException(__FILE__, __LINE__, err);
}
#endif
-
+
//
// Give one refcount to this thread!
//
@@ -427,15 +427,15 @@ Freeze::SharedDbEnv::setCurrentTransaction(const Freeze::TransactionPtr& tx)
//
// Release thread's refcount
//
- ctx->__decRef();
+ ctx->__decRef();
}
if(tx != 0)
{
if(ctx == 0 || ctx->transaction().get() != txi.get())
{
- ctx = new TransactionalEvictorContext(txi);
-
+ ctx = new TransactionalEvictorContext(txi);
+
#ifdef _WIN32
if(TlsSetValue(_tsdKey, ctx.get()) == 0)
{
@@ -497,7 +497,7 @@ Freeze::SharedDbEnv::SharedDbEnv(const std::string& envName,
string propertyPrefix = string("Freeze.DbEnv.") + envName;
string dbHome = properties->getPropertyWithDefault(propertyPrefix + ".DbHome", envName);
- string encoding = properties->getPropertyWithDefault(propertyPrefix + ".EncodingVersion",
+ string encoding = properties->getPropertyWithDefault(propertyPrefix + ".EncodingVersion",
encodingVersionToString(Ice::currentEncoding));
_encoding = stringToEncodingVersion(encoding);
IceInternal::checkSupportedEncoding(_encoding);
@@ -530,32 +530,32 @@ Freeze::SharedDbEnv::SharedDbEnv(const std::string& envName,
{
_envHolder.reset(new DbEnv(0));
_env = _envHolder.get();
-
+
if(_trace >= 1)
{
Trace out(_communicator->getLogger(), "Freeze.DbEnv");
out << "opening database environment \"" << envName << "\"";
}
-
+
_env->set_errpfx(reinterpret_cast<char*>(this));
-
+
_env->set_errcall(dbErrCallback);
-
+
#ifdef _WIN32
//
// Berkeley DB may use a different C++ runtime
//
_env->set_alloc(::malloc, ::realloc, ::free);
#endif
-
+
//
// Deadlock detection
//
_env->set_lk_detect(DB_LOCK_YOUNGEST);
-
+
u_int32_t flags = DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_INIT_TXN;
-
- if(properties->getPropertyAsInt(propertyPrefix + ".DbRecoverFatal") != 0)
+
+ if(properties->getPropertyAsInt(propertyPrefix + ".DbRecoverFatal") > 0)
{
flags |= DB_RECOVER_FATAL | DB_CREATE;
}
@@ -563,8 +563,8 @@ Freeze::SharedDbEnv::SharedDbEnv(const std::string& envName,
{
flags |= DB_RECOVER | DB_CREATE;
}
-
- if(properties->getPropertyAsIntWithDefault(propertyPrefix + ".DbPrivate", 1) != 0)
+
+ if(properties->getPropertyAsIntWithDefault(propertyPrefix + ".DbPrivate", 1) > 0)
{
flags |= DB_PRIVATE;
}
@@ -572,8 +572,8 @@ Freeze::SharedDbEnv::SharedDbEnv(const std::string& envName,
//
// Auto delete
//
- bool autoDelete = (properties->getPropertyAsIntWithDefault(propertyPrefix + ".OldLogsAutoDelete", 1) != 0);
-
+ bool autoDelete = (properties->getPropertyAsIntWithDefault(propertyPrefix + ".OldLogsAutoDelete", 1) > 0);
+
if(autoDelete)
{
#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR < 7)
@@ -585,23 +585,23 @@ Freeze::SharedDbEnv::SharedDbEnv(const std::string& envName,
_env->log_set_config(DB_LOG_AUTO_REMOVE, 1);
#endif
}
-
+
//
// Threading
- //
+ //
flags |= DB_THREAD;
//
// Berkeley DB expects file paths to be UTF8 encoded.
//
_env->open(nativeToUTF8(dbHome, getProcessStringConverter()).c_str(), flags, FREEZE_DB_MODE);
-
+
//
// Default checkpoint period is every 120 seconds
//
Int checkpointPeriod = properties->getPropertyAsIntWithDefault(propertyPrefix + ".CheckpointPeriod", 120);
Int kbyte = properties->getPropertyAsIntWithDefault(propertyPrefix + ".PeriodicCheckpointMinSize", 0);
-
+
if(checkpointPeriod > 0)
{
_thread = new CheckpointThread(*this, Time::seconds(checkpointPeriod), kbyte, _trace);
@@ -613,12 +613,12 @@ Freeze::SharedDbEnv::SharedDbEnv(const std::string& envName,
//
_catalog = new MapDb(_communicator, _encoding, catalogName(), Catalog::keyTypeId(),
Catalog::valueTypeId(), _env);
- _catalogIndexList = new MapDb(_communicator, _encoding, catalogIndexListName(),
+ _catalogIndexList = new MapDb(_communicator, _encoding, catalogIndexListName(),
CatalogIndexList::keyTypeId(), CatalogIndexList::valueTypeId(), _env);
}
catch(const ::DbException& dx)
{
- cleanup();
+ cleanup();
throw DatabaseException(__FILE__, __LINE__, dx.what());
}
}
@@ -676,7 +676,7 @@ Freeze::SharedDbEnv::cleanup()
//
// And finally close env
//
-
+
if(_envHolder.get() != 0)
{
try
@@ -691,11 +691,11 @@ Freeze::SharedDbEnv::cleanup()
}
-Freeze::CheckpointThread::CheckpointThread(SharedDbEnv& dbEnv, const Time& checkpointPeriod, Int kbyte, Int trace) :
+Freeze::CheckpointThread::CheckpointThread(SharedDbEnv& dbEnv, const Time& checkpointPeriod, Int kbyte, Int trace) :
Thread("Freeze checkpoint thread"),
- _dbEnv(dbEnv),
- _done(false),
- _checkpointPeriod(checkpointPeriod),
+ _dbEnv(dbEnv),
+ _done(false),
+ _checkpointPeriod(checkpointPeriod),
_kbyte(kbyte),
_trace(trace)
{
@@ -712,11 +712,11 @@ Freeze::CheckpointThread::terminate()
_done = true;
notify();
}
-
+
getThreadControl().join();
}
-void
+void
Freeze::CheckpointThread::run()
{
for(;;)
diff --git a/cpp/src/Freeze/TransactionalEvictorI.cpp b/cpp/src/Freeze/TransactionalEvictorI.cpp
index 46680e0ee0f..85b97ba4a04 100644
--- a/cpp/src/Freeze/TransactionalEvictorI.cpp
+++ b/cpp/src/Freeze/TransactionalEvictorI.cpp
@@ -37,11 +37,11 @@ const int never = 3;
//
// createEvictor functions
-//
+//
Freeze::TransactionalEvictorPtr
-Freeze::createTransactionalEvictor(const ObjectAdapterPtr& adapter,
- const string& envName,
+Freeze::createTransactionalEvictor(const ObjectAdapterPtr& adapter,
+ const string& envName,
const string& filename,
const FacetTypeMap& facetTypes,
const ServantInitializerPtr& initializer,
@@ -52,9 +52,9 @@ Freeze::createTransactionalEvictor(const ObjectAdapterPtr& adapter,
}
TransactionalEvictorPtr
-Freeze::createTransactionalEvictor(const ObjectAdapterPtr& adapter,
- const string& envName,
- DbEnv& dbEnv,
+Freeze::createTransactionalEvictor(const ObjectAdapterPtr& adapter,
+ const string& envName,
+ DbEnv& dbEnv,
const string& filename,
const FacetTypeMap& facetTypes,
const ServantInitializerPtr& initializer,
@@ -69,9 +69,9 @@ Freeze::createTransactionalEvictor(const ObjectAdapterPtr& adapter,
// TransactionalEvictorI
//
-Freeze::TransactionalEvictorI::TransactionalEvictorI(const ObjectAdapterPtr& adapter,
- const string& envName,
- DbEnv* dbEnv,
+Freeze::TransactionalEvictorI::TransactionalEvictorI(const ObjectAdapterPtr& adapter,
+ const string& envName,
+ DbEnv* dbEnv,
const string& filename,
const FacetTypeMap& facetTypes,
const ServantInitializerPtr& initializer,
@@ -80,7 +80,7 @@ Freeze::TransactionalEvictorI::TransactionalEvictorI(const ObjectAdapterPtr& ada
EvictorI<TransactionalEvictorElement>(adapter, envName, dbEnv, filename, facetTypes, initializer, indices, createDb),
_currentEvictorSize(0)
{
-
+
class DispatchInterceptorAdapter : public Ice::DispatchInterceptor
{
public:
@@ -96,16 +96,16 @@ Freeze::TransactionalEvictorI::TransactionalEvictorI(const ObjectAdapterPtr& ada
}
private:
-
+
TransactionalEvictorIPtr _evictor;
};
_interceptor = new DispatchInterceptorAdapter(this);
- string propertyPrefix = string("Freeze.Evictor.") + envName + '.' + _filename;
-
+ string propertyPrefix = string("Freeze.Evictor.") + envName + '.' + _filename;
+
_rollbackOnUserException = _communicator->getProperties()->
- getPropertyAsIntWithDefault(propertyPrefix + ".RollbackOnUserException", 0) != 0;
+ getPropertyAsIntWithDefault(propertyPrefix + ".RollbackOnUserException", 0) > 0;
}
@@ -113,7 +113,7 @@ TransactionPtr
Freeze::TransactionalEvictorI::getCurrentTransaction() const
{
DeactivateController::Guard deactivateGuard(_deactivateController);
-
+
TransactionalEvictorContextPtr ctx = _dbEnv->getCurrent();
if(ctx == 0)
{
@@ -139,14 +139,14 @@ Freeze::TransactionalEvictorI::addFacet(const ObjectPtr& servant, const Identity
checkIdentity(ident);
checkServant(servant);
DeactivateController::Guard deactivateGuard(_deactivateController);
-
+
ObjectStore<TransactionalEvictorElement>* store = findStore(facet, _createDb);
if(store == 0)
{
throw NotFoundException(__FILE__, __LINE__, "addFacet: could not open database for facet '"
+ facet + "'");
}
-
+
Ice::Long currentTime = 0;
if(store->keepStats())
@@ -156,9 +156,9 @@ Freeze::TransactionalEvictorI::addFacet(const ObjectPtr& servant, const Identity
Statistics stats = { currentTime };
ObjectRecord rec = { servant, stats };
-
+
TransactionIPtr tx = beforeQuery();
-
+
if(store->keepStats())
{
updateStats(rec.stats, currentTime);
@@ -175,7 +175,7 @@ Freeze::TransactionalEvictorI::addFacet(const ObjectPtr& servant, const Identity
}
throw ex;
}
-
+
ObjectPrx obj = _adapter->createProxy(ident);
if(!facet.empty())
{
@@ -189,11 +189,11 @@ Freeze::TransactionalEvictorI::removeFacet(const Identity& ident, const string&
{
checkIdentity(ident);
DeactivateController::Guard deactivateGuard(_deactivateController);
-
+
ObjectPtr servant = 0;
bool removed = false;
ObjectStore<TransactionalEvictorElement>* store = findStore(facet, false);
-
+
if(store != 0)
{
TransactionalEvictorContextPtr ctx = _dbEnv->getCurrent();
@@ -206,9 +206,9 @@ Freeze::TransactionalEvictorI::removeFacet(const Identity& ident, const string&
throw DatabaseException(__FILE__, __LINE__, "inactive transaction");
}
}
-
+
removed = store->remove(ident, tx);
-
+
if(removed)
{
if(ctx != 0)
@@ -227,7 +227,7 @@ Freeze::TransactionalEvictorI::removeFacet(const Identity& ident, const string&
}
}
}
-
+
if(!removed)
{
NotRegisteredException ex(__FILE__, __LINE__);
@@ -266,7 +266,7 @@ Freeze::TransactionalEvictorI::hasFacet(const Identity& ident, const string& fac
}
TransactionIPtr tx = beforeQuery();
-
+
if(tx == 0)
{
TransactionalEvictorElementPtr element = store->getIfPinned(ident);
@@ -288,38 +288,38 @@ Freeze::TransactionalEvictorI::hasAnotherFacet(const Identity& ident, const stri
DeactivateController::Guard deactivateGuard(_deactivateController);
//
- // If the object exists in another store, throw FacetNotExistException
+ // If the object exists in another store, throw FacetNotExistException
// instead of returning 0 (== ObjectNotExistException)
- //
+ //
StoreMap storeMapCopy;
{
Lock sync(*this);
storeMapCopy = _storeMap;
- }
+ }
TransactionIPtr tx = beforeQuery();
-
+
for(StoreMap::iterator p = storeMapCopy.begin(); p != storeMapCopy.end(); ++p)
{
//
// Do not check again the given facet
//
if((*p).first != facet)
- {
+ {
ObjectStore<TransactionalEvictorElement>* store = (*p).second;
-
+
if(tx == 0 && store->getIfPinned(ident) != 0)
{
return true;
}
-
+
if(store->dbHasObject(ident, tx))
{
return true;
}
}
}
-
+
return false;
}
@@ -357,7 +357,7 @@ Freeze::TransactionalEvictorI::dispatch(Request& request)
#endif
{
}
-
+
~CtxHolder() ICE_NOEXCEPT_FALSE
{
if(_ownCtx)
@@ -382,7 +382,7 @@ Freeze::TransactionalEvictorI::dispatch(Request& request)
const SharedDbEnvPtr& _dbEnv;
#endif
};
-
+
DeactivateController::Guard deactivateGuard(_deactivateController);
@@ -400,15 +400,15 @@ Freeze::TransactionalEvictorI::dispatch(Request& request)
ObjectPtr cachedServant = 0;
TransactionalEvictorContext::ServantHolder servantHolder;
-
+
if(sample == 0)
{
if(ctx != 0)
- {
+ {
try
{
servantHolder.init(ctx, current, store);
- }
+ }
catch(const DeadlockException& dx)
{
assert(dx.tx == ctx->transaction());
@@ -422,9 +422,9 @@ Freeze::TransactionalEvictorI::dispatch(Request& request)
//
// find / load read-only servant
//
-
+
cachedServant = loadCachedServant(current.id, store);
-
+
if(cachedServant == 0)
{
servantNotFound(__FILE__, __LINE__, current);
@@ -436,16 +436,16 @@ Freeze::TransactionalEvictorI::dispatch(Request& request)
assert(sample != 0);
int operationAttributes = sample->ice_operationAttributes(current.operation);
-
+
if(operationAttributes < 0)
{
throw OperationNotExistException(__FILE__, __LINE__);
}
-
+
bool readOnly = (operationAttributes & 0x1) == 0;
-
+
int txMode = (operationAttributes & 0x6) >> 1;
-
+
bool ownCtx = false;
//
@@ -489,7 +489,7 @@ Freeze::TransactionalEvictorI::dispatch(Request& request)
throw OperationNotExistException(__FILE__, __LINE__);
}
}
-
+
if(ctx == 0 && !ownCtx)
{
//
@@ -499,7 +499,7 @@ Freeze::TransactionalEvictorI::dispatch(Request& request)
if(cachedServant == 0)
{
cachedServant = loadCachedServant(current.id, store);
-
+
if(cachedServant == 0)
{
servantNotFound(__FILE__, __LINE__, current);
@@ -512,9 +512,9 @@ Freeze::TransactionalEvictorI::dispatch(Request& request)
//
// Create a new transaction; retry on DeadlockException
//
-
+
bool tryAgain = false;
-
+
do
{
TransactionPtr tx;
@@ -525,7 +525,7 @@ Freeze::TransactionalEvictorI::dispatch(Request& request)
{
ctx = _dbEnv->createCurrent();
}
-
+
#ifndef NDEBUG
CtxHolder ctxHolder(ownCtx, ctx, _dbEnv);
#else
@@ -534,7 +534,7 @@ Freeze::TransactionalEvictorI::dispatch(Request& request)
tx = ctx->transaction();
try
- {
+ {
TransactionalEvictorContext::ServantHolder sh;
if(servantHolder.initialized())
{
@@ -547,7 +547,7 @@ Freeze::TransactionalEvictorI::dispatch(Request& request)
{
sh.init(ctx, current, store);
}
-
+
if(sh.servant() == 0)
{
servantNotFound(__FILE__, __LINE__, current);
@@ -557,7 +557,7 @@ Freeze::TransactionalEvictorI::dispatch(Request& request)
{
sh.markReadWrite();
}
-
+
try
{
DispatchStatus dispatchStatus = sh.servant()->ice_dispatch(request, ctx);
@@ -577,7 +577,7 @@ Freeze::TransactionalEvictorI::dispatch(Request& request)
ctx->rollback();
}
}
-
+
return dispatchStatus;
}
catch(...)
@@ -591,7 +591,7 @@ Freeze::TransactionalEvictorI::dispatch(Request& request)
}
//
// servant holder destructor runs here and may throw (if !rolled back)
- //
+ //
}
catch(const DeadlockException& dx)
{
@@ -609,7 +609,7 @@ Freeze::TransactionalEvictorI::dispatch(Request& request)
}
throw;
}
-
+
//
// commit occurs here (when ownCtx)
//
@@ -654,7 +654,7 @@ Freeze::TransactionalEvictorI::deactivate(const string&)
{
{
Lock sync(*this);
-
+
//
// Set the evictor size to zero, meaning that we will evict
// everything possible.
@@ -701,7 +701,7 @@ Freeze::TransactionalEvictorI::beforeQuery()
throw DatabaseException(__FILE__, __LINE__,"inactive transaction");
}
}
-
+
return tx;
}
@@ -728,12 +728,12 @@ Freeze::TransactionalEvictorI::loadCachedServant(const Identity& ident, ObjectSt
for(;;)
{
TransactionalEvictorElementPtr element = store->pin(ident);
-
+
if(element == 0)
{
return 0;
}
-
+
Lock sync(*this);
if(element->stale())
{
@@ -742,9 +742,9 @@ Freeze::TransactionalEvictorI::loadCachedServant(const Identity& ident, ObjectSt
//
continue;
}
-
+
fixEvictPosition(element);
-
+
//
// if _evictorSize is 0, I may evict myself ... no big deal
//
@@ -760,7 +760,7 @@ Freeze::TransactionalEvictorI::evict(const Identity& ident, ObjectStore<Transact
// Important: we can't wait for the DB (even indirectly) with 'this' locked
//
TransactionalEvictorElementPtr element = store->getIfPinned(ident, true);
-
+
if(element != 0)
{
Lock sync(*this);
@@ -773,7 +773,7 @@ Freeze::TransactionalEvictorI::evict(const Identity& ident, ObjectStore<Transact
return 0;
}
-void
+void
Freeze::TransactionalEvictorI::evict(const TransactionalEvictorElementPtr& element)
{
//
@@ -782,7 +782,7 @@ Freeze::TransactionalEvictorI::evict(const TransactionalEvictorElementPtr& eleme
assert(!element->_stale);
element->_stale = true;
element->_store.unpin(element->_cachePosition);
-
+
if(element->_inEvictor)
{
element->_inEvictor = false;
@@ -791,7 +791,7 @@ Freeze::TransactionalEvictorI::evict(const TransactionalEvictorElementPtr& eleme
}
}
-void
+void
Freeze::TransactionalEvictorI::fixEvictPosition(const TransactionalEvictorElementPtr& element)
{
//
@@ -799,7 +799,7 @@ Freeze::TransactionalEvictorI::fixEvictPosition(const TransactionalEvictorElemen
//
assert(!element->_stale);
-
+
if(element->_inEvictor)
{
_evictorList.erase(element->_evictPosition);
@@ -823,10 +823,10 @@ Freeze::TransactionalEvictorI::servantNotFound(const char* file, int line, const
if(_trace >= 2)
{
Trace out(_communicator->getLogger(), "Freeze.Evictor");
- out << "could not find \"" << _communicator->identityToString(current.id)
- << "\" with facet \"" << current.facet + "\"";
+ out << "could not find \"" << _communicator->identityToString(current.id)
+ << "\" with facet \"" << current.facet + "\"";
}
-
+
if(hasAnotherFacet(current.id, current.facet))
{
throw FacetNotExistException(file, line, current.id, current.facet, current.operation);
@@ -853,7 +853,7 @@ Freeze::TransactionalEvictorElement::~TransactionalEvictorElement()
{
}
-void
+void
Freeze::TransactionalEvictorElement::init(ObjectStore<TransactionalEvictorElement>::Position p)
{
_stale = false;
diff --git a/cpp/src/FreezeScript/DumpDB.cpp b/cpp/src/FreezeScript/DumpDB.cpp
index 736f22e0d9d..b630ae27133 100644
--- a/cpp/src/FreezeScript/DumpDB.cpp
+++ b/cpp/src/FreezeScript/DumpDB.cpp
@@ -186,7 +186,7 @@ run(const Ice::StringSeq& originalArgs, const Ice::CommunicatorPtr& communicator
//
Ice::PropertiesPtr props = communicator->getProperties();
string prefix = "Freeze.DbEnv." + args[0];
- if(props->getPropertyAsIntWithDefault(prefix + ".DbPrivate", 1) == 0)
+ if(props->getPropertyAsIntWithDefault(prefix + ".DbPrivate", 1) <= 0)
{
props->setProperty(prefix + ".LockFile", "0");
}
@@ -315,7 +315,7 @@ run(const Ice::StringSeq& originalArgs, const Ice::CommunicatorPtr& communicator
{
selectExpr = opts.optArg("select");
}
-
+
if(outputFile.empty() && args.size() != 2)
{
usage(appName);
diff --git a/cpp/src/FreezeScript/transformdb.cpp b/cpp/src/FreezeScript/transformdb.cpp
index 7021e125e91..06b907059be 100644
--- a/cpp/src/FreezeScript/transformdb.cpp
+++ b/cpp/src/FreezeScript/transformdb.cpp
@@ -118,9 +118,9 @@ findType(const Slice::UnitPtr& u, const string& type)
static void
transformDb(bool evictor, const Ice::CommunicatorPtr& communicator,
const FreezeScript::ObjectFactoryPtr& objectFactory,
- DbEnv& dbEnv, DbEnv& dbEnvNew, const string& dbName,
+ DbEnv& dbEnv, DbEnv& dbEnvNew, const string& dbName,
const Freeze::ConnectionPtr& connectionNew, vector<Db*>& dbs,
- const Slice::UnitPtr& oldUnit, const Slice::UnitPtr& newUnit,
+ const Slice::UnitPtr& oldUnit, const Slice::UnitPtr& newUnit,
DbTxn* txnNew, bool purgeObjects, bool suppress, string descriptors)
{
if(evictor)
@@ -139,10 +139,10 @@ transformDb(bool evictor, const Ice::CommunicatorPtr& communicator,
Dbt dbKey, dbValue;
dbKey.set_flags(DB_DBT_MALLOC);
dbValue.set_flags(DB_DBT_USERMEM | DB_DBT_PARTIAL);
-
+
Dbc* dbc = 0;
db.cursor(0, &dbc, 0);
-
+
while(dbc->get(&dbKey, &dbValue, DB_NEXT) == 0)
{
string s(static_cast<char*>(dbKey.get_data()), dbKey.get_size());
@@ -152,11 +152,11 @@ transformDb(bool evictor, const Ice::CommunicatorPtr& communicator,
}
free(dbKey.get_data());
}
-
+
dbc->close();
db.close(0);
}
-
+
//
// Transform each database. We must delay closing the new databases
// until after the transaction is committed or aborted.
@@ -164,14 +164,14 @@ transformDb(bool evictor, const Ice::CommunicatorPtr& communicator,
for(vector<string>::iterator p = dbNames.begin(); p != dbNames.end(); ++p)
{
string name = p->c_str();
-
+
Db db(&dbEnv, 0);
db.open(0, dbName.c_str(), name.c_str(), DB_BTREE, DB_RDONLY, FREEZE_SCRIPT_DB_MODE);
-
+
Db* dbNew = new Db(&dbEnvNew, 0);
dbs.push_back(dbNew);
dbNew->open(txnNew, dbName.c_str(), name.c_str(), DB_BTREE, DB_CREATE | DB_EXCL, FREEZE_SCRIPT_DB_MODE);
-
+
//
// Execute the transformation descriptors.
//
@@ -179,10 +179,10 @@ transformDb(bool evictor, const Ice::CommunicatorPtr& communicator,
string facet = (name == "$default" ? string("") : name);
FreezeScript::transformDatabase(communicator, objectFactory, oldUnit, newUnit, &db, dbNew, txnNew, 0,
dbName, facet, purgeObjects, cerr, suppress, istr);
-
+
db.close(0);
}
-
+
Freeze::Catalog catalogNew(connectionNew, Freeze::catalogName());
Freeze::CatalogData catalogData = { true, "::Ice::Identity", "Object" };
catalogNew.put(Freeze::Catalog::value_type(dbName, catalogData));
@@ -194,18 +194,18 @@ transformDb(bool evictor, const Ice::CommunicatorPtr& communicator,
//
Db db(&dbEnv, 0);
db.open(0, dbName.c_str(), 0, DB_BTREE, DB_RDONLY, FREEZE_SCRIPT_DB_MODE);
-
+
Db* dbNew = new Db(&dbEnvNew, 0);
dbs.push_back(dbNew);
dbNew->open(txnNew, dbName.c_str(), 0, DB_BTREE, DB_CREATE | DB_EXCL, FREEZE_SCRIPT_DB_MODE);
-
+
//
// Execute the transformation descriptors.
//
istringstream istr(descriptors);
FreezeScript::transformDatabase(communicator, objectFactory, oldUnit, newUnit, &db, dbNew, txnNew,
connectionNew, dbName, "", purgeObjects, cerr, suppress, istr);
-
+
db.close(0);
}
}
@@ -429,7 +429,7 @@ run(const Ice::StringSeq& originalArgs, const Ice::CommunicatorPtr& communicator
{
Ice::PropertiesPtr props = communicator->getProperties();
string prefix = "Freeze.DbEnv." + args[0];
- if(props->getPropertyAsIntWithDefault(prefix + ".DbPrivate", 1) == 0)
+ if(props->getPropertyAsIntWithDefault(prefix + ".DbPrivate", 1) <= 0)
{
props->setProperty(prefix + ".LockFile", "0");
}
@@ -483,7 +483,7 @@ run(const Ice::StringSeq& originalArgs, const Ice::CommunicatorPtr& communicator
// If no input file was provided, then we need to analyze the Slice types.
//
string descriptors;
-
+
if(inputFile.empty())
{
ostringstream out;
@@ -576,17 +576,17 @@ run(const Ice::StringSeq& originalArgs, const Ice::CommunicatorPtr& communicator
// If we are not generating an output file, we have to stop now.
//
if(outputFile.empty() && (!oldKeyType || !newKeyType || !oldValueType || !newValueType))
- {
+ {
return EXIT_FAILURE;
}
-
+
analyzer.addDatabase(p->first, oldKeyType, newKeyType, oldValueType, newValueType);
}
}
else
{
string oldKeyName, newKeyName, oldValueName, newValueName;
-
+
string::size_type pos;
if(!evictor && (keyTypeNames.empty() || valueTypeNames.empty()))
@@ -634,7 +634,7 @@ run(const Ice::StringSeq& originalArgs, const Ice::CommunicatorPtr& communicator
newValueName = valueTypeNames.substr(pos + 1);
}
}
-
+
if(evictor)
{
if(oldKeyName.empty())
@@ -683,7 +683,7 @@ run(const Ice::StringSeq& originalArgs, const Ice::CommunicatorPtr& communicator
// Stop now if any of the types could not be found.
//
if(!oldKeyType || !newKeyType || !oldValueType || !newValueType)
- {
+ {
return EXIT_FAILURE;
}
@@ -839,7 +839,7 @@ run(const Ice::StringSeq& originalArgs, const Ice::CommunicatorPtr& communicator
}
else
{
- transformDb(evictor, communicator, objectFactory, dbEnv, dbEnvNew, dbName, connectionNew, dbs,
+ transformDb(evictor, communicator, objectFactory, dbEnv, dbEnvNew, dbName, connectionNew, dbs,
oldUnit, newUnit, txnNew, purgeObjects, suppress, descriptors);
}
}
diff --git a/cpp/src/Ice/Application.cpp b/cpp/src/Ice/Application.cpp
index e8c95c333b8..0ba9368c797 100644
--- a/cpp/src/Ice/Application.cpp
+++ b/cpp/src/Ice/Application.cpp
@@ -73,7 +73,7 @@ CtrlCHandlerCallback _previousCallback = 0;
//
// Variables that are immutable during run() and until communicator->destroy() has returned;
-// before and after run(), and once communicator->destroy() has returned, we assume that
+// before and after run(), and once communicator->destroy() has returned, we assume that
// only the main thread and CtrlCHandler threads are running.
//
CtrlCHandler* _ctrlCHandler = 0;
@@ -109,7 +109,7 @@ holdInterruptCallback(int signal)
{
IceInternal::Application::_condVar->wait(lock);
}
-
+
if(IceInternal::Application::_destroyed)
{
//
@@ -120,7 +120,7 @@ holdInterruptCallback(int signal)
assert(_ctrlCHandler != 0);
callback = _ctrlCHandler->getCallback();
}
-
+
if(callback != 0)
{
callback(signal);
@@ -149,7 +149,7 @@ destroyOnInterruptCallback(int signal)
IceInternal::Application::_interrupted = true;
IceInternal::Application::_destroyed = true;
}
-
+
try
{
assert(IceInternal::Application::_communicator != 0);
@@ -367,7 +367,7 @@ Ice::Application::main(int argc, char* argv[], const InitializationData& initial
if(argc > 0 && argv[0] && LoggerIPtr::dynamicCast(getProcessLogger()))
{
const bool convert = initializationData.properties ?
- initializationData.properties->getPropertyAsIntWithDefault("Ice.LogStdErr.Convert", 1) == 1 &&
+ initializationData.properties->getPropertyAsIntWithDefault("Ice.LogStdErr.Convert", 1) > 0 &&
initializationData.properties->getProperty("Ice.StdErr").empty() : true;
setProcessLogger(new LoggerI(argv[0], "", convert, IceUtil::getProcessStringConverter()));
}
@@ -379,7 +379,7 @@ Ice::Application::main(int argc, char* argv[], const InitializationData& initial
return EXIT_FAILURE;
}
int status;
-
+
//
// We parse the properties here to extract Ice.ProgramName.
//
@@ -400,9 +400,9 @@ Ice::Application::main(int argc, char* argv[], const InitializationData& initial
out << "unknown exception";
return EXIT_FAILURE;
}
- IceInternal::Application::_appName = initData.properties->getPropertyWithDefault("Ice.ProgramName",
+ IceInternal::Application::_appName = initData.properties->getPropertyWithDefault("Ice.ProgramName",
IceInternal::Application::_appName);
-
+
//
// Used by destroyOnInterruptCallback and shutdownOnInterruptCallback.
//
@@ -420,12 +420,12 @@ Ice::Application::main(int argc, char* argv[], const InitializationData& initial
//
CtrlCHandler ctrCHandler;
_ctrlCHandler = &ctrCHandler;
-
+
status = doMain(argc, argv, initData);
//
// Set _ctrlCHandler to 0 only once communicator->destroy() has completed.
- //
+ //
_ctrlCHandler = 0;
}
catch(const CtrlCHandlerException&)
@@ -439,18 +439,18 @@ Ice::Application::main(int argc, char* argv[], const InitializationData& initial
{
status = doMain(argc, argv, initData);
}
-
+
return status;
}
-int
+int
Ice::Application::main(int argc, char* const argv[], const char* configFile)
{
ArgVector av(argc, argv);
return main(av.argc, av.argv, configFile);
}
-int
+int
Ice::Application::main(int argc, char* const argv[], const Ice::InitializationData& initData)
{
ArgVector av(argc, argv);
@@ -530,7 +530,7 @@ Ice::Application::shutdownOnInterrupt()
else
{
Warning out(getProcessLogger());
- out << "interrupt method called on Application configured to not handle interrupts.";
+ out << "interrupt method called on Application configured to not handle interrupts.";
}
}
@@ -620,7 +620,7 @@ Ice::Application::releaseInterrupt()
// setting _released to true and signalling _condVar
// do no harm.
//
-
+
_released = true;
_ctrlCHandler->setCallback(_previousCallback);
IceInternal::Application::_condVar->signal();
@@ -657,8 +657,8 @@ Ice::Application::doMain(int argc, char* argv[], const InitializationData& initD
//
if(initData.properties->getProperty("Ice.ProgramName") != "" && LoggerIPtr::dynamicCast(getProcessLogger()))
{
- const bool convert =
- initData.properties->getPropertyAsIntWithDefault("Ice.LogStdErr.Convert", 1) == 1 &&
+ const bool convert =
+ initData.properties->getPropertyAsIntWithDefault("Ice.LogStdErr.Convert", 1) > 0 &&
initData.properties->getProperty("Ice.StdErr").empty();
setProcessLogger(new LoggerI(initData.properties->getProperty("Ice.ProgramName"), "", convert,
@@ -667,7 +667,7 @@ Ice::Application::doMain(int argc, char* argv[], const InitializationData& initD
IceInternal::Application::_communicator = initialize(argc, argv, initData);
IceInternal::Application::_destroyed = false;
-
+
//
// The default is to destroy when a signal is received.
//
diff --git a/cpp/src/Ice/DefaultsAndOverrides.cpp b/cpp/src/Ice/DefaultsAndOverrides.cpp
index cabed7d70cb..03bed195abd 100644
--- a/cpp/src/Ice/DefaultsAndOverrides.cpp
+++ b/cpp/src/Ice/DefaultsAndOverrides.cpp
@@ -97,14 +97,14 @@ IceInternal::DefaultsAndOverrides::DefaultsAndOverrides(const PropertiesPtr& pro
if(!value.empty())
{
const_cast<bool&>(overrideCompress) = true;
- const_cast<bool&>(overrideCompressValue) = properties->getPropertyAsInt("Ice.Override.Compress");
+ const_cast<bool&>(overrideCompressValue) = properties->getPropertyAsInt("Ice.Override.Compress") > 0;
}
value = properties->getProperty("Ice.Override.Secure");
if(!value.empty())
{
const_cast<bool&>(overrideSecure) = true;
- const_cast<bool&>(overrideSecureValue) = properties->getPropertyAsInt("Ice.Override.Secure");
+ const_cast<bool&>(overrideSecureValue) = properties->getPropertyAsInt("Ice.Override.Secure") > 0;
}
const_cast<bool&>(defaultCollocationOptimization) =
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index 2e0ccf2e502..2157b7704b5 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -188,13 +188,13 @@ private:
//
-// Timer specialization which supports the thread observer
+// Timer specialization which supports the thread observer
//
class Timer : public IceUtil::Timer
{
public:
- Timer(int priority) : IceUtil::Timer(priority)
+ Timer(int priority) : IceUtil::Timer(priority)
{
}
@@ -220,9 +220,9 @@ Timer::updateObserver(const Ice::Instrumentation::CommunicatorObserverPtr& obsv)
{
IceUtil::Mutex::Lock sync(_mutex);
assert(obsv);
- _observer.attach(obsv->getThreadObserver("Communicator",
- "Ice.Timer",
- Ice::Instrumentation::ThreadStateIdle,
+ _observer.attach(obsv->getThreadObserver("Communicator",
+ "Ice.Timer",
+ Ice::Instrumentation::ThreadStateIdle,
_observer.get()));
_hasObserver = _observer.get();
}
@@ -239,7 +239,7 @@ Timer::runTimerTask(const IceUtil::TimerTaskPtr& task)
}
if(threadObserver)
{
- threadObserver->stateChanged(Ice::Instrumentation::ThreadStateIdle,
+ threadObserver->stateChanged(Ice::Instrumentation::ThreadStateIdle,
Ice::Instrumentation::ThreadStateInUseForOther);
}
try
@@ -250,13 +250,13 @@ Timer::runTimerTask(const IceUtil::TimerTaskPtr& task)
{
if(threadObserver)
{
- threadObserver->stateChanged(Ice::Instrumentation::ThreadStateInUseForOther,
+ threadObserver->stateChanged(Ice::Instrumentation::ThreadStateInUseForOther,
Ice::Instrumentation::ThreadStateIdle);
}
}
if(threadObserver)
{
- threadObserver->stateChanged(Ice::Instrumentation::ThreadStateInUseForOther,
+ threadObserver->stateChanged(Ice::Instrumentation::ThreadStateInUseForOther,
Ice::Instrumentation::ThreadStateIdle);
}
}
@@ -673,9 +673,9 @@ IceInternal::Instance::createAdmin(const ObjectAdapterPtr& adminAdapter, const I
{
ObjectAdapterPtr adapter = adminAdapter;
bool createAdapter = !adminAdapter;
-
+
IceUtil::RecMutex::Lock sync(*this);
-
+
if(_state == StateDestroyed)
{
throw CommunicatorDestroyedException(__FILE__, __LINE__);
@@ -685,17 +685,17 @@ IceInternal::Instance::createAdmin(const ObjectAdapterPtr& adminAdapter, const I
{
throw Ice::IllegalIdentityException(__FILE__, __LINE__, adminIdentity);
}
-
+
if(_adminAdapter)
{
throw InitializationException(__FILE__, __LINE__, "Admin already created");
}
-
+
if(!_adminEnabled)
{
throw InitializationException(__FILE__, __LINE__, "Admin is disabled");
}
-
+
if(createAdapter)
{
if(_initData.properties->getProperty("Ice.Admin.Endpoints") != "")
@@ -712,7 +712,7 @@ IceInternal::Instance::createAdmin(const ObjectAdapterPtr& adminAdapter, const I
_adminAdapter = adapter;
addAllAdminFacets();
sync.release();
-
+
if(createAdapter)
{
try
@@ -723,10 +723,10 @@ IceInternal::Instance::createAdmin(const ObjectAdapterPtr& adminAdapter, const I
{
//
// We clean it up, even through this error is not recoverable
- // (can't call again createAdmin after fixing the problem since all the facets
+ // (can't call again createAdmin after fixing the problem since all the facets
// in the adapter are lost)
//
- adapter->destroy();
+ adapter->destroy();
sync.acquire();
_adminAdapter = 0;
throw;
@@ -740,12 +740,12 @@ Ice::ObjectPrx
IceInternal::Instance::getAdmin()
{
IceUtil::RecMutex::Lock sync(*this);
-
+
if(_state == StateDestroyed)
{
throw CommunicatorDestroyedException(__FILE__, __LINE__);
}
-
+
if(_adminAdapter)
{
return _adminAdapter->createProxy(_adminIdentity);
@@ -761,7 +761,7 @@ IceInternal::Instance::getAdmin()
{
return 0;
}
-
+
Identity adminIdentity;
adminIdentity.name = "admin";
adminIdentity.category = _initData.properties->getProperty("Ice.Admin.InstanceName");
@@ -769,7 +769,7 @@ IceInternal::Instance::getAdmin()
{
adminIdentity.category = IceUtil::generateUUID();
}
-
+
_adminIdentity = adminIdentity;
_adminAdapter = adapter;
addAllAdminFacets();
@@ -782,10 +782,10 @@ IceInternal::Instance::getAdmin()
{
//
// We clean it up, even through this error is not recoverable
- // (can't call again createAdmin after fixing the problem since all the facets
+ // (can't call again createAdmin after fixing the problem since all the facets
// in the adapter are lost)
//
- adapter->destroy();
+ adapter->destroy();
sync.acquire();
_adminAdapter = 0;
throw;
@@ -793,7 +793,7 @@ IceInternal::Instance::getAdmin()
setServerProcessProxy(adapter, adminIdentity);
return adapter->createProxy(adminIdentity);
- }
+ }
else
{
return 0;
@@ -804,12 +804,12 @@ void
IceInternal::Instance::addAllAdminFacets()
{
// must be called with this locked
-
+
//
// Add all facets to OA
//
FacetMap filteredFacets;
-
+
for(FacetMap::iterator p = _adminFacets.begin(); p != _adminFacets.end(); ++p)
{
if(_adminFacetFilter.empty() || _adminFacetFilter.find(p->first) != _adminFacetFilter.end())
@@ -849,8 +849,8 @@ IceInternal::Instance::setServerProcessProxy(const ObjectAdapterPtr& adminAdapte
out << "couldn't register server `" + serverId + "' with the locator registry:\n";
out << "the server is not known to the locator registry";
}
-
- throw InitializationException(__FILE__, __LINE__, "Locator `" + _proxyFactory->proxyToString(locator) +
+
+ throw InitializationException(__FILE__, __LINE__, "Locator `" + _proxyFactory->proxyToString(locator) +
"' knows nothing about server `" + serverId + "'");
}
catch(const LocalException& ex)
@@ -1205,7 +1205,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
}
#else
logStdErrConvert =
- _initData.properties->getPropertyAsIntWithDefault("Ice.LogStdErr.Convert", 1) == 1 &&
+ _initData.properties->getPropertyAsIntWithDefault("Ice.LogStdErr.Convert", 1) > 0 &&
_initData.properties->getProperty("Ice.StdErr").empty();
#endif
}
@@ -1439,7 +1439,7 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[], const Ice::Communica
// Note that any logger-dependent admin facet must be created after we load all plugins,
// since one of these plugins can be a Logger plugin that sets a new logger during loading
//
-
+
if(_initData.properties->getProperty("Ice.Admin.Enabled") == "")
{
_adminEnabled = _initData.properties->getProperty("Ice.Admin.Endpoints") != "";
@@ -1449,12 +1449,12 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[], const Ice::Communica
_adminEnabled = _initData.properties->getPropertyAsInt("Ice.Admin.Enabled") > 0;
}
- StringSeq facetSeq = _initData.properties->getPropertyAsList("Ice.Admin.Facets");
+ StringSeq facetSeq = _initData.properties->getPropertyAsList("Ice.Admin.Facets");
if(!facetSeq.empty())
{
_adminFacetFilter.insert(facetSeq.begin(), facetSeq.end());
}
-
+
if(_adminEnabled)
{
//
@@ -1488,7 +1488,7 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[], const Ice::Communica
_adminFacets.insert(make_pair(propertiesFacetName, propsAdmin));
}
- //
+ //
// Metrics facet
//
const string metricsFacetName = "Metrics";
@@ -1497,7 +1497,7 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[], const Ice::Communica
CommunicatorObserverIPtr observer = new CommunicatorObserverI(_initData);
_initData.observer = observer;
_adminFacets.insert(make_pair(metricsFacetName, observer->getFacet()));
-
+
//
// Make sure the metrics admin facet receives property updates.
//
@@ -1507,15 +1507,15 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[], const Ice::Communica
}
}
}
-
- //
+
+ //
// Set observer updater
//
if(_initData.observer)
{
_initData.observer->setObserverUpdater(new ObserverUpdaterI(this));
}
-
+
//
// Create threads.
//
@@ -1618,7 +1618,7 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[], const Ice::Communica
// Note: getAdmin here can return 0 and do nothing in the event the
// application set Ice.Admin.Enabled but did not set Ice.Admin.Enpoints
// and one or more of the properties required to create the Admin object.
- //
+ //
if(_adminEnabled && _initData.properties->getPropertyAsIntWithDefault("Ice.Admin.DelayCreation", 0) <= 0)
{
getAdmin();
@@ -1678,7 +1678,7 @@ IceInternal::Instance::destroy()
{
CommunicatorObserverIPtr observer = CommunicatorObserverIPtr::dynamicCast(_initData.observer);
if(observer)
- {
+ {
observer->destroy(); // Break cyclic reference counts. Don't clear _observer, it's immutable.
}
_initData.observer->setObserverUpdater(0); // Break cyclic reference count.
diff --git a/cpp/src/Ice/Service.cpp b/cpp/src/Ice/Service.cpp
index f3271be7cb8..fc8b94e7c99 100644
--- a/cpp/src/Ice/Service.cpp
+++ b/cpp/src/Ice/Service.cpp
@@ -155,14 +155,14 @@ typedef IceUtil::Handle<SMEventLogger> SMEventLoggerPtr;
class SMEventLoggerIWrapper : public Ice::Logger
{
public:
-
+
SMEventLoggerIWrapper(const SMEventLoggerPtr& logger, const string& prefix) :
_logger(logger),
_prefix(prefix)
{
assert(_logger);
}
-
+
virtual void
print(const string& message)
{
@@ -186,7 +186,7 @@ public:
{
_logger->error(_prefix, message);
}
-
+
virtual string
getPrefix()
{
@@ -198,9 +198,9 @@ public:
{
return new SMEventLoggerIWrapper(_logger, prefix);
}
-
+
private:
-
+
SMEventLoggerPtr _logger;
const string _prefix;
};
@@ -271,7 +271,7 @@ public:
//
err = RegSetValueExW(hKey, L"EventMessageFile", 0, REG_EXPAND_SZ, reinterpret_cast<unsigned char*>(path),
static_cast<DWORD>((wcslen(path) * sizeof(wchar_t)) + 1));
-
+
if(err == ERROR_SUCCESS)
{
//
@@ -279,7 +279,7 @@ public:
// types.
//
DWORD typesSupported = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE;
- err = RegSetValueExW(hKey, L"TypesSupported", 0, REG_DWORD,
+ err = RegSetValueExW(hKey, L"TypesSupported", 0, REG_DWORD,
reinterpret_cast<unsigned char*>(&typesSupported), sizeof(typesSupported));
}
if(err != ERROR_SUCCESS)
@@ -300,7 +300,7 @@ public:
// Don't need to use a wide string converter as the wide string is passed
// to Windows API.
//
- LONG err = RegDeleteKeyW(HKEY_LOCAL_MACHINE,
+ LONG err = RegDeleteKeyW(HKEY_LOCAL_MACHINE,
IceUtil::stringToWstring(createKey(source), stringConverter).c_str());
if(err != ERROR_SUCCESS)
{
@@ -322,7 +322,7 @@ public:
s.append(message);
print(s);
}
-
+
void
print(const string& message)
{
@@ -352,7 +352,7 @@ public:
s.append(message);
trace(prefix, s);
}
-
+
void
trace(const string& category, const string& message)
{
@@ -390,7 +390,7 @@ public:
s.append(message);
warning(s);
}
-
+
void
warning(const string& message)
{
@@ -437,7 +437,7 @@ public:
//
ReportEventW(_source, EVENTLOG_ERROR_TYPE, 0, EVENT_LOGGER_MSG, 0, 1, 0, messages, 0);
}
-
+
static void
setModuleHandle(HMODULE module)
{
@@ -705,7 +705,7 @@ Ice::Service::main(int& argc, char* argv[], const InitializationData& initializa
#endif
//
- // If no logger has been set yet, we set it to the process logger. If the
+ // If no logger has been set yet, we set it to the process logger. If the
// process logger is the default logger, we change it to a logger which is
// using the program name for the prefix.
//
@@ -714,10 +714,10 @@ Ice::Service::main(int& argc, char* argv[], const InitializationData& initializa
_logger = getProcessLogger();
if(LoggerIPtr::dynamicCast(_logger))
{
- const bool convert =
- initData.properties->getPropertyAsIntWithDefault("Ice.LogStdErr.Convert", 1) == 1 &&
+ const bool convert =
+ initData.properties->getPropertyAsIntWithDefault("Ice.LogStdErr.Convert", 1) > 0 &&
initData.properties->getProperty("Ice.StdErr").empty();
-
+
_logger = new LoggerI(initData.properties->getProperty("Ice.ProgramName"), "", convert,
IceUtil::getProcessStringConverter());
setProcessLogger(_logger);
@@ -727,7 +727,7 @@ Ice::Service::main(int& argc, char* argv[], const InitializationData& initializa
return run(argc, argv, initData);
}
-int
+int
Ice::Service::main(int argc, char* const argv[], const InitializationData& initializationData)
{
IceUtilInternal::ArgVector av(argc, argv);
diff --git a/cpp/src/IceBox/ServiceManagerI.cpp b/cpp/src/IceBox/ServiceManagerI.cpp
index 6d0f732e292..6643db94912 100644
--- a/cpp/src/IceBox/ServiceManagerI.cpp
+++ b/cpp/src/IceBox/ServiceManagerI.cpp
@@ -77,12 +77,12 @@ IceBox::ServiceManagerI::ServiceManagerI(CommunicatorPtr communicator, int& argc
_pendingStatusChanges(false),
_traceServiceObserver(0),
_observerCompletedCB(newCallback(this, &ServiceManagerI::observerCompleted))
-{
+{
_logger = _communicator->getLogger();
PropertiesPtr props = _communicator->getProperties();
_traceServiceObserver = props->getPropertyAsInt("IceBox.Trace.ServiceObserver");
-
+
if(props->getProperty("Ice.Admin.Enabled") == "")
{
_adminEnabled = props->getProperty("Ice.Admin.Endpoints") != "";
@@ -91,7 +91,7 @@ IceBox::ServiceManagerI::ServiceManagerI(CommunicatorPtr communicator, int& argc
{
_adminEnabled = props->getPropertyAsInt("Ice.Admin.Enabled") > 0;
}
-
+
if(_adminEnabled)
{
StringSeq facetSeq = props->getPropertyAsList("Ice.Admin.Facets");
@@ -374,7 +374,7 @@ IceBox::ServiceManagerI::start()
{
InitializationData initData;
initData.properties = createServiceProperties("SharedCommunicator");
-
+
for(vector<StartServiceInfo>::iterator q = servicesInfo.begin(); q != servicesInfo.end(); ++q)
{
if(properties->getPropertyAsInt("IceBox.UseSharedCommunicator." + q->name) <= 0)
@@ -417,7 +417,7 @@ IceBox::ServiceManagerI::start()
}
const string facetNamePrefix = "IceBox.SharedCommunicator.";
- bool addFacets = configureAdmin(initData.properties, facetNamePrefix);
+ bool addFacets = configureAdmin(initData.properties, facetNamePrefix);
_sharedCommunicator = initialize(initData);
@@ -426,7 +426,7 @@ IceBox::ServiceManagerI::start()
// Add all facets created on shared communicator to the IceBox communicator
// but renamed <prefix>.<facet-name>, except for the Process facet which is
// never added.
-
+
FacetMap facets = _sharedCommunicator->findAllAdminFacets();
for(FacetMap::const_iterator p = facets.begin(); p != facets.end(); ++p)
{
@@ -567,7 +567,7 @@ IceBox::ServiceManagerI::start(const string& service, const string& entryPoint,
// property set.
//
Ice::CommunicatorPtr communicator;
-
+
if(_communicator->getProperties()->getPropertyAsInt("IceBox.UseSharedCommunicator." + service) > 0)
{
assert(_sharedCommunicator);
@@ -591,38 +591,38 @@ IceBox::ServiceManagerI::start(const string& service, const string& entryPoint,
// read the service config file if it's specified with --Ice.Config.
//
initData.properties = createProperties(info.args, initData.properties);
-
+
//
// Next, parse the service "<service>.*" command line options (the Ice command
// line options were parsed by the createProperties above)
//
info.args = initData.properties->parseCommandLineOptions(service, info.args);
}
-
+
//
// Clone the logger to assign a new prefix. If one of the built-in loggers is configured
// don't set any logger.
//
- if(initData.properties->getProperty("Ice.LogFile").empty()
+ if(initData.properties->getProperty("Ice.LogFile").empty()
#ifndef _WIN32
- && initData.properties->getPropertyAsInt("Ice.UseSyslog") == 0
+ && initData.properties->getPropertyAsInt("Ice.UseSyslog") <= 0
#endif
)
{
//
- // When _logger is a LoggerAdminLogger, cloneWithPrefix returns a clone of the
+ // When _logger is a LoggerAdminLogger, cloneWithPrefix returns a clone of the
// underlying local logger, not of the LoggerAdminLogger itself
//
initData.logger = _logger->cloneWithPrefix(initData.properties->getProperty("Ice.ProgramName"));
}
-
+
//
// If Admin is enabled on the IceBox communicator, for each service that does not set
// Ice.Admin.Enabled, we set Ice.Admin.Enabled=1 to have this service create facets; then
- // we add these facets to the IceBox Admin object as IceBox.Service.<service>.<facet>.
+ // we add these facets to the IceBox Admin object as IceBox.Service.<service>.<facet>.
//
const string serviceFacetNamePrefix = "IceBox.Service." + service + ".";
- bool addFacets = configureAdmin(initData.properties, serviceFacetNamePrefix);
+ bool addFacets = configureAdmin(initData.properties, serviceFacetNamePrefix);
//
// Remaining command line options are passed to the communicator. This is
@@ -636,7 +636,7 @@ IceBox::ServiceManagerI::start(const string& service, const string& entryPoint,
// Add all facets created on the service communicator to the IceBox communicator
// but renamed IceBox.Service.<service>.<facet-name>, except for the Process facet
// which is never added
-
+
FacetMap facets = communicator->findAllAdminFacets();
for(FacetMap::const_iterator p = facets.begin(); p != facets.end(); ++p)
{
@@ -678,7 +678,7 @@ IceBox::ServiceManagerI::start(const string& service, const string& entryPoint,
LoggerOutputBase s;
s << "ServiceManager: exception in entry point `" + entryPoint + "' for service " << info.name << ":\n";
s << ex;
-
+
FailureException e(__FILE__, __LINE__);
e.reason = s.str();
throw e;
@@ -687,19 +687,19 @@ IceBox::ServiceManagerI::start(const string& service, const string& entryPoint,
{
ostringstream s;
s << "ServiceManager: unknown exception in entry point `" + entryPoint + "' for service " << info.name;
-
+
FailureException e(__FILE__, __LINE__);
e.reason = s.str();
throw e;
}
-
+
//
// Start the service.
//
try
{
info.service->start(info.name, communicator, info.args);
-
+
//
// There is no need to notify the observers since the 'start all'
// (that indirectly calls this function) occurs before the creation of
@@ -979,7 +979,7 @@ IceBox::ServiceManagerI::createServiceProperties(const string& service)
void
ServiceManagerI::observerCompleted(const Ice::AsyncResultPtr& result)
{
- try
+ try
{
result->throwLocalException();
}
@@ -991,7 +991,7 @@ ServiceManagerI::observerCompleted(const Ice::AsyncResultPtr& result)
//
// It's possible to remove several times the same observer, e.g. multiple concurrent
// requests that fail
- //
+ //
set<ServiceObserverPrx>::iterator p = _observers.find(observer);
if(p != _observers.end())
{
@@ -1051,11 +1051,11 @@ IceBox::ServiceManagerI::configureAdmin(const PropertiesPtr& properties, const s
facetNames.push_back(p->substr(prefix.size()));
}
}
-
+
if(_adminFacetFilter.empty() || !facetNames.empty())
{
properties->setProperty("Ice.Admin.Enabled", "1");
-
+
if(!facetNames.empty())
{
// TODO: need joinString with escape!
@@ -1073,7 +1073,7 @@ IceBox::ServiceManagerI::removeAdminFacets(const string& prefix)
try
{
FacetMap facets = _communicator->findAllAdminFacets();
-
+
for(FacetMap::const_iterator p = facets.begin(); p != facets.end(); ++p)
{
if(p->first.find(prefix) == 0)
@@ -1091,4 +1091,4 @@ IceBox::ServiceManagerI::removeAdminFacets(const string& prefix)
// Ignored
}
}
-
+
diff --git a/cpp/src/IceGrid/RegistryI.cpp b/cpp/src/IceGrid/RegistryI.cpp
index 0f8edea64ff..e21f87da173 100644
--- a/cpp/src/IceGrid/RegistryI.cpp
+++ b/cpp/src/IceGrid/RegistryI.cpp
@@ -53,12 +53,12 @@ namespace
class LookupI : public IceGrid::Lookup
{
public:
-
- LookupI(const std::string& instanceName, const WellKnownObjectsManagerPtr& wellKnownObjects) :
+
+ LookupI(const std::string& instanceName, const WellKnownObjectsManagerPtr& wellKnownObjects) :
_instanceName(instanceName), _wellKnownObjects(wellKnownObjects)
{
}
-
+
virtual void
findLocator(const string& instanceName, const LookupReplyPrx& reply, const Ice::Current&)
{
@@ -88,11 +88,11 @@ private:
class FinderI : public Ice::LocatorFinder
{
public:
-
+
FinderI(const WellKnownObjectsManagerPtr& wellKnownObjects) : _wellKnownObjects(wellKnownObjects)
{
}
-
+
virtual Ice::LocatorPrx
getLocator(const Ice::Current&)
{
@@ -107,20 +107,20 @@ private:
class ProcessI : public Process
{
public:
-
+
ProcessI(const RegistryIPtr&, const ProcessPtr&);
virtual void shutdown(const Current&);
virtual void writeMessage(const std::string&, Int, const Current&);
-
+
private:
-
+
RegistryIPtr _registry;
ProcessPtr _origProcess;
};
-ProcessI::ProcessI(const RegistryIPtr& registry, const ProcessPtr& origProcess) :
+ProcessI::ProcessI(const RegistryIPtr& registry, const ProcessPtr& origProcess) :
_registry(registry),
_origProcess(origProcess)
{
@@ -145,7 +145,7 @@ RegistryI::RegistryI(const CommunicatorPtr& communicator,
bool nowarn,
bool readonly,
const string& initFromReplica,
- const string& collocatedNodeName) :
+ const string& collocatedNodeName) :
_communicator(communicator),
_traceLevels(traceLevels),
_nowarn(nowarn),
@@ -215,7 +215,7 @@ RegistryI::startImpl()
{
Warning out(_communicator->getLogger());
out << "session manager endpoints `IceGrid.Registry.SessionManager.Endpoints' enabled";
- if(properties->getPropertyAsInt("IceGrid.Registry.SessionFilters") == 0)
+ if(properties->getPropertyAsInt("IceGrid.Registry.SessionFilters") <= 0)
{
out << " (with Glacier2 filters disabled)";
}
@@ -228,7 +228,7 @@ RegistryI::startImpl()
{
Warning out(_communicator->getLogger());
out << "administrative session manager endpoints `IceGrid.Registry.AdminSessionManager.Endpoints' enabled";
- if(properties->getPropertyAsInt("IceGrid.Registry.AdminSessionFilters") == 0)
+ if(properties->getPropertyAsInt("IceGrid.Registry.AdminSessionFilters") <= 0)
{
out << " (with Glacier2 filters disabled)";
}
@@ -257,7 +257,7 @@ RegistryI::startImpl()
{
Error out(_communicator->getLogger());
out << "invalid --initdb-from-replica option: identical replica";
- return false;
+ return false;
}
if(_sessionTimeout > 0 && properties->getProperty("IceGrid.Registry.Client.ACM.Timemout").empty())
@@ -282,7 +282,7 @@ RegistryI::startImpl()
}
properties->setProperty("Ice.ACM.Server.Close", "3"); // Close on invocation and idle.
-
+
if(!_master && !_communicator->getDefaultLocator())
{
Error out(_communicator->getLogger());
@@ -297,7 +297,7 @@ RegistryI::startImpl()
//
// Get the instance name
//
- _instanceName = properties->getProperty("IceGrid.InstanceName");
+ _instanceName = properties->getProperty("IceGrid.InstanceName");
if(_instanceName.empty())
{
_instanceName = properties->getProperty("IceGridDiscovery.InstanceName");
@@ -341,7 +341,7 @@ RegistryI::startImpl()
_communicator->getProperties()->setProperty("Freeze.DbEnv.Registry.DbHome", dbPath);
const string envName = "Registry";
Freeze::ConnectionPtr connection = Freeze::createConnection(_communicator, envName);
-
+
//
// Ensure that nothing is running on this port. This is also
// useful to ensure that we don't run twice the same instance of
@@ -380,15 +380,15 @@ RegistryI::startImpl()
Identity registryTopicManagerId;
registryTopicManagerId.category = _instanceName;
registryTopicManagerId.name = "RegistryTopicManager";
- _iceStorm = IceStormInternal::Service::create(_communicator,
- _registryAdapter,
- _registryAdapter,
- "IceGrid.Registry",
+ _iceStorm = IceStormInternal::Service::create(_communicator,
+ _registryAdapter,
+ _registryAdapter,
+ "IceGrid.Registry",
registryTopicManagerId,
envName);
const IceStorm::TopicManagerPrx topicManager = _iceStorm->getTopicManager();
- _database = new Database(_registryAdapter, topicManager, _instanceName, _traceLevels, getInfo(), connection,
+ _database = new Database(_registryAdapter, topicManager, _instanceName, _traceLevels, getInfo(), connection,
"Registry", _readonly);
_wellKnownObjects = new WellKnownObjectsManager(_database);
@@ -524,7 +524,7 @@ RegistryI::startImpl()
//
// Create the session servant manager. The session servant manager is responsible
- // for managing sessions servants and to ensure that session servants are only
+ // for managing sessions servants and to ensure that session servants are only
// accessed by the connection that created the session. The session servant manager
// also takes care of providing router servants for admin objects.
//
@@ -533,15 +533,15 @@ RegistryI::startImpl()
ObjectPtr replicaAdminRouter = new RegistryReplicaAdminRouter(_replicaName, _database);
AdminCallbackRouterPtr adminCallbackRouter = new AdminCallbackRouter;
- _servantManager = new SessionServantManager(_clientAdapter, _instanceName, true,
- getServerAdminCategory(), serverAdminRouter,
+ _servantManager = new SessionServantManager(_clientAdapter, _instanceName, true,
+ getServerAdminCategory(), serverAdminRouter,
getNodeAdminCategory(), nodeAdminRouter,
getReplicaAdminCategory(), replicaAdminRouter,
adminCallbackRouter);
-
+
_clientAdapter->addServantLocator(_servantManager, "");
_serverAdapter->addDefaultServant(adminCallbackRouter, "");
-
+
vector<string> verifierProperties;
verifierProperties.push_back("IceGrid.Registry.PermissionsVerifier");
verifierProperties.push_back("IceGrid.Registry.SSLPermissionsVerifier");
@@ -551,7 +551,7 @@ RegistryI::startImpl()
Glacier2Internal::setupNullPermissionsVerifier(_communicator, _instanceName, verifierProperties);
ObjectAdapterPtr sessionAdpt = setupClientSessionFactory(internalLocator);
- ObjectAdapterPtr admSessionAdpt = setupAdminSessionFactory(serverAdminRouter, nodeAdminRouter, replicaAdminRouter,
+ ObjectAdapterPtr admSessionAdpt = setupAdminSessionFactory(serverAdminRouter, nodeAdminRouter, replicaAdminRouter,
internalLocator);
_wellKnownObjects->finish();
@@ -616,7 +616,7 @@ RegistryI::startImpl()
}
}
}
-
+
//
// We are ready to go!
//
@@ -626,7 +626,7 @@ RegistryI::startImpl()
{
discoveryAdapter->activate();
}
-
+
if(sessionAdpt)
{
sessionAdpt->activate();
@@ -664,7 +664,7 @@ RegistryI::setupLocator(const Ice::LocatorRegistryPrx& locatorRegistry,
locatorId.name = "Locator-" + _replicaName;
_clientAdapter->add(locator, locatorId);
-
+
return LocatorPrx::uncheckedCast(_registryAdapter->addWithUUID(locator));
}
@@ -711,13 +711,13 @@ RegistryI::setupInternalRegistry()
// Replace Admin facet
ProcessPtr origProcess = ProcessPtr::dynamicCast(_communicator->removeAdminFacet("Process"));
_communicator->addAdminFacet(new ProcessI(this, origProcess), "Process");
-
+
Identity adminId;
adminId.name = "RegistryAdmin-" + _replicaName;
adminId.category = _instanceName;
_communicator->createAdmin(_registryAdapter, adminId);
}
-
+
InternalRegistryPrx registry = InternalRegistryPrx::uncheckedCast(proxy);
_database->getReplicaCache().setInternalRegistry(registry);
return registry;
@@ -804,7 +804,7 @@ RegistryI::setupClientSessionFactory(const IceGrid::LocatorPrx& locator)
}
Ice::ObjectAdapterPtr
-RegistryI::setupAdminSessionFactory(const Ice::ObjectPtr& serverAdminRouter, const Ice::ObjectPtr& nodeAdminRouter,
+RegistryI::setupAdminSessionFactory(const Ice::ObjectPtr& serverAdminRouter, const Ice::ObjectPtr& nodeAdminRouter,
const Ice::ObjectPtr& replicaAdminRouter, const IceGrid::LocatorPrx& locator)
{
Ice::PropertiesPtr properties = _communicator->getProperties();
@@ -814,9 +814,9 @@ RegistryI::setupAdminSessionFactory(const Ice::ObjectPtr& serverAdminRouter, con
if(!properties->getProperty("IceGrid.Registry.AdminSessionManager.Endpoints").empty())
{
adapter = _communicator->createObjectAdapter("IceGrid.Registry.AdminSessionManager");
- servantManager = new SessionServantManager(adapter, _instanceName, false,
- getServerAdminCategory(), serverAdminRouter,
- getNodeAdminCategory(), nodeAdminRouter,
+ servantManager = new SessionServantManager(adapter, _instanceName, false,
+ getServerAdminCategory(), serverAdminRouter,
+ getNodeAdminCategory(), nodeAdminRouter,
getReplicaAdminCategory(), replicaAdminRouter, 0);
adapter->addServantLocator(servantManager, "");
}
@@ -840,7 +840,7 @@ RegistryI::setupAdminSessionFactory(const Ice::ObjectPtr& serverAdminRouter, con
adapter->add(new AdminSessionManagerI(_adminSessionFactory), sessionMgrId);
adapter->add(new AdminSSLSessionManagerI(_adminSessionFactory), sslSessionMgrId);
-
+
_wellKnownObjects->add(adapter->createProxy(sessionMgrId), Glacier2::SessionManager::ice_staticId());
_wellKnownObjects->add(adapter->createProxy(sslSessionMgrId), Glacier2::SSLSessionManager::ice_staticId());
}
@@ -885,7 +885,7 @@ RegistryI::stop()
{
Warning out(_communicator->getLogger());
out << "unexpected exception while shutting down registry communicator:\n" << ex;
- }
+ }
if(_reaper)
{
@@ -1028,7 +1028,7 @@ RegistryI::createAdminSession(const string& user, const string& password, const
AdminSessionIPtr session = _adminSessionFactory->createSessionServant(user);
Ice::ObjectPrx proxy = session->_register(_servantManager, current.con);
_reaper->add(new SessionReapable<AdminSessionI>(_traceLevels->logger, session), _sessionTimeout);
- return AdminSessionPrx::uncheckedCast(proxy);
+ return AdminSessionPrx::uncheckedCast(proxy);
}
SessionPrx
@@ -1040,7 +1040,7 @@ RegistryI::createSessionFromSecureConnection(const Current& current)
ex.reason = "client session creation is only allowed with the master registry.";
throw ex;
}
-
+
assert(_reaper && _clientSessionFactory);
if(!_sslClientVerifier)
@@ -1140,7 +1140,7 @@ RegistryI::createAdminSessionFromSecureConnection(const Current& current)
exc.reason = "internal server error";
throw exc;
}
-
+
//
// We let the connection access the administrative interface.
//
@@ -1188,13 +1188,13 @@ RegistryI::shutdown()
_clientAdapter->deactivate();
}
-Ice::ObjectPrx
+Ice::ObjectPrx
RegistryI::createAdminCallbackProxy(const Identity& id) const
{
return _serverAdapter->createProxy(id);
}
-Ice::LocatorPrx
+Ice::LocatorPrx
RegistryI::getLocator()
{
return _wellKnownObjects->getLocator();
@@ -1208,7 +1208,7 @@ RegistryI::getPermissionsVerifier(const IceGrid::LocatorPrx& locator,
// Get the permissions verifier
//
ObjectPrx verifier;
-
+
try
{
verifier = _communicator->propertyToProxy(verifierProperty);
@@ -1216,7 +1216,7 @@ RegistryI::getPermissionsVerifier(const IceGrid::LocatorPrx& locator,
catch(const LocalException& ex)
{
Error out(_communicator->getLogger());
- out << "permissions verifier `" << _communicator->getProperties()->getProperty(verifierProperty)
+ out << "permissions verifier `" << _communicator->getProperties()->getProperty(verifierProperty)
<< "' is invalid:\n" << ex;
return 0;
}
@@ -1239,10 +1239,10 @@ RegistryI::getPermissionsVerifier(const IceGrid::LocatorPrx& locator,
if(!verifierPrx)
{
Error out(_communicator->getLogger());
- out << "permissions verifier `" << _communicator->getProperties()->getProperty(verifierProperty)
+ out << "permissions verifier `" << _communicator->getProperties()->getProperty(verifierProperty)
<< "' is invalid";
return 0;
- }
+ }
}
catch(const LocalException& ex)
{
@@ -1269,14 +1269,14 @@ RegistryI::getSSLPermissionsVerifier(const IceGrid::LocatorPrx& locator, const s
{
verifier = _communicator->propertyToProxy(verifierProperty);
}
- catch(const LocalException& ex)
+ catch(const LocalException& ex)
{
Error out(_communicator->getLogger());
- out << "ssl permissions verifier `" << _communicator->getProperties()->getProperty(verifierProperty)
+ out << "ssl permissions verifier `" << _communicator->getProperties()->getProperty(verifierProperty)
<< "' is invalid:\n" << ex;
return 0;
}
-
+
if(!verifier)
{
return 0;
@@ -1298,7 +1298,7 @@ RegistryI::getSSLPermissionsVerifier(const IceGrid::LocatorPrx& locator, const s
out << "ssl permissions verifier `" << _communicator->getProperties()->getProperty(verifierProperty)
<< "' is invalid";
return 0;
- }
+ }
}
catch(const LocalException& ex)
{
@@ -1306,7 +1306,7 @@ RegistryI::getSSLPermissionsVerifier(const IceGrid::LocatorPrx& locator, const s
{
Warning out(_communicator->getLogger());
out << "couldn't contact ssl permissions verifier `"
- << _communicator->getProperties()->getProperty(verifierProperty) << "':\n" << ex;
+ << _communicator->getProperties()->getProperty(verifierProperty) << "':\n" << ex;
}
verifierPrx = Glacier2::SSLPermissionsVerifierPrx::uncheckedCast(verifier->ice_locator(locator));
}
@@ -1387,20 +1387,20 @@ RegistryI::registerReplicas(const InternalRegistryPrx& internalRegistry, const N
continue; // Ignore the master registry proxy.
}
id.name = "InternalRegistry-" + id.name.substr(prefix.size());
-
+
Ice::ObjectPrx prx = (*p)->ice_identity(id)->ice_endpoints(Ice::EndpointSeq());
id.name = "Locator";
prx = prx->ice_locator(Ice::LocatorPrx::uncheckedCast((*p)->ice_identity(id)));
for(map<InternalRegistryPrx, RegistryPrx>::iterator q = replicas.begin(); q != replicas.end(); ++q)
{
- if(q->first->ice_getIdentity() == prx->ice_getIdentity())
+ if(q->first->ice_getIdentity() == prx->ice_getIdentity())
{
replicas.erase(q);
break;
}
}
- replicas.insert(pair<InternalRegistryPrx, RegistryPrx>(InternalRegistryPrx::uncheckedCast(prx),
+ replicas.insert(pair<InternalRegistryPrx, RegistryPrx>(InternalRegistryPrx::uncheckedCast(prx),
RegistryPrx::uncheckedCast(*p)));
}
@@ -1429,16 +1429,16 @@ RegistryI::registerReplicas(const InternalRegistryPrx& internalRegistry, const N
{
replicaName = replicaName.substr(prefix.size());
}
-
+
Ice::Trace out(_traceLevels->logger, _traceLevels->replicaCat);
out << "creating replica `" << replicaName << "' session";
}
-
+
try
{
replica->end_registerWithReplica(*p);
-
+
NodePrxSeq nds = replica->getNodes();
nodes.insert(nds.begin(), nds.end());
@@ -1457,7 +1457,7 @@ RegistryI::registerReplicas(const InternalRegistryPrx& internalRegistry, const N
RegistryPrx registry;
for(map<InternalRegistryPrx, RegistryPrx>::const_iterator q = replicas.begin(); q != replicas.end(); ++q)
{
- if(q->first->ice_getIdentity() == replica->ice_getIdentity())
+ if(q->first->ice_getIdentity() == replica->ice_getIdentity())
{
registry = q->second;
break;
@@ -1490,7 +1490,7 @@ RegistryI::registerReplicas(const InternalRegistryPrx& internalRegistry, const N
}
}
}
-
+
NodePrxSeq result;
for(set<NodePrx>::iterator p = nodes.begin(); p != nodes.end(); ++p)
{
diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp
index 0234020b553..0ea70b5fc14 100644
--- a/cpp/src/IceGrid/ServerI.cpp
+++ b/cpp/src/IceGrid/ServerI.cpp
@@ -100,7 +100,7 @@ chownRecursive(const string& path, uid_t uid, gid_t gid)
{
throw "cannot stat `" + name + "':\n" + IceUtilInternal::lastErrorToString();
}
-
+
if(S_ISDIR(buf.st_mode))
{
chownRecursive(name, uid, gid);
@@ -131,7 +131,7 @@ descriptorUpdated(const InternalServerDescriptorPtr& lhs, const InternalServerDe
lhs->application != rhs->application ||
lhs->uuid != rhs->uuid ||
lhs->sessionId != rhs->sessionId ||
- lhs->exe != rhs->exe ||
+ lhs->exe != rhs->exe ||
lhs->pwd != rhs->pwd ||
lhs->user != rhs->user ||
lhs->activation != rhs->activation ||
@@ -174,7 +174,7 @@ descriptorUpdated(const InternalServerDescriptorPtr& lhs, const InternalServerDe
}
}
}
-
+
if(lhs->dbEnvs.size() != rhs->dbEnvs.size())
{
return true;
@@ -209,7 +209,7 @@ toPropertyDict(const PropertyDescriptorSeq& seq)
{
continue; // Ignore comments.
}
-
+
if(q->value.empty())
{
props.erase(q->name);
@@ -225,31 +225,31 @@ toPropertyDict(const PropertyDescriptorSeq& seq)
class CommandTimeoutTimerTask : public IceUtil::TimerTask
{
public:
-
+
CommandTimeoutTimerTask(const TimedServerCommandPtr& command) : _command(command)
{
}
-
+
virtual void runTimerTask()
{
_command->timeout();
}
private:
-
+
const TimedServerCommandPtr _command;
};
class DelayedStart : public IceUtil::TimerTask
{
public:
-
- DelayedStart(const ServerIPtr& server, const TraceLevelsPtr& traceLevels) :
+
+ DelayedStart(const ServerIPtr& server, const TraceLevelsPtr& traceLevels) :
_server(server),
_traceLevels(traceLevels)
{
}
-
+
virtual void runTimerTask()
{
try
@@ -259,8 +259,8 @@ public:
catch(const ServerStartException& ex)
{
Ice::Error out(_traceLevels->logger);
- out << "couldn't reactivate server `" << _server->getId()
- << "' with `always' activation mode after failure:\n"
+ out << "couldn't reactivate server `" << _server->getId()
+ << "' with `always' activation mode after failure:\n"
<< ex.reason;
}
catch(const Ice::ObjectNotExistException&)
@@ -278,17 +278,17 @@ class ResetPropertiesCB : public IceUtil::Shared
{
public:
- ResetPropertiesCB(const ServerIPtr& server,
- const Ice::ObjectPrx admin,
+ ResetPropertiesCB(const ServerIPtr& server,
+ const Ice::ObjectPrx admin,
const InternalServerDescriptorPtr& desc,
const InternalServerDescriptorPtr& old,
const TraceLevelsPtr& traceLevels) :
- _server(server),
- _admin(admin),
+ _server(server),
+ _admin(admin),
_desc(desc),
_traceLevels(traceLevels),
_properties(server->getProperties(desc)),
- _oldProperties(server->getProperties(old)),
+ _oldProperties(server->getProperties(old)),
_p(_properties.begin())
{
}
@@ -356,17 +356,17 @@ private:
++_p;
Ice::PropertiesAdminPrx p = Ice::PropertiesAdminPrx::uncheckedCast(_admin, facet);
- p->begin_setProperties(props, Ice::newCallback_PropertiesAdmin_setProperties(this,
- &ResetPropertiesCB::next,
+ p->begin_setProperties(props, Ice::newCallback_PropertiesAdmin_setProperties(this,
+ &ResetPropertiesCB::next,
&ResetPropertiesCB::exception));
}
-
+
void
exception(const Ice::Exception& ex)
{
_server->updateRuntimePropertiesCallback(ex, _desc);
}
-
+
const ServerIPtr _server;
const Ice::ObjectPrx _admin;
const InternalServerDescriptorPtr _desc;
@@ -379,7 +379,7 @@ typedef IceUtil::Handle<ResetPropertiesCB> ResetPropertiesCBPtr;
struct EnvironmentEval : std::unary_function<string, string>
{
-
+
string
operator()(const std::string& value)
{
@@ -404,7 +404,7 @@ struct EnvironmentEval : std::unary_function<string, string>
break;
}
string variable = v.substr(beg + 1, end - beg - 1);
- DWORD ret = GetEnvironmentVariableW(IceUtil::stringToWstring(variable).c_str(), &buf[0],
+ DWORD ret = GetEnvironmentVariableW(IceUtil::stringToWstring(variable).c_str(), &buf[0],
static_cast<DWORD>(buf.size()));
string valstr = (ret > 0 && ret < buf.size()) ? IceUtil::wstringToString(&buf[0]) : string("");
v.replace(beg, end - beg + 1, valstr);
@@ -455,7 +455,7 @@ ServerCommand::~ServerCommand()
{
}
-TimedServerCommand::TimedServerCommand(const ServerIPtr& server, const IceUtil::TimerPtr& timer, int timeout) :
+TimedServerCommand::TimedServerCommand(const ServerIPtr& server, const IceUtil::TimerPtr& timer, int timeout) :
ServerCommand(server), _timer(timer), _timeout(timeout)
{
}
@@ -484,9 +484,9 @@ TimedServerCommand::stopTimer()
}
}
-LoadCommand::LoadCommand(const ServerIPtr& server,
- const InternalServerDescriptorPtr& runtime,
- const TraceLevelsPtr& traceLevels) :
+LoadCommand::LoadCommand(const ServerIPtr& server,
+ const InternalServerDescriptorPtr& runtime,
+ const TraceLevelsPtr& traceLevels) :
ServerCommand(server), _runtime(runtime), _updating(false), _traceLevels(traceLevels)
{
}
@@ -522,7 +522,7 @@ LoadCommand::getInternalServerDescriptor() const
return _desc;
}
-bool
+bool
LoadCommand::clearDir() const
{
return _clearDir;
@@ -543,7 +543,7 @@ LoadCommand::startRuntimePropertiesUpdate(const Ice::ObjectPrx& process)
}
assert(_desc != _runtime);
_updating = true;
-
+
ResetPropertiesCBPtr cb = new ResetPropertiesCB(_server, process, _desc, _runtime, _traceLevels);
cb->execute();
}
@@ -577,7 +577,7 @@ LoadCommand::failed(const Ice::Exception& ex)
for(vector<AMD_Node_loadServerPtr>::const_iterator p = _loadCB.begin(); p != _loadCB.end(); ++p)
{
(*p)->ice_exception(ex);
- }
+ }
_loadCB.clear();
}
@@ -591,7 +591,7 @@ LoadCommand::finished(const ServerPrx& proxy, const AdapterPrxDict& adapters, in
_loadCB.clear();
}
-DestroyCommand::DestroyCommand(const ServerIPtr& server, bool loadFailure, bool clearDir) :
+DestroyCommand::DestroyCommand(const ServerIPtr& server, bool loadFailure, bool clearDir) :
ServerCommand(server),
_loadFailure(loadFailure),
_clearDir(clearDir)
@@ -643,8 +643,8 @@ DestroyCommand::clearDir() const
return _clearDir;
}
-PatchCommand::PatchCommand(const ServerIPtr& server) :
- ServerCommand(server),
+PatchCommand::PatchCommand(const ServerIPtr& server) :
+ ServerCommand(server),
_notified(false),
_destroyed(false)
{
@@ -694,7 +694,7 @@ PatchCommand::finished()
{
}
-StartCommand::StartCommand(const ServerIPtr& server, const IceUtil::TimerPtr& timer, int timeout) :
+StartCommand::StartCommand(const ServerIPtr& server, const IceUtil::TimerPtr& timer, int timeout) :
TimedServerCommand(server, timer, timeout)
{
}
@@ -729,7 +729,7 @@ StartCommand::addCallback(const AMD_Server_startPtr& amdCB)
{
_startCB.push_back(amdCB);
}
-
+
void
StartCommand::failed(const string& reason)
{
@@ -738,7 +738,7 @@ StartCommand::failed(const string& reason)
for(vector<AMD_Server_startPtr>::const_iterator p = _startCB.begin(); p != _startCB.end(); ++p)
{
(*p)->ice_exception(ex);
- }
+ }
_startCB.clear();
}
@@ -758,7 +758,7 @@ StopCommand::StopCommand(const ServerIPtr& server, const IceUtil::TimerPtr& time
{
}
-bool
+bool
StopCommand::isStopped(ServerI::InternalServerState state)
{
return state == ServerI::Inactive || state == ServerI::Patching || state == ServerI::Loading;
@@ -806,7 +806,7 @@ StopCommand::failed(const string& reason)
for(vector<AMD_Server_stopPtr>::const_iterator p = _stopCB.begin(); p != _stopCB.end(); ++p)
{
(*p)->ice_exception(ex);
- }
+ }
_stopCB.clear();
}
@@ -834,7 +834,7 @@ ServerI::ServerI(const NodeIPtr& node, const ServerPrx& proxy, const string& ser
_pid(0)
{
assert(_node->getActivator());
- const_cast<int&>(_disableOnFailure) =
+ const_cast<int&>(_disableOnFailure) =
_node->getCommunicator()->getProperties()->getPropertyAsIntWithDefault("IceGrid.Node.DisableOnFailure", 0);
}
@@ -928,7 +928,7 @@ Ice::ObjectPrx
ServerI::getProcess() const
{
Lock sync(*this);
-
+
if(_process == 0 || _state <= Inactive || _state >= Deactivating)
{
return 0;
@@ -939,7 +939,7 @@ ServerI::getProcess() const
}
}
-void
+void
ServerI::setEnabled(bool enabled, const ::Ice::Current&)
{
bool activate = false;
@@ -988,7 +988,7 @@ ServerI::setEnabled(bool enabled, const ::Ice::Current&)
catch(const ServerStartException& ex)
{
Ice::Error out(_node->getTraceLevels()->logger);
- out << "couldn't reactivate server `" << _id << "' with `always' activation mode:\n"
+ out << "couldn't reactivate server `" << _id << "' with `always' activation mode:\n"
<< ex.reason;
}
catch(const Ice::ObjectNotExistException&)
@@ -1059,7 +1059,7 @@ ServerI::getOffsetFromEnd(const string& filename, int count, const Ice::Current&
}
bool
-ServerI::read(const string& filename, Ice::Long pos, int size, Ice::Long& newPos, Ice::StringSeq& lines,
+ServerI::read(const string& filename, Ice::Long pos, int size, Ice::Long& newPos, Ice::StringSeq& lines,
const Ice::Current&) const
{
return _node->getFileCache()->read(getFilePath(filename), pos, size, newPos, lines);
@@ -1074,7 +1074,7 @@ ServerI::isAdapterActivatable(const string& id) const
return false;
}
- if(_desc->activation == "manual" ||
+ if(_desc->activation == "manual" ||
(_desc->activation == "session" && _desc->sessionId.empty()))
{
return false;
@@ -1137,7 +1137,7 @@ ServerI::start(ServerActivation activation, const AMD_Server_startPtr& amdCB)
if(_disableOnFailure > 0 && _failureTime != IceUtil::Time())
{
if(activation == Manual ||
- (_failureTime + IceUtil::Time::seconds(_disableOnFailure) <
+ (_failureTime + IceUtil::Time::seconds(_disableOnFailure) <
IceUtil::Time::now(IceUtil::Time::Monotonic)))
{
_activation = _previousActivation;
@@ -1164,7 +1164,7 @@ ServerI::start(ServerActivation activation, const AMD_Server_startPtr& amdCB)
else if(_activation == Session && _desc->sessionId.empty())
{
throw ServerStartException(_id, "The server is not owned by a session.");
- }
+ }
//
// Check the current state.
@@ -1211,7 +1211,7 @@ ServerI::start(ServerActivation activation, const AMD_Server_startPtr& amdCB)
}
ServerCommandPtr
-ServerI::load(const AMD_Node_loadServerPtr& amdCB, const InternalServerDescriptorPtr& desc, const string& replicaName,
+ServerI::load(const AMD_Node_loadServerPtr& amdCB, const InternalServerDescriptorPtr& desc, const string& replicaName,
bool noRestart)
{
Lock sync(*this);
@@ -1227,7 +1227,7 @@ ServerI::load(const AMD_Node_loadServerPtr& amdCB, const InternalServerDescripto
//
// we don't re-load the server. We just return the server
// proxy and the proxies of its adapters.
- //
+ //
InternalServerDescriptorPtr d = _load ? _load->getInternalServerDescriptor() : _desc;
if(d && (replicaName != "Master" || d->sessionId == desc->sessionId) && !descriptorUpdated(d, desc))
{
@@ -1265,7 +1265,7 @@ ServerI::load(const AMD_Node_loadServerPtr& amdCB, const InternalServerDescripto
_stop = new StopCommand(this, _node->getTimer(), _deactivationTimeout);
}
}
-
+
if(!_load)
{
_load = new LoadCommand(this, _desc, _node->getTraceLevels());
@@ -1296,7 +1296,7 @@ ServerI::load(const AMD_Node_loadServerPtr& amdCB, const InternalServerDescripto
for(ServerAdapterDict::const_iterator p = _adapters.begin(); p != _adapters.end(); ++p)
{
adapters.insert(make_pair(p->first, p->second->getProxy()));
- }
+ }
amdCB->ice_response(_this, adapters, _activationTimeout, _deactivationTimeout);
}
else if(_state == ServerI::Active)
@@ -1462,7 +1462,7 @@ ServerI::adapterActivated(const string& id)
ServerAdapterDict adpts;
{
Lock sync(*this);
- if(_state != ServerI::Activating &&
+ if(_state != ServerI::Activating &&
_state != ServerI::WaitForActivation &&
_state != ServerI::ActivationTimeout)
{
@@ -1628,7 +1628,7 @@ ServerI::activate()
_waitForReplication = false;
_process = 0;
-
+
#ifndef _WIN32
uid = _uid;
gid = _gid;
@@ -1737,7 +1737,7 @@ ServerI::activate()
disableOnFailure();
setStateNoSync(ServerI::Deactivating, failure);
}
-
+
for(ServerAdapterDict::iterator r = adpts.begin(); r != adpts.end(); ++r)
{
try
@@ -1829,7 +1829,7 @@ ServerI::deactivate()
{
Ice::Warning out(_node->getTraceLevels()->logger);
out << "deactivation failed for server `" << _id << "':\n";
- out << ex;
+ out << ex;
setState(ServerI::Inactive); // TODO: Is this really correct?
}
}
@@ -1867,7 +1867,7 @@ ServerI::destroy()
}
}
}
-
+
//
// Destroy the object adapters.
//
@@ -1880,7 +1880,7 @@ ServerI::destroy()
catch(const Ice::LocalException&)
{
}
- }
+ }
setState(Destroyed);
}
@@ -1916,8 +1916,8 @@ ServerI::terminated(const string& msg, int status)
disableOnFailure();
}
- if(_state != ServerI::Deactivating &&
- _state != ServerI::DeactivatingWaitForProcess &&
+ if(_state != ServerI::Deactivating &&
+ _state != ServerI::DeactivatingWaitForProcess &&
_state != ServerI::Destroying)
{
ostringstream os;
@@ -2065,7 +2065,7 @@ ServerI::update()
for(ServerAdapterDict::const_iterator p = _adapters.begin(); p != _adapters.end(); ++p)
{
adapters.insert(make_pair(p->first, p->second->getProxy()));
- }
+ }
_load->finished(_this, adapters, _activationTimeout, _deactivationTimeout);
}
catch(const DeploymentException& ex)
@@ -2129,10 +2129,10 @@ ServerI::updateImpl(const InternalServerDescriptorPtr& descriptor)
// will be used later to not update the configuration on the disk
// (as an optimization and to allow users to review the
// configuration file after allocating a server -- that's useful
- // if the server configuration is bogus and the session server
+ // if the server configuration is bogus and the session server
// can't start).
//
- bool serverSessionReleased = _desc && _desc->activation == "session" &&
+ bool serverSessionReleased = _desc && _desc->activation == "session" &&
_desc->revision == descriptor->revision && !_desc->sessionId.empty() && descriptor->sessionId.empty();
//
@@ -2216,7 +2216,7 @@ ServerI::updateImpl(const InternalServerDescriptorPtr& descriptor)
{
_node->getTimer()->cancel(_timerTask);
_timerTask = 0;
- }
+ }
checkAndUpdateUser(_desc, true); // we pass true to update _uid/_gid.
@@ -2248,7 +2248,7 @@ ServerI::updateImpl(const InternalServerDescriptorPtr& descriptor)
}
}
sort(_logs.begin(), _logs.begin());
-
+
PropertyDescriptorSeqDict properties = getProperties(_desc);
PropertyDescriptorSeq& props = properties["config"];
_stdErrFile = getProperty(props, "Ice.StdErr");
@@ -2282,7 +2282,7 @@ ServerI::updateImpl(const InternalServerDescriptorPtr& descriptor)
//
{
//
- // We do not want to esapce the properties if the Ice version is
+ // We do not want to esapce the properties if the Ice version is
// previous to Ice 3.3.
//
Ice::StringSeq knownFiles;
@@ -2344,10 +2344,10 @@ ServerI::updateImpl(const InternalServerDescriptorPtr& descriptor)
for(InternalDbEnvDescriptorSeq::const_iterator q = _desc->dbEnvs.begin(); q != _desc->dbEnvs.end(); ++q)
{
knownDbEnvs.push_back((*q)->name);
-
+
string dbEnvHome = _serverDir + "/dbs/" + (*q)->name;
createOrUpdateDirectory(dbEnvHome);
-
+
if(!(*q)->properties.empty())
{
string file = dbEnvHome + "/DB_CONFIG";
@@ -2357,7 +2357,7 @@ ServerI::updateImpl(const InternalServerDescriptorPtr& descriptor)
{
throw "couldn't create configuration file `" + file + "'";
}
-
+
for(PropertyDescriptorSeq::const_iterator p = (*q)->properties.begin();
p != (*q)->properties.end(); ++p)
{
@@ -2375,7 +2375,7 @@ ServerI::updateImpl(const InternalServerDescriptorPtr& descriptor)
}
}
sort(knownDbEnvs.begin(), knownDbEnvs.end());
-
+
//
// Remove old database environments.
//
@@ -2429,7 +2429,7 @@ ServerI::checkRevision(const string& replicaName, const string& uuid, int revisi
{
return;
}
-
+
char line[1024];
is.getline(line, 1024); // Ignore comments
is.getline(line, 1024);
@@ -2438,7 +2438,7 @@ ServerI::checkRevision(const string& replicaName, const string& uuid, int revisi
is >> ignore >> descUUID;
is >> ignore >> descRevision;
}
-
+
if(uuid != descUUID)
{
DeploymentException ex;
@@ -2537,7 +2537,7 @@ ServerI::checkAndUpdateUser(const InternalServerDescriptorPtr& desc, bool /*upda
// documentation). So if a user is specified, we just check
// that the node is running under the same user account as the
// one which is specified.
- //
+ //
vector<char> buf(256);
buf.resize(256);
DWORD size = static_cast<DWORD>(buf.size());
@@ -2581,7 +2581,7 @@ ServerI::checkAndUpdateUser(const InternalServerDescriptorPtr& desc, bool /*upda
if(pw->pw_uid == 0 &&
- _node->getCommunicator()->getProperties()->getPropertyAsInt("IceGrid.Node.AllowRunningServersAsRoot") == 0)
+ _node->getCommunicator()->getProperties()->getPropertyAsInt("IceGrid.Node.AllowRunningServersAsRoot") <= 0)
{
throw "running server as `root' is not allowed";
}
@@ -2666,7 +2666,7 @@ ServerI::checkActivation()
if(_state == ServerI::WaitForActivation || _state == ServerI::ActivationTimeout)
{
//
- // Mark the server as active if the server process proxy is registered (or it's not expecting
+ // Mark the server as active if the server process proxy is registered (or it's not expecting
// one to be registered) and if all the server lifetime adapters have been activated.
//
if((!_desc->processRegistered || _process) &&
@@ -2753,7 +2753,7 @@ ServerI::setStateNoSync(InternalServerState st, const std::string& reason)
break;
case Active:
assert(_state == WaitForActivation || _state == ActivationTimeout);
- break;
+ break;
case Deactivating:
//assert(_stop && _stop->canExecute(_state));
break;
@@ -2773,7 +2773,7 @@ ServerI::setStateNoSync(InternalServerState st, const std::string& reason)
//
InternalServerState previous = _state;
_state = st;
-
+
//
// Check if some commands are done.
//
@@ -2896,7 +2896,7 @@ ServerI::setStateNoSync(InternalServerState st, const std::string& reason)
// schedule a callback to re-enable it. We add 500ms to
// the disable on failure duration to make sure that the
// server will be ready to be reactivated when the
- // callback is executed.
+ // callback is executed.
//
assert(!_timerTask);
_timerTask = new DelayedStart(this, _node->getTraceLevels());
@@ -2905,7 +2905,7 @@ ServerI::setStateNoSync(InternalServerState st, const std::string& reason)
IceUtil::Time now = IceUtil::Time::now(IceUtil::Time::Monotonic);
if(now - _failureTime < IceUtil::Time::seconds(_disableOnFailure))
{
- _node->getTimer()->schedule(_timerTask,
+ _node->getTimer()->schedule(_timerTask,
IceUtil::Time::seconds(_disableOnFailure) - now + _failureTime +
IceUtil::Time::milliSeconds(500));
}
@@ -3083,10 +3083,10 @@ ServerI::getDynamicInfo() const
ServerDynamicInfo descriptor;
descriptor.id = _id;
descriptor.state = toServerState(_state);
-
+
//
- // NOTE: this must be done only for the active state. Otherwise, we could get a
- // deadlock since getPid() will lock the activator and since this method might
+ // NOTE: this must be done only for the active state. Otherwise, we could get a
+ // deadlock since getPid() will lock the activator and since this method might
// be called from the activator locked.
//
descriptor.pid = _pid;
@@ -3141,7 +3141,7 @@ ServerI::getProperties(const InternalServerDescriptorPtr& desc)
//
PropertyDescriptorSeqDict properties = desc->properties;
PropertyDescriptorSeq& props = properties["config"];
-
+
//
// Cache the path of the stderr/stdout file, first check if the
// node OutputDir property is set and then we check the server
@@ -3189,7 +3189,7 @@ ServerI::getProperties(const InternalServerDescriptorPtr& desc)
p->second.push_back(createProperty("IceGridDiscovery.InstanceName", _node->getInstanceName()));
}
}
-
+
if(!overrides.empty())
{
p->second.push_back(createProperty("# Node properties override"));
diff --git a/cpp/src/IceStorm/Service.cpp b/cpp/src/IceStorm/Service.cpp
index dc722a2ba6d..673fdae3860 100644
--- a/cpp/src/IceStorm/Service.cpp
+++ b/cpp/src/IceStorm/Service.cpp
@@ -49,14 +49,14 @@ public:
const CommunicatorPtr&,
const StringSeq&);
- virtual void start(const CommunicatorPtr&,
- const ObjectAdapterPtr&,
+ virtual void start(const CommunicatorPtr&,
const ObjectAdapterPtr&,
- const string&,
+ const ObjectAdapterPtr&,
+ const string&,
const Ice::Identity&,
const string&);
- virtual TopicManagerPrx getTopicManager() const;
+ virtual TopicManagerPrx getTopicManager() const;
virtual void stop();
@@ -73,11 +73,11 @@ private:
class FinderI : public IceStorm::Finder
{
public:
-
+
FinderI(const TopicManagerPrx& topicManager) : _topicManager(topicManager)
{
}
-
+
virtual TopicManagerPrx
getTopicManager(const Ice::Current&)
{
@@ -157,7 +157,7 @@ ServiceI::start(
topicManagerId.category = instanceName;
topicManagerId.name = "TopicManager";
- if(properties->getPropertyAsIntWithDefault(name+ ".Transient", 0))
+ if(properties->getPropertyAsIntWithDefault(name+ ".Transient", 0) > 0)
{
_instance = new Instance(instanceName, name, communicator, publishAdapter, topicAdapter, 0);
try
@@ -215,7 +215,7 @@ ServiceI::start(
// We support two possible deployments. The first is a manual
// deployment, the second is IceGrid.
//
- // Here we check for the manual deployment
+ // Here we check for the manual deployment
const string prefix = name + ".Nodes.";
Ice::PropertyDict props = properties->getPropertiesForPrefix(prefix);
if(!props.empty())
@@ -332,10 +332,10 @@ ServiceI::start(
}
Ice::ObjectAdapterPtr nodeAdapter = communicator->createObjectAdapter(name + ".Node");
- _instance = new Instance(instanceName, name, communicator, publishAdapter, topicAdapter,
+ _instance = new Instance(instanceName, name, communicator, publishAdapter, topicAdapter,
nodeAdapter, nodes[id]);
_instance->observers()->setMajority(static_cast<unsigned int>(nodes.size())/2);
-
+
// Trace replication information.
TraceLevelsPtr traceLevels = _instance->traceLevels();
if(traceLevels->election > 0)
@@ -361,7 +361,7 @@ ServiceI::start(
// indirect proxies.
_managerProxy = TopicManagerPrx::uncheckedCast(topicAdapter->createIndirectProxy(topicManagerId));
}
-
+
_manager = new TopicManagerImpl(_instance);
topicAdapter->add(_manager->getServant(), topicManagerId);
@@ -392,9 +392,9 @@ ServiceI::start(
}
}
- topicAdapter->add(new FinderI(TopicManagerPrx::uncheckedCast(topicAdapter->createProxy(topicManagerId))),
+ topicAdapter->add(new FinderI(TopicManagerPrx::uncheckedCast(topicAdapter->createProxy(topicManagerId))),
communicator->stringToIdentity("IceStorm/Finder"));
-
+
topicAdapter->activate();
publishAdapter->activate();
}
diff --git a/cpp/src/iceserviceinstall/Install.cpp b/cpp/src/iceserviceinstall/Install.cpp
index 560e452eac0..facf29d6316 100644
--- a/cpp/src/iceserviceinstall/Install.cpp
+++ b/cpp/src/iceserviceinstall/Install.cpp
@@ -138,7 +138,7 @@ Install::run(int argc, char* argv[])
}
}
- _debug = properties->getPropertyAsInt("Debug") != 0;
+ _debug = properties->getPropertyAsInt("Debug") > 0;
installer.install(properties);
}
diff --git a/cpp/src/iceserviceinstall/ServiceInstaller.cpp b/cpp/src/iceserviceinstall/ServiceInstaller.cpp
index 8766e3fbdbe..b5f0b2c8011 100644
--- a/cpp/src/iceserviceinstall/ServiceInstaller.cpp
+++ b/cpp/src/iceserviceinstall/ServiceInstaller.cpp
@@ -97,7 +97,7 @@ IceServiceInstaller::IceServiceInstaller(int serviceType, const string& configFi
void
IceServiceInstaller::install(const PropertiesPtr& properties)
{
- _debug = properties->getPropertyAsInt("Debug") != 0;
+ _debug = properties->getPropertyAsInt("Debug") > 0;
initializeSid(properties->getPropertyWithDefault("ObjectName", "NT Authority\\LocalService"));
@@ -142,7 +142,7 @@ IceServiceInstaller::install(const PropertiesPtr& properties)
if(_serviceType == icegridregistry)
{
- if(properties->getPropertyAsInt("DependOnRegistry") != 0)
+ if(properties->getPropertyAsInt("DependOnRegistry") > 0)
{
throw "The IceGrid registry service can't depend on itself";
}
@@ -181,14 +181,14 @@ IceServiceInstaller::install(const PropertiesPtr& properties)
grantPermissions("MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib", SE_REGISTRY_KEY, true);
- if(properties->getPropertyAsInt("DependOnRegistry") != 0)
+ if(properties->getPropertyAsInt("DependOnRegistry") > 0)
{
dependency = "icegridregistry." + _icegridInstanceName;
}
}
else if(_serviceType == glacier2router)
{
- if(properties->getPropertyAsInt("DependOnRegistry") != 0)
+ if(properties->getPropertyAsInt("DependOnRegistry") > 0)
{
if(_icegridInstanceName == "")
{
@@ -202,7 +202,7 @@ IceServiceInstaller::install(const PropertiesPtr& properties)
{
grantPermissions(_configFile);
}
-
+
string eventLog = properties->getProperty("EventLog");
if(eventLog == "")
{
@@ -263,7 +263,7 @@ IceServiceInstaller::install(const PropertiesPtr& properties)
command += _configFile + "\"";
}
- bool autoStart = properties->getPropertyAsIntWithDefault("AutoStart", 1) != 0;
+ bool autoStart = properties->getPropertyAsIntWithDefault("AutoStart", 1) > 0;
string password = properties->getProperty("Password");
//
@@ -550,18 +550,18 @@ IceServiceInstaller::grantPermissions(const string& path, SE_OBJECT_TYPE type, b
}
LUID unusedId = { 0 };
-
+
if(!AuthzInitializeContextFromSid(0, _sid, manager, 0, unusedId, 0, &clientContext))
{
throw "AuthzInitializeContextFromSid failed: " + IceUtilInternal::lastErrorToString();
}
- AUTHZ_ACCESS_REQUEST accessRequest = { 0 };
+ AUTHZ_ACCESS_REQUEST accessRequest = { 0 };
accessRequest.DesiredAccess = MAXIMUM_ALLOWED;
accessRequest.PrincipalSelfSid = 0;
accessRequest.ObjectTypeList = 0;
accessRequest.ObjectTypeListLength = 0;
- accessRequest.OptionalArguments = 0;
+ accessRequest.OptionalArguments = 0;
ACCESS_MASK accessMask = 0;
DWORD accessUnused = 0;
@@ -624,7 +624,7 @@ IceServiceInstaller::grantPermissions(const string& path, SE_OBJECT_TYPE type, b
{
ea.grfInheritance = NO_INHERITANCE;
}
-
+
TRUSTEE_W trustee;
BuildTrusteeWithSidW(&trustee, _sid);
ea.Trustee = trustee;
@@ -637,7 +637,7 @@ IceServiceInstaller::grantPermissions(const string& path, SE_OBJECT_TYPE type, b
{
throw "Could not modify ACL for " + path + ": " + IceUtilInternal::errorToString(res);
}
-
+
res = SetNamedSecurityInfoW(const_cast<wchar_t*>(IceUtil::stringToWstring(path).c_str()), type,
DACL_SECURITY_INFORMATION, 0, 0, newAcl, 0);
if(res != ERROR_SUCCESS)
@@ -830,7 +830,7 @@ IceServiceInstaller::removeSource(const string& source) const
// use string converters in calls to stringToWstring.
//
LONG delRes = RegDeleteKeyW(HKEY_LOCAL_MACHINE,
- IceUtil::stringToWstring(createSource(source,
+ IceUtil::stringToWstring(createSource(source,
IceUtil::wstringToString(subkey))).c_str());
if(delRes == ERROR_SUCCESS)
{