this.registry.rebind(this.serviceName, this.exportedObject);
this.registry.rebind(this.serviceName, this.exportedObject);
registry.rebind(bindName, exportable);
registry.rebind(bindName, exportable);
Controle obj = new Controle(4); Controle stub = (Controle) UnicastRemoteObject.exportObject(obj, 0); Registry reg = LocateRegistry.createRegistry(1099); System.out.println("Server is ready"); reg.rebind("CtrlServ", stub);
Controle obj = new Controle(4); Registry reg = LocateRegistry.createRegistry(1099); System.out.println("Server is ready"); reg.rebind("CtrlServ", obj);
public static void rebind(String name, Remote obj) throws RemoteException, java.net.MalformedURLException { ParsedNamingURL parsed = parseURL(name); Registry registry = getRegistry(parsed); if (obj == null) throw new NullPointerException("cannot bind to null"); registry.rebind(parsed.name, obj); }
public static void rebind(String name, Remote obj) throws RemoteException, MalformedURLException ParsedNamingURL parsed = parseURL(name); Registry registry = getRegistry(parsed); if (obj == null) throw new NullPointerException("cannot bind to null"); registry.rebind(parsed.name, obj); } ... private static Registry getRegistry(ParsedNamingURL parsed) throws RemoteException { return LocateRegistry.getRegistry(parsed.host, parsed.port); }
private void startServer() { try { // create on port 1298 registry = LocateRegistry.createRegistry(port); // create a new service named hostsService registry.rebind(SERVICE_NAME, new MessageImpl()); } catch (Exception e) { e.printStackTrace(); } System.out.println("system is ready on port " + port); }
System.getProperties().put("java.rmi.server.hostname", IP 80.80.80.10); MyService rmiserver = new MyService(); MyService stub = (MyService) UnicastRemoteObject.exportObject(rmiserver, 6620); LocateRegistry.createRegistry(1099); Registry registry = LocateRegistry.getRegistry(); registry.rebind("FAManagerService", stub);
class Service extends UnicastRemoteObject implements MyInterface { public Service() { } public MyClass f(MyClass v) throws RemoteException { return new MyClass(v.getValue() + 1) } public static void main(Strint arg[]) { Registry r = LocateRegistry.createRegistry(1099); r.rebind("service", new Service()); } }
import java.rmi.*; import java.rmi.registry.*; import java.io.*; public class RMIServer{ public static void main(String[] argv) throws Exception{ StackImp s = new StackImp(10); Registry reg = LocateRegistry.createRegistry(2000); reg.rebind("xyz", s); System.out.println("RMI Server ready...."); System.out.println("Waiting for Request..."); } }
public static void registry() { Registry registry = null; try { // 指定服务端口 registry = LocateRegistry.createRegistry(8687); RMIServiceImp server = new RMIServiceImp(); // 绑定服务 registry.rebind("test", server); } catch (RemoteException e) { e.printStackTrace(); } }
public boolean addToRegistry(T object, String key) { try { Registry reg = getAndCreateRegistry(); removeExisting(reg, key); reg.rebind(key, object); return true; } catch (RemoteException e) { // includes AccessException // LOGGER .error("got exception at startup: could not add object to registry. aborting.", e); } return false; }
public void registerServices() throws RemoteException{ masterNode = new MasterNodeImpl(registry); MasterNodeRemote stub = (MasterNodeRemote) UtilsRMI.exportObject(masterNode); registry.rebind(MasterNodeRemote.RMI_SERVICE_NAME, stub); }
... private static ServiceImpl serviceImpl = null; public static void register (int port) { serviceImpl = new ServiceImpl(); Registry registry = LocateRegistry.createRegistry(port); registry.rebind ("serviceImpl", serviceImpl); } public static void main(String[] args) throws RemoteException, NotBoundException { register(1099); ...the rest of your code... }
public ConnectionSet() { try { LocateRegistry.createRegistry(Registry.REGISTRY_PORT); RemoteConnectionSet stub = (RemoteConnectionSet) UnicastRemoteObject.exportObject(this, 0); Registry registry = LocateRegistry.getRegistry(); registry.rebind(CometConnectionManager.NAME, stub); } catch (RemoteException e) { e.printStackTrace(); } } }
public void rebind(String name, Object obj) throws NamingException { checkName(name); try { Registry registry = getRegistry(); registry.rebind(toRMIName(name), (Remote) obj); } catch (RemoteException ex) { ex.printStackTrace(); throw new NamingException("Remote exception: " + ex.getMessage()); } }
public void rebind(String name, Object obj) throws NamingException { checkName(name); try { Registry registry = getRegistry(); registry.rebind(toRMIName(name), (Remote) obj); } catch (RemoteException ex) { ex.printStackTrace(); throw new NamingException("Remote exception: " + ex.getMessage()); } }