diff options
author | Benoit Foucher <benoit@zeroc.com> | 2002-08-09 14:46:06 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2002-08-09 14:46:06 +0000 |
commit | db3b68cb56c951f2f54fd63685039ab908acab06 (patch) | |
tree | a2fc0e7e9fde3634b96f6da41b268fb1582b4f44 /cpp/test/IcePack/deployer/Service.cpp | |
parent | added dummy file (diff) | |
download | ice-db3b68cb56c951f2f54fd63685039ab908acab06.tar.bz2 ice-db3b68cb56c951f2f54fd63685039ab908acab06.tar.xz ice-db3b68cb56c951f2f54fd63685039ab908acab06.zip |
Added new IcePack test suite, add IcePack tracing properties, added IcePack
server shutdown.
Diffstat (limited to 'cpp/test/IcePack/deployer/Service.cpp')
-rw-r--r-- | cpp/test/IcePack/deployer/Service.cpp | 130 |
1 files changed, 130 insertions, 0 deletions
diff --git a/cpp/test/IcePack/deployer/Service.cpp b/cpp/test/IcePack/deployer/Service.cpp new file mode 100644 index 00000000000..b1a54c8bc23 --- /dev/null +++ b/cpp/test/IcePack/deployer/Service.cpp @@ -0,0 +1,130 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#include <Ice/Ice.h> +#include <IceBox/IceBox.h> +#include <Freeze/Freeze.h> +#include <TestI.h> + +#if defined(_WIN32) +# define TEST_SERVICE_API __declspec(dllexport) +#else +# define TEST_SERVICE_API /**/ +#endif + +using namespace std; +using namespace Ice; + +class TEST_SERVICE_API ServiceI : public ::IceBox::Service +{ +public: + + ServiceI(); + virtual ~ServiceI(); + + virtual void start(const string&, + const CommunicatorPtr&, + const PropertiesPtr&, + const StringSeq&); + + virtual void stop(); +}; + +class TEST_SERVICE_API FreezeServiceI : public ::IceBox::FreezeService +{ +public: + + FreezeServiceI(); + virtual ~FreezeServiceI(); + + virtual void start(const string&, + const CommunicatorPtr&, + const PropertiesPtr&, + const StringSeq&, + const Freeze::DBEnvironmentPtr&); + + virtual void stop(); +}; + +extern "C" +{ + +// +// Factory function +// +TEST_SERVICE_API ::IceBox::Service* +create(CommunicatorPtr communicator) +{ + return new ServiceI; +} + +TEST_SERVICE_API ::IceBox::FreezeService* +createFreezeService(CommunicatorPtr communicator) +{ + return new FreezeServiceI; +} + +} + +ServiceI::ServiceI() +{ +} + +ServiceI::~ServiceI() +{ +} + +void +ServiceI::start(const string& name, + const CommunicatorPtr& communicator, + const PropertiesPtr& properties, + const StringSeq& args) +{ + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter(name + "Adapter"); + Ice::ObjectPtr object = new TestI(adapter, properties); + adapter->add(object, Ice::stringToIdentity(name)); + adapter->activate(); +} + +void +ServiceI::stop() +{ +} + +FreezeServiceI::FreezeServiceI() +{ +} + +FreezeServiceI::~FreezeServiceI() +{ +} + +void +FreezeServiceI::start(const string& name, + const CommunicatorPtr& communicator, + const PropertiesPtr& properties, + const StringSeq& args, + const Freeze::DBEnvironmentPtr& dbEnv) +{ + // + // Ensure that we can create an environment. + // + Freeze::DBPtr db = dbEnv->openDB("testdb", true); + + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter(name + "Adapter"); + Ice::ObjectPtr object = new TestI(adapter, properties); + adapter->add(object, Ice::stringToIdentity(name)); + adapter->activate(); +} + +void +FreezeServiceI::stop() +{ +} |