?? server.java
字號:
import ServerImpl.ServerConfigure;
import ServerImpl.*;
import org.omg.CORBA.ORB;
import org.omg.CORBA.Policy;
import org.omg.PortableServer.*;
public class Server {
public static void main(String[] args) {
// java Server RoundRobin 1000
if(args.length!=0){
if(args.length==2)
{
ServerConfigure.pooling=true;
ServerConfigure.SetPooling(args[0],Integer.parseInt(args[1]));
System.out.println(ServerConfigure.GetStrategyType()+" "+ServerConfigure.GetPoolSize());
}
else{
System.out.println("args error\n");
}
}
try{
ORB orb=ORB.init(args,null) ;
POA rootPOA=POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
Policy[] policies={
rootPOA.create_lifespan_policy(LifespanPolicyValue.PERSISTENT)
};
POA myPOA=rootPOA.create_POA("BankPOA",rootPOA.the_POAManager(),policies);
AccountManagerImpl servant =new AccountManagerImpl();
myPOA.activate_object_with_id("BankManager".getBytes(),servant);
rootPOA.the_POAManager().activate();
System.out.println("Server launch\n");
orb.run();
}catch(Exception e){
e.printStackTrace();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -