summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/IceGridRegistry.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2009-09-28 11:05:44 -0230
committerDwayne Boone <dwayne@zeroc.com>2009-09-28 11:05:44 -0230
commit7d20430028f05cc26c412465176a75ce4ea5af9e (patch)
tree593695acf366f7e3a7081d15af8f474683ce4af7 /cpp/src/IceGrid/IceGridRegistry.cpp
parentRemoved unused __checkTwoway(const char*) from Proxy (diff)
downloadice-7d20430028f05cc26c412465176a75ce4ea5af9e.tar.bz2
ice-7d20430028f05cc26c412465176a75ce4ea5af9e.tar.xz
ice-7d20430028f05cc26c412465176a75ce4ea5af9e.zip
Bug 3231 - alternative storage for IceGrid and IceStorm
Diffstat (limited to 'cpp/src/IceGrid/IceGridRegistry.cpp')
-rw-r--r--cpp/src/IceGrid/IceGridRegistry.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/cpp/src/IceGrid/IceGridRegistry.cpp b/cpp/src/IceGrid/IceGridRegistry.cpp
index f6b15394f00..8b41caea87f 100644
--- a/cpp/src/IceGrid/IceGridRegistry.cpp
+++ b/cpp/src/IceGrid/IceGridRegistry.cpp
@@ -18,6 +18,11 @@
# include <IceGrid/Database.h>
# include <IceGrid/WellKnownObjectsManager.h>
#endif
+#ifdef QTSQL
+# include <IceSQL/SqlTypes.h>
+# include <QtCore/QCoreApplication>
+# include <QtCore/QTextCodec>
+#endif
using namespace std;
using namespace Ice;
@@ -31,6 +36,7 @@ class RegistryService : public Service
public:
RegistryService();
+ ~RegistryService();
virtual bool shutdown();
@@ -46,6 +52,9 @@ private:
void usage(const std::string&);
RegistryIPtr _registry;
+#ifdef QTSQL
+ QCoreApplication* _qtApp;
+#endif
};
} // End of namespace IceGrid
@@ -54,6 +63,17 @@ RegistryService::RegistryService()
{
}
+RegistryService::~RegistryService()
+{
+#ifdef QTSQL
+ if(_qtApp != 0)
+ {
+ delete _qtApp;
+ _qtApp = 0;
+ }
+#endif
+}
+
bool
RegistryService::shutdown()
{
@@ -121,6 +141,7 @@ RegistryService::start(int argc, char* argv[])
out << "you should set individual adapter thread pools instead.";
}
+
TraceLevelsPtr traceLevels = new TraceLevels(communicator(), "IceGrid.Registry");
_registry = new RegistryI(communicator(), traceLevels, nowarn, readonly);
@@ -163,6 +184,15 @@ RegistryService::initializeCommunicator(int& argc, char* argv[],
//
initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
+#ifdef QTSQL
+ if(QCoreApplication::instance() == 0)
+ {
+ _qtApp = new QCoreApplication(argc, argv);
+ QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
+ }
+ initData.threadHook = new IceSQL::ThreadHook();
+#endif
+
return Service::initializeCommunicator(argc, argv, initData);
}