Package org.apache.vinci.transport

Examples of org.apache.vinci.transport.VinciFrame.fadd()


    String realhost = in.fgetString("IP");
    try {
      if (realhost == null)
        realhost = InetAddress.getByName(host).getHostAddress();
    } catch (Exception e) {
      out.fadd("vinci:ERROR", "Could not resolve IP due to Exception " + e);
      return out;
    }

    Debug.p("search: realhost = " + realhost + " - instance = " + instance);
View Full Code Here


        Debug.p("Adding service : " + H.get("NAME") + ", lvl=" + H.get("LEVEL") + ",instance="
                + H.get("INSTANCE") + ",ip=" + H.get("IP"));
        ok = SR.addService(srv);
      }
      if (!ok) {
        out.fadd("vinci:ERROR", "COuld not find or add service " + name);
        return out;
      }
    } else {
      if (srv.minport != srv.maxport) { // if it isn't running on a fixed port
        final String s_host = srv.host;
View Full Code Here

        final int s_port = srv.port;
        new Thread(new Runnable() {
          public void run() {
            Debug.p("Trying to shutdown old service ...");
            VinciFrame shutdown = new VinciFrame();
            shutdown
                    .fadd(
                            "vinci:SHUTDOWN",
                            "Identical service started on this host. Use the INSTANCE tag to run multiple instances of the same service on a single host.");
            try {
              VinciFrame f = BaseClient.rpc(shutdown, s_host, s_port, 10000);
View Full Code Here

    }

    VinciFrame F = new VinciFrame();
    for (int i = 0; i < servicelist.length; i++) {
      if (ServiceAlias.isAlias(servicelist))
        F.fadd("SERVICE", ((ServiceAlias) servicelist[i]).toFrame());
      else
        F.fadd("SERVICE", ((Service) servicelist[i]).toFrame());
    }

    return F;
View Full Code Here

    VinciFrame F = new VinciFrame();
    for (int i = 0; i < servicelist.length; i++) {
      if (ServiceAlias.isAlias(servicelist))
        F.fadd("SERVICE", ((ServiceAlias) servicelist[i]).toFrame());
      else
        F.fadd("SERVICE", ((Service) servicelist[i]).toFrame());
    }

    return F;
  }
View Full Code Here

      Debug.p("Matches for getNames : " + servicelist.length);
    }

    VinciFrame F = new VinciFrame();
    for (int i = 0; i < servicelist.length; i++) {
      F.fadd("SERVICE", servicelist[i]);
    }

    return F;
  }
View Full Code Here

      if (type.equals("all")) {
        Enumeration keys = hits.keys();
        while (keys.hasMoreElements()) {
          key = (String) keys.nextElement();
          temp = new VinciFrame();
          temp.fadd("TYPE", key);
          temp.fadd("COUNT", hits.get(key).toString());
          F.fadd("HITS", temp);
        }
        F.fadd("TOTAL", "" + totalhits);
      } else {
View Full Code Here

        Enumeration keys = hits.keys();
        while (keys.hasMoreElements()) {
          key = (String) keys.nextElement();
          temp = new VinciFrame();
          temp.fadd("TYPE", key);
          temp.fadd("COUNT", hits.get(key).toString());
          F.fadd("HITS", temp);
        }
        F.fadd("TOTAL", "" + totalhits);
      } else {
        if (hits.get(type) != null)
View Full Code Here

  /* Helper method to return the correct VinciFrame */
  VinciFrame getFrame(boolean ok, String err) {
    VinciFrame F = null;
    if (ok) {
      F = new VinciFrame();
      F.fadd("STATUS", "OK");
    } else
      return new ErrorFrame(err);

    return F;
  }
View Full Code Here

  }

  public Frame toFrame() {
    Frame F = new VinciFrame(); // hack around the fact that Frame is an abstract class

    F.fadd("NAME", name);
    F.fadd("TARGET", target);

    return F;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.