當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。