diff options
author | Bernard Normier <bernard@zeroc.com> | 2014-09-10 19:09:53 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2014-09-10 19:09:53 +0000 |
commit | ac587d9f1a6d34e46956fd17c81f99beb7ed97ad (patch) | |
tree | fa09b2b2d5b6037c76976ee293eb0d15b7a93717 /cpp/src/IceGrid/NodeCache.cpp | |
parent | Fix networkProxy test dependencies (diff) | |
download | ice-ac587d9f1a6d34e46956fd17c81f99beb7ed97ad.tar.bz2 ice-ac587d9f1a6d34e46956fd17c81f99beb7ed97ad.tar.xz ice-ac587d9f1a6d34e46956fd17c81f99beb7ed97ad.zip |
IceGrid::Admin now provides remote access to IceGrid registry and node Admin objects, and icegridadmin uses these
new operations to show the Ice log file for IceGrid registries and IceGrid nodes (ICE-2400)
Diffstat (limited to 'cpp/src/IceGrid/NodeCache.cpp')
-rw-r--r-- | cpp/src/IceGrid/NodeCache.cpp | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/cpp/src/IceGrid/NodeCache.cpp b/cpp/src/IceGrid/NodeCache.cpp index e7f138ce926..d69de22d689 100644 --- a/cpp/src/IceGrid/NodeCache.cpp +++ b/cpp/src/IceGrid/NodeCache.cpp @@ -55,16 +55,17 @@ struct ToInternalServerDescriptor : std::unary_function<CommunicatorDescriptorPt PropertyDescriptorSeq communicatorProps = desc->propertySet.properties; // - // If this is a service communicator and the IceBox server has admin - // endpoints configured, we ignore the server-lifetime attributes of - // the service object adapters and assume it's set to false. + // If this is a service communicator and the IceBox server has Admin + // enabled or Admin endpoints configured, we ignore the server-lifetime attributes + // of the service object adapters and assume it's set to false. // bool ignoreServerLifetime = false; if(svc) { if(_iceVersion == 0 || _iceVersion >= 30300) { - if(getProperty(_desc->properties["config"], "Ice.Admin.Endpoints") != "") + if(getPropertyAsInt(_desc->properties["config"], "Ice.Admin.Enabled") > 0 || + getProperty(_desc->properties["config"], "Ice.Admin.Endpoints") != "") { ignoreServerLifetime = true; } @@ -538,6 +539,17 @@ NodeEntry::getSession() const return _session; } +Ice::ObjectPrx +NodeEntry::getAdminProxy() const +{ + Ice::ObjectPrx prx = getProxy(); + assert(prx); + Ice::Identity adminId; + adminId.name = "NodeAdmin-" + _name ; + adminId.category = prx->ice_getIdentity().category; + return prx->ice_identity(adminId); +} + bool NodeEntry::canRemove() { @@ -939,12 +951,18 @@ NodeEntry::getInternalServerDescriptor(const ServerInfo& info) const if(iceVersion == 0 || iceVersion >= 30300) { props.push_back(createProperty("Ice.Admin.ServerId", info.descriptor->id)); - if(hasProperty(info.descriptor->propertySet.properties, "Ice.Admin.Endpoints")) + + if(hasProperty(info.descriptor->propertySet.properties, "Ice.Admin.Enabled")) { - if(getProperty(info.descriptor->propertySet.properties, "Ice.Admin.Endpoints") != "") - { - server->processRegistered = true; - } + // Ice.Admin.Enabled explicitely set, leave Ice.Admin.Endpoints alone + server->processRegistered = + getPropertyAsInt(info.descriptor->propertySet.properties, "Ice.Admin.Enabled") > 0; + } + else if(hasProperty(info.descriptor->propertySet.properties, "Ice.Admin.Endpoints")) + { + // Ice.Admin.Endpoints explicitely set, check if not "" + server->processRegistered = + getProperty(info.descriptor->propertySet.properties, "Ice.Admin.Endpoints") != ""; } else { @@ -955,6 +973,10 @@ NodeEntry::getInternalServerDescriptor(const ServerInfo& info) const else { props.push_back(createProperty("Ice.ServerId", info.descriptor->id)); + // + // Prior to Ice 3.3, use adapter's registerProcess to compute server->processRegistered; + // see ToInternalServerDescriptor::operator() above + // } props.push_back(createProperty("Ice.ProgramName", info.descriptor->id)); |