throw new ServerNotActiveException("not in remote call");
/** * ReBinds a name to an object, overwriting any existing binding. All * intermediate contexts and the target context (that named by all but * terminal atomic component of the name) must already exist. * @param name the name to bind; may not be empty * @param obj the object to bind; possibly null * @throws RemoteException if a bind cannot be done exception is encountered * @throws AccessException if cannot bind */ @Override public void rebind(String name, Remote obj) throws RemoteException, AccessException { if (verbose) { try { System.out.println("ManageableRegistry.rebind(" + name + ", obj)" + " from client: " + getClientHost()); } catch (ServerNotActiveException e) { e.printStackTrace(); } } registryObjects.put(name, obj); }
log.warn("Can not get client host for connection id. " + e.getMessage());
try { clientHost = RemoteServer.getClientHost(); } catch(ServerNotActiveException x) { StackTraceElement stes[] = x.getStackTrace(); StringBuffer sb = new StringBuffer("localhost <trace>"); for (int i = 4; i < stes.length; i++) {
throw new RemoteException(e.getMessage());
throw new ServerNotActiveException("not in remote call");
/** * Enumerates the names bound in the named context, along with the class * names of objects bound to them. The contents of any subcontexts are not * included. * @return the names in this context. * @throws RemoteException if a naming exception is encountered */ @Override public String[] list() throws RemoteException { if (verbose) { try { System.out.println("ManageableRegistry.list()" + " from client: " + getClientHost()); } catch (ServerNotActiveException e) { // TODO Auto-generated catch block e.printStackTrace(); } } String[] names; synchronized (registryObjects) { int i = registryObjects.size(); names = new String[i]; Enumeration<String> e = registryObjects.keys(); while ((--i) >= 0) { names[i] = e.nextElement(); } } return names; }
/** * 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; } }
/** * Binds a name to an object, overwriting any existing binding. All * intermediate contexts and the target context (that named by all but * terminal atomic component of the name) must already exist. * @param name the name to bind; may not be empty * @param obj the object to bind; possibly null * @throws RemoteException if a bind cannot be done exception is encountered * @throws AlreadyBoundException if object is already bound * @throws AccessException if cannot bind */ @Override public void bind(String name, Remote obj) throws RemoteException, AlreadyBoundException, AccessException { if (verbose) { try { System.out.println("ManageableRegistry.bind(" + name + ", obj)" + " from client: " + getClientHost()); } catch (ServerNotActiveException e) { e.printStackTrace(); } } synchronized (registryObjects) { Remote curr = registryObjects.get(name); if (curr != null) { throw new AlreadyBoundException(name); } registryObjects.put(name, obj); } }