diff options
author | Mark Spruiell <mes@zeroc.com> | 2002-05-02 03:27:07 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2002-05-02 03:27:07 +0000 |
commit | 5f342d668a30647b7d7182b4b296e65f7cfc2b07 (patch) | |
tree | 53f13aa7e79a77da4ca6133cf170812d3995d8b2 /java/src/IceBox/Server.java | |
parent | adding assertions (diff) | |
download | ice-5f342d668a30647b7d7182b4b296e65f7cfc2b07.tar.bz2 ice-5f342d668a30647b7d7182b4b296e65f7cfc2b07.tar.xz ice-5f342d668a30647b7d7182b4b296e65f7cfc2b07.zip |
align with C++ changes for thread pool, properties, plug-ins
Diffstat (limited to 'java/src/IceBox/Server.java')
-rw-r--r-- | java/src/IceBox/Server.java | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/java/src/IceBox/Server.java b/java/src/IceBox/Server.java index 1958efdbf0e..bbe013e9c2e 100644 --- a/java/src/IceBox/Server.java +++ b/java/src/IceBox/Server.java @@ -12,18 +12,45 @@ package IceBox; public final class Server { + private static void + usage() + { + System.err.println("Usage: IceBox.Server [options]\n"); + System.err.println( + "Options:\n" + + "-h, --help Show this message.\n" + ); + } + public static void main(String[] args) { Ice.Communicator communicator = null; int status = 0; - Ice.Util.addArgumentPrefix("IceBox"); - try { Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args); communicator = Ice.Util.initialize(argsH); + + Ice.Properties properties = communicator.getProperties(); + argsH.value = properties.parseCommandLineOptions("IceBox", argsH.value); + + for (int i = 1; i < argsH.value.length; ++i) + { + if (argsH.value[i].equals("-h") || argsH.value[i].equals("--help")) + { + usage(); + System.exit(0); + } + else if (!argsH.value[i].startsWith("--")) + { + System.err.println("Server: unknown option `" + argsH.value[i] + "'"); + usage(); + System.exit(1); + } + } + ServiceManagerI serviceManagerImpl = new ServiceManagerI(communicator, argsH.value); status = serviceManagerImpl.run(); } |