summaryrefslogtreecommitdiff
path: root/cpp/test/IceGrid/deployer/Service.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2005-04-18 13:58:42 +0000
committerBenoit Foucher <benoit@zeroc.com>2005-04-18 13:58:42 +0000
commit12736d6b110b4f7e8f5eed868fd5c1e2a369fcd2 (patch)
tree8940ba23901283d9494acff7cae7b8d3e7539582 /cpp/test/IceGrid/deployer/Service.cpp
parentfixes. (diff)
downloadice-12736d6b110b4f7e8f5eed868fd5c1e2a369fcd2.tar.bz2
ice-12736d6b110b4f7e8f5eed868fd5c1e2a369fcd2.tar.xz
ice-12736d6b110b4f7e8f5eed868fd5c1e2a369fcd2.zip
Changed deployment implementation.
Diffstat (limited to 'cpp/test/IceGrid/deployer/Service.cpp')
-rw-r--r--cpp/test/IceGrid/deployer/Service.cpp75
1 files changed, 75 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..b96f8881558
--- /dev/null
+++ b/cpp/test/IceGrid/deployer/Service.cpp
@@ -0,0 +1,75 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2005 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>
+
+#ifndef TEST_SERVICE_API
+# define TEST_SERVICE_API ICE_DECLSPEC_EXPORT
+#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 StringSeq&);
+
+ virtual void stop();
+};
+
+extern "C"
+{
+
+//
+// Factory function
+//
+TEST_SERVICE_API ::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);
+ Ice::ObjectPtr object = new TestI(adapter, properties);
+ adapter->add(object, Ice::stringToIdentity(properties->getProperty(name + ".Identity")));
+ adapter->activate();
+}
+
+void
+ServiceI::stop()
+{
+}
+