/**
  * Gets all the windows which are open in the desktop
  *
  * @return list of windows if available, null otherwise
  * @throws Exception
  */
 public Windows getAllWindows() throws Exception {
   try {
     int id = RemoteServer.instance().executeAndGetId("getwindows", getRefId());
     return new Windows(id);
   } catch (RefIdNotAvailableException e) {
     return null;
   }
 }
 /**
  * Gets all the icons which are available in the desktop
  *
  * @return list of icons if available, null otherwise
  * @throws Exception
  * @see ListItems
  */
 public ListItems getIcons() throws Exception {
   try {
     int id = RemoteServer.instance().executeAndGetId("geticons", getRefId());
     return new ListItems(id);
   } catch (RefIdNotAvailableException e) {
     return null;
   }
 }
  /**
   * Gets the current desktop.
   *
   * @return current desktop
   * @throws Exception
   */
  public static Desktop getCurrent() throws Exception {

    try {
      int id = RemoteServer.instance().executeAndGetId("getdesktop", 0);
      return new Desktop(id);
    } catch (RefIdNotAvailableException e) {
      return null;
    }
  }
    @Override
    public void messageReceived(byte[] message) {
      // TOOO: this could have a leading field that identified which
      // class of message (server, client, etc.) this is, but for now
      // we'll just assume that all messages are RAFT-core

      RemoteServer.register(message, endpoint, membershipHandle);
      endpoint.removeListener(this);
    }
 static {
   RemoteServer.setupRMI();
 }
 public void heartBeet(String name, String ip, String port) {
   RemoteServer server = servers.get(name);
   if (server == null) createServer(name, ip, port);
   else server.heartBeet();
 }