Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2010-08-03 21:13:46 +0000
committerrescobar2010-08-03 21:13:46 +0000
commit89b8c8054171a7dc1b8e2efddf26088791675885 (patch)
treeeb378f4b172ae504e1e0b3acb8a18bd8effa83a3 /plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src
parentfee8a93ec9a4aa9ea461e94f2341b7898e063127 (diff)
downloadorg.eclipse.osee-89b8c8054171a7dc1b8e2efddf26088791675885.tar.gz
org.eclipse.osee-89b8c8054171a7dc1b8e2efddf26088791675885.tar.xz
org.eclipse.osee-89b8c8054171a7dc1b8e2efddf26088791675885.zip
"Team Workflow" - YGHW1 - "Block changes to requirements unless done under an appropriate action."
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src')
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/Activator.java20
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataAccessor.java (renamed from plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/ArtifactDataAccessor.java)2
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderServiceRegHandler.java50
3 files changed, 63 insertions, 9 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/Activator.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/Activator.java
index eab0f323715..7df389a6dc1 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/Activator.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/Activator.java
@@ -11,31 +11,35 @@
package org.eclipse.osee.framework.core.dsl.ui.integration.internal;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.util.ServiceDependencyTracker;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.util.tracker.ServiceTracker;
public class Activator implements BundleActivator {
public static final String PLUGIN_ID = "org.eclipse.osee.framework.core.dsl.ui.integration";
- private static BundleContext context;
+
private static Activator instance;
- private ServiceTracker cacheServiceTracker;
- static BundleContext getContext() {
- return context;
- }
+ private ServiceTracker cacheServiceTracker;
+ private ServiceDependencyTracker dependencyTracker;
@Override
- public void start(BundleContext bundleContext) throws Exception {
+ public void start(BundleContext context) throws Exception {
Activator.instance = this;
- Activator.context = bundleContext;
+
+ dependencyTracker = new ServiceDependencyTracker(context, new ArtifactDataProviderServiceRegHandler());
+ dependencyTracker.open();
+
cacheServiceTracker = new ServiceTracker(context, IOseeCachingService.class.getName(), null);
cacheServiceTracker.open(true);
}
@Override
public void stop(BundleContext bundleContext) throws Exception {
- Activator.context = null;
+ Lib.close(dependencyTracker);
+
if (cacheServiceTracker != null) {
cacheServiceTracker.close();
}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/ArtifactDataAccessor.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataAccessor.java
index a716390bdfb..e1cb3b6880a 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/ArtifactDataAccessor.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataAccessor.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.core.dsl.ui.integration;
+package org.eclipse.osee.framework.core.dsl.ui.integration.internal;
import java.util.Collection;
import java.util.HashSet;
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderServiceRegHandler.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderServiceRegHandler.java
new file mode 100644
index 00000000000..579f6492662
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderServiceRegHandler.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * 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:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.core.dsl.ui.integration.internal;
+
+import java.util.Map;
+import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider;
+import org.eclipse.osee.framework.core.services.IOseeCachingService;
+import org.eclipse.osee.framework.core.util.AbstractTrackingHandler;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class ArtifactDataProviderServiceRegHandler extends AbstractTrackingHandler {
+
+ private static final Class<?>[] SERVICE_DEPENDENCIES = new Class<?>[] {
+ //
+ IOseeCachingService.class, //
+ };
+
+ private ServiceRegistration registration;
+
+ @Override
+ public Class<?>[] getDependencies() {
+ return SERVICE_DEPENDENCIES;
+ }
+
+ @Override
+ public void onActivate(BundleContext context, Map<Class<?>, Object> services) {
+ ArtifactDataProvider artifactDataProvider = new ArtifactDataAccessor();
+ registration = context.registerService(ArtifactDataProvider.class.getName(), artifactDataProvider, null);
+ }
+
+ @Override
+ public void onDeActivate() {
+ if (registration != null) {
+ registration.unregister();
+ }
+ }
+
+}

Back to the top