diff options
author | Mark Spruiell <mes@zeroc.com> | 2002-01-17 21:48:53 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2002-01-17 21:48:53 +0000 |
commit | 34e1b0206e7a265d2a03e8077637c404634c1657 (patch) | |
tree | 0214c307fcecbbd03036dd0a901f555e58fcb79a /java/test/Ice/facets/Server.java | |
parent | fixes (diff) | |
download | ice-34e1b0206e7a265d2a03e8077637c404634c1657.tar.bz2 ice-34e1b0206e7a265d2a03e8077637c404634c1657.tar.xz ice-34e1b0206e7a265d2a03e8077637c404634c1657.zip |
adding server
Diffstat (limited to 'java/test/Ice/facets/Server.java')
-rw-r--r-- | java/test/Ice/facets/Server.java | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/java/test/Ice/facets/Server.java b/java/test/Ice/facets/Server.java new file mode 100644 index 00000000000..d111c4340b6 --- /dev/null +++ b/java/test/Ice/facets/Server.java @@ -0,0 +1,65 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +public class Server +{ + private static int + run(String[] args, Ice.Communicator communicator) + { + String endpts = "default -p 12345 -t 2000"; + Ice.ObjectAdapter adapter = + communicator.createObjectAdapterWithEndpoints("TestAdapter", + endpts); + Ice.Object d = new DI(); + adapter.add(d, Ice.Util.stringToIdentity("d")); + d.ice_addFacet(d, "facetABCD"); + d.ice_addFacet(new FI(), "facetEF"); + d.ice_addFacet(new GI(communicator), "facetG"); + + adapter.activate(); + communicator.waitForShutdown(); + + d.ice_removeAllFacets(); // Break cyclic dependencies + 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); + } +} |