summaryrefslogtreecommitdiff
path: root/cpp/src/IceStorm/TopicI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceStorm/TopicI.cpp')
-rw-r--r--cpp/src/IceStorm/TopicI.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/cpp/src/IceStorm/TopicI.cpp b/cpp/src/IceStorm/TopicI.cpp
index d95c4d0d000..8b17f4da2f1 100644
--- a/cpp/src/IceStorm/TopicI.cpp
+++ b/cpp/src/IceStorm/TopicI.cpp
@@ -24,6 +24,10 @@ using namespace std;
namespace IceStorm
{
+//
+// The servant has a 1-1 association with a topic. It is used to
+// receive events from Publishers.
+//
class BlobjectI : public Ice::Blobject
{
public:
@@ -42,6 +46,9 @@ public:
private:
+ //
+ // Set of associated subscribers
+ //
IceStorm::TopicSubscribersPtr _subscribers;
};
@@ -186,6 +193,11 @@ TopicI::TopicI(const Ice::ObjectAdapterPtr& adapter, const TraceLevelsPtr& trace
{
_subscribers = new TopicSubscribers(_traceLevels, _logger, _name, _flusher);
+ //
+ // Create a servant per Topic to receive event data. The servants
+ // object-id is <topic>#publish. Active the object and save a
+ // reference to give to publishers.
+ //
_publisher = new BlobjectI(_subscribers);
string id = name;
@@ -216,6 +228,13 @@ void
TopicI::destroy()
{
JTCSyncT<JTCMutex> sync(_destroyedMutex);
+ if (_traceLevels->topic > 0)
+ {
+ ostringstream s;
+ s << "Destroy " << _name;
+ _logger->trace(_traceLevels->topicCat, s.str());
+ }
+
_adapter->remove(_name);
_destroyed = true;
}