Activator.java :  » OSGi » netbeams » org » netbeams » test » randomnumber » Java Open Source

Java Open Source » OSGi » netbeams 
netbeams » org » netbeams » test » randomnumber » Activator.java
package org.netbeams.test.randomnumber;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

/**
 * 
 * @author Teresa L. Johnson <gamma.particle@gmail.com>
 *
 */
public class Activator implements BundleActivator {
  
  public static BundleContext bc = null;
  private RandomNumber thread = null;
  
  public void start(BundleContext bc) throws Exception {
    
    System.out.println("Random Number Generator starting...");
    this.bc = bc;
    this.thread = new RandomNumber();
    this.thread.start();
  }

  public void stop(BundleContext bc) throws Exception {
    
    System.out.println("Random Number Generator stopping...");
    this.thread.stopThread();
    this.thread.join();
    this.bc = null;
    

  }

}
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.