summaryrefslogtreecommitdiff
path: root/cpp/demo/IcePack/hello/Server.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2002-12-05 22:31:29 +0000
committerBenoit Foucher <benoit@zeroc.com>2002-12-05 22:31:29 +0000
commit7abe0bb2e951d22f67f34d38bd4892f30ad901bb (patch)
tree4844d8f0ed9c4988f5ec8988aa313b1f47f15162 /cpp/demo/IcePack/hello/Server.cpp
parentAdded support for object lookup by identity (diff)
downloadice-7abe0bb2e951d22f67f34d38bd4892f30ad901bb.tar.bz2
ice-7abe0bb2e951d22f67f34d38bd4892f30ad901bb.tar.xz
ice-7abe0bb2e951d22f67f34d38bd4892f30ad901bb.zip
Added IcePack object registry.
Added support for locator object lookup by identity. Added Query interface to lookup objects by type. Changed the IcePack.Registry.Locator properties to IcePack.Registry.Client Changed the IcePack.Registry.LocatorRegistry properties to IcePack.Registry.Se rver Added IcePack demo Minor fixes and clean-up
Diffstat (limited to 'cpp/demo/IcePack/hello/Server.cpp')
-rw-r--r--cpp/demo/IcePack/hello/Server.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/cpp/demo/IcePack/hello/Server.cpp b/cpp/demo/IcePack/hello/Server.cpp
new file mode 100644
index 00000000000..c15c30d75bb
--- /dev/null
+++ b/cpp/demo/IcePack/hello/Server.cpp
@@ -0,0 +1,49 @@
+// **********************************************************************
+//
+// Copyright (c) 2002
+// ZeroC, Inc.
+// Billerica, MA, USA
+//
+// All Rights Reserved.
+//
+// Ice is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License version 2 as published by
+// the Free Software Foundation.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <HelloI.h>
+
+using namespace std;
+
+class Server : public Ice::Application
+{
+public:
+
+ virtual int run(int argc, char* argv[]);
+
+};
+
+int
+::Server::run(int argc, char* argv[])
+{
+ Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Hello");
+
+ string id = communicator()->getProperties()->getProperty("Identity");
+
+ Ice::ObjectPtr object = new HelloFactoryI();
+ adapter->add(object, Ice::stringToIdentity(id));
+ adapter->activate();
+
+ communicator()->waitForShutdown();
+ return EXIT_SUCCESS;
+}
+
+int
+main(int argc, char* argv[])
+{
+ Server app;
+ int status = app.main(argc, argv);
+ return status;
+}