Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Now, create the Activator, mypackage.MyActivator.java

Panel
{{
Wiki Markup
Code Block
titlemypackage.MyActivator.java
borderStylesolid

package mypackage;
import java.util.Properties;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import com.affymetrix.genometryImpl.util.FloatTransformer;

public class MyActivator implements BundleActivator {
  private BundleContext bundleContext;
  private ServiceRegistration serviceRegistration;
  protected BundleContext getContext() {
    return bundleContext;
  }
  public void start(BundleContext _bundleContext) throws Exception {
    bundleContext = _bundleContext;
    serviceRegistration = bundleContext.registerService(FloatTransformer.class.getName(), new InverseTransformer(), new Properties());
  }
  public void stop(BundleContext _bundleContext) throws Exception {
    if (serviceRegistration != null) {
      serviceRegistration.unregister();
    }
    bundleContext = null;
  }
}
}}

...