X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.procore%2Fsrc%2Ffi%2Fvtt%2Fsimantics%2Fprocore%2Finternal%2FServiceLocatorImpl.java;h=cbde88bffef35bda9215b540b4d3be7587e3909c;hb=73884c78cf2695329aa3b6559c4c6a196792ac9b;hp=bf4d0f6684498c43607178b79abeb66220148df8;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git
diff --git a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ServiceLocatorImpl.java b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ServiceLocatorImpl.java
index bf4d0f668..cbde88bff 100644
--- a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ServiceLocatorImpl.java
+++ b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ServiceLocatorImpl.java
@@ -1,194 +1,194 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management
- * in Industry THTH ry.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * VTT Technical Research Centre of Finland - initial API and implementation
- *******************************************************************************/
-package fi.vtt.simantics.procore.internal;
-
-import gnu.trove.map.hash.THashMap;
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.simantics.db.Disposable;
-import org.simantics.db.ServiceLocator;
-import org.simantics.db.exception.ServiceNotFoundException;
-
-/**
- * @author Tuukka Lehtonen
- */
-public class ServiceLocatorImpl implements ServiceLocator {
-
- /**
- * The parent for this service locator. If a service can't be found in this
- * locator, then the parent is asked. This value may be null
- * if there is no parent.
- */
- private final ServiceLocator parent;
-
- /**
- * The map of services maintained by the workbench window. These services
- * are initialized during workbench window during the
- * {@link #configureShell(Shell)}. This value is null until
- * a service is registered.
- */
- private Map, Object> services = null;
-
- /**
- * Constructs a service locator with no parent.
- */
- public ServiceLocatorImpl() {
- this(null);
- }
-
- /**
- * Constructs a service locator with the given parent.
- *
- * @param parent
- * The parent for this service locator; this value may be
- * null.
- */
- public ServiceLocatorImpl(final ServiceLocator parent) {
- this.parent = parent;
- }
-
-// public final void activate() {
-// if (services != null) {
-// final Iterator serviceItr = services.values().iterator();
-// while (serviceItr.hasNext()) {
-// final Object service = serviceItr.next();
-// if (service instanceof INestable) {
-// final INestable nestableService = (INestable) service;
-// nestableService.activate();
-// }
-// }
-// }
-// }
-//
-// public final void deactivate() {
-// if (services != null) {
-// final Iterator serviceItr = services.values().iterator();
-// while (serviceItr.hasNext()) {
-// final Object service = serviceItr.next();
-// if (service instanceof INestable) {
-// final INestable nestableService = (INestable) service;
-// nestableService.deactivate();
-// }
-// }
-// }
-// }
-
- public final void dispose() {
- Map, Object> s = null;
- synchronized (this) {
- s = services;
- services = null;
- }
- if (s != null) {
- final Iterator