diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-02-14 12:06:57 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-02-14 12:06:57 +0000 |
commit | 770b66fc97582743bf045f709feac5c468c9d06d (patch) | |
tree | de6f5b22ed6c5a22d072337a647c9d3ac626eaa1 /java/test/Ice/binding/Server.java | |
parent | Fixed another race condition in the activator test suite. (diff) | |
download | ice-770b66fc97582743bf045f709feac5c468c9d06d.tar.bz2 ice-770b66fc97582743bf045f709feac5c468c9d06d.tar.xz ice-770b66fc97582743bf045f709feac5c468c9d06d.zip |
- Added ice_cacheConnection, ice_endpointSelection
- Fixed a bug where connection.close(true) would print a connection
warning.
- Fixed a bug where ice_newEndpoints would throw a ClassCastException
- Added test/Ice/binding test suite.
Diffstat (limited to 'java/test/Ice/binding/Server.java')
-rw-r--r-- | java/test/Ice/binding/Server.java | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/java/test/Ice/binding/Server.java b/java/test/Ice/binding/Server.java new file mode 100644 index 00000000000..f7119a97305 --- /dev/null +++ b/java/test/Ice/binding/Server.java @@ -0,0 +1,58 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +public class Server +{ + private static int + run(String[] args, Ice.Communicator communicator) + { + communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12345:udp"); + Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); + Ice.Identity id = Ice.Util.stringToIdentity("communicator"); + adapter.add(new RemoteCommunicatorI(), id); + 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.gc(); + System.exit(status); + } +} |