//
// Activator.java
//

package com.example.foo.osgi;

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

import com.example.foo.spi.Foo;
import com.example.foo.spi.FooFactory;

public class Activator implements BundleActivator {

  public void start(BundleContext context) throws Exception {
    System.out.println("In com.example.foo.osgi.Activator.start():");
    Foo foo = FooFactory.getFoo();
    if (foo == null) {
      System.out.println("no service providers found for Foo");
    }
    else {
      System.out.println(foo.doFoo());
    }
  }

  public void stop(BundleContext context) throws Exception {
    // Do nothing.
  }

}
