本文整理汇总了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);
}