Package threading

Examples of threading.IntegratorThread


     
    }
    else if (e.getSource() == searchButton)
    {
      ExecutorService pool = Executors.newFixedThreadPool(8);
      IntegratorThread integrator = new IntegratorThread(jobList.size());
     
      pool.execute(integrator);
     
      for (SearchThread s : jobList)
      {
        s.addListener(integrator);
        pool.execute(s);
      }
     
      try
      {
        pool.awaitTermination(100, TimeUnit.MILLISECONDS);
      }
     
      catch (InterruptedException e1)
      {
        e1.printStackTrace();
      }
     
      Vector<Person> result = integrator.getResult();
     
      caller.summaryArea.setText("");
     
      if (operatorComboBox.getSelectedItem().toString().equals("Or"))
      {
View Full Code Here


   *            The year to search
   */
  public Person searchPerson(Person person, int low, int high)
  {
    SearchThread job = new SearchThread(person, low, high);
    IntegratorThread intergrator = new IntegratorThread();
    intergrator.incJob();
    pool.execute(job);
   
    try
    {
      pool.awaitTermination(10, TimeUnit.MILLISECONDS);
View Full Code Here

  {
    Vector<MileStone> result = new Vector<MileStone>();
    SearchThread job;
    Person p;
   
    IntegratorThread integrator = new IntegratorThread();
    pool.execute(integrator);
   
    for (int i = 0 ; i < vipComboBox.getItemCount() ; i++)
    {
      p = vipComboBox.getItemAt(i);
      job = new SearchThread(p, low, high);
      job.addListener(integrator);
      integrator.incJob();
      pool.execute(job);
    }
   
    try
    {
      pool.awaitTermination(100, TimeUnit.MILLISECONDS);
    }
    catch (InterruptedException e)
    {
      e.printStackTrace();
    }

    summaryArea.setText("");
   
    for (Person person : integrator.getResult())
    {
      summaryArea.setText(summaryArea.getText() + person.lifeHistoryToString());
    }
  }
View Full Code Here

TOP

Related Classes of threading.IntegratorThread

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.