@Test public void shouldRegisterServiceIfTasksModuleIsAlreadyAvailable() { when(bundleContext.getBundle(TASKS_BUNDLE_SYMBOLIC_NAME)).thenReturn(bundle); registerer.init(); verify(bundleContext).getBundle(TASKS_BUNDLE_SYMBOLIC_NAME); verify(bundleContext).registerService( eq(DynamicChannelProvider.class.getName()), eq(new SchedulerChannelProvider(sqlProperties)), eq(new Hashtable<>()) ); }
@PostConstruct public void init() { if (bundleContext.getBundle(TASKS_BUNDLE_SYMBOLIC_NAME) != null) { register(); } BundleTracker taskTracker = new BundleTracker(bundleContext, Bundle.ACTIVE, this); taskTracker.open(); }
DynamicChannelProviderRegisterer implements BundleTrackerCustomizer { @PostConstruct public void init() { if (bundleContext.getBundle(TASKS_BUNDLE_SYMBOLIC_NAME) != null) { register(); } BundleTracker taskTracker = new BundleTracker(bundleContext, Bundle.ACTIVE, this); taskTracker.open(); } }
DynamicChannelProviderRegisterer implements BundleTrackerCustomizer { @PostConstruct public void init() { if (bundleContext.getBundle(TASKS_BUNDLE_SYMBOLIC_NAME) != null) { register(); } BundleTracker taskTracker = new BundleTracker(bundleContext, Bundle.ACTIVE, this); taskTracker.open(); }  }
DynamicChannelProviderRegisterer implements BundleTrackerCustomizer { @PostConstruct public void init() { if (bundleContext.getBundle(TASKS_BUNDLE_SYMBOLIC_NAME) != null) { register(); } BundleTracker taskTracker = new BundleTracker(bundleContext, Bundle.ACTIVE, this); taskTracker.open(); }  @PostConstruct void init(); @Override Object addingBundle(Bundle bundle, BundleEvent bundleEvent); @Override void modifiedBundle(Bundle bundle, BundleEvent bundleEvent, Object o); @Override void removedBundle(Bundle bundle, BundleEvent bundleEvent, Object o); }
DynamicChannelProviderRegisterer implements BundleTrackerCustomizer { @PostConstruct public void init() { if (bundleContext.getBundle(TASKS_BUNDLE_SYMBOLIC_NAME) != null) { register(); } BundleTracker taskTracker = new BundleTracker(bundleContext, Bundle.ACTIVE, this); taskTracker.open(); }  @PostConstruct void init(); @Override Object addingBundle(Bundle bundle, BundleEvent bundleEvent); @Override void modifiedBundle(Bundle bundle, BundleEvent bundleEvent, Object o); @Override void removedBundle(Bundle bundle, BundleEvent bundleEvent, Object o);  }