HelloWorldThread.java :  » OSGi » netbeams » org » netbeams » test » simplebundle » Java Open Source

Java Open Source » OSGi » netbeams 
netbeams » org » netbeams » test » simplebundle » HelloWorldThread.java
package org.netbeams.test.simplebundle;

/**
 * 
 * @author teresa  | tlj@sfsu.edu
 *
 */
public class HelloWorldThread extends Thread {
  private boolean running = true;
  
  public HelloWorldThread() {
    
  }
  
  public void run() {
    while (running) {
      System.out.println("Hello World!");
      
      try {
        Thread.sleep(5000);
      } catch (InterruptedException e) {
        System.out.println("HelloWorldThread ERROR: " + e);
      }
    }
  }
  
  public void stopThread() {
    this.running = false;
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.