当前位置: 首页>>代码示例>>Java>>正文


Java Naming.unbind方法代码示例

本文整理汇总了Java中java.rmi.Naming.unbind方法的典型用法代码示例。如果您正苦于以下问题:Java Naming.unbind方法的具体用法?Java Naming.unbind怎么用?Java Naming.unbind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.rmi.Naming的用法示例。


在下文中一共展示了Naming.unbind方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: close

import java.rmi.Naming; //导入方法依赖的package包/类
public static String close(final Service svc)
throws RemoteException, MalformedURLException {
	final String svcName = svc.getName();
	String svcUri = null;
	try {
		UnicastRemoteObject.unexportObject(svc, true);
	} finally {
		try {
			svcUri = getLocalSvcUri(svcName, svc.getRegistryPort()).toString();
			Naming.unbind(svcUri);
			synchronized(SVC_MAP) {
				if(null == SVC_MAP.remove(svcName + ":" + svc.getRegistryPort())) {
					System.err.println(
						"Failed to remove the service \"" + svcName + "\""
					);
				}
			}
		} catch(final NotBoundException | URISyntaxException e) {
			e.printStackTrace(System.err);
		}
	}
	return svcUri;
}
 
开发者ID:emc-mongoose,项目名称:mongoose-base,代码行数:24,代码来源:ServiceUtil.java

示例2: shutdown

import java.rmi.Naming; //导入方法依赖的package包/类
public synchronized void shutdown() throws RemoteException,
        NotBoundException, MalformedURLException {
    System.out.println("Shuting down...");
    if (a_state == STATE_STARTED) {
        System.out.println("Disconnecting from NodeQueryProcessors...");
        for (int i = 0; i < a_nodes.length; i++) {
            System.out.println("Node " + a_nodes[i].getAddress());
            a_nodes[i] = null;
        }
        a_nodes = null;
    }
    System.out.println("Unbinding...");
    Naming.unbind(a_objectName);
    System.out.println("Exit.");
    a_shutdown_requested = true;
    notifyAll();
}
 
开发者ID:assis,项目名称:ParGRES,代码行数:18,代码来源:CQP_Scheduler_Engine.java

示例3: main

import java.rmi.Naming; //导入方法依赖的package包/类
/**
 * Start the Server and wait for user termination by keyboard.
 * 
 * @param args
 *            This program does not accept command line parameters.
 */
public static void main(String args[]) {

	// Override the default security manager
	System.setSecurityManager(new SecurityManager());
	
	try {
		LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
	} catch (RemoteException remoteException) {
		remoteException.printStackTrace();
	}

	Server server = new Server();

	System.out.println("Server started.");
	System.out.println("Enter <CR> to end.");

	try {
		System.in.read(); // Wait for Enter ...
	} catch (IOException ioException) {
		ioException.printStackTrace();
	}

	try {
		Naming.unbind("//" + server.hostname + "/meganalysis");
	} catch (Exception e) {
		e.printStackTrace();
	} finally {
		System.exit(0);
	}
}
 
开发者ID:amritbhat786,项目名称:DocIT,代码行数:37,代码来源:Server.java

示例4: shutdown

import java.rmi.Naming; //导入方法依赖的package包/类
@Override
public void shutdown() throws RemoteException {
    Xlog.timedOut("shutdown");

    notifyClientsShutdown();

    try {
        Naming.unbind(mRmiNameServer);
        Jota.exit(0);
    } catch (NotBoundException | MalformedURLException ex) {
        Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, ex);
    }
}
 
开发者ID:trixon,项目名称:java-jotasync,代码行数:14,代码来源:Server.java

示例5: tearDown2

import java.rmi.Naming; //导入方法依赖的package包/类
/**
 * Cleans up after this test by unbinding the instance of
 * <code>RemoteBlockingQueue</code> that was initialized in {@link
 * #setUp}.
 */
public void tearDown2() throws Exception {
  Naming.unbind(this.queueURL);
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:9,代码来源:RemoteBlockingQueueTest.java


注:本文中的java.rmi.Naming.unbind方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。