ICE 3.4.2
[php5-ice-freebsdport.git] / cs / demo / IceGrid / simple / Server.cs
blob4607bdcfe9ffc438ddd056457a20080bfd449277
1 // **********************************************************************
2 //
3 // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
4 //
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
7 //
8 // **********************************************************************
10 using System;
11 using System.Reflection;
13 [assembly: CLSCompliant(true)]
15 [assembly: AssemblyTitle("IceGridSimpleServer")]
16 [assembly: AssemblyDescription("IceGrid simple demo server")]
17 [assembly: AssemblyCompany("ZeroC, Inc.")]
19 public class Server
21 public class App : Ice.Application
23 public override int run(string[] args)
25 if(args.Length > 0)
27 System.Console.Error.WriteLine(appName() + ": too many arguments");
28 return 1;
31 Ice.ObjectAdapter adapter = communicator().createObjectAdapter("Hello");
32 Ice.Properties properties = communicator().getProperties();
33 Ice.Identity id = communicator().stringToIdentity(properties.getProperty("Identity"));
34 adapter.add(new HelloI(properties.getProperty("Ice.ProgramName")), id);
35 adapter.activate();
36 communicator().waitForShutdown();
37 return 0;
41 static public int Main(string[] args)
43 App app = new App();
44 return app.main(args);