예제 #1
0
  @Override
  public void stop(BundleContext context) throws Exception {
    if (serviceTracker != null) {
      serviceTracker.close();
    }

    if (bundleTracker != null) {
      bundleTracker.close();
    }
  }
예제 #2
0
  @Override
  public void start(BundleContext context) throws Exception {
    bundleTracker =
        new BundleTracker(context, Bundle.ACTIVE, new ValidationResolverBundleTrackerCustomizer());
    bundleTracker.open();

    ValidationProviderHolder holder = new ValidationProviderHolder(context);

    ValidationProviderServiceTrackerCustomizer serviceTrackerCustomizer =
        new ValidationProviderServiceTrackerCustomizer(context, holder);
    serviceTracker =
        new ServiceTracker(context, ValidationProvider.class, serviceTrackerCustomizer);
    serviceTracker.open();
  }