diff options
author | Matthew Newhook <matthew@zeroc.com> | 2005-04-19 07:22:26 +0000 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2005-04-19 07:22:26 +0000 |
commit | 21d4f05364a1bd09eabc075a3bffdbae4d0b92b5 (patch) | |
tree | 5d9664798d26581ddc3e47ed6224ee877dca2e90 /cpp/demo/Ice/session/SessionI.cpp | |
parent | Added missing lock. (diff) | |
download | ice-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-x | cpp/demo/Ice/session/SessionI.cpp | 19 |
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; |