Package aleph

Examples of aleph.Host


      }
      StringBuffer warning = new StringBuffer();
      boolean ok = true;      // so far so good
      for (Iterator iter = options.liveHosts.iterator();
           iter.hasNext();) { // enumerate live hosts
        Host host = (Host) iter.next();
        if (! host.stop()) {  // did we shut it down?
          warning.append(" "); // if not, whine about it
          warning.append(host.toString());
          ok = false;
        }
      }
      if (!ok)
        JOptionPane.showMessageDialog(null,
View Full Code Here


      default:
        hosts = args;
        count = args.length;
      }
      for (int i = 0; i < count; i++) {
  Host host = new Host(hosts[i]);
  System.out.print("\t");
  System.out.print(host);
  if (host.ping())
    System.out.println(" OK");
  else
    System.out.println(" not responding");
      }
      System.exit(0);
View Full Code Here

      default:
        hosts = args;
        count = args.length;
      }
      for (int i = 0; i < count; i++) {
  Host host = new Host(hosts[i]);
  System.out.print("\t");
  System.out.print(host);
  if (host.stop())
    System.out.println(" shutdown confirmed");
  else
    System.out.println(" not responding");
      }
      System.exit(0);
View Full Code Here

    hostButtons.setBorder(new TitledBorder(BorderFactory.createEtchedBorder(),
                                           "Hosts"));

    // now fill in one button for each known host and select the live ones
    for (Iterator iter = Host.allHosts(); iter.hasNext(); ) {
      Host host = (Host) iter.next();
      HostButton hostButton = new HostButton(host);
      buttonSet.add(hostButton);
      hostButtons.add(hostButton);
      options.hosts.add(host);
      if (hostButton.isEnabled()) {
  options.selectedHosts.add(host);
  options.liveHosts.add(host);
      }
    }
    hostButtons.setToolTipText("Select which hosts you want to use.");
    hostPanel.add(hostButtons, c);

    // button panel
    btnPanel.setLayout(new GridLayout(1, 2, 10, 10));
    //    btnPanel.setMaximumSize(new Dimension(60, 100));
    //    btnPanel.setPreferredSize(new Dimension(60, 100));
   
    addButton = new JButton("Add");
    background = addButton.getBackground();
    foreground = addButton.getForeground();
    addButton.setBorder(BorderFactory.createRaisedBevelBorder());
    addButton.addMouseListener(this);
    addButton.setToolTipText("add Host to list");
    addButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        hostField.setText("");
        String hostName = (String) JOptionPane.showInputDialog(null,
                                                               "Enter host name",
                                                               "Add Host",
                                                               JOptionPane.QUESTION_MESSAGE,
                                                               null,
                                                               null,
                                                               "");
        if (hostName == null)
          return;               // didn't mean it
        Host host = null;
        try {
          host = new Host(hostName); // bogus?
        } catch (UnknownHostException x) {
          JOptionPane.showMessageDialog(null,
                                        "Cannot find host named " + hostName,
                                        "Error",
                                        JOptionPane.ERROR_MESSAGE);
View Full Code Here

  private Set findLiveHosts(String host) {
    Set liveHosts = new HashSet();
    try {
      if (host == null) {
        for (Iterator iter = Host.allHosts(); iter.hasNext(); ) {
          Host nextHost = (Host) iter.next();
          if (nextHost.ping())
            liveHosts.add(nextHost);
        }
      } else {
        Host nextHost = new Host(host);
        if (nextHost.ping())
          liveHosts.add(nextHost);
      }
    } catch (UnknownHostException e) {
      System.err.println(e);
      System.exit(-1);
View Full Code Here

TOP

Related Classes of aleph.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.