summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-09-06 12:54:51 +0000
committerMarc Laukien <marc@zeroc.com>2002-09-06 12:54:51 +0000
commit5c967135e45b42c0b191351b7379b4e4f4f1dc56 (patch)
tree632bdfb4b85208e33278e4bf23f8dad335217755 /cpp/src
parentfixes (diff)
downloadice-5c967135e45b42c0b191351b7379b4e4f4f1dc56.tar.bz2
ice-5c967135e45b42c0b191351b7379b4e4f4f1dc56.tar.xz
ice-5c967135e45b42c0b191351b7379b4e4f4f1dc56.zip
added toString to EventHandler
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/Connection.cpp6
-rw-r--r--cpp/src/Ice/Connection.h1
-rw-r--r--cpp/src/Ice/ConnectionFactory.cpp12
-rw-r--r--cpp/src/Ice/ConnectionFactory.h1
-rw-r--r--cpp/src/Ice/EventHandler.h5
-rw-r--r--cpp/src/Ice/ThreadPool.cpp10
6 files changed, 34 insertions, 1 deletions
diff --git a/cpp/src/Ice/Connection.cpp b/cpp/src/Ice/Connection.cpp
index eaad513e59e..a48b9649f4a 100644
--- a/cpp/src/Ice/Connection.cpp
+++ b/cpp/src/Ice/Connection.cpp
@@ -796,6 +796,12 @@ IceInternal::Connection::exception(const LocalException& ex)
setState(StateClosed, ex);
}
+string
+IceInternal::Connection::toString() const
+{
+ return _transceiver->toString();
+}
+
IceInternal::Connection::Connection(const InstancePtr& instance,
const TransceiverPtr& transceiver,
const EndpointPtr& endpoint,
diff --git a/cpp/src/Ice/Connection.h b/cpp/src/Ice/Connection.h
index 0aa118ac89c..f3eaa396925 100644
--- a/cpp/src/Ice/Connection.h
+++ b/cpp/src/Ice/Connection.h
@@ -66,6 +66,7 @@ public:
virtual void message(BasicStream&, const ThreadPoolPtr&);
virtual void finished(const ThreadPoolPtr&);
virtual void exception(const ::Ice::LocalException&);
+ virtual std::string toString() const;
private:
diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp
index cf022cce2fa..7a93c367f59 100644
--- a/cpp/src/Ice/ConnectionFactory.cpp
+++ b/cpp/src/Ice/ConnectionFactory.cpp
@@ -412,6 +412,18 @@ IceInternal::IncomingConnectionFactory::exception(const LocalException&)
assert(false); // Must not be called.
}
+string
+IceInternal::IncomingConnectionFactory::toString() const
+{
+ if(_transceiver)
+ {
+ return _transceiver->toString();
+ }
+
+ assert(_acceptor);
+ return _acceptor->toString();
+}
+
IceInternal::IncomingConnectionFactory::IncomingConnectionFactory(const InstancePtr& instance,
const EndpointPtr& endpoint,
const ObjectAdapterPtr& adapter) :
diff --git a/cpp/src/Ice/ConnectionFactory.h b/cpp/src/Ice/ConnectionFactory.h
index 76e56ab21da..f7972c89de3 100644
--- a/cpp/src/Ice/ConnectionFactory.h
+++ b/cpp/src/Ice/ConnectionFactory.h
@@ -72,6 +72,7 @@ public:
virtual void message(BasicStream&, const ThreadPoolPtr&);
virtual void finished(const ThreadPoolPtr&);
virtual void exception(const ::Ice::LocalException&);
+ virtual std::string toString() const;
private:
diff --git a/cpp/src/Ice/EventHandler.h b/cpp/src/Ice/EventHandler.h
index d7308f6ca30..9aa6fc32b63 100644
--- a/cpp/src/Ice/EventHandler.h
+++ b/cpp/src/Ice/EventHandler.h
@@ -59,6 +59,11 @@ public:
//
virtual void exception(const ::Ice::LocalException&) = 0;
+ //
+ // Get a textual representation of the event handler.
+ //
+ virtual std::string toString() const = 0;
+
protected:
EventHandler(const InstancePtr&);
diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp
index 4c1f1100aed..60d75341c32 100644
--- a/cpp/src/Ice/ThreadPool.cpp
+++ b/cpp/src/Ice/ThreadPool.cpp
@@ -475,7 +475,15 @@ IceInternal::ThreadPool::run()
// Notify a handler about it's removal from the thread
// pool.
//
- handler->finished(self); // "self" is faster than "this", as the reference count is not modified.
+ try
+ {
+ handler->finished(self); // "self" is faster than "this", as the reference count is not modified.
+ }
+ catch(const LocalException& ex)
+ {
+ Error out(_instance->logger());
+ out << "exception while calling finished():\n" << handler->toString() << '\n' << ex;
+ }
{
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);