01: package demo.benchmark;
02:
03: import org.omg.CosNaming.*;
04:
05: public class OctetServer {
06: public static void main(String[] args) {
07:
08: try {
09: org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null);
10: org.omg.PortableServer.POA poa = org.omg.PortableServer.POAHelper
11: .narrow(orb.resolve_initial_references("RootPOA"));
12:
13: poa.the_POAManager().activate();
14:
15: org.omg.CORBA.Object o = poa
16: .servant_to_reference(new octetBenchImpl());
17:
18: NamingContextExt nc = NamingContextExtHelper.narrow(orb
19: .resolve_initial_references("NameService"));
20: nc.bind(nc.to_name("octet_benchmark"), o);
21:
22: orb.run();
23: } catch (Exception e) {
24: e.printStackTrace();
25: }
26: }
27: }
|