diff options
Diffstat (limited to 'java/demo/Ice/throughput/Client.java')
-rw-r--r-- | java/demo/Ice/throughput/Client.java | 41 |
1 files changed, 7 insertions, 34 deletions
diff --git a/java/demo/Ice/throughput/Client.java b/java/demo/Ice/throughput/Client.java index 3a6eac769a9..4dc7af06ebe 100644 --- a/java/demo/Ice/throughput/Client.java +++ b/java/demo/Ice/throughput/Client.java @@ -9,7 +9,7 @@ import Demo.*; -public class Client +public class Client extends Ice.Application { private static void menu() @@ -35,10 +35,10 @@ public class Client "?: help\n"); } - private static int - run(String[] args, Ice.Communicator communicator) + public int + run(String[] args) { - Ice.Properties properties = communicator.getProperties(); + Ice.Properties properties = communicator().getProperties(); final String refProperty = "Throughput.Throughput"; String ref = properties.getProperty(refProperty); if(ref.length() == 0) @@ -47,7 +47,7 @@ public class Client return 1; } - Ice.ObjectPrx base = communicator.stringToProxy(ref); + Ice.ObjectPrx base = communicator().stringToProxy(ref); ThroughputPrx throughput = ThroughputPrxHelper.checkedCast(base); if(throughput == null) { @@ -408,35 +408,8 @@ public class Client 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; - } - } - + Client app = new Client(); + int status = app.main("Client", args, "config"); System.exit(status); } } |