summaryrefslogtreecommitdiff
path: root/cpp/src/IceStorm/TopicManagerI.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/IceStorm/TopicManagerI.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/IceStorm/TopicManagerI.cpp')
-rw-r--r--cpp/src/IceStorm/TopicManagerI.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/cpp/src/IceStorm/TopicManagerI.cpp b/cpp/src/IceStorm/TopicManagerI.cpp
index 3eb9a1dd588..2d17084902b 100644
--- a/cpp/src/IceStorm/TopicManagerI.cpp
+++ b/cpp/src/IceStorm/TopicManagerI.cpp
@@ -26,13 +26,13 @@ using namespace std;
TopicManagerI::TopicManagerI(const Ice::CommunicatorPtr& communicator, const Ice::ObjectAdapterPtr& topicAdapter,
const Ice::ObjectAdapterPtr& publishAdapter, const TraceLevelsPtr& traceLevels,
- const Freeze::DBEnvironmentPtr& dbEnv, const Freeze::DBPtr& db) :
+ const string& envName, const string& dbName) :
_communicator(communicator),
_topicAdapter(topicAdapter),
_publishAdapter(publishAdapter),
_traceLevels(traceLevels),
- _dbEnv(dbEnv),
- _topics(db)
+ _envName(envName),
+ _topics(_communicator, envName, dbName)
{
_flusher = new Flusher(_communicator, _traceLevels);
_factory = new SubscriberFactory(_traceLevels, _flusher);
@@ -206,20 +206,17 @@ TopicManagerI::installTopic(const string& message, const string& name, bool crea
//
// Prepend "topic-" to the topic name in order to form a
// unique name for the Freeze database. Since the name we
- // supply to openDB is also used as a filename, we call
- // getDatabaseName to obtain a name with any questionable
- // filename characters converted to hex.
+ // supply is also used as a filename, we call getDatabaseName
+ // to obtain a name with any questionable filename characters converted to hex.
//
// TODO: instance
// TODO: failure? cleanup database?
//
- string dbName = "topic-" + getDatabaseName(name);
- Freeze::DBPtr db = _dbEnv->openDB(dbName, create);
-
+ string dbName = "topic-" + getDatabaseName(name);
//
// Create topic implementation
//
- TopicIPtr topicI = new TopicI(_publishAdapter, _traceLevels, name, _factory, db);
+ TopicIPtr topicI = new TopicI(_publishAdapter, _traceLevels, name, _factory, _envName, dbName, create);
//
// The identity is the name of the Topic.