Example 2: Server-side Java Code II
public class CounterServer {
public static org.omg.CORBA.ORB theORB;
static public void main(String[] args) {
theORB = org.omg.CORBA.ORB.init(args, null);
CountServantImpl servant = new CountServantImpl();
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();
} . . . //catch exceptions