Package net.sf.xbus.admin.html

Source Code of net.sf.xbus.admin.html.ReceiverThreadBean

package net.sf.xbus.admin.html;

import java.util.Iterator;
import java.util.Set;

import net.sf.xbus.base.core.XException;
import net.sf.xbus.technical.ReceiverThreadManager;

/**
* TODO Kommentierung
*/
public class ReceiverThreadBean
{
  public String getRunningReceiverThreads()
  {
    StringBuffer buf = new StringBuffer(
        "<option selected>--------------------");

    try
    {
      Set runningSystems = ReceiverThreadManager.getInstance()
          .getRunningSystems();

      for (Iterator it = runningSystems.iterator(); it.hasNext();)
      {
        buf.append("<option>");
        buf.append((String) it.next());
      }
    }
    catch (XException e)
    {
      // do nothing
    }
    return buf.toString();
  }

  public String getNotRunningReceiverThreads()
  {
    StringBuffer buf = new StringBuffer(
        "<option selected>--------------------");

    try
    {
      ReceiverThreadManager manager = ReceiverThreadManager.getInstance();
      Set allSystems = manager.getAllSystems();
      Set runningSystems = manager.getRunningSystems();

      String name = null;
      for (Iterator it = allSystems.iterator(); it.hasNext();)
      {
        name = (String) it.next();
        if (!runningSystems.contains(name))
        {
          buf.append("<option>");
          buf.append(name);
        }
      }
    }
    catch (XException e)
    {
      // do nothing
    }

    return buf.toString();
  }

}
TOP

Related Classes of net.sf.xbus.admin.html.ReceiverThreadBean

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.