diff options
author | Mark Spruiell <mes@zeroc.com> | 2002-01-17 20:38:49 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2002-01-17 20:38:49 +0000 |
commit | 0ab7f17f4b0312ff8f21d68095e1118133111816 (patch) | |
tree | de9f855f06a356bde49835620d96b6fd9a397f9f /java/test/Ice/exceptions/Server.java | |
parent | unicode tests (diff) | |
download | ice-0ab7f17f4b0312ff8f21d68095e1118133111816.tar.bz2 ice-0ab7f17f4b0312ff8f21d68095e1118133111816.tar.xz ice-0ab7f17f4b0312ff8f21d68095e1118133111816.zip |
adding server
Diffstat (limited to 'java/test/Ice/exceptions/Server.java')
-rw-r--r-- | java/test/Ice/exceptions/Server.java | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/java/test/Ice/exceptions/Server.java b/java/test/Ice/exceptions/Server.java new file mode 100644 index 00000000000..3d4a4de765b --- /dev/null +++ b/java/test/Ice/exceptions/Server.java @@ -0,0 +1,61 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +public class Server +{ + private static int + run(String[] args, Ice.Communicator communicator) + { + Ice.Properties properties = communicator.getProperties(); + properties.setProperty("Ice.ConnectionWarnings", "0"); + String endpts = "default -p 12345 -t 2000"; + Ice.ObjectAdapter adapter = + communicator.createObjectAdapterWithEndpoints("TestAdapter", + endpts); + Ice.Object object = new ThrowerI(adapter); + adapter.add(object, Ice.Util.stringToIdentity("thrower")); + adapter.activate(); + communicator.waitForShutdown(); + return 0; + } + + public static void + main(String[] args) + { + int status = 0; + Ice.Communicator communicator = null; + + try + { + communicator = Ice.Util.initialize(args); + 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); + } +} |