java.rmi.Naming.bind()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(158)

本文整理了Java中java.rmi.Naming.bind()方法的一些代码示例,展示了Naming.bind()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Naming.bind()方法的具体详情如下:
包路径:java.rmi.Naming
类名称:Naming
方法名:bind

Naming.bind介绍

暂无

代码示例

代码示例来源:origin: apache/geode

private static synchronized void initialize() throws Exception {
 if (blackboard == null) {
  System.out.println(
    DUnitLauncher.RMI_PORT_PARAM + "=" + System.getProperty(DUnitLauncher.RMI_PORT_PARAM));
  int namingPort = Integer.getInteger(DUnitLauncher.RMI_PORT_PARAM).intValue();
  String name = "//localhost:" + namingPort + "/" + "InternalBlackboard";
  try {
   blackboard = (InternalBlackboard) Naming.lookup(name);
  } catch (NotBoundException e) {
   // create the master blackboard in this VM
   blackboard = new InternalBlackboardImpl();
   Naming.bind(name, blackboard);
  }
 }
}

代码示例来源:origin: stackoverflow.com

Naming.bind(bindLocation, Hello);
  System.out.println("Addition Server is ready at:" + bindLocation);
} catch (RemoteException e) {

代码示例来源:origin: Waikato/weka-trunk

+ "...");
java.rmi.registry.LocateRegistry.createRegistry(port);
Naming.bind(name, engine);
System.out.println("RemoteEngine bound in RMI registry");

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

+ "...");
java.rmi.registry.LocateRegistry.createRegistry(port);
Naming.bind(name, engine);
System.out.println("RemoteEngine bound in RMI registry");

代码示例来源:origin: io.snappydata/gemfire-hydra-tests

public static void main(String[] args) throws Throwable {
 try {
  int namingPort = Integer.getInteger(DUnitLauncher.RMI_PORT_PARAM).intValue();
  int vmNum = Integer.getInteger(DUnitLauncher.VM_NUM_PARAM).intValue();
  LogWriter log = Log.createLogWriter("dunit-vm-" + vmNum, DUnitLauncher.LOG_LEVEL);
  System.out.println("VM" + vmNum + " is launching");
  DUnitLauncher.initSystemProperties(log);
  MasterRemote holder = (MasterRemote) Naming.lookup("//localhost:" + namingPort + "/" + DUnitLauncher.MASTER_PARAM);
  RemoteTestModule.Master = new FakeMaster();
  DUnitLauncher.locatorPort = holder.getLocatorPort();
  Naming.bind("//localhost:" + namingPort + "/vm" + vmNum, new FakeRemoteTestModule(log));
  holder.signalVMReady();
  //This loop is here so this VM will die even if the master is mean killed.
  while(true) {
   holder.ping();
   Thread.sleep(1000);
  }
 } catch (Throwable t) {
  t.printStackTrace();
  System.exit(1);
 }
}

代码示例来源:origin: io.snappydata/gemfire-hydra-tests

/**
 * Initializes this test by binding an instance of
 * <code>RemoteBlockingQueueImpl</code> into the RMI registry hosted
 * in Hydra's master controller VM.
 */
public void setUp() throws Exception {
 String queueName = this.getUniqueName();
 Host host = Host.getHost(0);
 this.queueURL = RmiRegistryHelper.getMasterRegistryURL() + queueName;
 RemoteBlockingQueue queue =
  new RemoteBlockingQueueImpl(QUEUE_CAPACITY);
 DistributedTestCase.getLogWriter().info("Binding queue named \"" + this.queueURL
              + "\"");
 Naming.bind(this.queueURL, queue);
}

相关文章