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


public class CounterServer {
public static org.omg.CORBA.ORB theORB;
static public void main(String[] args) {
try {
theORB = org.omg.CORBA.ORB.init(args, null);
CountServantImpl servant = new CountServantImpl();
theORB.connect(servant);
org.omg.CORBA.Object objRef =
theORB.resolve_initial_references("NameService");
NamingContext ncRef = NamingContextHelper.narrow(objRef);
NameComponent nc = new NameComponent("Counter", "");
NameComponent path[] = {nc};
ncRef.rebind(path, servant);
java.lang.Object sync = new java.lang.Object();
synchronized (sync) {
sync.wait();
}
} . . . //catch exceptions
}



© 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