summaryrefslogtreecommitdiff
path: root/cpp/src/IcePack/IcePackNode.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2003-07-18 19:47:14 +0000
committerBernard Normier <bernard@zeroc.com>2003-07-18 19:47:14 +0000
commit3c02842b6143c6ce9297feecd7c9497312c76da8 (patch)
tree478210bed985772e2957ee0a65b9cd3f5f390234 /cpp/src/IcePack/IcePackNode.cpp
parentuse lazy initialization of communicator for each request (diff)
downloadice-3c02842b6143c6ce9297feecd7c9497312c76da8.tar.bz2
ice-3c02842b6143c6ce9297feecd7c9497312c76da8.tar.xz
ice-3c02842b6143c6ce9297feecd7c9497312c76da8.zip
Major Freeze update
Diffstat (limited to 'cpp/src/IcePack/IcePackNode.cpp')
-rw-r--r--cpp/src/IcePack/IcePackNode.cpp40
1 files changed, 7 insertions, 33 deletions
diff --git a/cpp/src/IcePack/IcePackNode.cpp b/cpp/src/IcePack/IcePackNode.cpp
index e32421a9530..248c7169baf 100644
--- a/cpp/src/IcePack/IcePackNode.cpp
+++ b/cpp/src/IcePack/IcePackNode.cpp
@@ -87,7 +87,7 @@ shutdownCallback(int)
int
-run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator, const Freeze::DBEnvironmentPtr& dbEnv)
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator, const string& envName)
{
Ice::PropertiesPtr properties = communicator->getProperties();
@@ -184,7 +184,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator, const Free
// installing the evictors and object factory necessary to persist
// and create these objects.
//
- ServerFactoryPtr serverFactory = new ServerFactory(adapter, traceLevels, dbEnv, activator, waitQueue);
+ ServerFactoryPtr serverFactory = new ServerFactory(adapter, traceLevels, envName, activator, waitQueue);
//
// Create the node object and the node info. Because of circular
@@ -343,7 +343,6 @@ main(int argc, char* argv[])
}
Ice::CommunicatorPtr communicator;
- Freeze::DBEnvironmentPtr dbEnv;
int status;
try
@@ -437,7 +436,7 @@ main(int argc, char* argv[])
// Initialize the database environment (first setup the
// directory structure if needed).
//
- string dbPath;
+ string envName;
string dataPath = properties->getProperty("IcePack.Node.Data");
if(dataPath.empty())
{
@@ -462,21 +461,20 @@ main(int argc, char* argv[])
dataPath += "/";
}
- dbPath = dataPath + "db";
+ envName = dataPath + "db";
string serversPath = dataPath + "servers";
- if(stat(dbPath.c_str(), &filestat) != 0)
+ if(stat(envName.c_str(), &filestat) != 0)
{
- mkdir(dbPath.c_str(), 0755);
+ mkdir(envName.c_str(), 0755);
}
if(stat(serversPath.c_str(), &filestat) != 0)
{
mkdir(serversPath.c_str(), 0755);
}
}
- dbEnv = Freeze::initialize(communicator, dbPath);
- status = run(argc, argv, communicator, dbEnv);
+ status = run(argc, argv, communicator, envName);
}
catch(const Ice::Exception& ex)
{
@@ -489,30 +487,6 @@ main(int argc, char* argv[])
status = EXIT_FAILURE;
}
- if(dbEnv)
- {
- try
- {
- dbEnv->close();
- }
- catch(const Freeze::DBException& ex)
- {
- cerr << argv[0] << ": " << ex << ": " << ex.message << endl;
- status = EXIT_FAILURE;
- }
- catch(const Ice::Exception& ex)
- {
- cerr << argv[0] << ": " << ex << endl;
- status = EXIT_FAILURE;
- }
- catch(...)
- {
- cerr << argv[0] << ": unknown exception" << endl;
- status = EXIT_FAILURE;
- }
- dbEnv = 0;
- }
-
if(communicator)
{
try