summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/Util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceGrid/Util.cpp')
-rw-r--r--cpp/src/IceGrid/Util.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/cpp/src/IceGrid/Util.cpp b/cpp/src/IceGrid/Util.cpp
index 8fe7baf5a04..78c1c04aab0 100644
--- a/cpp/src/IceGrid/Util.cpp
+++ b/cpp/src/IceGrid/Util.cpp
@@ -11,10 +11,19 @@
#include <IcePatch2/Util.h>
#include <IceGrid/Util.h>
#include <IceGrid/Admin.h>
+#include <IceGrid/Internal.h>
using namespace std;
+using namespace Ice;
using namespace IceGrid;
+void
+IceGrid::SynchronizationException::ice_print(ostream& out) const
+{
+ Exception::ice_print(out);
+ out << ":\nsynchronization exception";
+}
+
string
IceGrid::toString(const vector<string>& v, const string& sep)
{
@@ -129,6 +138,38 @@ IceGrid::escapeProperty(const string& s)
return result;
}
+void
+IceGrid::setupThreadPool(const PropertiesPtr& properties, const string& name, int size, int sizeMax, bool serialize)
+{
+ if(properties->getPropertyAsIntWithDefault(name + ".Size", 0) < size)
+ {
+ ostringstream os;
+ os << size;
+ properties->setProperty(name + ".Size", os.str());
+ }
+ else
+ {
+ size = properties->getPropertyAsInt(name + ".Size");
+ }
+
+ if(sizeMax > 0 && properties->getPropertyAsIntWithDefault(name + ".SizeMax", 0) < sizeMax)
+ {
+ if(size >= sizeMax)
+ {
+ sizeMax = size * 10;
+ }
+
+ ostringstream os;
+ os << sizeMax;
+ properties->setProperty(name + ".SizeMax", os.str());
+ }
+
+ if(serialize)
+ {
+ properties->setProperty(name + ".Serialize", "1");
+ }
+}
+
int
IceGrid::getMMVersion(const string& o)
{