summaryrefslogtreecommitdiff
path: root/java/demo/Ice/minimal/Server.java
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-09-13 02:25:11 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-09-13 02:25:11 +0000
commit13c1478b4bf220e3c08055f7af39281e2f5d8875 (patch)
tree2d80b77591f870688270b6637678eddb3e1c6196 /java/demo/Ice/minimal/Server.java
parentupdates. (diff)
downloadice-13c1478b4bf220e3c08055f7af39281e2f5d8875.tar.bz2
ice-13c1478b4bf220e3c08055f7af39281e2f5d8875.tar.xz
ice-13c1478b4bf220e3c08055f7af39281e2f5d8875.zip
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=335
Diffstat (limited to 'java/demo/Ice/minimal/Server.java')
-rwxr-xr-xjava/demo/Ice/minimal/Server.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/java/demo/Ice/minimal/Server.java b/java/demo/Ice/minimal/Server.java
new file mode 100755
index 00000000000..ce13d72873d
--- /dev/null
+++ b/java/demo/Ice/minimal/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.
+//
+// **********************************************************************
+
+import Demo.*;
+
+public class Server
+{
+ public static int
+ run(String[] args, Ice.Communicator communicator)
+ {
+ Ice.ObjectAdapter adapter = communicator.createObjectAdapter("Hello");
+ adapter.add(new HelloI(), Ice.Util.stringToIdentity("hello"));
+ adapter.activate();
+ communicator.waitForShutdown();
+ return 0;
+ }
+
+ public static void
+ main(String[] args)
+ {
+ int status = 0;
+ Ice.Communicator communicator = null;
+
+ try
+ {
+ Ice.Properties properties = Ice.Util.createProperties();
+ properties.load("config");
+ communicator = Ice.Util.initializeWithProperties(args, properties);
+ 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);
+ }
+}