diff options
author | Andrew Ferrazzutti | 2014-05-29 14:28:09 +0000 |
---|---|---|
committer | Jeff Johnston | 2014-06-09 15:29:26 +0000 |
commit | 9bdd7a2d81c01e795a40874ced1d5e6a1e43f5eb (patch) | |
tree | 576e540d1eecbe9f2a2654ddfbce6c2aa66ec47f /systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal | |
parent | da99fda8413e38bd051e00e72fe63dcdce3cef33 (diff) | |
download | org.eclipse.linuxtools-9bdd7a2d81c01e795a40874ced1d5e6a1e43f5eb.tar.gz org.eclipse.linuxtools-9bdd7a2d81c01e795a40874ced1d5e6a1e43f5eb.tar.xz org.eclipse.linuxtools-9bdd7a2d81c01e795a40874ced1d5e6a1e43f5eb.zip |
Systemtap: Restore public TapsetLibrary.init().
Restore the public initialization method for TapsetLibrary,
so that tapset contents can be loaded as soon as the Systemtap
plugin is loaded. Also implement a better means of forbidding
multiple initializations than what was done before.
Resolves EBZ #436169.
Change-Id: I7a771c78698d32cb24f94403fb4f9c648085a5b6
Signed-off-by: Andrew Ferrazzutti <aferrazz@redhat.com>
Reviewed-on: https://git.eclipse.org/r/27533
Tested-by: Hudson CI
Reviewed-by: Jeff Johnston <jjohnstn@redhat.com>
Tested-by: Jeff Johnston <jjohnstn@redhat.com>
Reviewed-on: https://git.eclipse.org/r/28152
Diffstat (limited to 'systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal')
2 files changed, 23 insertions, 17 deletions
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/IDEPlugin.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/IDEPlugin.java index bf9eeea4c0..6510dfd054 100644 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/IDEPlugin.java +++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/IDEPlugin.java @@ -55,6 +55,7 @@ public class IDEPlugin extends AbstractUIPlugin { workbenchListener = new IDECloseMonitor(); plugin.getWorkbench().addWorkbenchListener(workbenchListener); + TapsetLibrary.init(); } /** diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TapsetLibrary.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TapsetLibrary.java index 833722a394..8cdcc4c87e 100644 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TapsetLibrary.java +++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/structures/TapsetLibrary.java @@ -50,6 +50,8 @@ public final class TapsetLibrary { private static final IUpdateListener functionCompletionListener = new ParseCompletionListener(functionParser); private static final IUpdateListener probeCompletionListener = new ParseCompletionListener(probeParser); + private static boolean initialized = false; + public static TreeNode getProbes() { return probeTree; } @@ -139,19 +141,26 @@ public final class TapsetLibrary { return documentation; } - private static void init() { - IPreferenceStore preferenceStore = IDEPlugin.getDefault().getPreferenceStore(); - preferenceStore.addPropertyChangeListener(propertyChangeListener); - ConsoleLogPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(credentialChangeListener); - - functionParser.addListener(functionCompletionListener); - probeParser.addListener(probeCompletionListener); - - if (preferenceStore.getBoolean(IDEPreferenceConstants.P_STORED_TREE) - && isTreeFileCurrent()) { - readTreeFile(); - } else { - runStapParser(); + /** + * Initialize all listeners associated with loading tapset contents, and perform + * the first tapset load operation. Note that subsequent calls to this method will have no effect. + */ + public synchronized static void init() { + if (!initialized) { + initialized = true; + IPreferenceStore preferenceStore = IDEPlugin.getDefault().getPreferenceStore(); + preferenceStore.addPropertyChangeListener(propertyChangeListener); + ConsoleLogPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(credentialChangeListener); + + functionParser.addListener(functionCompletionListener); + probeParser.addListener(probeCompletionListener); + + if (preferenceStore.getBoolean(IDEPreferenceConstants.P_STORED_TREE) + && isTreeFileCurrent()) { + readTreeFile(); + } else { + runStapParser(); + } } } @@ -448,8 +457,4 @@ public final class TapsetLibrary { cacheProbeManpages.join(); } catch (InterruptedException e) {} } - - static { - init(); - } } |