01: package demo.events;
02:
03: /**
04: *
05: * This drives the event channel object.
06: *
07: */
08:
09: import org.jacorb.events.*;
10: import org.omg.CosEventChannelAdmin.*;
11: import org.omg.CosNaming.*;
12:
13: public class ChannelServer {
14: static public void main(String[] argv) {
15: org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(argv, null);
16: try {
17: org.omg.PortableServer.POA poa = org.omg.PortableServer.POAHelper
18: .narrow(orb.resolve_initial_references("RootPOA"));
19:
20: NamingContextExt nc = NamingContextExtHelper.narrow(orb
21: .resolve_initial_references("NameService"));
22:
23: EventChannelImpl channel = new EventChannelImpl(orb, poa);
24:
25: poa.the_POAManager().activate();
26:
27: org.omg.CORBA.Object o = poa.servant_to_reference(channel);
28:
29: nc.bind(nc.to_name("eventchannel.example"), o);
30:
31: orb.run();
32: } catch (Exception e) {
33: e.printStackTrace();
34: }
35: }
36: }
|