summaryrefslogtreecommitdiff
path: root/java/demo/Ice/throughput/Server.java
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2003-04-25 19:59:14 +0000
committerMark Spruiell <mes@zeroc.com>2003-04-25 19:59:14 +0000
commit95a9deb459eada060fbeb1186c53ba93d94580dc (patch)
tree59e6312d24668ae41333a2541fd48ff3796f4137 /java/demo/Ice/throughput/Server.java
parentminor fix for const problem (diff)
downloadice-95a9deb459eada060fbeb1186c53ba93d94580dc.tar.bz2
ice-95a9deb459eada060fbeb1186c53ba93d94580dc.tar.xz
ice-95a9deb459eada060fbeb1186c53ba93d94580dc.zip
porting throughput demo
Diffstat (limited to 'java/demo/Ice/throughput/Server.java')
-rw-r--r--java/demo/Ice/throughput/Server.java62
1 files changed, 62 insertions, 0 deletions
diff --git a/java/demo/Ice/throughput/Server.java b/java/demo/Ice/throughput/Server.java
new file mode 100644
index 00000000000..644840db3c7
--- /dev/null
+++ b/java/demo/Ice/throughput/Server.java
@@ -0,0 +1,62 @@
+// **********************************************************************
+//
+// 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
+{
+ private static int
+ run(String[] args, Ice.Communicator communicator)
+ {
+ Ice.ObjectAdapter adapter = communicator.createObjectAdapter("Throughput");
+ Ice.Object object = new ThroughputI();
+ adapter.add(object, Ice.Util.stringToIdentity("throughput"));
+ adapter.activate();
+ communicator.waitForShutdown();
+ return 0;
+ }
+
+ public static void
+ main(String[] args)
+ {
+ int status = 0;
+ Ice.Communicator communicator = null;
+
+ try
+ {
+ Ice.Properties properties = Ice.Util.createProperties(args);
+ 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;
+ }
+ }
+
+ System.exit(status);
+ }
+}