diff options
Diffstat (limited to 'java/test/Ice/location/Server.java')
-rw-r--r-- | java/test/Ice/location/Server.java | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/java/test/Ice/location/Server.java b/java/test/Ice/location/Server.java index d7ae98ced7b..394d838c9aa 100644 --- a/java/test/Ice/location/Server.java +++ b/java/test/Ice/location/Server.java @@ -12,37 +12,37 @@ public class Server private static int run(String[] args, Ice.Communicator communicator, Ice.InitializationData initData) { - // - // Register the server manager. The server manager creates a new - // 'server' (a server isn't a different process, it's just a new - // communicator and object adapter). - // - Ice.Properties properties = communicator.getProperties(); - properties.setProperty("Ice.ThreadPool.Server.Size", "2"); - properties.setProperty("Ice.OA.ServerManagerAdapter.Endpoints", "default -p 12010 -t 30000:udp"); + // + // Register the server manager. The server manager creates a new + // 'server' (a server isn't a different process, it's just a new + // communicator and object adapter). + // + Ice.Properties properties = communicator.getProperties(); + properties.setProperty("Ice.ThreadPool.Server.Size", "2"); + properties.setProperty("Ice.OA.ServerManagerAdapter.Endpoints", "default -p 12010 -t 30000:udp"); - Ice.ObjectAdapter adapter = communicator.createObjectAdapter("ServerManagerAdapter"); + Ice.ObjectAdapter adapter = communicator.createObjectAdapter("ServerManagerAdapter"); - // - // We also register a sample server locator which implements the - // locator interface, this locator is used by the clients and the - // 'servers' created with the server manager interface. - // - ServerLocatorRegistry registry = new ServerLocatorRegistry(); - registry.addObject(adapter.createProxy(communicator.stringToIdentity("ServerManager"))); - Ice.Object object = new ServerManagerI(adapter, registry, initData); - adapter.add(object, communicator.stringToIdentity("ServerManager")); + // + // We also register a sample server locator which implements the + // locator interface, this locator is used by the clients and the + // 'servers' created with the server manager interface. + // + ServerLocatorRegistry registry = new ServerLocatorRegistry(); + registry.addObject(adapter.createProxy(communicator.stringToIdentity("ServerManager"))); + Ice.Object object = new ServerManagerI(adapter, registry, initData); + adapter.add(object, communicator.stringToIdentity("ServerManager")); - Ice.LocatorRegistryPrx registryPrx = - Ice.LocatorRegistryPrxHelper.uncheckedCast(adapter.add(registry, communicator.stringToIdentity("registry"))); - - ServerLocator locator = new ServerLocator(registry, registryPrx); - adapter.add(locator, communicator.stringToIdentity("locator")); - - adapter.activate(); - communicator.waitForShutdown(); - - return 0; + Ice.LocatorRegistryPrx registryPrx = + Ice.LocatorRegistryPrxHelper.uncheckedCast(adapter.add(registry, communicator.stringToIdentity("registry"))); + + ServerLocator locator = new ServerLocator(registry, registryPrx); + adapter.add(locator, communicator.stringToIdentity("locator")); + + adapter.activate(); + communicator.waitForShutdown(); + + return 0; } public static void @@ -53,9 +53,9 @@ public class Server try { - Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args); - Ice.InitializationData initData = new Ice.InitializationData(); - initData.properties = Ice.Util.createProperties(argsH); + Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args); + Ice.InitializationData initData = new Ice.InitializationData(); + initData.properties = Ice.Util.createProperties(argsH); communicator = Ice.Util.initialize(argsH, initData); status = run(argsH.value, communicator, initData); } |