Package org.rzo.yajsw.srvmgr.client

Examples of org.rzo.yajsw.srvmgr.client.Host


        int port = Integer.parseInt(x[1]);
        String name = InetAddress.getByName(x[0]).getHostName();
        synchronized(hostsList)
        {
          System.out.println("new host "+name+":"+port);
          Host newHost = new Host(name, port);
          Host oldHost = hostsList.get(newHost.getName());
          if (oldHost != null)
          {
            newHost.setIncluded(oldHost.isIncluded());
          }
        hostsList.put(newHost.getName(), newHost);

          saveData();
        }
View Full Code Here


  protected static void doNewHost(String host, int port)
  {
    synchronized(hostsList)
    {
      Host newHost = new Host(host, port);
      Host oldHost = hostsList.get(newHost.getName());
      if (oldHost != null)
      {
        newHost.setIncluded(oldHost.isIncluded());
      }
      newHost.setState("CONNECTED");
      hostsList.put(newHost.getName(), newHost);

    saveData();
View Full Code Here

      return;
    ObjectInputStream in = new ObjectInputStream(new FileInputStream(f));
    Map data = (Map) in.readObject();
    for (Iterator it = ((Collection)data.get("hosts")).iterator(); it.hasNext(); )
    {
      Host host = (Host) it.next();
      hostsList.put(host.getName(), host);
    }
    for (Iterator it = ((Collection)data.get("hidden")).iterator(); it.hasNext(); )
      hiddenList.add((String)it.next());
    configurations = (Set<String>) data.get("configurations");
    in.close();
View Full Code Here

            {
              synchronized(proxies)
              {
            proxies.put(host.getName(), proxy);
              }
            Host newHost = new Host(host.getName(), host.getPort());
            newHost.setIncluded(true);
            newHost.setState("CONNECTED");
            hostsList.remove(host.getName());
            hostsList.put(newHost.getName(), newHost);
            //if (host.isIncluded())
            // TODO  servicesList.addService(host.getName(), proxy);
            }
            else
              future.getChannel().close();
          }
        }
        catch (Exception e)
        {
          System.out.println("error accessing "+host.getName());
          e.printStackTrace();
         
          connected = false;
          if (future != null)
            future.getChannel().close();
        }
       
      }
       
      if (!connected)
      {
        synchronized(proxies)
        {
        disconnect(host, proxies.remove(host.getName()));
        }
        changed = true;
      }
      else if (proxy == null && !"DISCONNECTED".equals(host.getState()))
      {
        Host newHost = new Host(host.getName(), host.getPort());
        newHost.setIncluded(host.isIncluded());
        newHost.setState("DISCONNECTED");
        hostsList.put(newHost.getName(), newHost);
      }
    }
    }
  }
View Full Code Here

TOP

Related Classes of org.rzo.yajsw.srvmgr.client.Host

Copyright © 2018 www.massapicom. 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.