summaryrefslogtreecommitdiff
path: root/py/demo/IceGrid/simple/Server.py
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2005-11-17 18:26:29 +0000
committerDwayne Boone <dwayne@zeroc.com>2005-11-17 18:26:29 +0000
commit05d60f523e830ba7849827100ccec7659f73e23e (patch)
tree4f6d47ed248e26245b219fa81131dc014b247314 /py/demo/IceGrid/simple/Server.py
parentFix (diff)
downloadice-05d60f523e830ba7849827100ccec7659f73e23e.tar.bz2
ice-05d60f523e830ba7849827100ccec7659f73e23e.tar.xz
ice-05d60f523e830ba7849827100ccec7659f73e23e.zip
Added IceGrid, IceStorm and Glacier2 demos
Diffstat (limited to 'py/demo/IceGrid/simple/Server.py')
-rw-r--r--py/demo/IceGrid/simple/Server.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/py/demo/IceGrid/simple/Server.py b/py/demo/IceGrid/simple/Server.py
new file mode 100644
index 00000000000..1b0751eeec2
--- /dev/null
+++ b/py/demo/IceGrid/simple/Server.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# 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.
+#
+# **********************************************************************
+
+import sys, traceback, Ice
+
+Ice.loadSlice('Hello.ice')
+import Demo
+
+class HelloI(Demo.Hello):
+ def __init__(self, name):
+ self.name = name
+
+ def sayHello(self, current=None):
+ print self.name + " says Hello World!"
+
+ def shutdown(self, current=None):
+ print self.name + " shutting down..."
+ current.adapter.getCommunicator().shutdown()
+
+class Server(Ice.Application):
+ def run(self, args):
+ properties = self.communicator().getProperties()
+ adapter = self.communicator().createObjectAdapter("Hello")
+ id = Ice.stringToIdentity(properties.getProperty("Identity"))
+ adapter.add(HelloI(properties.getProperty("Ice.ServerId")), id)
+ adapter.activate()
+ self.communicator().waitForShutdown()
+ return True
+
+app = Server()
+sys.exit(app.main(sys.argv))