diff options
author | Eike Stepper | 2016-02-16 12:30:23 +0000 |
---|---|---|
committer | Eike Stepper | 2016-02-16 12:30:23 +0000 |
commit | 575951a1cad4dbddf610c8290b6bf7f7831c4061 (patch) | |
tree | 5352422391cc12975380cb9078419b15c3422a06 /plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util | |
parent | 1f70c6f6785d44bf46eb1b08be13980027eeaa2e (diff) | |
download | cdo-575951a1cad4dbddf610c8290b6bf7f7831c4061.tar.gz cdo-575951a1cad4dbddf610c8290b6bf7f7831c4061.tar.xz cdo-575951a1cad4dbddf610c8290b6bf7f7831c4061.zip |
[486458] Provide support for optimized loading and notifying of object units
https://bugs.eclipse.org/bugs/show_bug.cgi?id=486458
Diffstat (limited to 'plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util')
4 files changed, 39 insertions, 11 deletions
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractBundle.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractBundle.java index f3f68b718d..40d6122b0c 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractBundle.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractBundle.java @@ -57,8 +57,6 @@ public abstract class AbstractBundle implements OMBundle, OMBundle.DebugSupport, private boolean debugging; - private boolean debuggingInitialized; - private Map<String, Tracer> tracers = new ConcurrentHashMap<String, Tracer>(0); private OMLogger logger; @@ -80,6 +78,9 @@ public abstract class AbstractBundle implements OMBundle, OMBundle.DebugSupport, this.platform = platform; this.bundleID = bundleID; this.accessor = accessor; + + boolean debug = getDebugOption("debug", false); //$NON-NLS-1$ + setDebugging(debug); } public OMPlatform getPlatform() @@ -97,6 +98,11 @@ public abstract class AbstractBundle implements OMBundle, OMBundle.DebugSupport, return accessor; } + public void setAccessor(Class<?> accessor) + { + this.accessor = accessor; + } + public Object getBundleContext() { return bundleContext; @@ -125,12 +131,6 @@ public abstract class AbstractBundle implements OMBundle, OMBundle.DebugSupport, return false; } - if (!debuggingInitialized) - { - debugging = getDebugOption("debug", false); //$NON-NLS-1$ - debuggingInitialized = true; - } - return debugging; } diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractPlatform.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractPlatform.java index 2e29b0c31a..5c54abe11c 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractPlatform.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/bundle/AbstractPlatform.java @@ -86,10 +86,18 @@ public abstract class AbstractPlatform implements OMPlatform public synchronized OMBundle bundle(String bundleID, Class<?> accessor) { - OMBundle bundle = bundles.get(bundleID); + AbstractBundle bundle = bundles.get(bundleID); if (bundle == null) { - bundle = createBundle(bundleID, accessor); + bundle = (AbstractBundle)createBundle(bundleID, accessor); + bundles.put(bundleID, bundle); + } + else if (accessor != null) + { + if (bundle.getAccessor() == null) + { + bundle.setAccessor(accessor); + } } return bundle; diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/LegacyBundle.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/LegacyBundle.java index ebf04da546..b344c0aa0a 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/LegacyBundle.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/LegacyBundle.java @@ -16,6 +16,8 @@ import org.eclipse.net4j.util.ReflectUtil; import org.eclipse.net4j.util.StringUtil; import org.eclipse.net4j.util.WrappedException; import org.eclipse.net4j.util.io.IOUtil; +import org.eclipse.net4j.util.om.OMPlatform; +import org.eclipse.net4j.util.om.trace.Tracer; import java.io.File; import java.io.IOException; @@ -37,6 +39,9 @@ import java.util.jar.JarFile; */ public class LegacyBundle extends AbstractBundle { + private static final boolean isOptionsDisabled = Boolean + .valueOf(OMPlatform.INSTANCE.getProperty(Tracer.PROP_DISABLE_TRACING_OPTIONS, Boolean.FALSE.toString())); + private URL baseURL; public LegacyBundle(AbstractPlatform platform, String bundleID, Class<?> accessor) @@ -51,7 +56,10 @@ public class LegacyBundle extends AbstractBundle throw new IllegalStateException("No base URL"); } - loadOptions(); + if (!isOptionsDisabled) + { + loadOptions(); + } } catch (Exception ex) { diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/LegacyPlatform.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/LegacyPlatform.java index 976a49afc2..d5ff6ad2b0 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/LegacyPlatform.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/LegacyPlatform.java @@ -55,4 +55,16 @@ public class LegacyPlatform extends AbstractPlatform { return LegacyUtil.getCommandLineArgs(); } + + public static boolean clearDebugOptions() + { + if (INSTANCE instanceof LegacyPlatform) + { + LegacyPlatform platform = (LegacyPlatform)INSTANCE; + platform.debugOptions.clear(); + return true; + } + + return false; + } } |