private ServiceTracker<SchemaContextListener, SchemaContextListener> listenerTracker;
private BundleTracker<Iterable<Registration>> bundleTracker;
private boolean starting = true;
+ private volatile boolean stopping;
private static OsgiBundleScanningSchemaService instance;
private OsgiBundleScanningSchemaService(final BundleContext context) {
@Override
public void close() {
+ stopping = true;
if (bundleTracker != null) {
bundleTracker.close();
}
}
public synchronized void tryToUpdateSchemaContext() {
- if (starting) {
+ if (starting || stopping) {
return;
}
final Optional<SchemaContext> schema = contextResolver.getSchemaContext();