diff options
author | Matthew Newhook <matthew@zeroc.com> | 2005-09-13 02:25:11 +0000 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2005-09-13 02:25:11 +0000 |
commit | 13c1478b4bf220e3c08055f7af39281e2f5d8875 (patch) | |
tree | 2d80b77591f870688270b6637678eddb3e1c6196 /java/demo/Ice/invoke/Server.java | |
parent | updates. (diff) | |
download | ice-13c1478b4bf220e3c08055f7af39281e2f5d8875.tar.bz2 ice-13c1478b4bf220e3c08055f7af39281e2f5d8875.tar.xz ice-13c1478b4bf220e3c08055f7af39281e2f5d8875.zip |
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=335
Diffstat (limited to 'java/demo/Ice/invoke/Server.java')
-rw-r--r-- | java/demo/Ice/invoke/Server.java | 44 |
1 files changed, 8 insertions, 36 deletions
diff --git a/java/demo/Ice/invoke/Server.java b/java/demo/Ice/invoke/Server.java index f82de481416..9f97355ea30 100644 --- a/java/demo/Ice/invoke/Server.java +++ b/java/demo/Ice/invoke/Server.java @@ -9,51 +9,23 @@ import Demo.*; -public class Server +public class Server extends Ice.Application { - private static int - run(String[] args, Ice.Communicator communicator) + public int + run(String[] args) { - Ice.ObjectAdapter adapter = communicator.createObjectAdapter("Printer"); - Ice.Object object = new PrinterI(); - adapter.add(object, Ice.Util.stringToIdentity("printer")); + Ice.ObjectAdapter adapter = communicator().createObjectAdapter("Printer"); + adapter.add(new PrinterI(), Ice.Util.stringToIdentity("printer")); adapter.activate(); - communicator.waitForShutdown(); + communicator().waitForShutdown(); return 0; } public static void main(String[] args) { - int status = 0; - Ice.Communicator communicator = null; - - try - { - Ice.Properties properties = Ice.Util.createProperties(); - properties.load("config"); - communicator = Ice.Util.initializeWithProperties(args, properties); - status = run(args, communicator); - } - catch(Ice.LocalException ex) - { - ex.printStackTrace(); - status = 1; - } - - if(communicator != null) - { - try - { - communicator.destroy(); - } - catch(Ice.LocalException ex) - { - ex.printStackTrace(); - status = 1; - } - } - + Server app = new Server(); + int status = app.main("Server", args, "config"); System.exit(status); } } |