本文整理匯總了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;
}
示例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();
}
示例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);
}
}
示例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);
}
}
示例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);
}