01: package demo.outparam;
02:
03: import org.omg.CosNaming.*;
04:
05: public class Server {
06: public static void main(String[] args) {
07: org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null);
08: try {
09: org.omg.PortableServer.POA poa = org.omg.PortableServer.POAHelper
10: .narrow(orb.resolve_initial_references("RootPOA"));
11: poa.the_POAManager().activate();
12: org.omg.PortableServer.Servant servant = new serverImpl();
13: org.omg.CORBA.Object o = poa.servant_to_reference(servant);
14:
15: // register server with naming context
16: NamingContextExt nc = NamingContextExtHelper.narrow(orb
17: .resolve_initial_references("NameService"));
18: NameComponent[] name = new NameComponent[] { new NameComponent(
19: "ParamServer", "service") };
20: nc.rebind(name, o);
21: } catch (Exception e) {
22: e.printStackTrace();
23: }
24: orb.run();
25: }
26: }
|