⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 helloclient.java

📁 java 结合corba 实现事件推送
💻 JAVA
字号:
import HelloApp.*;import org.omg.CosNaming.*;import org.omg.CosNaming.NamingContextPackage.*;import org.omg.CORBA.*;public class HelloClient{  public static void main(String args[]){      try{      // create and initialize the ORB      ORB orb = ORB.init(args, null);      // get the root naming context      org.omg.CORBA.Object objRef = 	  orb.resolve_initial_references("NameService");	        // Use NamingContextExt instead of NamingContext. This is       // part of the Interoperable naming Service.        NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);       // resolve the Object Reference in Naming      String name = "Hello";      Hello helloImpl = HelloHelper.narrow(ncRef.resolve_str(name));      System.out.println("Obtained a handle on server object: " + helloImpl);      System.out.println(helloImpl.sayHello());      helloImpl.shutdown();      }          catch (Exception e) {      System.out.println("ERROR : " + e) ;      e.printStackTrace(System.out);    }  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -