?? showserver.java
字號:
package org;
import java.util.Properties;
import org.omg.CORBA.ORB;
import org.omg.CosNaming.NameComponent;
import org.omg.CosNaming.NamingContextExt;
import org.omg.CosNaming.NamingContextExtHelper;
import org.omg.PortableServer.POA;
import org.omg.PortableServer.POAHelper;
import calculator.Show;
import calculator.ShowImpl;
import calculator.ShowPOATie;
public class ShowServer {
public static void main(String args[]) {
try {
Properties props = new Properties();
props.put("org.omg.CORBA.ORBInitialPort", "8080");
props.put("org.omg.CORBA.ORBInitialHost", "localhost");
ORB orb = ORB.init(args, props);
POA rootpoa = POAHelper.narrow(orb
.resolve_initial_references("RootPOA"));
rootpoa.the_POAManager().activate();
ShowImpl showImpl = new ShowImpl();
ShowPOATie tie = new ShowPOATie(showImpl, rootpoa);
Show href = tie._this(orb);
org.omg.CORBA.Object objRef = orb
.resolve_initial_references("NameService");
NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
String name = "Show";
NameComponent path[] = ncRef.to_name(name);
ncRef.rebind(path, href);
System.out.println("HelloServer ready and waiting ...");
orb.run();
}
catch (Exception e) {
System.err.println("ERROR: " + e);
e.printStackTrace(System.out);
}
System.out.println("HelloServer Exiting ...");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -