diff options
author | Matthew Newhook <matthew@zeroc.com> | 2015-03-18 12:58:16 -0230 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2015-03-18 12:58:16 -0230 |
commit | 9b7668c7c92cf9cb311fe444cdddb489cd2a219d (patch) | |
tree | 5016567c58c81f5654e9d01935e199c6bf4761d2 /java/demo/Ice/properties/Server.java | |
parent | VS add-in & build updates: (diff) | |
download | ice-9b7668c7c92cf9cb311fe444cdddb489cd2a219d.tar.bz2 ice-9b7668c7c92cf9cb311fe444cdddb489cd2a219d.tar.xz ice-9b7668c7c92cf9cb311fe444cdddb489cd2a219d.zip |
Removed demos.
Moved demoscript to distribution.
Diffstat (limited to 'java/demo/Ice/properties/Server.java')
-rw-r--r-- | java/demo/Ice/properties/Server.java | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/java/demo/Ice/properties/Server.java b/java/demo/Ice/properties/Server.java deleted file mode 100644 index edc97c01573..00000000000 --- a/java/demo/Ice/properties/Server.java +++ /dev/null @@ -1,98 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2015 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 extends Ice.Application -{ - // - // The servant implements the Slice interface Demo::Props as well as the - // native callback interface Ice.PropertiesAdminUpdateCallback. - // - static class PropsI extends Demo._PropsDisp implements Ice.PropertiesAdminUpdateCallback - { - PropsI() - { - _called = false; - } - - @Override - public synchronized java.util.Map<String, String> getChanges(Ice.Current current) - { - // - // Make sure that we have received the property updates before we - // return the results. - // - while(!_called) - { - try - { - wait(); - } - catch(InterruptedException ex) - { - } - } - - _called = false; - return _changes; - } - - @Override - public void shutdown(Ice.Current current) - { - current.adapter.getCommunicator().shutdown(); - } - - @Override - public synchronized void updated(java.util.Map<String, String> changes) - { - _changes = changes; - _called = true; - notify(); - } - - java.util.Map<String, String> _changes; - private boolean _called; - } - - @Override - public int - run(String[] args) - { - if(args.length > 0) - { - System.err.println(appName() + ": too many arguments"); - return 1; - } - - PropsI props = new PropsI(); - - // - // Retrieve the PropertiesAdmin facet and register the servant as the update callback. - // - Ice.Object obj = communicator().findAdminFacet("Properties"); - Ice.NativePropertiesAdmin admin = (Ice.NativePropertiesAdmin)obj; - admin.addUpdateCallback(props); - - Ice.ObjectAdapter adapter = communicator().createObjectAdapter("Props"); - adapter.add(props, communicator().stringToIdentity("props")); - adapter.activate(); - communicator().waitForShutdown(); - return 0; - } - - public static void - main(String[] args) - { - Server app = new Server(); - int status = app.main("Server", args, "config.server"); - System.exit(status); - } -} |