diff options
author | Mark Spruiell <mes@zeroc.com> | 2002-04-01 20:41:28 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2002-04-01 20:41:28 +0000 |
commit | f5452c64777343b5b854629f600e1734ef6f9008 (patch) | |
tree | e4a76b4a6214ad9544470031848405acd0bc4197 /cpp/demo/IceBox/hello/HelloServiceI.cpp | |
parent | adding IceBox (diff) | |
download | ice-f5452c64777343b5b854629f600e1734ef6f9008.tar.bz2 ice-f5452c64777343b5b854629f600e1734ef6f9008.tar.xz ice-f5452c64777343b5b854629f600e1734ef6f9008.zip |
initial check-in
Diffstat (limited to 'cpp/demo/IceBox/hello/HelloServiceI.cpp')
-rw-r--r-- | cpp/demo/IceBox/hello/HelloServiceI.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/cpp/demo/IceBox/hello/HelloServiceI.cpp b/cpp/demo/IceBox/hello/HelloServiceI.cpp new file mode 100644 index 00000000000..b7596d539e2 --- /dev/null +++ b/cpp/demo/IceBox/hello/HelloServiceI.cpp @@ -0,0 +1,54 @@ +#include <Ice/Ice.h> +#include <HelloServiceI.h> +#include <HelloI.h> + +using namespace std; + +extern "C" +{ + +// +// Factory function +// +::IceBox::ServicePtr +create(::Ice::CommunicatorPtr communicator) +{ + return new HelloServiceI; +} + +} + +HelloServiceI::HelloServiceI() +{ + cout << "HelloServiceI()" << endl; +} + +HelloServiceI::~HelloServiceI() +{ + cout << "~HelloServiceI()" << endl; +} + +void +HelloServiceI::init(const string& name, + const ::Ice::CommunicatorPtr& communicator, + const ::Ice::PropertiesPtr& properties, + const ::Ice::StringSeq& args) +{ + _adapter = communicator->createObjectAdapter(name + "Adapter"); + ::Ice::ObjectPtr object = new HelloI(communicator); + _adapter->add(object, ::Ice::stringToIdentity("hello")); + _adapter->activate(); +} + +void +HelloServiceI::start() +{ + cout << "HelloServiceI::start" << endl; +} + +void +HelloServiceI::stop() +{ + cout << "HelloServiceI::stop" << endl; + _adapter->deactivate(); +} |