diff options
Diffstat (limited to 'cpp/test/IceBox/admin/Service.cpp')
-rw-r--r-- | cpp/test/IceBox/admin/Service.cpp | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/cpp/test/IceBox/admin/Service.cpp b/cpp/test/IceBox/admin/Service.cpp new file mode 100644 index 00000000000..2e3c1be9817 --- /dev/null +++ b/cpp/test/IceBox/admin/Service.cpp @@ -0,0 +1,76 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 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 <TestI.h> + +using namespace std; +using namespace Ice; + +class ServiceI : public ::IceBox::Service +{ +public: + + ServiceI(const CommunicatorPtr&); + 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(communicator); +} + +} + +ServiceI::ServiceI(const CommunicatorPtr& serviceManagerCommunicator) +{ + TestFacetIPtr facet = new TestFacetI; + + // + // Install a custom admin facet. + // + serviceManagerCommunicator->addAdminFacet(facet, "TestFacet"); + + // + // The TestFacetI servant also implements PropertiesAdminUpdateCallback. + // Set the callback on the admin facet. + // + ObjectPtr propFacet = serviceManagerCommunicator->findAdminFacet("IceBox.Service.TestService.Properties"); + NativePropertiesAdminPtr admin = NativePropertiesAdminPtr::dynamicCast(propFacet); + assert(admin); + admin->setUpdateCallback(facet); +} + +ServiceI::~ServiceI() +{ +} + +void +ServiceI::start(const string& name, const CommunicatorPtr& communicator, const StringSeq& args) +{ +} + +void +ServiceI::stop() +{ +} |