From d35bb9f5c19e34aee31f83d445695a8186ef675e Mon Sep 17 00:00:00 2001 From: Joe George Date: Tue, 3 Mar 2015 17:30:50 -0500 Subject: Ice 3.4.2 Source Distribution --- cpp/test/IceGrid/deployer/Service.cpp | 77 +++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 cpp/test/IceGrid/deployer/Service.cpp (limited to 'cpp/test/IceGrid/deployer/Service.cpp') 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 +#include +#include +#include + +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() +{ +} + -- cgit v1.2.3