12.07.2015 Views

VisiBroker Edition

VisiBroker Edition

VisiBroker Edition

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

设 置 收 听 和 调 度 属 性pm.addProperty("vbroker.se.mySe.host", "");pm.addProperty("vbroker.se.mySe.proxyHost", "");pm.addProperty("vbroker.se.mySe.scms", "scmlist");pm.addProperty("vbroker.se.mySe.scm.scmlist.manager.type", "Socket");pm.addProperty("vbroker.se.mySe.scm.scmlist.manager.connectionMax", 100);pm.addProperty("vbroker.se.mySe.scm.scmlist.manager.connectionMaxIdle",300);pm.addProperty("vbroker.se.mySe.scm.scmlist.listener.type", "IIOP");pm.addProperty("vbroker.se.mySe.scm.scmlist.listener.port", 55000);pm.addProperty("vbroker.se.mySe.scm.scmlist.listener.proxyPort", 0);pm.addProperty("vbroker.se.mySe.scm.scmlist.dispatcher.type","ThreadPool");pm.addProperty("vbroker.se.mySe.scm.scmlist.dispatcher.threadMax", 100);pm.addProperty("vbroker.se.mySe.scm.scmlist.dispatcher.threadMin", 5);pm.addProperty("vbroker.se.mySe.scm.scmlist.dispatcher.threadMaxIdle",300);// 取 得 根 POA 的 引 用POA rootPOA =POAHelper.narrow(orb.resolve_initial_references("RootPOA"));// 创 建 我 们 的 服 务 器 引 擎 策 略org.omg.CORBA.Any seAny = orb.create_any();org.omg.CORBA.StringSequenceHelper.insert(seAny, new String[]{"mySe"});org.omg.CORBA.Policy sePolicy =orb.create_policy(com.inprise.vbroker.PortableServerExt.SERVER_ENGINE_POLICY_TYPE.value,seAny);// 为 永 久 POA 创 建 策 略org.omg.CORBA.Policy[] policies = {rootPOA.create_lifespan_policy(LifespanPolicyValue.PERSISTENT),sePolicy};// 用 正 确 的 策 略 创 建 myPOAPOA myPOA = rootPOA.create_POA("bank_se_policy_poa",rootPOA.the_POAManager(),policies );// 创 建 服 务 对 象AccountManagerImpl managerServant = new AccountManagerImpl();// 启 动 服 务 对 象myPOA.activate_object_with_id("BankManager".getBytes(), managerServant);// 取 得 引 用org.omg.CORBA.Object ref = myPOA.servant_to_reference(managerServant);// 现 在 写 出 IORtry {java.io.PrintWriter pw =new java.io.PrintWriter( new java.io.FileWriter("ior.dat") );pw.println(orb.object_to_string(ref));pw.close();} catch ( java.io.IOException e ) {System.out.println("Error writing the IOR to file ior.dat");return;}// 激 活 POA 管 理 器rootPOA.the_POAManager().activate();7-32 <strong>VisiBroker</strong> 开 发 者 指 南

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!