diff options
author | Joe George <joe@zeroc.com> | 2015-03-03 17:30:50 -0500 |
---|---|---|
committer | Joe George <joe@zeroc.com> | 2015-05-12 11:41:55 -0400 |
commit | d35bb9f5c19e34aee31f83d445695a8186ef675e (patch) | |
tree | d5324eaf44f5f9776495537c51653f50a66a7237 /cpp/test/IceGrid/deployer/Service.cpp | |
download | ice-d35bb9f5c19e34aee31f83d445695a8186ef675e.tar.bz2 ice-d35bb9f5c19e34aee31f83d445695a8186ef675e.tar.xz ice-d35bb9f5c19e34aee31f83d445695a8186ef675e.zip |
Ice 3.4.2 Source Distributionv3.4.2
Diffstat (limited to 'cpp/test/IceGrid/deployer/Service.cpp')
-rw-r--r-- | cpp/test/IceGrid/deployer/Service.cpp | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/cpp/test/IceGrid/deployer/Service.cpp b/cpp/test/IceGrid/deployer/Service.cpp new file mode 100644 index 00000000000..9d074a8ea85 --- /dev/null +++ b/cpp/test/IceGrid/deployer/Service.cpp @@ -0,0 +1,77 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#include <Ice/Ice.h> +#include <IceBox/IceBox.h> +#include <Freeze/Freeze.h> +#include <TestI.h> + +using namespace std; +using namespace Ice; + +class ServiceI : public ::IceBox::Service +{ +public: + + ServiceI(); + virtual ~ServiceI(); + + virtual void start(const string&, + const CommunicatorPtr&, + const StringSeq&); + + virtual void stop(); +}; + +extern "C" +{ + +// +// Factory function +// +ICE_DECLSPEC_EXPORT ::IceBox::Service* +create(CommunicatorPtr communicator) +{ + return new ServiceI; +} + +} + +ServiceI::ServiceI() +{ +} + +ServiceI::~ServiceI() +{ +} + +void +ServiceI::start(const string& name, + const CommunicatorPtr& communicator, + const StringSeq& args) +{ + Ice::PropertiesPtr properties = communicator->getProperties(); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter(name); + if(properties->getPropertyAsInt(name + ".Freeze") > 0) + { + // + // We do this to ensure the dbenv directory exists. + // + Freeze::createConnection(communicator, name); + } + Ice::ObjectPtr object = new TestI(properties); + adapter->add(object, communicator->stringToIdentity(properties->getProperty(name + ".Identity"))); + adapter->activate(); +} + +void +ServiceI::stop() +{ +} + |