aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Besedin2012-10-23 10:29:31 (EDT)
committerOleg Besedin2012-10-23 10:29:31 (EDT)
commit4fb085bbddd9e72a75662c3daef38a9836da871d (patch)
treeba9977a7a39a2731260a74e1e2693b6798ebe12e
parente418dfc33aae81aff5fcd522393ac2ee89db8715 (diff)
downloadeclipse.platform.runtime-4fb085bbddd9e72a75662c3daef38a9836da871d.zip
eclipse.platform.runtime-4fb085bbddd9e72a75662c3daef38a9836da871d.tar.gz
eclipse.platform.runtime-4fb085bbddd9e72a75662c3daef38a9836da871d.tar.bz2
Bug 389863 - EventHandlers are not called on part after closing otherv20121023-142931
part
-rw-r--r--bundles/org.eclipse.e4.core.contexts/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.e4.core.contexts/src/org/eclipse/e4/core/contexts/ContextInjectionFactory.java12
-rw-r--r--bundles/org.eclipse.e4.core.di/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/di/IInjector.java8
-rw-r--r--bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/InjectorImpl.java8
-rw-r--r--bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/osgi/ProviderHelper.java6
6 files changed, 33 insertions, 5 deletions
diff --git a/bundles/org.eclipse.e4.core.contexts/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.core.contexts/META-INF/MANIFEST.MF
index ebdfaa0..edddd87 100644
--- a/bundles/org.eclipse.e4.core.contexts/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.e4.core.contexts/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.e4.core.contexts
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.2.0.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.e4.core.contexts/src/org/eclipse/e4/core/contexts/ContextInjectionFactory.java b/bundles/org.eclipse.e4.core.contexts/src/org/eclipse/e4/core/contexts/ContextInjectionFactory.java
index 3b06e0c..a160f8b 100644
--- a/bundles/org.eclipse.e4.core.contexts/src/org/eclipse/e4/core/contexts/ContextInjectionFactory.java
+++ b/bundles/org.eclipse.e4.core.contexts/src/org/eclipse/e4/core/contexts/ContextInjectionFactory.java
@@ -184,4 +184,16 @@ final public class ContextInjectionFactory {
PrimaryObjectSupplier tempSupplier = ContextObjectSupplier.getObjectSupplier(staticContext, injector);
return injector.make(clazz, supplier, tempSupplier);
}
+
+ /**
+ * Specifies context used by the injector to create its internal objects.
+ * Providing this context allows injector to become aware of higher-level
+ * constructs, such as application logging and synchronization.
+ * @param context the context to be used as a data source by the injector
+ * @since 1.2
+ */
+ static public void setDefault(IEclipseContext context) {
+ PrimaryObjectSupplier supplier = ContextObjectSupplier.getObjectSupplier(context, injector);
+ injector.setDefaultSupplier(supplier);
+ }
}
diff --git a/bundles/org.eclipse.e4.core.di/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.core.di/META-INF/MANIFEST.MF
index ecd64d2..21dae4d 100644
--- a/bundles/org.eclipse.e4.core.di/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.e4.core.di/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.e4.core.di
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.2.0.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/di/IInjector.java b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/di/IInjector.java
index b4d08d1..a336af4 100644
--- a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/di/IInjector.java
+++ b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/di/IInjector.java
@@ -160,4 +160,12 @@ public interface IInjector {
*/
public IBinding addBinding(IBinding binding);
+ /**
+ * Specifies object supplier to inject internally created objects,
+ * such as extended object suppliers.
+ * @param objectSupplier the object supplier used to inject objects
+ * implicitly created by this injector
+ * @since 1.2
+ */
+ public void setDefaultSupplier(PrimaryObjectSupplier objectSupplier);
}
diff --git a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/InjectorImpl.java b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/InjectorImpl.java
index 1d943a3..8e6d421 100644
--- a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/InjectorImpl.java
+++ b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/InjectorImpl.java
@@ -77,6 +77,8 @@ public class InjectorImpl implements IInjector {
private Set<Class<?>> classesBeingCreated = new HashSet<Class<?>>(5);
+ private PrimaryObjectSupplier defaultSupplier;
+
public void inject(Object object, PrimaryObjectSupplier objectSupplier) {
inject(object, objectSupplier, null);
}
@@ -534,7 +536,7 @@ public class InjectorImpl implements IInjector {
ExtendedObjectSupplier supplier;
try {
// use qualified name to refer to a class that might be missing
- supplier = org.eclipse.e4.core.internal.di.osgi.ProviderHelper.findProvider(key, objectSupplier);
+ supplier = org.eclipse.e4.core.internal.di.osgi.ProviderHelper.findProvider(key, defaultSupplier);
} catch (NoClassDefFoundError e) {
return null; // OSGi framework not present
}
@@ -860,4 +862,8 @@ public class InjectorImpl implements IInjector {
}
}
+ public void setDefaultSupplier(PrimaryObjectSupplier objectSupplier) {
+ defaultSupplier = objectSupplier;
+ }
+
}
diff --git a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/osgi/ProviderHelper.java b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/osgi/ProviderHelper.java
index aef5a92..bad8e56 100644
--- a/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/osgi/ProviderHelper.java
+++ b/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/internal/di/osgi/ProviderHelper.java
@@ -60,8 +60,10 @@ public class ProviderHelper {
ServiceReference[] refs = bundleContext.getServiceReferences(ExtendedObjectSupplier.SERVICE_NAME, filter);
if (refs != null && refs.length > 0) {
ExtendedObjectSupplier supplier = (ExtendedObjectSupplier) bundleContext.getService(refs[0]);
- IInjector injector = InjectorFactory.getDefault();
- injector.inject(supplier, objectSupplier);
+ if (objectSupplier != null) {
+ IInjector injector = InjectorFactory.getDefault();
+ injector.inject(supplier, objectSupplier);
+ }
extendedSuppliers.put(qualifier, supplier);
return supplier;
}