summaryrefslogtreecommitdiff
path: root/cpp/test/IceGrid/replication/Service.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2005-09-30 04:58:01 +0000
committerBenoit Foucher <benoit@zeroc.com>2005-09-30 04:58:01 +0000
commita795900d002f4182b13b32f6ebf3391458786123 (patch)
tree3a75ed09a7ce57e0253f54ee6f0cbcf08dfba3ac /cpp/test/IceGrid/replication/Service.cpp
parentBug 498. (diff)
downloadice-a795900d002f4182b13b32f6ebf3391458786123.tar.bz2
ice-a795900d002f4182b13b32f6ebf3391458786123.tar.xz
ice-a795900d002f4182b13b32f6ebf3391458786123.zip
Added support for <adapter name>.ReplicaId.
Diffstat (limited to 'cpp/test/IceGrid/replication/Service.cpp')
-rw-r--r--cpp/test/IceGrid/replication/Service.cpp73
1 files changed, 73 insertions, 0 deletions
diff --git a/cpp/test/IceGrid/replication/Service.cpp b/cpp/test/IceGrid/replication/Service.cpp
new file mode 100644
index 00000000000..3ca3038b031
--- /dev/null
+++ b/cpp/test/IceGrid/replication/Service.cpp
@@ -0,0 +1,73 @@
+// **********************************************************************
+//
+// 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::ObjectAdapterPtr adapter = communicator->createObjectAdapter(name);
+ Ice::ObjectPtr object = new TestI(adapter, communicator->getProperties());
+ adapter->add(object, Ice::stringToIdentity("test"));
+ adapter->activate();
+}
+
+void
+ServiceI::stop()
+{
+}
+