public GridServiceDescriptionClient(
     GridServiceDescription gsd,
     GridServiceDescription whitePagesGsd,
     ConversationManager conversationManager) {
   this.id = gsd.getId();
   this.serviceInterface = gsd.getServiceInterface();
   this.addresses = new HashMap(gsd.getAddresses());
   this.data = gsd.getData();
   this.whitePagesGsd = whitePagesGsd;
   this.conversationManager = conversationManager;
 }
  public static synchronized GridNode getGridNode(String name, Grid grid, boolean forceRemote) {

    if (logger.isDebugEnabled()) {
      logger.debug(" ### Grid Helper trying to locate GridNode: " + name);
    }

    if (nodeCache.containsKey(name)) {
      logger.debug(" ### Grid Helper found node " + name + " in cache");
      return nodeCache.get(name);
    }

    GridServiceDescription<GridNode> nGsd = grid.get(WhitePages.class).lookup(name);

    if (nGsd == null) {
      if (logger.isDebugEnabled()) {
        logger.error(
            "("
                + Thread.currentThread().getId()
                + ")"
                + Thread.currentThread().getName()
                + " ### Grid Helper DOES NOT Found a Node Descriptor for: "
                + name);
      }
      return null;
    }
    if (logger.isDebugEnabled()) {

      logger.debug(
          "("
              + Thread.currentThread().getId()
              + ")"
              + Thread.currentThread().getName()
              + " ### Grid Helper Found Node Descriptor: "
              + nGsd);
      logger.debug(
          "("
              + Thread.currentThread().getId()
              + ")"
              + Thread.currentThread().getName()
              + " ### \t id: "
              + nGsd.getId());
      logger.debug(
          "("
              + Thread.currentThread().getId()
              + ")"
              + Thread.currentThread().getName()
              + " ### \t Address size: "
              + nGsd.getAddresses().size());
      logger.debug(
          "("
              + Thread.currentThread().getId()
              + ")"
              + Thread.currentThread().getName()
              + " ### \t Addresses: "
              + nGsd.getAddresses());
      for (String key : nGsd.getAddresses().keySet()) {
        logger.debug(
            "("
                + Thread.currentThread().getId()
                + ")"
                + Thread.currentThread().getName()
                + " \t ### Address: "
                + nGsd.getAddresses().get(key));
      }

      logger.debug(
          "("
              + Thread.currentThread().getId()
              + ")"
              + Thread.currentThread().getName()
              + " ### \t Interface: "
              + nGsd.getServiceInterface());
      logger.debug(
          "("
              + Thread.currentThread().getId()
              + ")"
              + Thread.currentThread().getName()
              + " ### \t DATA: "
              + nGsd.getData());
    }

    ConnectionFactoryService csf = grid.get(ConnectionFactoryService.class);
    boolean allowsLocal = csf.isLocalAllowed();
    csf.setLocalAllowed(!forceRemote);
    GridConnection<GridNode> conn = csf.createConnection(nGsd);
    csf.setLocalAllowed(allowsLocal);

    if (logger.isDebugEnabled()) {
      logger.debug(
          "("
              + Thread.currentThread().getId()
              + ")"
              + Thread.currentThread().getName()
              + " ### Grid Helper Create a Conection: "
              + name);
    }
    GridNode node = conn.connect();

    if (logger.isDebugEnabled()) {
      logger.debug(
          "("
              + Thread.currentThread().getId()
              + ")"
              + Thread.currentThread().getName()
              + " ### Grid Helper found GridNode: ("
              + name
              + ") -> "
              + node);
    }

    nodeCache.put(name, node);

    return node;
  }