Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDJ Houghton2006-01-30 13:05:27 -0500
committerDJ Houghton2006-01-30 13:05:27 -0500
commit0dfb62acca921e22bdcde2b4376f8962d4083a88 (patch)
tree712d812cb41718949c3b1793cdb9f165f23ea1d2
parent8c6f799546c25e681ac8f07faa7d3d0c6e04739c (diff)
downloadrt.equinox.bundles-0dfb62acca921e22bdcde2b4376f8962d4083a88.tar.gz
rt.equinox.bundles-0dfb62acca921e22bdcde2b4376f8962d4083a88.tar.xz
rt.equinox.bundles-0dfb62acca921e22bdcde2b4376f8962d4083a88.zip
Bug 117947 - Provide a way to convert "old" extension registry elements to "new" and vice versa
-rw-r--r--bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionRegistry.java5
-rw-r--r--bundles/org.eclipse.equinox.registry/src/org/eclipse/equinox/registry/tracker/ExtensionTracker.java20
2 files changed, 6 insertions, 19 deletions
diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionRegistry.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionRegistry.java
index f77edca9..da025eb6 100644
--- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionRegistry.java
+++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionRegistry.java
@@ -724,11 +724,6 @@ public class ExtensionRegistry implements IExtensionRegistry {
strategy.log(status);
}
- public void setInitializationData(Object newClassInstance, IConfigurationElement confElement, String propertyName, Object initData) throws CoreException {
- if (compatibilityStrategy != null)
- compatibilityStrategy.setInitializationData(newClassInstance, confElement, propertyName, initData);
- }
-
public String translate(String key, ResourceBundle resources) {
return strategy.translate(key, resources);
}
diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/equinox/registry/tracker/ExtensionTracker.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/equinox/registry/tracker/ExtensionTracker.java
index 9680a6fd..6512c4e3 100644
--- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/equinox/registry/tracker/ExtensionTracker.java
+++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/equinox/registry/tracker/ExtensionTracker.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
* 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
@@ -13,7 +13,6 @@ package org.eclipse.equinox.registry.tracker;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.internal.registry.RegistryMessages;
-import org.eclipse.core.internal.registry.osgi.Activator;
import org.eclipse.core.internal.runtime.ReferenceHashSet;
import org.eclipse.core.internal.runtime.RuntimeLog;
import org.eclipse.core.runtime.IStatus;
@@ -25,8 +24,7 @@ import org.eclipse.equinox.registry.IExtensionPoint;
import org.eclipse.equinox.registry.IExtensionRegistry;
import org.eclipse.equinox.registry.IRegistryChangeEvent;
import org.eclipse.equinox.registry.IRegistryChangeListener;
-import org.osgi.framework.BundleContext;
-import org.osgi.util.tracker.ServiceTracker;
+import org.eclipse.equinox.registry.RegistryFactory;
/**
* Implementation of the IExtensionTracker.
@@ -39,7 +37,7 @@ public class ExtensionTracker implements IExtensionTracker, IRegistryChangeListe
private ListenerList handlers = new ListenerList();
private final Object lock = new Object();
private boolean closed = false;
- IExtensionRegistry registry; // the registry that this tacker works with
+ private IExtensionRegistry registry; // the registry that this tacker works with
private static final Object[] EMPTY_ARRAY = new Object[0];
@@ -47,15 +45,7 @@ public class ExtensionTracker implements IExtensionTracker, IRegistryChangeListe
* Construct a new instance of the extension tracker.
*/
public ExtensionTracker() {
- BundleContext context = Activator.getContext();
- ServiceTracker registryTracker = new ServiceTracker(context, IExtensionRegistry.class.getName(), null);
- registryTracker.open(true); // TODO check if argument is necessary
- if (registryTracker != null) {
- registry = (IExtensionRegistry) registryTracker.getService();
- registry.addRegistryChangeListener(this);
- registryTracker.close();
- } else
- RuntimeLog.log(new Status(IStatus.ERROR, RegistryMessages.OWNER_NAME, 0, RegistryMessages.registry_no_default, null));
+ this(RegistryFactory.getRegistry());
}
/**
@@ -66,6 +56,8 @@ public class ExtensionTracker implements IExtensionTracker, IRegistryChangeListe
registry = theRegistry;
if (registry != null)
registry.addRegistryChangeListener(this);
+ else
+ RuntimeLog.log(new Status(IStatus.ERROR, RegistryMessages.OWNER_NAME, 0, RegistryMessages.registry_no_default, null));
}
/* (non-Javadoc)

Back to the top