diff options
author | Mark Spruiell <mes@zeroc.com> | 2003-12-24 18:48:42 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2003-12-24 18:48:42 +0000 |
commit | 0f4947090461357805586e6a8dcf1a212b003c26 (patch) | |
tree | def1fa2567b6db3103a4108fae890cfc2520f5fc /java/demo/IcePack/hello/Server.java | |
parent | adding IcePack tests for Win32 (diff) | |
download | ice-0f4947090461357805586e6a8dcf1a212b003c26.tar.bz2 ice-0f4947090461357805586e6a8dcf1a212b003c26.tar.xz ice-0f4947090461357805586e6a8dcf1a212b003c26.zip |
adding IcePack demo
Diffstat (limited to 'java/demo/IcePack/hello/Server.java')
-rw-r--r-- | java/demo/IcePack/hello/Server.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/java/demo/IcePack/hello/Server.java b/java/demo/IcePack/hello/Server.java new file mode 100644 index 00000000000..06bc5df24b9 --- /dev/null +++ b/java/demo/IcePack/hello/Server.java @@ -0,0 +1,39 @@ +// ********************************************************************** +// +// Copyright (c) 2003 +// 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. +// +// ********************************************************************** + +public class Server extends Ice.Application +{ + public int + run(String[] args) + { + Ice.ObjectAdapter adapter = communicator().createObjectAdapter("Hello"); + + String id = communicator().getProperties().getProperty("Identity"); + + Ice.Object object = new HelloFactoryI(); + adapter.add(object, Ice.Util.stringToIdentity(id)); + adapter.activate(); + + communicator().waitForShutdown(); + return 0; + } + + public static void + main(String[] args) + { + Server app = new Server(); + int status = app.main("Server", args); + System.exit(status); + } +} |