Basic HTML version of Foils prepared May 19 1999

Foil 91 Example 2: Server-side Java Code II

From CORBA Common Object Request Broker Architecture Basic Information Track Computational Science Course CPS616 -- Spring Semester 1999. by Geoffrey Fox, Wojtek Furmanski, Nancy McCracken, Chao-Wei Ou, Shrideep Pallickara


1 public class CounterServer {
2 public static org.omg.CORBA.ORB theORB;
3 static public void main(String[] args) {
4 try {
5 theORB = org.omg.CORBA.ORB.init(args, null);
6 CountServantImpl servant = new CountServantImpl();
7 theORB.connect(servant);
8 org.omg.CORBA.Object objRef =
9 theORB.resolve_initial_references("NameService");
10 NamingContext ncRef = NamingContextHelper.narrow(objRef);
11 NameComponent nc = new NameComponent("Counter", "");
12 NameComponent path[] = {nc};
13 ncRef.rebind(path, servant);
14 java.lang.Object sync = new java.lang.Object();
15 synchronized (sync) {
16 sync.wait();
17 }
18 } . . . //catch exceptions
19 }

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Mon Jul 5 1999