diff options
author | Mark Spruiell <mes@zeroc.com> | 2005-06-02 12:17:00 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2005-06-02 12:17:00 +0000 |
commit | e22ac16e2f56f898b14f09e8a6c9f78fbaa95d21 (patch) | |
tree | 11552443a5907516c60e215e5974f4d25b181a92 /java/demo/Ice/value/Server.java | |
parent | Fixed bug 258, 347, 352 (diff) | |
download | ice-e22ac16e2f56f898b14f09e8a6c9f78fbaa95d21.tar.bz2 ice-e22ac16e2f56f898b14f09e8a6c9f78fbaa95d21.tar.xz ice-e22ac16e2f56f898b14f09e8a6c9f78fbaa95d21.zip |
align with C++
Diffstat (limited to 'java/demo/Ice/value/Server.java')
-rw-r--r-- | java/demo/Ice/value/Server.java | 41 |
1 files changed, 7 insertions, 34 deletions
diff --git a/java/demo/Ice/value/Server.java b/java/demo/Ice/value/Server.java index 577bea672c0..01ad02ffba3 100644 --- a/java/demo/Ice/value/Server.java +++ b/java/demo/Ice/value/Server.java @@ -7,51 +7,24 @@ // // ********************************************************************** -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("Value"); + Ice.ObjectAdapter adapter = communicator().createObjectAdapter("Value"); Ice.Object object = new InitialI(adapter); adapter.add(object, Ice.Util.stringToIdentity("initial")); 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); } } |