summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/session/SessionI.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-04-19 07:22:26 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-04-19 07:22:26 +0000
commit21d4f05364a1bd09eabc075a3bffdbae4d0b92b5 (patch)
tree5d9664798d26581ddc3e47ed6224ee877dca2e90 /cpp/demo/Ice/session/SessionI.cpp
parentAdded missing lock. (diff)
downloadice-21d4f05364a1bd09eabc075a3bffdbae4d0b92b5.tar.bz2
ice-21d4f05364a1bd09eabc075a3bffdbae4d0b92b5.tar.xz
ice-21d4f05364a1bd09eabc075a3bffdbae4d0b92b5.zip
addressed few more concerns.
Diffstat (limited to 'cpp/demo/Ice/session/SessionI.cpp')
-rwxr-xr-xcpp/demo/Ice/session/SessionI.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/cpp/demo/Ice/session/SessionI.cpp b/cpp/demo/Ice/session/SessionI.cpp
index e3dc2c4937d..4cf07aa8fa3 100755
--- a/cpp/demo/Ice/session/SessionI.cpp
+++ b/cpp/demo/Ice/session/SessionI.cpp
@@ -9,6 +9,7 @@
#include <Ice/Ice.h>
#include <SessionFactoryI.h>
+#include <SessionI.h>
using namespace std;
using namespace Demo;
@@ -42,7 +43,11 @@ HelloPrx
SessionI::createHello(const Ice::Current& c)
{
Lock sync(*this);
- // XXX Check for destruction missing.
+ if(_destroy)
+ {
+ throw Ice::ObjectNotExistException(__FILE__, __LINE__);
+ }
+
HelloPrx hello = HelloPrx::uncheckedCast(c.adapter->addWithUUID(new HelloI(_nextId++)));
_objs.push_back(hello);
return hello;
@@ -52,7 +57,11 @@ void
SessionI::refresh(const Ice::Current& c)
{
Lock sync(*this);
- // XXX Check for destruction missing.
+ if(_destroy)
+ {
+ throw Ice::ObjectNotExistException(__FILE__, __LINE__);
+ }
+
_timestamp = IceUtil::Time::now();
}
@@ -60,7 +69,11 @@ void
SessionI::destroy(const Ice::Current& c)
{
Lock sync(*this);
- // XXX Check for destruction missing.
+ if(_destroy)
+ {
+ throw Ice::ObjectNotExistException(__FILE__, __LINE__);
+ }
+
_destroy = true;
cout << "The session #" << Ice::identityToString(c.id) << " is now destroyed." << endl;