Package net.sf.myway.trainer

Source Code of net.sf.myway.trainer.Plugin

package net.sf.myway.trainer;

import net.sf.myway.trainer.bl.TrainerBL;
import net.sf.myway.trainer.bl.impl.TrainerBLImpl;

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

public class Plugin implements BundleActivator {

  private static BundleContext context;

  static BundleContext getContext() {
    return context;
  }

  private static TrainerBL _bl;
 
  /**
   * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
   */
  @Override
  public void start(BundleContext bundleContext) throws Exception {
    Plugin.context = bundleContext;
  }

  /**
   * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
   */
  @Override
  public void stop(BundleContext bundleContext) throws Exception {
    Plugin.context = null;
  }

  /**
   * @return the bl
   */
  public static TrainerBL getBl() {
    if (_bl == null) {
      _bl = new TrainerBLImpl();
    }
    return _bl;
  }

}
TOP

Related Classes of net.sf.myway.trainer.Plugin

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.