summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/CHANGES3
-rwxr-xr-xcpp/config/PropertyNames.xml19
-rwxr-xr-x[-rw-r--r--]cpp/config/makeprops.py0
-rw-r--r--cpp/slice/Ice/Communicator.ice37
-rw-r--r--cpp/slice/Ice/Properties.ice86
-rw-r--r--cpp/slice/Ice/PropertiesF.ice1
-rw-r--r--cpp/src/Freeze/ConnectionI.cpp21
-rw-r--r--cpp/src/Freeze/MapI.cpp1
-rw-r--r--cpp/src/Freeze/TransactionI.cpp1
-rw-r--r--cpp/src/Ice/CommunicatorI.cpp18
-rw-r--r--cpp/src/Ice/CommunicatorI.h4
-rw-r--r--cpp/src/Ice/Instance.cpp179
-rw-r--r--cpp/src/Ice/Instance.h25
-rw-r--r--cpp/src/Ice/ObjectAdapterI.cpp28
-rw-r--r--cpp/src/Ice/ObjectAdapterI.h15
-rw-r--r--cpp/src/Ice/PropertiesI.cpp42
-rw-r--r--cpp/src/Ice/PropertiesI.h20
-rw-r--r--cpp/src/Ice/PropertyNames.cpp83
-rw-r--r--cpp/src/Ice/PropertyNames.h2
-rw-r--r--cpp/src/IceBox/Service.cpp1
-rw-r--r--cpp/src/IceBox/ServiceManagerI.cpp14
-rw-r--r--cpp/src/IceGrid/DescriptorHelper.cpp51
-rw-r--r--cpp/src/IceGrid/DescriptorHelper.h20
-rwxr-xr-xcpp/src/IceUtil/Timer.cpp2
-rw-r--r--cpp/test/Freeze/dbmap/Client.cpp48
-rw-r--r--cpp/test/Glacier2/router/Client.cpp26
-rwxr-xr-xcpp/test/Glacier2/router/run.py3
27 files changed, 606 insertions, 144 deletions
diff --git a/cpp/CHANGES b/cpp/CHANGES
index 50e002cf7f9..fb8e7668848 100644
--- a/cpp/CHANGES
+++ b/cpp/CHANGES
@@ -1,6 +1,9 @@
Changes since version 3.2.X (binary incompatible)
-------------------------------------------------
+- Fixed IceGrid bug where updates to IceBox services were not
+ correctly sent to the IceGrid GUI or IceGrid registry slaves.
+
- Setting IceBox.ServiceManager.Endpoints is no longer necessary
in order to run the IceBox service. If no endpoints are specified
the the ServiceManager interface is not created.
diff --git a/cpp/config/PropertyNames.xml b/cpp/config/PropertyNames.xml
index a9a320e7ba5..3960d45ab44 100755
--- a/cpp/config/PropertyNames.xml
+++ b/cpp/config/PropertyNames.xml
@@ -267,7 +267,7 @@ generated from the section label.
<suffix name="Endpoints" />
<suffix name="Locator" />
<suffix name="PublishedEndpoints" />
- <suffix name="RegisterProcess" />
+ <suffix name="RegisterProcess" deprecated="true" />
<suffix name="ReplicaGroupId" />
<suffix name="Router" />
<suffix name="ThreadPerConnection" />
@@ -278,6 +278,9 @@ generated from the section label.
<section name="Ice">
<property name="ACM.Client" />
<property name="ACM.Server" />
+ <property name="Admin" class="objectadapter" />
+ <property name="Admin.InstanceName" />
+ <property name="Admin.ServerId" />
<property name="BatchAutoFlush" />
<property name="ChangeUser" />
<property name="Compression.Level" />
@@ -311,7 +314,7 @@ generated from the section label.
<property name="PrintProcessId" />
<property name="ProgramName" />
<property name="RetryIntervals" />
- <property name="ServerId" />
+ <property name="ServerId" deprecated="true" />
<property name="ServerIdleTime" />
<property name="StdErr" />
<property name="StdOut" />
@@ -477,16 +480,12 @@ generated from the section label.
<property name="AddSSLContext" />
<property name="AddUserToAllowCategories" deprecated="true"
deprecatedBy="Glacier2.Filter.Category.AcceptUser" />
- <property name="Admin.Endpoints" />
- <property name="Admin.PublishedEndpoints" />
- <property name="Admin.RegisterProcess" />
+ <property name="Admin" class="objectadapter"/>
<property name="AllowCategories" deprecated="true" deprecatedBy="Glacier2.Filter.Category.Accept" />
+ <property name="Client" class="objectadapter"/>
<property name="Client.AlwaysBatch" />
<property name="Client.Buffered" />
- <property name="Client.Endpoints" />
<property name="Client.ForwardContext" />
- <property name="Client.PublishedEndpoints" />
- <property name="Client.RegisterProcess" />
<property name="Client.SleepTime" />
<property name="Client.Trace.Override" />
<property name="Client.Trace.Reject" />
@@ -504,12 +503,10 @@ generated from the section label.
<property name="ReturnClientProxy" />
<property name="SSLPermissionsVerifier" class="proxy" />
<property name="RoutingTable.MaxSize" />
+ <property name="Server" class="objectadapter" />
<property name="Server.AlwaysBatch" />
<property name="Server.Buffered" />
- <property name="Server.Endpoints" />
<property name="Server.ForwardContext" />
- <property name="Server.PublishedEndpoints" />
- <property name="Server.RegisterProcess" />
<property name="Server.SleepTime" />
<property name="Server.Trace.Override" />
<property name="Server.Trace.Request" />
diff --git a/cpp/config/makeprops.py b/cpp/config/makeprops.py
index 5933fd2cb37..5933fd2cb37 100644..100755
--- a/cpp/config/makeprops.py
+++ b/cpp/config/makeprops.py
diff --git a/cpp/slice/Ice/Communicator.ice b/cpp/slice/Ice/Communicator.ice
index 230c7392429..57f8d24f439 100644
--- a/cpp/slice/Ice/Communicator.ice
+++ b/cpp/slice/Ice/Communicator.ice
@@ -469,6 +469,43 @@ local interface Communicator
*
**/
void flushBatchRequests();
+
+
+ /**
+ *
+ * Get a proxy to the main facet of the Admin object. Please note
+ * that the Admin object (and proxy) only become available at the end
+ * of the communicator initialization, after all plugins have initialized.
+ *
+ * @return The main ("") facet of the Admin object; a null proxy if no
+ * Admin object is configured.
+ *
+ **/
+ ["cpp:const"] Object* getAdmin();
+
+ /**
+ *
+ * Add a new facet to the Admin object.
+ * Adding a servant with a facet that is already registered
+ * throws [AlreadyRegisteredException].
+ *
+ * @param servant The servant that implements the new Admin facet.
+ * @param facet The new Admin facet.
+ *
+ **/
+ void addAdminFacet(Object servant, string facet);
+
+ /**
+ *
+ * Remove the following facet to the Admin object.
+ * Removing a facet that was not previously registered throws
+ * [NotRegisteredException].
+ *
+ * @param facet The Admin facet.
+ * @return The servant associated with this Admin facet
+ *
+ **/
+ Object removeAdminFacet(string facet);
};
};
diff --git a/cpp/slice/Ice/Properties.ice b/cpp/slice/Ice/Properties.ice
index 4d4e7dae7ba..7bbc5a2f3f8 100644
--- a/cpp/slice/Ice/Properties.ice
+++ b/cpp/slice/Ice/Properties.ice
@@ -23,7 +23,7 @@ module Ice
* @see Properties::getPropertiesForPrefix
*
**/
-local dictionary<string, string> PropertyDict;
+dictionary<string, string> PropertyDict;
/**
*
@@ -188,6 +188,90 @@ local interface Properties
Properties clone();
};
+/**
+ *
+ * The PropertiesAdmin interface provides remote access to the properties
+ * of a communicator.
+ *
+ **/
+interface PropertiesAdmin
+{
+ /**
+ *
+ * Get a property by key. If the property does not exist, an empty
+ * string is returned.
+ *
+ * @param key The property key.
+ *
+ * @return The property value.
+ *
+ * @see setProperty
+ *
+ **/
+ string getProperty(string key);
+
+ /**
+ *
+ * Get a property by key. If the property does not exist, the
+ * given default value is returned.
+ *
+ * @param key The property key.
+ *
+ * @param value The default value to use if the property does not
+ * exist.
+ *
+ * @return The property value or the default value.
+ *
+ * @see setProperty
+ *
+ **/
+ string getPropertyWithDefault(string key, string value);
+
+ /**
+ *
+ * Get a property as an integer. If the property does not exist, 0
+ * is returned.
+ *
+ * @param key The property key.
+ *
+ * @return The property value interpreted as an integer.
+ *
+ * @see setProperty
+ *
+ **/
+ int getPropertyAsInt(string key);
+
+ /**
+ *
+ * Get a property as an integer. If the property does not exist, the
+ * given default value is returned.
+ *
+ * @param key The property key.
+ *
+ * @param value The default value to use if the property does not
+ * exist.
+ *
+ * @return The property value interpreted as an integer, or the
+ * default value.
+ *
+ * @see setProperty
+ *
+ **/
+ int getPropertyAsIntWithDefault(string key, int value);
+
+ /**
+ *
+ * Get all properties whose keys begins with
+ * <em>prefix</em>. If
+ * <em>prefix</em> is an empty string,
+ * then all properties are returned.
+ *
+ * @return The matching property set.
+ *
+ **/
+ PropertyDict getPropertiesForPrefix(string prefix);
+};
+
};
#endif
diff --git a/cpp/slice/Ice/PropertiesF.ice b/cpp/slice/Ice/PropertiesF.ice
index 3b34d272585..10efeb87852 100644
--- a/cpp/slice/Ice/PropertiesF.ice
+++ b/cpp/slice/Ice/PropertiesF.ice
@@ -14,6 +14,7 @@ module Ice
{
local interface Properties;
+interface PropertiesAdmin;
};
diff --git a/cpp/src/Freeze/ConnectionI.cpp b/cpp/src/Freeze/ConnectionI.cpp
index 258060f9f5c..7bd9a114f13 100644
--- a/cpp/src/Freeze/ConnectionI.cpp
+++ b/cpp/src/Freeze/ConnectionI.cpp
@@ -44,17 +44,8 @@ Freeze::ConnectionI::close()
{
if(_transaction)
{
- try
- {
- _transaction->rollbackInternal(true);
- }
- catch(const DatabaseException&)
- {
- //
- // Ignored
- //
- }
- assert(!_transaction);
+ _transaction->rollbackInternal(true);
+ assert(_transaction == 0);
}
while(!_mapList.empty())
@@ -97,7 +88,13 @@ Freeze::ConnectionI::__decRef()
else if(_refCount == 1 && _transaction != 0 && _transaction->dbTxn() != 0 && _transaction->__getRefNoSync() == 1)
{
sync.release();
- close();
+ if(_transaction)
+ {
+ //
+ // This makes the transaction release the last refcount on the connection
+ //
+ _transaction->rollbackInternal(true);
+ }
}
}
diff --git a/cpp/src/Freeze/MapI.cpp b/cpp/src/Freeze/MapI.cpp
index ee2b1de0e3a..57728bc8f0e 100644
--- a/cpp/src/Freeze/MapI.cpp
+++ b/cpp/src/Freeze/MapI.cpp
@@ -1313,6 +1313,7 @@ Freeze::MapHelperI::close()
{
if(_db != 0)
{
+ closeAllIterators();
_connection->unregisterMap(this);
}
_db = 0;
diff --git a/cpp/src/Freeze/TransactionI.cpp b/cpp/src/Freeze/TransactionI.cpp
index a11c0eb44c4..725953a4c6c 100644
--- a/cpp/src/Freeze/TransactionI.cpp
+++ b/cpp/src/Freeze/TransactionI.cpp
@@ -273,5 +273,6 @@ Freeze::TransactionI::postCompletion(bool committed, bool deadlock)
ConnectionIPtr connection = _connection;
_connection = 0;
+
connection->clearTransaction(); // may release the last _refCount
}
diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp
index c7ca49ea899..cb01f17259f 100644
--- a/cpp/src/Ice/CommunicatorI.cpp
+++ b/cpp/src/Ice/CommunicatorI.cpp
@@ -258,6 +258,24 @@ Ice::CommunicatorI::flushBatchRequests()
_instance->flushBatchRequests();
}
+ObjectPrx
+Ice::CommunicatorI::getAdmin() const
+{
+ return _instance->getAdmin();
+}
+
+void
+Ice::CommunicatorI::addAdminFacet(const Ice::ObjectPtr& servant, const string& facet)
+{
+ _instance->addAdminFacet(servant, facet);
+}
+
+Ice::ObjectPtr
+Ice::CommunicatorI::removeAdminFacet(const string& facet)
+{
+ return _instance->removeAdminFacet(facet);
+}
+
Ice::CommunicatorI::CommunicatorI(const InitializationData& initData)
{
__setNoDelete(true);
diff --git a/cpp/src/Ice/CommunicatorI.h b/cpp/src/Ice/CommunicatorI.h
index c424ed41f47..579497447ed 100644
--- a/cpp/src/Ice/CommunicatorI.h
+++ b/cpp/src/Ice/CommunicatorI.h
@@ -63,6 +63,10 @@ public:
virtual void flushBatchRequests();
+ virtual ObjectPrx getAdmin() const;
+ virtual void addAdminFacet(const ObjectPtr&, const std::string&);
+ virtual ObjectPtr removeAdminFacet(const std::string&);
+
private:
CommunicatorI(const InitializationData&);
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index 959bf3e1a06..a206e5ca614 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -35,6 +35,9 @@
#include <Ice/Initialize.h>
#include <Ice/LoggerUtil.h>
#include <IceUtil/StringUtil.h>
+#include <Ice/PropertiesI.h>
+#include <IceUtil/UUID.h>
+#include <Ice/Communicator.h>
#include <stdio.h>
@@ -483,6 +486,83 @@ IceInternal::Instance::identityToString(const Identity& ident) const
}
}
+
+Ice::ObjectPrx
+IceInternal::Instance::getAdmin() const
+{
+ IceUtil::RecMutex::Lock sync(*this);
+
+ if(_state == StateDestroyed)
+ {
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ }
+
+ if(_adminAdapter == 0)
+ {
+ return 0;
+ }
+ else
+ {
+ return _adminAdapter->createProxy(_adminIdentity);
+ }
+}
+
+void
+IceInternal::Instance::addAdminFacet(const Ice::ObjectPtr& servant, const string& facet)
+{
+ IceUtil::RecMutex::Lock sync(*this);
+
+ if(_state == StateDestroyed)
+ {
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ }
+
+ if(_adminAdapter == 0)
+ {
+ if(_adminFacets.insert(FacetMap::value_type(facet, servant)).second == false)
+ {
+ throw AlreadyRegisteredException(__FILE__, __LINE__, "facet", facet);
+ }
+ }
+ else
+ {
+ _adminAdapter->addFacet(servant, _adminIdentity, facet);
+ }
+}
+
+Ice::ObjectPtr
+IceInternal::Instance::removeAdminFacet(const string& facet)
+{
+ IceUtil::RecMutex::Lock sync(*this);
+
+ if(_state == StateDestroyed)
+ {
+ throw CommunicatorDestroyedException(__FILE__, __LINE__);
+ }
+
+ ObjectPtr result;
+
+ if(_adminAdapter == 0)
+ {
+ FacetMap::iterator p = _adminFacets.find(facet);
+ if(p == _adminFacets.end())
+ {
+ throw NotRegisteredException(__FILE__, __LINE__, "facet", facet);
+ }
+ else
+ {
+ result = p->second;
+ _adminFacets.erase(p);
+ }
+ }
+ else
+ {
+ result = _adminAdapter->removeFacet(_adminIdentity, facet);
+ }
+ return result;
+}
+
+
IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const InitializationData& initData) :
_state(StateActive),
_initData(initData),
@@ -702,6 +782,12 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
_initData.wstringConverter = new UnicodeWstringConverter();
}
+ //
+ // Add Process and PropertiesAdmin facets
+ //
+ _adminFacets.insert(FacetMap::value_type("Properties", new PropertiesAdminI(_initData.properties)));
+ _adminFacets.insert(FacetMap::value_type("Process", new ProcessI(communicator)));
+
__setNoDelete(false);
}
catch(...)
@@ -782,8 +868,8 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[])
_referenceFactory->setDefaultRouter(
RouterPrx::uncheckedCast(_proxyFactory->propertyToProxy("Ice.Default.Router")));
- _referenceFactory->setDefaultLocator(
- LocatorPrx::uncheckedCast(_proxyFactory->propertyToProxy("Ice.Default.Locator")));
+ LocatorPrx defaultLocator = LocatorPrx::uncheckedCast(_proxyFactory->propertyToProxy("Ice.Default.Locator"));
+ _referenceFactory->setDefaultLocator(defaultLocator);
//
// Show process id if requested (but only once).
@@ -813,6 +899,61 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[])
}
//
+ // Create Admin object depending on configuration
+ // No-op unless Endpoints is set
+ //
+ const string adminOA = "Ice.Admin";
+ if(_initData.properties->getProperty(adminOA + ".Endpoints") != "")
+ {
+ string serverId = _initData.properties->getProperty("Ice.Admin.ServerId");
+ string instanceName = _initData.properties->getProperty("Ice.Admin.InstanceName");
+
+ if((defaultLocator != 0 && serverId != "") || instanceName != "")
+ {
+ _adminIdentity.name = "admin";
+ if(instanceName == "")
+ {
+ instanceName = IceUtil::generateUUID();
+ }
+ _adminIdentity.category = instanceName;
+
+ //
+ // Create OA
+ //
+ _adminAdapter = _objectAdapterFactory->createObjectAdapter(adminOA, "", 0);
+
+ //
+ // Add all facets to OA
+ //
+ for(FacetMap::iterator p = _adminFacets.begin(); p != _adminFacets.end(); ++p)
+ {
+ _adminAdapter->addFacet(p->second, _adminIdentity, p->first);
+ }
+ _adminFacets.clear();
+
+ //
+ // Activate OA
+ //
+ _adminAdapter->activate();
+
+ if(defaultLocator != 0 && serverId != "")
+ {
+ ProcessPrx process = ProcessPrx::uncheckedCast(
+ _adminAdapter->createProxy(_adminIdentity)->ice_facet("Process"));
+
+ try
+ {
+ defaultLocator->getRegistry()->setServerProcessProxy(serverId, process);
+ }
+ catch(const ServerNotFoundException&)
+ {
+ throw InitializationException(__FILE__, __LINE__, "Locator knows nothing about server '" + serverId + "'");
+ }
+ }
+ }
+ }
+
+ //
// Start connection monitor if necessary.
//
Int interval = 0;
@@ -960,6 +1101,9 @@ IceInternal::Instance::destroy()
// No destroy function defined.
// _dynamicLibraryList->destroy();
_dynamicLibraryList = 0;
+
+ _adminAdapter = 0;
+ _adminFacets.clear();
_state = StateDestroyed;
}
@@ -992,6 +1136,7 @@ IceInternal::Instance::destroy()
return true;
}
+
IceInternal::UTF8BufferI::UTF8BufferI() :
_buffer(0),
_offset(0)
@@ -1033,3 +1178,33 @@ IceInternal::UTF8BufferI::reset()
_buffer = 0;
_offset = 0;
}
+
+
+IceInternal::ProcessI::ProcessI(const CommunicatorPtr& communicator) :
+ _communicator(communicator)
+{
+}
+
+void
+IceInternal::ProcessI::shutdown(const Current&)
+{
+ _communicator->shutdown();
+}
+
+void
+IceInternal::ProcessI::writeMessage(const string& message, Int fd, const Current&)
+{
+ switch(fd)
+ {
+ case 1:
+ {
+ cout << message << endl;
+ break;
+ }
+ case 2:
+ {
+ cerr << message << endl;
+ break;
+ }
+ }
+}
diff --git a/cpp/src/Ice/Instance.h b/cpp/src/Ice/Instance.h
index a129104e386..f9dda82de07 100644
--- a/cpp/src/Ice/Instance.h
+++ b/cpp/src/Ice/Instance.h
@@ -34,6 +34,8 @@
#include <Ice/Initialize.h>
#include <Ice/SharedContext.h>
#include <Ice/ImplicitContextI.h>
+#include <Ice/FacetMap.h>
+#include <Ice/Process.h>
#include <list>
namespace Ice
@@ -78,8 +80,11 @@ public:
void setDefaultContext(const ::Ice::Context&);
SharedContextPtr getDefaultContext() const;
Ice::Identity stringToIdentity(const std::string&) const;
-
std::string identityToString(const Ice::Identity&) const;
+
+ Ice::ObjectPrx getAdmin() const;
+ void addAdminFacet(const Ice::ObjectPtr&, const std::string&);
+ Ice::ObjectPtr removeAdminFacet(const std::string&);
const Ice::ImplicitContextIPtr& getImplicitContext() const
{
@@ -125,6 +130,9 @@ private:
Ice::PluginManagerPtr _pluginManager;
SharedContextPtr _defaultContext;
const Ice::ImplicitContextIPtr _implicitContext;
+ Ice::ObjectAdapterPtr _adminAdapter;
+ Ice::FacetMap _adminFacets;
+ Ice::Identity _adminIdentity;
};
class UTF8BufferI : public Ice::UTF8Buffer
@@ -144,6 +152,21 @@ private:
size_t _offset;
};
+
+class ProcessI : public Ice::Process
+{
+public:
+
+ ProcessI(const Ice::CommunicatorPtr&);
+
+ virtual void shutdown(const Ice::Current&);
+ virtual void writeMessage(const std::string&, Ice::Int, const Ice::Current&);
+
+private:
+
+ const Ice::CommunicatorPtr _communicator;
+};
+
}
#endif
diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp
index 3de824796c8..9d7cf4c7d5c 100644
--- a/cpp/src/Ice/ObjectAdapterI.cpp
+++ b/cpp/src/Ice/ObjectAdapterI.cpp
@@ -1322,31 +1322,3 @@ Ice::ObjectAdapterI::filterProperties(StringSeq& unknownProps)
return noProps;
}
-Ice::ObjectAdapterI::ProcessI::ProcessI(const CommunicatorPtr& communicator) :
- _communicator(communicator)
-{
-}
-
-void
-Ice::ObjectAdapterI::ProcessI::shutdown(const Current&)
-{
- _communicator->shutdown();
-}
-
-void
-Ice::ObjectAdapterI::ProcessI::writeMessage(const string& message, Int fd, const Current&)
-{
- switch(fd)
- {
- case 1:
- {
- cout << message << endl;
- break;
- }
- case 2:
- {
- cerr << message << endl;
- break;
- }
- }
-}
diff --git a/cpp/src/Ice/ObjectAdapterI.h b/cpp/src/Ice/ObjectAdapterI.h
index b0e567837c3..84322f3a495 100644
--- a/cpp/src/Ice/ObjectAdapterI.h
+++ b/cpp/src/Ice/ObjectAdapterI.h
@@ -27,7 +27,6 @@
#include <Ice/LocatorInfoF.h>
#include <Ice/ThreadPoolF.h>
#include <Ice/Exception.h>
-#include <Ice/Process.h>
#include <Ice/BuiltinSequences.h>
#include <list>
@@ -130,20 +129,6 @@ private:
bool _threadPerConnection;
size_t _threadPerConnectionStackSize;
Identity _processId;
-
- class ProcessI : public Process
- {
- public:
-
- ProcessI(const CommunicatorPtr&);
-
- virtual void shutdown(const Current&);
- virtual void writeMessage(const std::string&, Int, const Current&);
-
- private:
-
- const CommunicatorPtr _communicator;
- };
};
}
diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp
index cc49cd4f78f..72671064a06 100644
--- a/cpp/src/Ice/PropertiesI.cpp
+++ b/cpp/src/Ice/PropertiesI.cpp
@@ -15,6 +15,7 @@
#include <Ice/PropertyNames.h>
#include <Ice/Logger.h>
#include <Ice/LoggerUtil.h>
+#include <Ice/Communicator.h>
#include <fstream>
using namespace std;
@@ -471,3 +472,44 @@ Ice::PropertiesI::loadConfig()
PropertyValue pv(value, true);
_properties["Ice.Config"] = pv;
}
+
+
+//
+// PropertiesAdminI
+//
+
+
+Ice::PropertiesAdminI::PropertiesAdminI(const PropertiesPtr& properties) :
+ _properties(properties)
+{
+}
+
+string
+Ice::PropertiesAdminI::getProperty(const string& name, const Ice::Current&)
+{
+ return _properties->getProperty(name);
+}
+
+string
+Ice::PropertiesAdminI::getPropertyWithDefault(const string& name, const string& dflt, const Ice::Current&)
+{
+ return _properties->getPropertyWithDefault(name, dflt);
+}
+
+Ice::Int
+Ice::PropertiesAdminI::getPropertyAsInt(const string& name, const Ice::Current&)
+{
+ return _properties->getPropertyAsInt(name);
+}
+
+Ice::Int
+Ice::PropertiesAdminI::getPropertyAsIntWithDefault(const string& name, Ice::Int dflt, const Ice::Current&)
+{
+ return _properties->getPropertyAsIntWithDefault(name, dflt);
+}
+
+Ice::PropertyDict
+Ice::PropertiesAdminI::getPropertiesForPrefix(const string& prefix, const Ice::Current&)
+{
+ return _properties->getPropertiesForPrefix(prefix);
+}
diff --git a/cpp/src/Ice/PropertiesI.h b/cpp/src/Ice/PropertiesI.h
index aadf7eda5f7..26231480edd 100644
--- a/cpp/src/Ice/PropertiesI.h
+++ b/cpp/src/Ice/PropertiesI.h
@@ -19,7 +19,7 @@
namespace Ice
{
-class ICE_API PropertiesI : public Properties, public IceUtil::Mutex
+class PropertiesI : public Properties, public IceUtil::Mutex
{
public:
@@ -70,6 +70,24 @@ private:
const StringConverterPtr _converter;
};
+
+class PropertiesAdminI : public PropertiesAdmin
+{
+public:
+
+ PropertiesAdminI(const PropertiesPtr&);
+
+ virtual std::string getProperty(const std::string&, const Current&);
+ virtual std::string getPropertyWithDefault(const std::string&, const std::string&, const Current&);
+ virtual Int getPropertyAsInt(const std::string&, const Current&);
+ virtual Int getPropertyAsIntWithDefault(const std::string&, Int, const Current&);
+ virtual PropertyDict getPropertiesForPrefix(const std::string&, const Current&);
+
+private:
+
+ const PropertiesPtr _properties;
+};
+
}
#endif
diff --git a/cpp/src/Ice/PropertyNames.cpp b/cpp/src/Ice/PropertyNames.cpp
index b4eb08cafce..db9d25059fe 100644
--- a/cpp/src/Ice/PropertyNames.cpp
+++ b/cpp/src/Ice/PropertyNames.cpp
@@ -7,7 +7,7 @@
//
// **********************************************************************
//
-// Generated by makeprops.py from file ./config/PropertyNames.xml, Thu Sep 6 17:17:28 2007
+// Generated by makeprops.py from file ../config/PropertyNames.xml, Fri Sep 7 11:03:12 2007
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
@@ -17,6 +17,21 @@ const IceInternal::Property IcePropsData[] =
{
IceInternal::Property("Ice.ACM.Client", false, 0),
IceInternal::Property("Ice.ACM.Server", false, 0),
+ IceInternal::Property("Ice.Admin.AdapterId", false, 0),
+ IceInternal::Property("Ice.Admin.Endpoints", false, 0),
+ IceInternal::Property("Ice.Admin.Locator", false, 0),
+ IceInternal::Property("Ice.Admin.PublishedEndpoints", false, 0),
+ IceInternal::Property("Ice.Admin.RegisterProcess", true, 0),
+ IceInternal::Property("Ice.Admin.ReplicaGroupId", false, 0),
+ IceInternal::Property("Ice.Admin.Router", false, 0),
+ IceInternal::Property("Ice.Admin.ThreadPerConnection", false, 0),
+ IceInternal::Property("Ice.Admin.ThreadPerConnection.StackSize", false, 0),
+ IceInternal::Property("Ice.Admin.ThreadPool.Size", false, 0),
+ IceInternal::Property("Ice.Admin.ThreadPool.SizeMax", false, 0),
+ IceInternal::Property("Ice.Admin.ThreadPool.SizeWarn", false, 0),
+ IceInternal::Property("Ice.Admin.ThreadPool.StackSize", false, 0),
+ IceInternal::Property("Ice.Admin.InstanceName", false, 0),
+ IceInternal::Property("Ice.Admin.ServerId", false, 0),
IceInternal::Property("Ice.BatchAutoFlush", false, 0),
IceInternal::Property("Ice.ChangeUser", false, 0),
IceInternal::Property("Ice.Compression.Level", false, 0),
@@ -67,7 +82,7 @@ const IceInternal::Property IcePropsData[] =
IceInternal::Property("Ice.PrintProcessId", false, 0),
IceInternal::Property("Ice.ProgramName", false, 0),
IceInternal::Property("Ice.RetryIntervals", false, 0),
- IceInternal::Property("Ice.ServerId", false, 0),
+ IceInternal::Property("Ice.ServerId", true, 0),
IceInternal::Property("Ice.ServerIdleTime", false, 0),
IceInternal::Property("Ice.StdErr", false, 0),
IceInternal::Property("Ice.StdOut", false, 0),
@@ -116,7 +131,7 @@ const IceInternal::Property IceBoxPropsData[] =
IceInternal::Property("IceBox.ServiceManager.Endpoints", false, 0),
IceInternal::Property("IceBox.ServiceManager.Locator", false, 0),
IceInternal::Property("IceBox.ServiceManager.PublishedEndpoints", false, 0),
- IceInternal::Property("IceBox.ServiceManager.RegisterProcess", false, 0),
+ IceInternal::Property("IceBox.ServiceManager.RegisterProcess", true, 0),
IceInternal::Property("IceBox.ServiceManager.ReplicaGroupId", false, 0),
IceInternal::Property("IceBox.ServiceManager.Router", false, 0),
IceInternal::Property("IceBox.ServiceManager.ThreadPerConnection", false, 0),
@@ -154,7 +169,7 @@ const IceInternal::Property IceGridPropsData[] =
IceInternal::Property("IceGrid.Node.Endpoints", false, 0),
IceInternal::Property("IceGrid.Node.Locator", false, 0),
IceInternal::Property("IceGrid.Node.PublishedEndpoints", false, 0),
- IceInternal::Property("IceGrid.Node.RegisterProcess", false, 0),
+ IceInternal::Property("IceGrid.Node.RegisterProcess", true, 0),
IceInternal::Property("IceGrid.Node.ReplicaGroupId", false, 0),
IceInternal::Property("IceGrid.Node.Router", false, 0),
IceInternal::Property("IceGrid.Node.ThreadPerConnection", false, 0),
@@ -215,7 +230,7 @@ const IceInternal::Property IceGridPropsData[] =
IceInternal::Property("IceGrid.Registry.Client.Endpoints", false, 0),
IceInternal::Property("IceGrid.Registry.Client.Locator", false, 0),
IceInternal::Property("IceGrid.Registry.Client.PublishedEndpoints", false, 0),
- IceInternal::Property("IceGrid.Registry.Client.RegisterProcess", false, 0),
+ IceInternal::Property("IceGrid.Registry.Client.RegisterProcess", true, 0),
IceInternal::Property("IceGrid.Registry.Client.ReplicaGroupId", false, 0),
IceInternal::Property("IceGrid.Registry.Client.Router", false, 0),
IceInternal::Property("IceGrid.Registry.Client.ThreadPerConnection", false, 0),
@@ -232,7 +247,7 @@ const IceInternal::Property IceGridPropsData[] =
IceInternal::Property("IceGrid.Registry.Internal.Endpoints", false, 0),
IceInternal::Property("IceGrid.Registry.Internal.Locator", false, 0),
IceInternal::Property("IceGrid.Registry.Internal.PublishedEndpoints", false, 0),
- IceInternal::Property("IceGrid.Registry.Internal.RegisterProcess", false, 0),
+ IceInternal::Property("IceGrid.Registry.Internal.RegisterProcess", true, 0),
IceInternal::Property("IceGrid.Registry.Internal.ReplicaGroupId", false, 0),
IceInternal::Property("IceGrid.Registry.Internal.Router", false, 0),
IceInternal::Property("IceGrid.Registry.Internal.ThreadPerConnection", false, 0),
@@ -258,7 +273,7 @@ const IceInternal::Property IceGridPropsData[] =
IceInternal::Property("IceGrid.Registry.Server.Endpoints", false, 0),
IceInternal::Property("IceGrid.Registry.Server.Locator", false, 0),
IceInternal::Property("IceGrid.Registry.Server.PublishedEndpoints", false, 0),
- IceInternal::Property("IceGrid.Registry.Server.RegisterProcess", false, 0),
+ IceInternal::Property("IceGrid.Registry.Server.RegisterProcess", true, 0),
IceInternal::Property("IceGrid.Registry.Server.ReplicaGroupId", false, 0),
IceInternal::Property("IceGrid.Registry.Server.Router", false, 0),
IceInternal::Property("IceGrid.Registry.Server.ThreadPerConnection", false, 0),
@@ -272,7 +287,7 @@ const IceInternal::Property IceGridPropsData[] =
IceInternal::Property("IceGrid.Registry.SessionManager.Endpoints", false, 0),
IceInternal::Property("IceGrid.Registry.SessionManager.Locator", false, 0),
IceInternal::Property("IceGrid.Registry.SessionManager.PublishedEndpoints", false, 0),
- IceInternal::Property("IceGrid.Registry.SessionManager.RegisterProcess", false, 0),
+ IceInternal::Property("IceGrid.Registry.SessionManager.RegisterProcess", true, 0),
IceInternal::Property("IceGrid.Registry.SessionManager.ReplicaGroupId", false, 0),
IceInternal::Property("IceGrid.Registry.SessionManager.Router", false, 0),
IceInternal::Property("IceGrid.Registry.SessionManager.ThreadPerConnection", false, 0),
@@ -314,7 +329,7 @@ const IceInternal::Property IcePatch2PropsData[] =
IceInternal::Property("IcePatch2.Endpoints", false, 0),
IceInternal::Property("IcePatch2.Locator", false, 0),
IceInternal::Property("IcePatch2.PublishedEndpoints", false, 0),
- IceInternal::Property("IcePatch2.RegisterProcess", false, 0),
+ IceInternal::Property("IcePatch2.RegisterProcess", true, 0),
IceInternal::Property("IcePatch2.ReplicaGroupId", false, 0),
IceInternal::Property("IcePatch2.Router", false, 0),
IceInternal::Property("IcePatch2.ThreadPerConnection", false, 0),
@@ -327,7 +342,7 @@ const IceInternal::Property IcePatch2PropsData[] =
IceInternal::Property("IcePatch2.Admin.Endpoints", false, 0),
IceInternal::Property("IcePatch2.Admin.Locator", false, 0),
IceInternal::Property("IcePatch2.Admin.PublishedEndpoints", false, 0),
- IceInternal::Property("IcePatch2.Admin.RegisterProcess", false, 0),
+ IceInternal::Property("IcePatch2.Admin.RegisterProcess", true, 0),
IceInternal::Property("IcePatch2.Admin.ReplicaGroupId", false, 0),
IceInternal::Property("IcePatch2.Admin.Router", false, 0),
IceInternal::Property("IcePatch2.Admin.ThreadPerConnection", false, 0),
@@ -402,7 +417,7 @@ const IceInternal::Property IceStormPropsData[] =
IceInternal::Property("IceStorm.Publish.Endpoints", false, 0),
IceInternal::Property("IceStorm.Publish.Locator", false, 0),
IceInternal::Property("IceStorm.Publish.PublishedEndpoints", false, 0),
- IceInternal::Property("IceStorm.Publish.RegisterProcess", false, 0),
+ IceInternal::Property("IceStorm.Publish.RegisterProcess", true, 0),
IceInternal::Property("IceStorm.Publish.ReplicaGroupId", false, 0),
IceInternal::Property("IceStorm.Publish.Router", false, 0),
IceInternal::Property("IceStorm.Publish.ThreadPerConnection", false, 0),
@@ -415,7 +430,7 @@ const IceInternal::Property IceStormPropsData[] =
IceInternal::Property("IceStorm.TopicManager.Endpoints", false, 0),
IceInternal::Property("IceStorm.TopicManager.Locator", false, 0),
IceInternal::Property("IceStorm.TopicManager.PublishedEndpoints", false, 0),
- IceInternal::Property("IceStorm.TopicManager.RegisterProcess", false, 0),
+ IceInternal::Property("IceStorm.TopicManager.RegisterProcess", true, 0),
IceInternal::Property("IceStorm.TopicManager.ReplicaGroupId", false, 0),
IceInternal::Property("IceStorm.TopicManager.Router", false, 0),
IceInternal::Property("IceStorm.TopicManager.ThreadPerConnection", false, 0),
@@ -455,16 +470,36 @@ const IceInternal::Property Glacier2PropsData[] =
{
IceInternal::Property("Glacier2.AddSSLContext", false, 0),
IceInternal::Property("Glacier2.AddUserToAllowCategories", true, "Glacier2.Filter.Category.AcceptUser"),
+ IceInternal::Property("Glacier2.Admin.AdapterId", false, 0),
IceInternal::Property("Glacier2.Admin.Endpoints", false, 0),
+ IceInternal::Property("Glacier2.Admin.Locator", false, 0),
IceInternal::Property("Glacier2.Admin.PublishedEndpoints", false, 0),
- IceInternal::Property("Glacier2.Admin.RegisterProcess", false, 0),
+ IceInternal::Property("Glacier2.Admin.RegisterProcess", true, 0),
+ IceInternal::Property("Glacier2.Admin.ReplicaGroupId", false, 0),
+ IceInternal::Property("Glacier2.Admin.Router", false, 0),
+ IceInternal::Property("Glacier2.Admin.ThreadPerConnection", false, 0),
+ IceInternal::Property("Glacier2.Admin.ThreadPerConnection.StackSize", false, 0),
+ IceInternal::Property("Glacier2.Admin.ThreadPool.Size", false, 0),
+ IceInternal::Property("Glacier2.Admin.ThreadPool.SizeMax", false, 0),
+ IceInternal::Property("Glacier2.Admin.ThreadPool.SizeWarn", false, 0),
+ IceInternal::Property("Glacier2.Admin.ThreadPool.StackSize", false, 0),
IceInternal::Property("Glacier2.AllowCategories", true, "Glacier2.Filter.Category.Accept"),
+ IceInternal::Property("Glacier2.Client.AdapterId", false, 0),
+ IceInternal::Property("Glacier2.Client.Endpoints", false, 0),
+ IceInternal::Property("Glacier2.Client.Locator", false, 0),
+ IceInternal::Property("Glacier2.Client.PublishedEndpoints", false, 0),
+ IceInternal::Property("Glacier2.Client.RegisterProcess", true, 0),
+ IceInternal::Property("Glacier2.Client.ReplicaGroupId", false, 0),
+ IceInternal::Property("Glacier2.Client.Router", false, 0),
+ IceInternal::Property("Glacier2.Client.ThreadPerConnection", false, 0),
+ IceInternal::Property("Glacier2.Client.ThreadPerConnection.StackSize", false, 0),
+ IceInternal::Property("Glacier2.Client.ThreadPool.Size", false, 0),
+ IceInternal::Property("Glacier2.Client.ThreadPool.SizeMax", false, 0),
+ IceInternal::Property("Glacier2.Client.ThreadPool.SizeWarn", false, 0),
+ IceInternal::Property("Glacier2.Client.ThreadPool.StackSize", false, 0),
IceInternal::Property("Glacier2.Client.AlwaysBatch", false, 0),
IceInternal::Property("Glacier2.Client.Buffered", false, 0),
- IceInternal::Property("Glacier2.Client.Endpoints", false, 0),
IceInternal::Property("Glacier2.Client.ForwardContext", false, 0),
- IceInternal::Property("Glacier2.Client.PublishedEndpoints", false, 0),
- IceInternal::Property("Glacier2.Client.RegisterProcess", false, 0),
IceInternal::Property("Glacier2.Client.SleepTime", false, 0),
IceInternal::Property("Glacier2.Client.Trace.Override", false, 0),
IceInternal::Property("Glacier2.Client.Trace.Reject", false, 0),
@@ -500,12 +535,22 @@ const IceInternal::Property Glacier2PropsData[] =
IceInternal::Property("Glacier2.SSLPermissionsVerifier.ThreadPerConnection", false, 0),
IceInternal::Property("Glacier2.SSLPermissionsVerifier", false, 0),
IceInternal::Property("Glacier2.RoutingTable.MaxSize", false, 0),
+ IceInternal::Property("Glacier2.Server.AdapterId", false, 0),
+ IceInternal::Property("Glacier2.Server.Endpoints", false, 0),
+ IceInternal::Property("Glacier2.Server.Locator", false, 0),
+ IceInternal::Property("Glacier2.Server.PublishedEndpoints", false, 0),
+ IceInternal::Property("Glacier2.Server.RegisterProcess", true, 0),
+ IceInternal::Property("Glacier2.Server.ReplicaGroupId", false, 0),
+ IceInternal::Property("Glacier2.Server.Router", false, 0),
+ IceInternal::Property("Glacier2.Server.ThreadPerConnection", false, 0),
+ IceInternal::Property("Glacier2.Server.ThreadPerConnection.StackSize", false, 0),
+ IceInternal::Property("Glacier2.Server.ThreadPool.Size", false, 0),
+ IceInternal::Property("Glacier2.Server.ThreadPool.SizeMax", false, 0),
+ IceInternal::Property("Glacier2.Server.ThreadPool.SizeWarn", false, 0),
+ IceInternal::Property("Glacier2.Server.ThreadPool.StackSize", false, 0),
IceInternal::Property("Glacier2.Server.AlwaysBatch", false, 0),
IceInternal::Property("Glacier2.Server.Buffered", false, 0),
- IceInternal::Property("Glacier2.Server.Endpoints", false, 0),
IceInternal::Property("Glacier2.Server.ForwardContext", false, 0),
- IceInternal::Property("Glacier2.Server.PublishedEndpoints", false, 0),
- IceInternal::Property("Glacier2.Server.RegisterProcess", false, 0),
IceInternal::Property("Glacier2.Server.SleepTime", false, 0),
IceInternal::Property("Glacier2.Server.Trace.Override", false, 0),
IceInternal::Property("Glacier2.Server.Trace.Request", false, 0),
diff --git a/cpp/src/Ice/PropertyNames.h b/cpp/src/Ice/PropertyNames.h
index 2085a9ea8bc..53c003fa79f 100644
--- a/cpp/src/Ice/PropertyNames.h
+++ b/cpp/src/Ice/PropertyNames.h
@@ -7,7 +7,7 @@
//
// **********************************************************************
//
-// Generated by makeprops.py from file ./config/PropertyNames.xml, Thu Sep 6 17:17:28 2007
+// Generated by makeprops.py from file ../config/PropertyNames.xml, Fri Sep 7 11:03:12 2007
// IMPORTANT: Do not edit this file -- any edits made here will be lost!
diff --git a/cpp/src/IceBox/Service.cpp b/cpp/src/IceBox/Service.cpp
index ba4e91525a6..aa198b86b40 100644
--- a/cpp/src/IceBox/Service.cpp
+++ b/cpp/src/IceBox/Service.cpp
@@ -79,6 +79,7 @@ IceBox::IceBoxService::start(int argc, char* argv[])
}
_serviceManager = new ServiceManagerI(communicator(), argc, argv);
+
return _serviceManager->start();
}
diff --git a/cpp/src/IceBox/ServiceManagerI.cpp b/cpp/src/IceBox/ServiceManagerI.cpp
index e75dd7fee26..8f8dd794376 100644
--- a/cpp/src/IceBox/ServiceManagerI.cpp
+++ b/cpp/src/IceBox/ServiceManagerI.cpp
@@ -245,6 +245,20 @@ IceBox::ServiceManagerI::start()
//
}
}
+
+ //
+ // Register "this" as a facet to the Admin object
+ //
+ try
+ {
+ _communicator->addAdminFacet(this, "IceBox.ServiceManager");
+ }
+ catch(const CommunicatorDestroyedException&)
+ {
+ //
+ // Ignored
+ //
+ }
}
catch(const FailureException& ex)
{
diff --git a/cpp/src/IceGrid/DescriptorHelper.cpp b/cpp/src/IceGrid/DescriptorHelper.cpp
index c41aa5c04de..1368294a5c5 100644
--- a/cpp/src/IceGrid/DescriptorHelper.cpp
+++ b/cpp/src/IceGrid/DescriptorHelper.cpp
@@ -1195,19 +1195,20 @@ ServiceHelper::ServiceHelper(const ServiceDescriptorPtr& descriptor) :
}
bool
-ServiceHelper::operator==(const ServiceHelper& helper) const
+ServiceHelper::operator==(const CommunicatorHelper& h) const
{
- if(!CommunicatorHelper::operator==(helper))
+ const ServiceHelper* helper = dynamic_cast<const ServiceHelper*>(&h);
+ if(!helper || !CommunicatorHelper::operator==(h))
{
return false;
}
- if(_desc->name != helper._desc->name)
+ if(_desc->name != helper->_desc->name)
{
return false;
}
- if(_desc->entry != helper._desc->entry)
+ if(_desc->entry != helper->_desc->entry)
{
return false;
}
@@ -1216,7 +1217,7 @@ ServiceHelper::operator==(const ServiceHelper& helper) const
}
bool
-ServiceHelper::operator!=(const ServiceHelper& helper) const
+ServiceHelper::operator!=(const CommunicatorHelper& helper) const
{
return !operator==(helper);
}
@@ -1272,66 +1273,67 @@ ServerHelper::ServerHelper(const ServerDescriptorPtr& descriptor) :
}
bool
-ServerHelper::operator==(const ServerHelper& helper) const
+ServerHelper::operator==(const CommunicatorHelper& h) const
{
- if(!CommunicatorHelper::operator==(helper))
+ const ServerHelper* helper = dynamic_cast<const ServerHelper*>(&h);
+ if(!helper || !CommunicatorHelper::operator==(h))
{
return false;
}
- if(_desc->id != helper._desc->id)
+ if(_desc->id != helper->_desc->id)
{
return false;
}
- if(_desc->exe != helper._desc->exe)
+ if(_desc->exe != helper->_desc->exe)
{
return false;
}
- if(_desc->pwd != helper._desc->pwd)
+ if(_desc->pwd != helper->_desc->pwd)
{
return false;
}
if(set<string>(_desc->options.begin(), _desc->options.end()) !=
- set<string>(helper._desc->options.begin(), helper._desc->options.end()))
+ set<string>(helper->_desc->options.begin(), helper->_desc->options.end()))
{
return false;
}
if(set<string>(_desc->envs.begin(), _desc->envs.end()) !=
- set<string>(helper._desc->envs.begin(), helper._desc->envs.end()))
+ set<string>(helper->_desc->envs.begin(), helper->_desc->envs.end()))
{
return false;
}
- if(_desc->activation != helper._desc->activation)
+ if(_desc->activation != helper->_desc->activation)
{
return false;
}
- if(_desc->activationTimeout != helper._desc->activationTimeout)
+ if(_desc->activationTimeout != helper->_desc->activationTimeout)
{
return false;
}
- if(_desc->deactivationTimeout != helper._desc->deactivationTimeout)
+ if(_desc->deactivationTimeout != helper->_desc->deactivationTimeout)
{
return false;
}
- if(_desc->distrib != helper._desc->distrib)
+ if(_desc->distrib != helper->_desc->distrib)
{
return false;
}
- if(_desc->allocatable != helper._desc->allocatable)
+ if(_desc->allocatable != helper->_desc->allocatable)
{
return false;
}
- if(_desc->user != helper._desc->user)
+ if(_desc->user != helper->_desc->user)
{
return false;
}
@@ -1340,7 +1342,7 @@ ServerHelper::operator==(const ServerHelper& helper) const
}
bool
-ServerHelper::operator!=(const ServerHelper& helper) const
+ServerHelper::operator!=(const CommunicatorHelper& helper) const
{
return !operator==(helper);
}
@@ -1483,14 +1485,15 @@ IceBoxHelper::IceBoxHelper(const IceBoxDescriptorPtr& descriptor) :
}
bool
-IceBoxHelper::operator==(const IceBoxHelper& helper) const
+IceBoxHelper::operator==(const CommunicatorHelper& h) const
{
- if(!ServerHelper::operator==(helper))
+ const IceBoxHelper* helper = dynamic_cast<const IceBoxHelper*>(&h);
+ if(!helper || !ServerHelper::operator==(h))
{
return false;
}
-
- if(_services != helper._services)
+
+ if(_services != helper->_services)
{
return false;
}
@@ -1499,7 +1502,7 @@ IceBoxHelper::operator==(const IceBoxHelper& helper) const
}
bool
-IceBoxHelper::operator!=(const IceBoxHelper& helper) const
+IceBoxHelper::operator!=(const CommunicatorHelper& helper) const
{
return !operator==(helper);
}
diff --git a/cpp/src/IceGrid/DescriptorHelper.h b/cpp/src/IceGrid/DescriptorHelper.h
index e222940686c..f16d50afb71 100644
--- a/cpp/src/IceGrid/DescriptorHelper.h
+++ b/cpp/src/IceGrid/DescriptorHelper.h
@@ -86,8 +86,8 @@ public:
CommunicatorHelper() { }
virtual ~CommunicatorHelper() { }
- bool operator==(const CommunicatorHelper&) const;
- bool operator!=(const CommunicatorHelper&) const;
+ virtual bool operator==(const CommunicatorHelper&) const;
+ virtual bool operator!=(const CommunicatorHelper&) const;
virtual void getIds(std::multiset<std::string>&, std::multiset<Ice::Identity>&) const;
virtual void getReplicaGroups(std::set<std::string>&) const;
@@ -115,8 +115,8 @@ public:
ServiceHelper(const ServiceDescriptorPtr&);
ServiceHelper() { }
- bool operator==(const ServiceHelper&) const;
- bool operator!=(const ServiceHelper&) const;
+ virtual bool operator==(const CommunicatorHelper&) const;
+ virtual bool operator!=(const CommunicatorHelper&) const;
ServiceDescriptorPtr getDescriptor() const;
ServiceDescriptorPtr instantiate(const Resolver&, const PropertyDescriptorSeq&,
@@ -141,8 +141,8 @@ public:
ServerHelper(const ServerDescriptorPtr&);
ServerHelper() { }
- bool operator==(const ServerHelper&) const;
- bool operator!=(const ServerHelper&) const;
+ virtual bool operator==(const CommunicatorHelper&) const;
+ virtual bool operator!=(const CommunicatorHelper&) const;
ServerDescriptorPtr getDescriptor() const;
virtual ServerDescriptorPtr instantiate(const Resolver&, const PropertyDescriptorSeq&,
@@ -203,8 +203,8 @@ public:
IceBoxHelper(const IceBoxDescriptorPtr&);
IceBoxHelper() { }
- bool operator==(const IceBoxHelper&) const;
- bool operator!=(const IceBoxHelper&) const;
+ virtual bool operator==(const CommunicatorHelper&) const;
+ virtual bool operator!=(const CommunicatorHelper&) const;
virtual ServerDescriptorPtr instantiate(const Resolver&, const PropertyDescriptorSeq&,
const PropertySetDescriptorDict&) const;
@@ -267,8 +267,8 @@ public:
NodeHelper(const std::string&, const NodeDescriptor&, const Resolver&, bool);
virtual ~NodeHelper() { }
- bool operator==(const NodeHelper&) const;
- bool operator!=(const NodeHelper&) const;
+ virtual bool operator==(const NodeHelper&) const;
+ virtual bool operator!=(const NodeHelper&) const;
NodeUpdateDescriptor diff(const NodeHelper&) const;
NodeDescriptor update(const NodeUpdateDescriptor&, const Resolver&) const;
diff --git a/cpp/src/IceUtil/Timer.cpp b/cpp/src/IceUtil/Timer.cpp
index fd80db92f2c..adca267c58e 100755
--- a/cpp/src/IceUtil/Timer.cpp
+++ b/cpp/src/IceUtil/Timer.cpp
@@ -152,8 +152,8 @@ Timer::run()
const Token& first = *(_tokens.begin());
if(first.scheduledTime <= now)
{
- _tokens.erase(_tokens.begin());
token = first;
+ _tokens.erase(_tokens.begin());
if(token.delay == IceUtil::Time())
{
_tasks.erase(token.task);
diff --git a/cpp/test/Freeze/dbmap/Client.cpp b/cpp/test/Freeze/dbmap/Client.cpp
index 17af3c7120b..4d602cb39f4 100644
--- a/cpp/test/Freeze/dbmap/Client.cpp
+++ b/cpp/test/Freeze/dbmap/Client.cpp
@@ -851,6 +851,54 @@ main(int argc, char* argv[])
status = EXIT_FAILURE;
}
+
+ cout << "testing manual code... " << flush;
+
+ //
+ // From manual
+ //
+
+ Freeze::ConnectionPtr connection =
+ Freeze::createConnection(communicator, envName);
+
+ // Instantiate the map.
+ //
+ ByteIntMap map(connection, "simple");
+
+ // Clear the map.
+ //
+ map.clear();
+
+ Ice::Int i;
+ ByteIntMap::iterator p;
+
+ // Populate the map.
+ //
+ for (i = 0; i < 26; i++)
+ {
+ Ice::Byte key = static_cast<Ice::Byte>('a' + i);
+ map.insert(make_pair(key, i));
+ }
+
+ // Iterate over the map and change the values.
+ //
+ for (p = map.begin(); p != map.end(); ++p)
+ {
+ p.set(p->second + 1);
+ }
+
+ // Find and erase the last element.
+ //
+ p = map.find(static_cast<Ice::Byte>('z'));
+ assert(p != map.end());
+ map.erase(p);
+
+ // Clean up.
+ //
+ connection->close();
+
+ cout << "ok" << endl;
+
try
{
communicator->destroy();
diff --git a/cpp/test/Glacier2/router/Client.cpp b/cpp/test/Glacier2/router/Client.cpp
index 686752a79d1..65717e620cc 100644
--- a/cpp/test/Glacier2/router/Client.cpp
+++ b/cpp/test/Glacier2/router/Client.cpp
@@ -862,36 +862,28 @@ CallbackClient::run(int argc, char* argv[])
cout << "ok" << endl;
}
- ObjectPrx adminBase;
+ ObjectPrx processBase;
{
- cout << "testing stringToProxy for admin object... " << flush;
- adminBase = communicator()->stringToProxy("Glacier2/admin:tcp -h 127.0.0.1 -p 12348 -t 10000");
+ cout << "testing stringToProxy for admin process facet... " << flush;
+ processBase = communicator()->stringToProxy("Glacier2/admin -f Process:tcp -h 127.0.0.1 -p 12348 -t 10000");
cout << "ok" << endl;
}
-/*
- {
- cout << "uninstalling router with admin object... " << flush;
- adminBase->ice_router(0);
- cout << "ok" << endl;
- }
-*/
-
- Glacier2::AdminPrx admin;
+ Ice::ProcessPrx process;
{
- cout << "testing checked cast for admin object... " << flush;
- admin = Glacier2::AdminPrx::checkedCast(adminBase);
- test(admin);
+ cout << "testing checked cast for process facet... " << flush;
+ process = Ice::ProcessPrx::checkedCast(processBase);
+ test(process);
cout << "ok" << endl;
}
cout << "testing Glacier2 shutdown... " << flush;
- admin->shutdown();
+ process->shutdown();
try
{
- admin->ice_ping();
+ process->ice_ping();
test(false);
}
catch(const Ice::LocalException&)
diff --git a/cpp/test/Glacier2/router/run.py b/cpp/test/Glacier2/router/run.py
index b54ebe0c3c4..a7106d66159 100755
--- a/cpp/test/Glacier2/router/run.py
+++ b/cpp/test/Glacier2/router/run.py
@@ -30,7 +30,8 @@ command = router + TestUtil.clientServerOptions + \
r' --Glacier2.SessionTimeout="30"' + \
r' --Glacier2.Client.Endpoints="default -p 12347 -t 10000"' + \
r' --Glacier2.Server.Endpoints="tcp -h 127.0.0.1 -t 10000"' \
- r' --Glacier2.Admin.Endpoints="tcp -h 127.0.0.1 -p 12348 -t 10000"' + \
+ r' --Ice.Admin.Endpoints="tcp -h 127.0.0.1 -p 12348 -t 10000"' + \
+ r' --Ice.Admin.InstanceName="Glacier2"' + \
r' --Glacier2.CryptPasswords="' + toplevel + r'/test/Glacier2/router/passwords"'
print "starting router...",