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

📄 stockserver.java

📁 关系型数据库 Postgresql 6.5.2
💻 JAVA
字号:
package example.corba;import org.omg.CosNaming.*;/** * This class implements the server side of the example. * * $Id: StockServer.java,v 1.1 1999/01/25 21:22:04 scrappy Exp $ */public class StockServer{    public static void main(String[] args)    {	int numInstances = 3;		try {	    // Initialise the ORB	    org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,null);	    	    // Create the StockDispenser object	    StockDispenserImpl dispenser = new StockDispenserImpl(args,"Stock Dispenser",numInstances);	    	    // Export the new object	    orb.connect(dispenser);	    	    // Get the naming service	    org.omg.CORBA.Object nameServiceObj = orb.resolve_initial_references("NameService");	    if(nameServiceObj == null) {		System.err.println("nameServiceObj = null");		return;	    }	    	    org.omg.CosNaming.NamingContext nameService = org.omg.CosNaming.NamingContextHelper.narrow(nameServiceObj);	    if(nameService == null) {		System.err.println("nameService = null");		return;	    }	    	    // bind the dispenser into the naming service	    NameComponent[] dispenserName = {		new NameComponent("StockDispenser","Stock")	    };	    nameService.rebind(dispenserName,dispenser);	    	    // Now wait forever for the current thread to die	    Thread.currentThread().join();	} catch(Exception e) {	    e.printStackTrace();	}    }}	    

⌨️ 快捷键说明

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