public Remote lookup(String paramString) throws NotBoundException { if (paramString.equals(this.name)) return this.object; throw new NotBoundException("Not bound: \"" + paramString + "\" (only " + "bound name is \"" + this.name + "\")"); }
public Remote lookup(String paramString) throws NotBoundException { if (paramString.equals(this.name)) return this.object; throw new NotBoundException("Not bound: \"" + paramString + "\" (only " + "bound name is \"" + this.name + "\")"); }
/** * Returns the single object if the specified name matches the single * name, otherwise throws NotBoundException. */ @Override public Remote lookup(String name) throws NotBoundException { if (name.equals(NAME)) { readLock.lock(); try { return systemStub; } finally { readLock.unlock(); } } throw new NotBoundException(name); }
/** * Unbinds the named object. Removes the terminal atomic name in * <code>name</code> from the target context--that named by all but the * terminal atomic part of <code>name</code>. * @param name the name to unbind; may not be empty * @throws RemoteException if a naming exception is encountered * @throws NotBoundException if object was not bound * @throws AccessException if unbind is not authorized */ @Override public void unbind(String name) throws RemoteException, NotBoundException, AccessException { if (verbose) { try { System.out.println("ManageableRegistry.unbind(" + name + ")" + " from client: " + getClientHost()); } catch (ServerNotActiveException e) { e.printStackTrace(); } } synchronized (registryObjects) { Remote obj = registryObjects.get(name); if (obj == null) { throw new NotBoundException(name); } registryObjects.remove(name); } }
/** * Retrieves the named object. * @param name the name of the object to look up * @return the object bound to <tt>name</tt> * @throws RemoteException if a naming exception is encountered * @throws NotBoundException if object is not bound */ @Override public Remote lookup(String name) throws RemoteException, NotBoundException { if (verbose) { try { System.out.println("ManageableRegistry.lookup(" + name + ") from client: " + getClientHost()); } catch (ServerNotActiveException e) { e.printStackTrace(); } } synchronized (registryObjects) { Remote obj = registryObjects.get(name); if (obj == null) { throw new NotBoundException(name); } return obj; } }
public void unbind(String n) throws NotBoundException, RemoteException { Object obj; synchronized (lreg) { obj = lreg.remove(n); if (obj != null) { if (TraceCarol.isDebugCmiRegistry()) { TraceCarol.debugCmiRegistry("Local unbind of " + n); } return; } if (TraceCarol.isDebugCmiRegistry()) TraceCarol.debugCmiRegistry("Global unbind of " + n); try { if (!DistributedEquiv.unexportObject(REG_PREFIX + n)) { throw new NotBoundException(n); } } catch (ConfigException e) { throw new RemoteException(e.toString()); } } }
public Remote lookup(String n) throws NotBoundException, RemoteException { Object obj; synchronized (lreg) { obj = lreg.get(n); } if (obj != null) { if (TraceCarol.isDebugCmiRegistry()) TraceCarol.debugCmiRegistry("local lookup of " + n); return (Remote) obj; } try { if (TraceCarol.isDebugCmiRegistry()) TraceCarol.debugCmiRegistry("global lookup of " + n); Remote cs = (Remote) DistributedEquiv.getGlobal(REG_PREFIX + n); if (cs != null) { if (TraceCarol.isDebugCmiRegistry()) TraceCarol.debugCmiRegistry("returned a cluster stub"); return cs; } } catch (ConfigException e) { throw new RemoteException(e.toString()); } throw new NotBoundException(n); }