ICE 3.4.2
[php5-ice-freebsdport.git] / java / test / Glacier2 / router / Server.java
blob7ce80568a990366bfeab9ee47ccb3e66640dec96
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 package test.Glacier2.router;
12 public class Server extends test.Util.Application
14 public int
15 run(String[] args)
17 communicator().getProperties().setProperty("CallbackAdapter.Endpoints", "tcp -p 12010");
18 Ice.ObjectAdapter adapter = communicator().createObjectAdapter("CallbackAdapter");
19 adapter.add(new CallbackI(),
20 communicator().stringToIdentity("c1/callback")); // The test allows "c1" as category.
21 adapter.add(new CallbackI(),
22 communicator().stringToIdentity("c2/callback")); // The test allows "c2" as category.
23 adapter.add(new CallbackI(),
24 communicator().stringToIdentity("c3/callback")); // The test rejects "c3" as category.
25 adapter.add(new CallbackI(),
26 communicator().stringToIdentity("_userid/callback")); // The test allows the prefixed userid.
27 adapter.activate();
28 communicator().waitForShutdown();
29 return 0;
33 protected Ice.InitializationData getInitData(Ice.StringSeqHolder argsH)
35 Ice.InitializationData initData = new Ice.InitializationData();
36 initData.properties = Ice.Util.createProperties(argsH);
37 initData.properties.setProperty("Ice.Package.Test", "test.Glacier2.router");
39 return initData;
42 public static void
43 main(String[] args)
45 Server c = new Server();
46 int status = c.main("Server", args);
48 System.gc();
49 System.exit(status);