mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
[247356] Use API tooling.
This commit is contained in:
parent
0fb7dec635
commit
f88b03fbd0
143 changed files with 4009 additions and 74 deletions
|
@ -20,9 +20,15 @@
|
|||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
395
plugins/org.eclipse.dd.dsf.debug.ui/.settings/.api_filters
Normal file
395
plugins/org.eclipse.dd.dsf.debug.ui/.settings/.api_filters
Normal file
|
@ -0,0 +1,395 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component id="org.eclipse.dd.dsf.debug.ui" version="2">
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/launch/StackFramesVMNode.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch.StackFramesVMNode">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch.StackFramesVMNode"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/expression/WatchExpressionDelegate.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.WatchExpressionDelegate">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.WatchExpressionDelegate"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/variable/MessagesForVariablesVM.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.MessagesForVariablesVM">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.MessagesForVariablesVM"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterCellModifier.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterCellModifier">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterCellModifier"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/AutomaticUpdatePolicyAction.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.AutomaticUpdatePolicyAction">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.AutomaticUpdatePolicyAction"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterBitFieldCellModifier.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterBitFieldCellModifier">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterBitFieldCellModifier"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/BreakpointHitUpdatePolicy.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.BreakpointHitUpdatePolicy">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.BreakpointHitUpdatePolicy"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/BreakpointHitUpdatePolicyAction.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.BreakpointHitUpdatePolicyAction">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.BreakpointHitUpdatePolicyAction"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/ManualUpdatePolicyAction.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.ManualUpdatePolicyAction">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.ManualUpdatePolicyAction"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterBitFieldVMNode.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterBitFieldVMNode">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterBitFieldVMNode"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/variable/SyncVariableDataAccess.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.SyncVariableDataAccess">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.SyncVariableDataAccess"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/expression/AbstractExpressionVMNode.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.AbstractExpressionVMNode">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.AbstractExpressionVMNode"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/RefreshActionDelegate.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.RefreshActionDelegate">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.RefreshActionDelegate"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/SyncRegisterDataAccess.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.SyncRegisterDataAccess">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.SyncRegisterDataAccess"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/AbstractSetFormatStyle.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.AbstractSetFormatStyle">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.AbstractSetFormatStyle"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/expression/ExpressionVMProviderModelProxyStrategy.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.ExpressionVMProviderModelProxyStrategy">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.ExpressionVMProviderModelProxyStrategy"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/variable/VariableColumnPresentation.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.VariableColumnPresentation">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.VariableColumnPresentation"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="META-INF/MANIFEST.MF">
|
||||
<filter id="923795461">
|
||||
<message_arguments>
|
||||
<message_argument value="1.1.0.qualifier"/>
|
||||
<message_argument value="1.0.0.v20080609"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/SelectUpdatePolicyAction.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.SelectUpdatePolicyAction">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.SelectUpdatePolicyAction"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/IDebugVMConstants.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.IDebugVMConstants">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.IDebugVMConstants"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/expression/ExpressionManagerVMNode.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.ExpressionManagerVMNode">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.ExpressionManagerVMNode"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/variable/VariableVMProvider.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.VariableVMProvider">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.VariableVMProvider"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterVMProvider.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterVMProvider">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterVMProvider"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/expression/IExpressionUpdate.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.IExpressionUpdate">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.IExpressionUpdate"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/MessagesForRegisterVM.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.MessagesForRegisterVM">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.MessagesForRegisterVM"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/launch/LaunchRootVMNode.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch.LaunchRootVMNode">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch.LaunchRootVMNode"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/expression/ExpressionVMProvider.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.ExpressionVMProvider">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.ExpressionVMProvider"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterGroupVMNode.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterGroupVMNode">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterGroupVMNode"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/IFormattedValuePreferenceStore.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.IFormattedValuePreferenceStore">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.IFormattedValuePreferenceStore"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatDecimal.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.actions.SetDefaultFormatDecimal">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.actions.SetDefaultFormatDecimal"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/expression/WatchExpressionCellModifier.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.WatchExpressionCellModifier">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.WatchExpressionCellModifier"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatNatural.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.actions.SetDefaultFormatNatural">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.actions.SetDefaultFormatNatural"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterRootDMVMNode.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterRootDMVMNode">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterRootDMVMNode"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/expression/MessagesForExpressionVM.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.MessagesForExpressionVM">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.MessagesForExpressionVM"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/expression/ExpressionColumnPresentation.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.ExpressionColumnPresentation">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.ExpressionColumnPresentation"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/expression/ExpressionVMProviderContentStragegy.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.ExpressionVMProviderContentStragegy">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.ExpressionVMProviderContentStragegy"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterColumnPresentation.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterColumnPresentation">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterColumnPresentation"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/variable/VariableVMNode.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.VariableVMNode">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.VariableVMNode"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatBinary.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.actions.SetDefaultFormatBinary">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.actions.SetDefaultFormatBinary"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModulesVMNode.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules.ModulesVMNode">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules.ModulesVMNode"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatOctal.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.actions.SetDefaultFormatOctal">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.actions.SetDefaultFormatOctal"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/modules/ModulesVMProvider.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules.ModulesVMProvider">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules.ModulesVMProvider"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/IFormattedValueVMContext.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.IFormattedValueVMContext">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.IFormattedValueVMContext"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/expression/IExpressionVMNode.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.IExpressionVMNode">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression.IExpressionVMNode"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/launch/StandardProcessVMNode.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch.StandardProcessVMNode">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch.StandardProcessVMNode"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/variable/VariableCellModifier.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.VariableCellModifier">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable.VariableCellModifier"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/FormattedValuePreferenceStore.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.FormattedValuePreferenceStore">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.FormattedValuePreferenceStore"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/numberformat/actions/SetDefaultFormatHex.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.actions.SetDefaultFormatHex">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.actions.SetDefaultFormatHex"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterVMNode.java" type="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterVMNode">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register.RegisterVMNode"/>
|
||||
<message_argument value="org.eclipse.dd.dsf.debug.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
</component>
|
|
@ -29,17 +29,17 @@ Require-Bundle: org.eclipse.ui,
|
|||
org.eclipse.core.filesystem;bundle-version="1.2.0"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package:
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.actions,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel;x-internal:=true,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions;x-internal:=true,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression;x-internal:=true,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch;x-internal:=true,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules;x-internal:=true,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat;x-internal:=true,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.actions;x-internal:=true,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register;x-internal:=true,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update;x-internal:=true,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions;x-internal:=true,
|
||||
org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable;x-internal:=true,
|
||||
org.eclipse.dd.dsf.debug.ui,
|
||||
org.eclipse.dd.dsf.debug.ui.actions,
|
||||
org.eclipse.dd.dsf.debug.ui.contexts,
|
||||
|
|
|
@ -29,6 +29,9 @@ import org.eclipse.ui.IActionDelegate2;
|
|||
import org.eclipse.ui.IViewActionDelegate;
|
||||
import org.eclipse.ui.IViewPart;
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
@SuppressWarnings("restriction")
|
||||
abstract public class AbstractVMProviderActionDelegate implements IViewActionDelegate, IDebugContextListener, IActionDelegate2 {
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import org.eclipse.debug.ui.IDebugUIConstants;
|
|||
|
||||
/**
|
||||
* Default model selection policy factory for DSF.
|
||||
* @since 1.1
|
||||
*/
|
||||
@SuppressWarnings("restriction")
|
||||
public class DefaultDsfModelSelectionPolicyFactory implements IModelSelectionPolicyFactory {
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.eclipse.jface.viewers.TreeSelection;
|
|||
/**
|
||||
* Default DSF selection policy implementation modelled after platform version
|
||||
* (<code>DefaultSelectionPolicy</code>).
|
||||
* @since 1.1
|
||||
*/
|
||||
@SuppressWarnings("restriction")
|
||||
public class DefaultDsfSelectionPolicy implements IModelSelectionPolicy {
|
||||
|
|
|
@ -149,7 +149,7 @@ public class RegisterBitFieldVMNode extends AbstractExpressionVMNode
|
|||
}
|
||||
|
||||
private SyncRegisterDataAccess fSyncRegisterDataAccess = null;
|
||||
private IWatchExpressionFactoryAdapter2 fBitFieldExpressionFactory = null;
|
||||
protected IWatchExpressionFactoryAdapter2 fBitFieldExpressionFactory = null;
|
||||
private final IFormattedValuePreferenceStore fFormattedPrefStore;
|
||||
|
||||
public RegisterBitFieldVMNode(IFormattedValuePreferenceStore prefStore, AbstractDMVMProvider provider, DsfSession session, SyncRegisterDataAccess access) {
|
||||
|
@ -168,10 +168,16 @@ public class RegisterBitFieldVMNode extends AbstractExpressionVMNode
|
|||
return fFormattedPrefStore;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public SyncRegisterDataAccess getSyncRegisterDataAccess() {
|
||||
return fSyncRegisterDataAccess;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public IWatchExpressionFactoryAdapter2 getWatchExpressionFactory() {
|
||||
if ( fBitFieldExpressionFactory == null ) {
|
||||
fBitFieldExpressionFactory = new BitFieldExpressionFactory();
|
||||
|
|
|
@ -143,6 +143,9 @@ public class RegisterGroupVMNode extends AbstractExpressionVMNode
|
|||
return fSyncRegisterDataAccess;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public IWatchExpressionFactoryAdapter2 getWatchExpressionFactory() {
|
||||
if ( fRegisterGroupExpressionFactory == null ) {
|
||||
fRegisterGroupExpressionFactory = new RegisterGroupExpressionFactory();
|
||||
|
|
|
@ -165,6 +165,9 @@ public class RegisterVMNode extends AbstractExpressionVMNode
|
|||
return fFormattedPrefStore;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public IWatchExpressionFactoryAdapter2 getWatchExpressionFactory() {
|
||||
if ( fRegisterExpressionFactory == null ) {
|
||||
fRegisterExpressionFactory = new RegisterExpressionFactory();
|
||||
|
|
|
@ -13,7 +13,7 @@ package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.action
|
|||
import org.eclipse.dd.dsf.ui.viewmodel.update.AllUpdateScope;
|
||||
|
||||
/**
|
||||
*
|
||||
* @since 1.1
|
||||
*/
|
||||
public class AllUpdateScopeAction extends SelectUpdateScopeAction {
|
||||
|
||||
|
|
|
@ -16,6 +16,9 @@ import org.eclipse.dd.dsf.debug.internal.ui.DsfDebugUIPlugin;
|
|||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public class AtomicUpdatePolicyAction extends AbstractVMProviderActionDelegate {
|
||||
|
||||
private final static String ATOMIC_UPDATE = "ATOMIC_UPDATE";
|
||||
|
|
|
@ -16,6 +16,9 @@ import org.eclipse.dd.dsf.debug.internal.ui.DsfDebugUIPlugin;
|
|||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public class NonAtomicUpdatePolicyAction extends AbstractVMProviderActionDelegate {
|
||||
|
||||
private final static String ATOMIC_UPDATE = "ATOMIC_UPDATE";
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.eclipse.jface.viewers.ISelection;
|
|||
import org.eclipse.ui.IViewPart;
|
||||
|
||||
/**
|
||||
*
|
||||
* @since 1.1
|
||||
*/
|
||||
public class SelectUpdateScopeAction extends AbstractVMProviderActionDelegate {
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.action
|
|||
import org.eclipse.dd.dsf.ui.viewmodel.update.VisibleUpdateScope;
|
||||
|
||||
/**
|
||||
*
|
||||
* @since 1.1
|
||||
*/
|
||||
public class VisibleUpdateScopeAction extends SelectUpdateScopeAction {
|
||||
|
||||
|
|
|
@ -458,6 +458,9 @@ public class SyncVariableDataAccess {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public class CanWriteExpressionQuery extends Query<Boolean> {
|
||||
|
||||
private IExpressionDMContext fDmc;
|
||||
|
|
|
@ -14,6 +14,9 @@ package org.eclipse.dd.dsf.debug.ui;
|
|||
import org.eclipse.dd.dsf.debug.internal.ui.DsfDebugUIPlugin;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public class DsfDebugUITools {
|
||||
|
||||
public static IPreferenceStore getPreferenceStore()
|
||||
|
|
|
@ -768,6 +768,9 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl
|
|||
startAnnotationClearingJob(e.getDMContext());
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(SteppingTimedOutEvent e) {
|
||||
startAnnotationClearingJob(e.getDMContext());
|
||||
|
|
|
@ -20,9 +20,15 @@
|
|||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
|
@ -13,6 +13,10 @@ package org.eclipse.dd.dsf.debug.service;
|
|||
import org.eclipse.dd.dsf.debug.service.command.ICommandControl;
|
||||
import org.eclipse.dd.dsf.service.DsfSession;
|
||||
|
||||
/**
|
||||
* Convenience base class for {@link IDsfDebugServicesFactory}
|
||||
* @since 1.1
|
||||
*/
|
||||
public abstract class AbstractDsfDebugServicesFactory implements IDsfDebugServicesFactory {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
|
@ -12,9 +12,10 @@ package org.eclipse.dd.dsf.debug.service;
|
|||
|
||||
import org.eclipse.dd.dsf.service.DsfSession;
|
||||
|
||||
/*
|
||||
/**
|
||||
* A factory to create DSF services. Using this interface allows
|
||||
* to easily have different service implementation for different backends.
|
||||
* @since 1.1
|
||||
*/
|
||||
public interface IDsfDebugServicesFactory {
|
||||
<V> V createService(Class<V> clazz, DsfSession session, Object ... optionalArguments);
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.eclipse.dd.dsf.datamodel.IDMService;
|
|||
* This service provides a relatively simple interface for
|
||||
* manipulating processes as compared with a full-blown
|
||||
* remote target debugger.
|
||||
* @since 1.1
|
||||
*/
|
||||
public interface IProcesses extends IDMService {
|
||||
|
||||
|
|
|
@ -20,9 +20,15 @@
|
|||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
|
@ -65,8 +65,13 @@ import org.eclipse.swt.widgets.Display;
|
|||
abstract public class AbstractVMProvider implements IVMProvider, IVMEventListener
|
||||
{
|
||||
// debug flags
|
||||
/** @since 1.1 */
|
||||
public static String DEBUG_PRESENTATION_ID = null;
|
||||
|
||||
/** @since 1.1 */
|
||||
public static boolean DEBUG_CONTENT_PROVIDER = false;
|
||||
|
||||
/** @since 1.1 */
|
||||
public static boolean DEBUG_DELTA = false;
|
||||
|
||||
static {
|
||||
|
@ -385,6 +390,7 @@ abstract public class AbstractVMProvider implements IVMProvider, IVMEventListene
|
|||
return false;
|
||||
}
|
||||
|
||||
/** @since 1.1 */
|
||||
public boolean shouldWaitHandleEventToComplete() {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -103,10 +103,12 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy, IVMModelProxy
|
|||
return fRootElement;
|
||||
}
|
||||
|
||||
public Object getViewerInput() {
|
||||
/** @since 1.1 */
|
||||
public Object getViewerInput() {
|
||||
return fRootElement;
|
||||
}
|
||||
|
||||
/** @since 1.1 */
|
||||
public TreePath getRootPath() {
|
||||
return TreePath.EMPTY;
|
||||
}
|
||||
|
@ -237,6 +239,8 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy, IVMModelProxy
|
|||
* Returns the viewer this proxy is installed in.
|
||||
*
|
||||
* @return viewer or <code>null</code> if not installed
|
||||
*
|
||||
* @since 1.1
|
||||
*/
|
||||
public Viewer getViewer() {
|
||||
return fViewer;
|
||||
|
|
|
@ -16,6 +16,8 @@ import org.eclipse.jface.viewers.Viewer;
|
|||
/**
|
||||
* View Model extension to IVMModelProxy interface. This extension
|
||||
* allows access to the viewer.
|
||||
*
|
||||
* @since 1.1
|
||||
*/
|
||||
public interface IVMModelProxyExtension extends IVMModelProxy {
|
||||
|
||||
|
|
|
@ -340,6 +340,8 @@ abstract public class AbstractDMVMNode extends AbstractVMNode implements IVMNode
|
|||
* @param update the viewer update request
|
||||
* @param dmcs the data model contexts
|
||||
* @param firstIndex the index of the first data model context
|
||||
*
|
||||
* @since 1.1
|
||||
*/
|
||||
protected void fillUpdateWithVMCs(IChildrenUpdate update, IDMContext[] dmcs, int firstIndex) {
|
||||
int updateIdx = update.getOffset() != -1 ? update.getOffset() : 0;
|
||||
|
|
|
@ -68,6 +68,9 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
|||
private boolean fDelayEventHandleForViewUpdate = false;
|
||||
|
||||
// debug flags
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public static boolean DEBUG_CACHE = false;
|
||||
|
||||
static {
|
||||
|
@ -305,6 +308,10 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
|||
}
|
||||
|
||||
protected static String SELECTED_UPDATE_MODE = "org.eclipse.dd.dsf.ui.viewmodel.update.selectedUpdateMode"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
protected static String SELECTED_UPDATE_SCOPE = "org.eclipse.dd.dsf.ui.viewmodel.update.selectedUpdateScope"; //$NON-NLS-1$
|
||||
|
||||
private IVMUpdatePolicy[] fAvailableUpdatePolicies;
|
||||
|
@ -351,6 +358,9 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
|||
return new IVMUpdatePolicy[] { new AutomaticUpdatePolicy() };
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
protected IVMUpdateScope[] createUpdateScopes() {
|
||||
return new IVMUpdateScope[] { new VisibleUpdateScope(), new AllUpdateScope() };
|
||||
}
|
||||
|
@ -1230,10 +1240,16 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public IVMUpdateScope[] getAvailableUpdateScopes() {
|
||||
return fAvailableUpdateScopes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public IVMUpdateScope getActiveUpdateScope() {
|
||||
String updateScopeId = (String)getPresentationContext().getProperty(SELECTED_UPDATE_SCOPE);
|
||||
if (updateScopeId != null) {
|
||||
|
@ -1248,14 +1264,21 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
|||
return getAvailableUpdateScopes()[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public void setActiveUpdateScope(IVMUpdateScope updateScope) {
|
||||
getPresentationContext().setProperty(SELECTED_UPDATE_SCOPE, updateScope.getID());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldWaitHandleEventToComplete() {
|
||||
return fDelayEventHandleForViewUpdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
protected void setDelayEventHandleForViewUpdate(boolean on) {
|
||||
fDelayEventHandleForViewUpdate = on;
|
||||
}
|
||||
|
|
|
@ -16,6 +16,8 @@ import org.eclipse.jface.viewers.TreePath;
|
|||
* An "automatic" update policy which causes the view model provider cache to
|
||||
* be flushed whenever an event causes a delta to be generated in the given
|
||||
* model.
|
||||
*
|
||||
* @since 1.1
|
||||
*/
|
||||
public class AllUpdateScope implements IVMUpdateScope {
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
package org.eclipse.dd.dsf.ui.viewmodel.update;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public interface IVMUpdateScope {
|
||||
|
||||
|
|
|
@ -12,6 +12,8 @@ package org.eclipse.dd.dsf.ui.viewmodel.update;
|
|||
|
||||
/**
|
||||
* An update policy decorator which can override behaviour of an underlying update policy.
|
||||
*
|
||||
* @since 1.1
|
||||
*/
|
||||
public abstract class UpdatePolicyDecorator implements IVMUpdatePolicy {
|
||||
|
||||
|
|
|
@ -18,7 +18,13 @@ public class ViewModelUpdateMessages extends NLS {
|
|||
|
||||
public static String AutomaticUpdatePolicy_name;
|
||||
public static String ManualUpdatePolicy_name;
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public static String AllUpdateScope_name;
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public static String VisibleUpdateScope_name;
|
||||
|
||||
static {
|
||||
|
|
|
@ -16,6 +16,7 @@ import org.eclipse.jface.viewers.TreePath;
|
|||
* An "automatic" update policy which causes the view model provider cache to
|
||||
* be flushed whenever an event causes a delta to be generated in the given
|
||||
* model.
|
||||
* @since 1.1
|
||||
*/
|
||||
public class VisibleUpdateScope implements IVMUpdateScope {
|
||||
|
||||
|
|
|
@ -20,9 +20,15 @@
|
|||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
|
@ -78,6 +78,7 @@ public class DMContexts {
|
|||
* @param ctx DMC to search.
|
||||
* @param ancestorType Class type of the desired DMC ancestor.
|
||||
* @return Returns all ancestors found, null if none.
|
||||
* @since 1.1
|
||||
*/
|
||||
@ThreadSafe
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
|
@ -0,0 +1,272 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2008 Wind River Systems 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.examples.dsf.dataviewer;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.dd.dsf.concurrent.ConfinedToDsfExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.ThreadSafe;
|
||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.ImmediateExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.Query;
|
||||
import org.eclipse.dd.dsf.ui.concurrent.DisplayDsfExecutor;
|
||||
import org.eclipse.jface.viewers.ILazyContentProvider;
|
||||
import org.eclipse.jface.viewers.TableViewer;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Font;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Table;
|
||||
|
||||
/**
|
||||
* Data viewer based on a table, which reads data using asynchronous methods.
|
||||
* <p>
|
||||
* This viewer implements the {@link ILazyContentProvider} interface
|
||||
* which is used by the JFace TableViewer class to populate a Table. This
|
||||
* interface contains separate asynchronous methods for requesting the count
|
||||
* and values for individual indexes, which neatly correspond to the methods
|
||||
* in {@link IDataGenerator}. As an added optimization, this viewer
|
||||
* implementation checks for the range of visible items in the view upon each
|
||||
* request, and it cancels old requests which scroll out of view but have not
|
||||
* been completed yet. However, it is up to the data generator implementation
|
||||
* to check the canceled state of the requests and ignore them.
|
||||
* </p>
|
||||
*/
|
||||
@ConfinedToDsfExecutor("fDisplayExecutor")
|
||||
public class AsyncDataViewer
|
||||
implements ILazyContentProvider, IDataGenerator.Listener
|
||||
{
|
||||
// Executor to use instead of Display.asyncExec().
|
||||
@ThreadSafe
|
||||
final private DsfExecutor fDisplayExecutor;
|
||||
|
||||
// The viewer and generator that this content provider using.
|
||||
final private TableViewer fViewer;
|
||||
final private IDataGenerator fDataGenerator;
|
||||
|
||||
// Fields used in request cancellation logic.
|
||||
private List<ValueDataRequestMonitor> fItemDataRequestMonitors = new LinkedList<ValueDataRequestMonitor>();
|
||||
private Set<Integer> fIndexesToCancel = new HashSet<Integer>();
|
||||
private int fCancelCallsPending = 0;
|
||||
|
||||
public AsyncDataViewer(TableViewer viewer, IDataGenerator generator) {
|
||||
fViewer = viewer;
|
||||
fDisplayExecutor = DisplayDsfExecutor.getDisplayDsfExecutor(fViewer.getTable().getDisplay());
|
||||
fDataGenerator = generator;
|
||||
fDataGenerator.addListener(this);
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
fDataGenerator.removeListener(this);
|
||||
}
|
||||
|
||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||
// Set the initial count to the viewer after the input is set.
|
||||
queryItemCount();
|
||||
}
|
||||
|
||||
public void updateElement(final int index) {
|
||||
// Calculate the visible index range.
|
||||
final int topIdx = fViewer.getTable().getTopIndex();
|
||||
final int botIdx = topIdx + getVisibleItemCount(topIdx);
|
||||
|
||||
// Request the item for the given index.
|
||||
queryValue(index);
|
||||
|
||||
// Invoke a cancel task with a delay. The delay allows multiple cancel
|
||||
// calls to be combined together improving performance of the viewer.
|
||||
fCancelCallsPending++;
|
||||
fDisplayExecutor.schedule(
|
||||
new Runnable() { public void run() {
|
||||
cancelStaleRequests(topIdx, botIdx);
|
||||
}},
|
||||
1, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
private int getVisibleItemCount(int top) {
|
||||
Table table = fViewer.getTable();
|
||||
int itemCount = table.getItemCount();
|
||||
return Math.min((table.getBounds().height / table.getItemHeight()) + 2, itemCount - top);
|
||||
}
|
||||
|
||||
@ThreadSafe
|
||||
public void countChanged() {
|
||||
queryItemCount();
|
||||
}
|
||||
|
||||
@ThreadSafe
|
||||
public void valuesChanged(final Set<Integer> indexes) {
|
||||
// Mark the changed items in table viewer as dirty, this will
|
||||
// trigger update requests for these indexes if they are
|
||||
// visible in the viewer.
|
||||
final TableViewer tableViewer = fViewer;
|
||||
fDisplayExecutor.execute( new Runnable() {
|
||||
public void run() {
|
||||
if (!fViewer.getTable().isDisposed()) {
|
||||
for (Integer index : indexes) {
|
||||
tableViewer.clear(index);
|
||||
}
|
||||
}
|
||||
}});
|
||||
}
|
||||
|
||||
|
||||
private void queryItemCount() {
|
||||
// Request count from data provider. When the count is returned, we
|
||||
// have to re-dispatch into the display thread to avoid calling
|
||||
// the table widget on the DSF dispatch thread.
|
||||
fIndexesToCancel.clear();
|
||||
fDataGenerator.getCount(
|
||||
// Use the display executor to construct the request monitor, this
|
||||
// will cause the handleCompleted() method to be automatically
|
||||
// called on the display thread.
|
||||
new DataRequestMonitor<Integer>(fDisplayExecutor, null) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (!fViewer.getTable().isDisposed()) {
|
||||
fViewer.setItemCount(getData());
|
||||
fViewer.getTable().clearAll();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Dedicated class for data item requests. This class holds the index
|
||||
// argument so it can be examined when canceling stale requests.
|
||||
private class ValueDataRequestMonitor extends DataRequestMonitor<String> {
|
||||
|
||||
/** Index is used when canceling stale requests. */
|
||||
int fIndex;
|
||||
|
||||
ValueDataRequestMonitor(int index) {
|
||||
super(fDisplayExecutor, null);
|
||||
fIndex = index;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
fItemDataRequestMonitors.remove(this);
|
||||
|
||||
// Check if the request completed successfully, otherwise ignore it.
|
||||
if (isSuccess()) {
|
||||
if (!fViewer.getTable().isDisposed()) {
|
||||
fViewer.replace(getData(), fIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void queryValue(final int index) {
|
||||
ValueDataRequestMonitor rm = new ValueDataRequestMonitor(index);
|
||||
fItemDataRequestMonitors.add(rm);
|
||||
fDataGenerator.getValue(index, rm);
|
||||
}
|
||||
|
||||
private void cancelStaleRequests(int topIdx, int botIdx) {
|
||||
// Decrement the count of outstanding cancel calls.
|
||||
fCancelCallsPending--;
|
||||
|
||||
// Must check again, in case disposed while re-dispatching.
|
||||
if (fDataGenerator == null || fViewer.getTable().isDisposed()) return;
|
||||
|
||||
// Go through the outstanding requests and cancel any that
|
||||
// are not visible anymore.
|
||||
for (Iterator<ValueDataRequestMonitor> itr = fItemDataRequestMonitors.iterator(); itr.hasNext();) {
|
||||
ValueDataRequestMonitor item = itr.next();
|
||||
if (item.fIndex < topIdx || item.fIndex > botIdx) {
|
||||
// Set the item to canceled status, so that the data provider
|
||||
// will ignore it.
|
||||
item.cancel();
|
||||
|
||||
// Add the item index to list of indexes that were canceled,
|
||||
// which will be sent to the table widget.
|
||||
fIndexesToCancel.add(item.fIndex);
|
||||
|
||||
// Remove the item from the outstanding cancel requests.
|
||||
itr.remove();
|
||||
}
|
||||
}
|
||||
if (!fIndexesToCancel.isEmpty() && fCancelCallsPending == 0) {
|
||||
Set<Integer> canceledIdxs = fIndexesToCancel;
|
||||
fIndexesToCancel = new HashSet<Integer>();
|
||||
|
||||
// Clear the indexes of the canceled request, so that the
|
||||
// viewer knows to request them again when needed.
|
||||
// Note: clearing using TableViewer.clear(int) seems very
|
||||
// inefficient, it's better to use Table.clear(int[]).
|
||||
int[] canceledIdxsArray = new int[canceledIdxs.size()];
|
||||
int i = 0;
|
||||
for (Integer index : canceledIdxs) {
|
||||
canceledIdxsArray[i++] = index;
|
||||
}
|
||||
fViewer.getTable().clear(canceledIdxsArray);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
// Create the shell to hold the viewer.
|
||||
Display display = new Display();
|
||||
Shell shell = new Shell(display, SWT.SHELL_TRIM);
|
||||
shell.setLayout(new GridLayout());
|
||||
GridData data = new GridData(GridData.FILL_BOTH);
|
||||
shell.setLayoutData(data);
|
||||
Font font = new Font(display, "Courier", 10, SWT.NORMAL);
|
||||
|
||||
// Create the table viewer.
|
||||
TableViewer tableViewer = new TableViewer(shell, SWT.BORDER | SWT.VIRTUAL);
|
||||
tableViewer.getControl().setLayoutData(data);
|
||||
|
||||
// Create the data generator.
|
||||
final IDataGenerator generator = new DataGeneratorWithExecutor();
|
||||
|
||||
// Create the content provider which will populate the viewer.
|
||||
AsyncDataViewer contentProvider = new AsyncDataViewer(tableViewer, generator);
|
||||
tableViewer.setContentProvider(contentProvider);
|
||||
tableViewer.setInput(new Object());
|
||||
|
||||
// Open the shell and service the display dispatch loop until user
|
||||
// closes the shell.
|
||||
shell.open();
|
||||
while (!shell.isDisposed()) {
|
||||
if (!display.readAndDispatch())
|
||||
display.sleep();
|
||||
}
|
||||
|
||||
// The IDataGenerator.shutdown() method is asynchronous, this requires
|
||||
// using a query again in order to wait for its completion.
|
||||
Query<Object> shutdownQuery = new Query<Object>() {
|
||||
@Override
|
||||
protected void execute(DataRequestMonitor<Object> rm) {
|
||||
generator.shutdown(rm);
|
||||
}
|
||||
};
|
||||
ImmediateExecutor.getInstance().execute(shutdownQuery);
|
||||
try {
|
||||
shutdownQuery.get();
|
||||
} catch (Exception e) {}
|
||||
|
||||
// Shut down the display.
|
||||
font.dispose();
|
||||
display.dispose();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,336 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2008 Wind River Systems 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.examples.dsf.dataviewer;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.DefaultDsfExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.DsfRunnable;
|
||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||
import org.eclipse.dd.examples.dsf.DsfExamplesPlugin;
|
||||
|
||||
/**
|
||||
* DSF Executor-based implementation of the data generator.
|
||||
* <p>
|
||||
* This generator uses a queue of client requests and processes these
|
||||
* requests periodically using a DSF executor. The main feature of this
|
||||
* generator is that it uses the executor as its only synchronization object.
|
||||
* This means that all the fields with the exception of the executor can only
|
||||
* be accessed while running in the executor thread.
|
||||
* </p>
|
||||
*/
|
||||
//TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
//indicating allowed thread access to this class/method/member
|
||||
public class DataGeneratorWithExecutor implements IDataGenerator {
|
||||
|
||||
// Request objects are used to serialize the interface calls into objects
|
||||
// which can then be pushed into a queue.
|
||||
// TODO Ecercise 4 - Add an annotationindicating allowed concurrency access
|
||||
// Hint: Request and its subclasses have all their fields declared as final.
|
||||
abstract class Request {
|
||||
final RequestMonitor fRequestMonitor;
|
||||
|
||||
Request(RequestMonitor rm) {
|
||||
fRequestMonitor = rm;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
class CountRequest extends Request {
|
||||
CountRequest(DataRequestMonitor<Integer> rm) {
|
||||
super(rm);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
class ItemRequest extends Request {
|
||||
final int fIndex;
|
||||
ItemRequest(int index, DataRequestMonitor<String> rm) {
|
||||
super(rm);
|
||||
fIndex = index;
|
||||
}
|
||||
}
|
||||
|
||||
// The executor used to access all internal data of the generator.
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
// Hint: If a member does not have an annotation, the programmer can assume
|
||||
// that the concurrency rule that applies to the class also applies to this
|
||||
// member.
|
||||
private DsfExecutor fExecutor;
|
||||
|
||||
// Main request queue of the data generator. The getValue(), getCount(),
|
||||
// and shutdown() methods write into the queue, while the serviceQueue()
|
||||
// method reads from it.
|
||||
// The executor used to access all internal data of the generator.
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
private List<Request> fQueue = new LinkedList<Request>();
|
||||
|
||||
// List of listeners is not synchronized, it also has to be accessed
|
||||
// using the executor.
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
private List<Listener> fListeners = new LinkedList<Listener>();
|
||||
|
||||
// Current number of elements in this generator.
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
private int fCount = MIN_COUNT;
|
||||
|
||||
// Counter used to determine when to reset the element count.
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
private int fCountResetTrigger = 0;
|
||||
|
||||
// Elements which were modified since the last reset.
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
private Set<Integer> fChangedIndexes = new HashSet<Integer>();
|
||||
|
||||
// Flag used to ensure that requests are processed sequentially.
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
private boolean fServiceQueueInProgress = false;
|
||||
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
public DataGeneratorWithExecutor() {
|
||||
// Create the executor
|
||||
fExecutor = new DefaultDsfExecutor("Supplier Executor");
|
||||
|
||||
// Schedule a runnable to make the random changes.
|
||||
fExecutor.scheduleAtFixedRate(
|
||||
new DsfRunnable() {
|
||||
public void run() {
|
||||
randomChanges();
|
||||
}
|
||||
},
|
||||
RANDOM_CHANGE_INTERVAL,
|
||||
RANDOM_CHANGE_INTERVAL,
|
||||
TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
public void shutdown(final RequestMonitor rm) {
|
||||
try {
|
||||
fExecutor.execute( new DsfRunnable() {
|
||||
public void run() {
|
||||
// Empty the queue of requests and fail them.
|
||||
for (Request request : fQueue) {
|
||||
request.fRequestMonitor.setStatus(
|
||||
new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down"));
|
||||
request.fRequestMonitor.done();
|
||||
}
|
||||
fQueue.clear();
|
||||
|
||||
// Kill executor.
|
||||
fExecutor.shutdown();
|
||||
rm.done();
|
||||
}
|
||||
});
|
||||
} catch (RejectedExecutionException e) {
|
||||
rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down"));
|
||||
rm.done();
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
public void getCount(final DataRequestMonitor<Integer> rm) {
|
||||
try {
|
||||
fExecutor.execute( new DsfRunnable() {
|
||||
public void run() {
|
||||
fQueue.add(new CountRequest(rm));
|
||||
serviceQueue();
|
||||
}
|
||||
});
|
||||
} catch (RejectedExecutionException e) {
|
||||
rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down"));
|
||||
rm.done();
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
public void getValue(final int index, final DataRequestMonitor<String> rm) {
|
||||
try {
|
||||
fExecutor.execute( new DsfRunnable() {
|
||||
public void run() {
|
||||
fQueue.add(new ItemRequest(index, rm));
|
||||
serviceQueue();
|
||||
}
|
||||
});
|
||||
} catch (RejectedExecutionException e) {
|
||||
rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down"));
|
||||
rm.done();
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
public void addListener(final Listener listener) {
|
||||
try {
|
||||
fExecutor.execute( new DsfRunnable() {
|
||||
public void run() {
|
||||
fListeners.add(listener);
|
||||
}
|
||||
});
|
||||
} catch (RejectedExecutionException e) {}
|
||||
}
|
||||
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
public void removeListener(final Listener listener) {
|
||||
try {
|
||||
fExecutor.execute( new DsfRunnable() {
|
||||
public void run() {
|
||||
fListeners.remove(listener);
|
||||
}
|
||||
});
|
||||
} catch (RejectedExecutionException e) {}
|
||||
}
|
||||
|
||||
// Main processing function of this generator.
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
private void serviceQueue() {
|
||||
|
||||
// TODO Exercise 3 - Add logic to discard cancelled requests from queue.
|
||||
// Hint: Since serviceQueue() is called using the executor, and the
|
||||
// fQueue list can only be modified when running in the executor
|
||||
// thread. This method can safely iterate and modify fQueue without
|
||||
// risk of race conditions or concurrent modification exceptions.
|
||||
|
||||
// If a queue servicing is already scheduled, do nothing.
|
||||
if (fServiceQueueInProgress) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (fQueue.size() != 0) {
|
||||
// If there are requests to service, remove one from the queue and
|
||||
// schedule a runnable to process the request after a processing
|
||||
// delay.
|
||||
fServiceQueueInProgress = true;
|
||||
final Request request = fQueue.remove(0);
|
||||
fExecutor.schedule(
|
||||
new DsfRunnable() {
|
||||
public void run() {
|
||||
if (request instanceof CountRequest) {
|
||||
processCountRequest((CountRequest)request);
|
||||
} else if (request instanceof ItemRequest) {
|
||||
processItemRequest((ItemRequest)request);
|
||||
}
|
||||
|
||||
// Reset the processing flag and process next
|
||||
// request.
|
||||
fServiceQueueInProgress = false;
|
||||
serviceQueue();
|
||||
}
|
||||
},
|
||||
PROCESSING_DELAY, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
private void processCountRequest(CountRequest request) {
|
||||
@SuppressWarnings("unchecked") // Suppress warning about lost type info.
|
||||
DataRequestMonitor<Integer> rm = (DataRequestMonitor<Integer>)request.fRequestMonitor;
|
||||
|
||||
rm.setData(fCount);
|
||||
rm.done();
|
||||
}
|
||||
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
private void processItemRequest(ItemRequest request) {
|
||||
@SuppressWarnings("unchecked") // Suppress warning about lost type info.
|
||||
DataRequestMonitor<String> rm = (DataRequestMonitor<String>)request.fRequestMonitor;
|
||||
|
||||
if (fChangedIndexes.contains(request.fIndex)) {
|
||||
rm.setData("Changed: " + request.fIndex);
|
||||
} else {
|
||||
rm.setData(Integer.toString(request.fIndex));
|
||||
}
|
||||
rm.done();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method simulates changes in the supplier's data set.
|
||||
*/
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
private void randomChanges() {
|
||||
// Once every number of changes, reset the count, the rest of the
|
||||
// times just change certain values.
|
||||
if (++fCountResetTrigger % RANDOM_COUNT_CHANGE_INTERVALS == 0){
|
||||
randomCountReset();
|
||||
} else {
|
||||
randomDataChange();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates new size for provider's data set.
|
||||
*/
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
private void randomCountReset() {
|
||||
// Calculate the new count.
|
||||
Random random = new java.util.Random();
|
||||
fCount = MIN_COUNT + Math.abs(random.nextInt()) % (MAX_COUNT - MIN_COUNT);
|
||||
|
||||
// Reset the changed values.
|
||||
fChangedIndexes.clear();
|
||||
|
||||
// Notify listeners
|
||||
for (Listener listener : fListeners) {
|
||||
listener.countChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidates a random range of indexes.
|
||||
*/
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
private void randomDataChange() {
|
||||
// Calculate the indexes to change.
|
||||
Random random = new java.util.Random();
|
||||
Set<Integer> set = new HashSet<Integer>();
|
||||
for (int i = 0; i < fCount * RANDOM_CHANGE_SET_PERCENTAGE / 100; i++) {
|
||||
set.add( new Integer(Math.abs(random.nextInt()) % fCount) );
|
||||
}
|
||||
|
||||
// Add the indexes to an overall set of changed indexes.
|
||||
fChangedIndexes.addAll(set);
|
||||
|
||||
// Notify listeners
|
||||
for (Listener listener : fListeners) {
|
||||
listener.valuesChanged(set);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,238 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2008 Wind River Systems 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.examples.dsf.dataviewer;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.ListenerList;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||
import org.eclipse.dd.examples.dsf.DsfExamplesPlugin;
|
||||
|
||||
/**
|
||||
* Thread-based implementation of the data generator.
|
||||
* <p>
|
||||
* This generator is based around a queue of client requests and a thread which
|
||||
* reads the requests from the queue and processes them. The distinguishing
|
||||
* feature of this generator is that it uses a a blocking queue as the main
|
||||
* synchronization object. However, fListeners, fShutdown, and fChangedIndexes
|
||||
* fields also need to be thread-safe and so they implement their own
|
||||
* synchronization.
|
||||
* </p>
|
||||
*/
|
||||
public class DataGeneratorWithThread extends Thread implements IDataGenerator {
|
||||
|
||||
// Request objects are used to serialize the interface calls into objects
|
||||
// which can then be pushed into a queue.
|
||||
abstract class Request {
|
||||
final RequestMonitor fRequestMonitor;
|
||||
|
||||
Request(RequestMonitor rm) {
|
||||
fRequestMonitor = rm;
|
||||
}
|
||||
}
|
||||
|
||||
class CountRequest extends Request {
|
||||
CountRequest(DataRequestMonitor<Integer> rm) {
|
||||
super(rm);
|
||||
}
|
||||
}
|
||||
|
||||
class ItemRequest extends Request {
|
||||
final int fIndex;
|
||||
ItemRequest(int index, DataRequestMonitor<String> rm) {
|
||||
super(rm);
|
||||
fIndex = index;
|
||||
}
|
||||
}
|
||||
|
||||
class ShutdownRequest extends Request {
|
||||
ShutdownRequest(RequestMonitor rm) {
|
||||
super(rm);
|
||||
}
|
||||
}
|
||||
|
||||
// Main request queue of the data generator. The getValue(), getCount(),
|
||||
// and shutdown() methods write into the queue, while the run() method
|
||||
// reads from it.
|
||||
private final BlockingQueue<Request> fQueue = new LinkedBlockingQueue<Request>();
|
||||
|
||||
// ListenerList class provides thread safety.
|
||||
private ListenerList fListeners = new ListenerList();
|
||||
|
||||
// Current number of elements in this generator.
|
||||
private int fCount = MIN_COUNT;
|
||||
|
||||
// Counter used to determine when to reset the element count.
|
||||
private int fCountResetTrigger = 0;
|
||||
|
||||
// Elements which were modified since the last reset.
|
||||
private Set<Integer> fChangedIndexes = Collections.synchronizedSet(new HashSet<Integer>());
|
||||
|
||||
// Used to determine when to make changes in data.
|
||||
private long fLastChangeTime = System.currentTimeMillis();
|
||||
|
||||
// Flag indicating when the generator has been shut down.
|
||||
private AtomicBoolean fShutdown = new AtomicBoolean(false);
|
||||
|
||||
public DataGeneratorWithThread() {
|
||||
// Immediately kick off the request processing thread.
|
||||
start();
|
||||
}
|
||||
|
||||
public void shutdown(RequestMonitor rm) {
|
||||
// Mark the generator as shut down. After the fShutdown flag is set,
|
||||
// all new requests should be shut down.
|
||||
if (!fShutdown.getAndSet(true)) {
|
||||
fQueue.add(new ShutdownRequest(rm));
|
||||
} else {
|
||||
//
|
||||
rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down"));
|
||||
rm.done();
|
||||
}
|
||||
}
|
||||
|
||||
public void getCount(DataRequestMonitor<Integer> rm) {
|
||||
if (!fShutdown.get()) {
|
||||
fQueue.add(new CountRequest(rm));
|
||||
} else {
|
||||
rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down"));
|
||||
rm.done();
|
||||
}
|
||||
}
|
||||
|
||||
public void getValue(int index, DataRequestMonitor<String> rm) {
|
||||
if (!fShutdown.get()) {
|
||||
fQueue.add(new ItemRequest(index, rm));
|
||||
} else {
|
||||
rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down"));
|
||||
rm.done();
|
||||
}
|
||||
}
|
||||
|
||||
public void addListener(Listener listener) {
|
||||
fListeners.add(listener);
|
||||
}
|
||||
|
||||
public void removeListener(Listener listener) {
|
||||
fListeners.remove(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
while(true) {
|
||||
// Get the next request from the queue. The time-out
|
||||
// ensures that that the random changes get processed.
|
||||
final Request request = fQueue.poll(100, TimeUnit.MILLISECONDS);
|
||||
|
||||
// If a request was dequeued, process it.
|
||||
if (request != null) {
|
||||
// Simulate a processing delay.
|
||||
Thread.sleep(PROCESSING_DELAY);
|
||||
|
||||
if (request instanceof CountRequest) {
|
||||
processCountRequest((CountRequest)request);
|
||||
} else if (request instanceof ItemRequest) {
|
||||
processItemRequest((ItemRequest)request);
|
||||
} else if (request instanceof ShutdownRequest) {
|
||||
// If shutting down, just break out of the while(true)
|
||||
// loop and thread will exit.
|
||||
request.fRequestMonitor.done();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Simulate data changes.
|
||||
randomChanges();
|
||||
}
|
||||
}
|
||||
catch (InterruptedException x) {}
|
||||
}
|
||||
|
||||
private void processCountRequest(CountRequest request) {
|
||||
@SuppressWarnings("unchecked") // Suppress warning about lost type info.
|
||||
DataRequestMonitor<Integer> rm = (DataRequestMonitor<Integer>)request.fRequestMonitor;
|
||||
|
||||
rm.setData(fCount);
|
||||
rm.done();
|
||||
}
|
||||
|
||||
private void processItemRequest(ItemRequest request) {
|
||||
@SuppressWarnings("unchecked") // Suppress warning about lost type info.
|
||||
DataRequestMonitor<String> rm = (DataRequestMonitor<String>)request.fRequestMonitor;
|
||||
|
||||
if (fChangedIndexes.contains(request.fIndex)) {
|
||||
rm.setData("Changed: " + request.fIndex);
|
||||
} else {
|
||||
rm.setData(Integer.toString(request.fIndex));
|
||||
}
|
||||
rm.done();
|
||||
}
|
||||
|
||||
|
||||
private void randomChanges() {
|
||||
// Check if enough time is elapsed.
|
||||
if (System.currentTimeMillis() > fLastChangeTime + RANDOM_CHANGE_INTERVAL) {
|
||||
fLastChangeTime = System.currentTimeMillis();
|
||||
|
||||
// Once every number of changes, reset the count, the rest of the
|
||||
// times just change certain values.
|
||||
if (++fCountResetTrigger % RANDOM_COUNT_CHANGE_INTERVALS == 0){
|
||||
randomCountReset();
|
||||
} else {
|
||||
randomDataChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void randomCountReset() {
|
||||
// Calculate the new count.
|
||||
Random random = new java.util.Random();
|
||||
fCount = MIN_COUNT + Math.abs(random.nextInt()) % (MAX_COUNT - MIN_COUNT);
|
||||
|
||||
// Reset the changed values.
|
||||
fChangedIndexes.clear();
|
||||
|
||||
// Notify listeners
|
||||
for (Object listener : fListeners.getListeners()) {
|
||||
((Listener)listener).countChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void randomDataChange() {
|
||||
// Calculate the indexes to change.
|
||||
Random random = new java.util.Random();
|
||||
Set<Integer> set = new HashSet<Integer>();
|
||||
for (int i = 0; i < fCount * RANDOM_CHANGE_SET_PERCENTAGE / 100; i++) {
|
||||
set.add( new Integer(Math.abs(random.nextInt()) % fCount) );
|
||||
}
|
||||
|
||||
// Add the indexes to an overall set of changed indexes.
|
||||
fChangedIndexes.addAll(set);
|
||||
|
||||
// Notify listeners
|
||||
for (Object listener : fListeners.getListeners()) {
|
||||
((Listener)listener).valuesChanged(set);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2008 Wind River Systems 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.examples.dsf.dataviewer;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||
|
||||
/**
|
||||
* Data generator is simple source of data used to populate the example table
|
||||
* view. It contains two asynchronous methods for retrieving the data
|
||||
* parameters: the count and the value for a given index. It also allows the
|
||||
* view to receive events indicating when the data supplied by the generator
|
||||
* is changed.
|
||||
*/
|
||||
// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor)
|
||||
// indicating allowed thread access to this class/method/member
|
||||
public interface IDataGenerator {
|
||||
|
||||
// Constants which control the data generator behavior.
|
||||
// Changing the count range can stress the scalability of the system, while
|
||||
// changing of the process delay and random change interval can stress
|
||||
// its performance.
|
||||
final static int MIN_COUNT = 100;
|
||||
final static int MAX_COUNT = 200;
|
||||
final static int PROCESSING_DELAY = 10;
|
||||
final static int RANDOM_CHANGE_INTERVAL = 10000;
|
||||
final static int RANDOM_COUNT_CHANGE_INTERVALS = 3;
|
||||
final static int RANDOM_CHANGE_SET_PERCENTAGE = 10;
|
||||
|
||||
|
||||
// Listener interface that the view needs to implement to react
|
||||
// to the changes in data.
|
||||
public interface Listener {
|
||||
void countChanged();
|
||||
void valuesChanged(Set<Integer> indexes);
|
||||
}
|
||||
|
||||
// Data access methods.
|
||||
void getCount(DataRequestMonitor<Integer> rm);
|
||||
void getValue(int index, DataRequestMonitor<String> rm);
|
||||
|
||||
// Method used to shutdown the data generator including any threads that
|
||||
// it may use.
|
||||
void shutdown(RequestMonitor rm);
|
||||
|
||||
// Methods for registering change listeners.
|
||||
void addListener(Listener listener);
|
||||
void removeListener(Listener listener);
|
||||
}
|
|
@ -0,0 +1,183 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008 Wind River Systems 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.examples.dsf.dataviewer;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.ImmediateExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.Query;
|
||||
import org.eclipse.jface.viewers.IStructuredContentProvider;
|
||||
import org.eclipse.jface.viewers.TableViewer;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Font;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
/**
|
||||
* Data viewer based on a table, which reads data using synchronous methods.
|
||||
* <p>
|
||||
* This viewer implements the {@link IStructuredContentProvider} interface
|
||||
* which is used by the JFace TableViewer class to populate a Table. This
|
||||
* interface contains one principal methods for reading data {@link #getElements(Object)},
|
||||
* which synchronously returns an array of elements. In order to implement this
|
||||
* method using the asynchronous data generator, this provider uses the
|
||||
* {@link Query} object.
|
||||
* </p>
|
||||
*/
|
||||
public class SyncDataViewer
|
||||
implements IStructuredContentProvider, IDataGenerator.Listener
|
||||
{
|
||||
// The viewer and generator that this content provider using.
|
||||
final private TableViewer fViewer;
|
||||
final private IDataGenerator fDataGenerator;
|
||||
|
||||
public SyncDataViewer(TableViewer viewer, IDataGenerator generator) {
|
||||
fViewer = viewer;
|
||||
fDataGenerator = generator;
|
||||
fDataGenerator.addListener(this);
|
||||
}
|
||||
|
||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||
// Not used
|
||||
}
|
||||
|
||||
|
||||
public Object[] getElements(Object inputElement) {
|
||||
|
||||
// Create the query object for reading data count.
|
||||
Query<Integer> countQuery = new Query<Integer>() {
|
||||
@Override
|
||||
protected void execute(DataRequestMonitor<Integer> rm) {
|
||||
fDataGenerator.getCount(rm);
|
||||
}
|
||||
};
|
||||
|
||||
// Submit the query to be executed. A query implements a runnable
|
||||
// interface and it has to be executed in order to do its work.
|
||||
ImmediateExecutor.getInstance().execute(countQuery);
|
||||
int count = 0;
|
||||
|
||||
// Block until the query completes, which will happen when the request
|
||||
// monitor of the execute() method is marked done.
|
||||
try {
|
||||
count = countQuery.get();
|
||||
} catch (Exception e) {
|
||||
// InterruptedException and ExecutionException can be thrown here.
|
||||
// ExecutionException containing a CoreException will be thrown
|
||||
// if an error status is set to the Query's request monitor.
|
||||
return new Object[0];
|
||||
}
|
||||
|
||||
// Create the array that will be filled with elements.
|
||||
// For each index in the array execute a query to get the element at
|
||||
// that index.
|
||||
final Object[] elements = new Object[count];
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
final int index = i;
|
||||
Query<String> valueQuery = new Query<String>() {
|
||||
@Override
|
||||
protected void execute(DataRequestMonitor<String> rm) {
|
||||
fDataGenerator.getValue(index, rm);
|
||||
}
|
||||
};
|
||||
ImmediateExecutor.getInstance().execute(valueQuery);
|
||||
try {
|
||||
elements[i] = valueQuery.get();
|
||||
} catch (Exception e) {
|
||||
elements[i] = "error";
|
||||
}
|
||||
}
|
||||
return elements;
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
fDataGenerator.removeListener(this);
|
||||
}
|
||||
|
||||
public void countChanged() {
|
||||
// For any event from the generator, refresh the whole viewer.
|
||||
refreshViewer();
|
||||
}
|
||||
|
||||
public void valuesChanged(Set<Integer> indexes) {
|
||||
// For any event from the generator, refresh the whole viewer.
|
||||
refreshViewer();
|
||||
}
|
||||
|
||||
private void refreshViewer() {
|
||||
// TODO Exercise 5 - Add a call to getElements() to force a deadlock.
|
||||
|
||||
// This method may be called on any thread, switch to the display
|
||||
// thread before calling the viewer.
|
||||
Display display = fViewer.getControl().getDisplay();
|
||||
display.asyncExec( new Runnable() {
|
||||
public void run() {
|
||||
if (!fViewer.getControl().isDisposed()) {
|
||||
fViewer.refresh();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// Create the shell to hold the viewer.
|
||||
Display display = new Display();
|
||||
Shell shell = new Shell(display, SWT.SHELL_TRIM);
|
||||
shell.setLayout(new GridLayout());
|
||||
GridData data = new GridData(GridData.FILL_BOTH);
|
||||
shell.setLayoutData(data);
|
||||
Font font = new Font(display, "Courier", 10, SWT.NORMAL);
|
||||
|
||||
// Create the table viewer.
|
||||
TableViewer tableViewer = new TableViewer(shell, SWT.BORDER);
|
||||
tableViewer.getControl().setLayoutData(data);
|
||||
|
||||
// Create the data generator.
|
||||
// TODO Exercise 5 - Use the DataGeneratorWithExecutor() instead.
|
||||
final IDataGenerator generator = new DataGeneratorWithThread();
|
||||
|
||||
// Create the content provider which will populate the viewer.
|
||||
SyncDataViewer contentProvider = new SyncDataViewer(tableViewer, generator);
|
||||
tableViewer.setContentProvider(contentProvider);
|
||||
tableViewer.setInput(new Object());
|
||||
|
||||
// Open the shell and service the display dispatch loop until user
|
||||
// closes the shell.
|
||||
shell.open();
|
||||
while (!shell.isDisposed()) {
|
||||
if (!display.readAndDispatch())
|
||||
display.sleep();
|
||||
}
|
||||
|
||||
// The IDataGenerator.shutdown() method is asynchronous, this requires
|
||||
// using a query again in order to wait for its completion.
|
||||
Query<Object> shutdownQuery = new Query<Object>() {
|
||||
@Override
|
||||
protected void execute(DataRequestMonitor<Object> rm) {
|
||||
generator.shutdown(rm);
|
||||
}
|
||||
};
|
||||
ImmediateExecutor.getInstance().execute(shutdownQuery);
|
||||
try {
|
||||
shutdownQuery.get();
|
||||
} catch (Exception e) {}
|
||||
|
||||
// Shut down the display.
|
||||
font.dispose();
|
||||
display.dispose();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,272 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2008 Wind River Systems 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.examples.dsf.dataviewer.answers;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.dd.dsf.concurrent.ConfinedToDsfExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.ThreadSafe;
|
||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.ImmediateExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.Query;
|
||||
import org.eclipse.dd.dsf.ui.concurrent.DisplayDsfExecutor;
|
||||
import org.eclipse.jface.viewers.ILazyContentProvider;
|
||||
import org.eclipse.jface.viewers.TableViewer;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Font;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Table;
|
||||
|
||||
/**
|
||||
* Data viewer based on a table, which reads data using asynchronous methods.
|
||||
* <p>
|
||||
* This viewer implements the {@link ILazyContentProvider} interface
|
||||
* which is used by the JFace TableViewer class to populate a Table. This
|
||||
* interface contains separate asynchronous methods for requesting the count
|
||||
* and values for individual indexes, which neatly correspond to the methods
|
||||
* in {@link IDataGenerator}. As an added optimization, this viewer
|
||||
* implementation checks for the range of visible items in the view upon each
|
||||
* request, and it cancels old requests which scroll out of view but have not
|
||||
* been completed yet. However, it is up to the data generator implementation
|
||||
* to check the canceled state of the requests and ignore them.
|
||||
* </p>
|
||||
*/
|
||||
@ConfinedToDsfExecutor("fDisplayExecutor")
|
||||
public class AsyncDataViewer
|
||||
implements ILazyContentProvider, IDataGenerator.Listener
|
||||
{
|
||||
// Executor to use instead of Display.asyncExec().
|
||||
@ThreadSafe
|
||||
final private DsfExecutor fDisplayExecutor;
|
||||
|
||||
// The viewer and generator that this content provider using.
|
||||
final private TableViewer fViewer;
|
||||
final private IDataGenerator fDataGenerator;
|
||||
|
||||
// Fields used in request cancellation logic.
|
||||
private List<ValueDataRequestMonitor> fItemDataRequestMonitors = new LinkedList<ValueDataRequestMonitor>();
|
||||
private Set<Integer> fIndexesToCancel = new HashSet<Integer>();
|
||||
private int fCancelCallsPending = 0;
|
||||
|
||||
public AsyncDataViewer(TableViewer viewer, IDataGenerator generator) {
|
||||
fViewer = viewer;
|
||||
fDisplayExecutor = DisplayDsfExecutor.getDisplayDsfExecutor(fViewer.getTable().getDisplay());
|
||||
fDataGenerator = generator;
|
||||
fDataGenerator.addListener(this);
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
fDataGenerator.removeListener(this);
|
||||
}
|
||||
|
||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||
// Set the initial count to the viewer after the input is set.
|
||||
queryItemCount();
|
||||
}
|
||||
|
||||
public void updateElement(final int index) {
|
||||
// Calculate the visible index range.
|
||||
final int topIdx = fViewer.getTable().getTopIndex();
|
||||
final int botIdx = topIdx + getVisibleItemCount(topIdx);
|
||||
|
||||
// Request the item for the given index.
|
||||
queryValue(index);
|
||||
|
||||
// Invoke a cancel task with a delay. The delay allows multiple cancel
|
||||
// calls to be combined together improving performance of the viewer.
|
||||
fCancelCallsPending++;
|
||||
fDisplayExecutor.schedule(
|
||||
new Runnable() { public void run() {
|
||||
cancelStaleRequests(topIdx, botIdx);
|
||||
}},
|
||||
1, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
private int getVisibleItemCount(int top) {
|
||||
Table table = fViewer.getTable();
|
||||
int itemCount = table.getItemCount();
|
||||
return Math.min((table.getBounds().height / table.getItemHeight()) + 2, itemCount - top);
|
||||
}
|
||||
|
||||
@ThreadSafe
|
||||
public void countChanged() {
|
||||
queryItemCount();
|
||||
}
|
||||
|
||||
@ThreadSafe
|
||||
public void valuesChanged(final Set<Integer> indexes) {
|
||||
// Mark the changed items in table viewer as dirty, this will
|
||||
// trigger update requests for these indexes if they are
|
||||
// visible in the viewer.
|
||||
final TableViewer tableViewer = fViewer;
|
||||
fDisplayExecutor.execute( new Runnable() {
|
||||
public void run() {
|
||||
if (!fViewer.getTable().isDisposed()) {
|
||||
for (Integer index : indexes) {
|
||||
tableViewer.clear(index);
|
||||
}
|
||||
}
|
||||
}});
|
||||
}
|
||||
|
||||
|
||||
private void queryItemCount() {
|
||||
// Request count from data provider. When the count is returned, we
|
||||
// have to re-dispatch into the display thread to avoid calling
|
||||
// the table widget on the DSF dispatch thread.
|
||||
fIndexesToCancel.clear();
|
||||
fDataGenerator.getCount(
|
||||
// Use the display executor to construct the request monitor, this
|
||||
// will cause the handleCompleted() method to be automatically
|
||||
// called on the display thread.
|
||||
new DataRequestMonitor<Integer>(fDisplayExecutor, null) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (!fViewer.getTable().isDisposed()) {
|
||||
fViewer.setItemCount(getData());
|
||||
fViewer.getTable().clearAll();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Dedicated class for data item requests. This class holds the index
|
||||
// argument so it can be examined when canceling stale requests.
|
||||
private class ValueDataRequestMonitor extends DataRequestMonitor<String> {
|
||||
|
||||
/** Index is used when canceling stale requests. */
|
||||
int fIndex;
|
||||
|
||||
ValueDataRequestMonitor(int index) {
|
||||
super(fDisplayExecutor, null);
|
||||
fIndex = index;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
fItemDataRequestMonitors.remove(this);
|
||||
|
||||
// Check if the request completed successfully, otherwise ignore it.
|
||||
if (isSuccess()) {
|
||||
if (!fViewer.getTable().isDisposed()) {
|
||||
fViewer.replace(getData(), fIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void queryValue(final int index) {
|
||||
ValueDataRequestMonitor rm = new ValueDataRequestMonitor(index);
|
||||
fItemDataRequestMonitors.add(rm);
|
||||
fDataGenerator.getValue(index, rm);
|
||||
}
|
||||
|
||||
private void cancelStaleRequests(int topIdx, int botIdx) {
|
||||
// Decrement the count of outstanding cancel calls.
|
||||
fCancelCallsPending--;
|
||||
|
||||
// Must check again, in case disposed while re-dispatching.
|
||||
if (fDataGenerator == null || fViewer.getTable().isDisposed()) return;
|
||||
|
||||
// Go through the outstanding requests and cancel any that
|
||||
// are not visible anymore.
|
||||
for (Iterator<ValueDataRequestMonitor> itr = fItemDataRequestMonitors.iterator(); itr.hasNext();) {
|
||||
ValueDataRequestMonitor item = itr.next();
|
||||
if (item.fIndex < topIdx || item.fIndex > botIdx) {
|
||||
// Set the item to canceled status, so that the data provider
|
||||
// will ignore it.
|
||||
item.cancel();
|
||||
|
||||
// Add the item index to list of indexes that were canceled,
|
||||
// which will be sent to the table widget.
|
||||
fIndexesToCancel.add(item.fIndex);
|
||||
|
||||
// Remove the item from the outstanding cancel requests.
|
||||
itr.remove();
|
||||
}
|
||||
}
|
||||
if (!fIndexesToCancel.isEmpty() && fCancelCallsPending == 0) {
|
||||
Set<Integer> canceledIdxs = fIndexesToCancel;
|
||||
fIndexesToCancel = new HashSet<Integer>();
|
||||
|
||||
// Clear the indexes of the canceled request, so that the
|
||||
// viewer knows to request them again when needed.
|
||||
// Note: clearing using TableViewer.clear(int) seems very
|
||||
// inefficient, it's better to use Table.clear(int[]).
|
||||
int[] canceledIdxsArray = new int[canceledIdxs.size()];
|
||||
int i = 0;
|
||||
for (Integer index : canceledIdxs) {
|
||||
canceledIdxsArray[i++] = index;
|
||||
}
|
||||
fViewer.getTable().clear(canceledIdxsArray);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
// Create the shell to hold the viewer.
|
||||
Display display = new Display();
|
||||
Shell shell = new Shell(display, SWT.SHELL_TRIM);
|
||||
shell.setLayout(new GridLayout());
|
||||
GridData data = new GridData(GridData.FILL_BOTH);
|
||||
shell.setLayoutData(data);
|
||||
Font font = new Font(display, "Courier", 10, SWT.NORMAL);
|
||||
|
||||
// Create the table viewer.
|
||||
TableViewer tableViewer = new TableViewer(shell, SWT.BORDER | SWT.VIRTUAL);
|
||||
tableViewer.getControl().setLayoutData(data);
|
||||
|
||||
// Create the data generator.
|
||||
final IDataGenerator generator = new DataGeneratorWithExecutor();
|
||||
|
||||
// Create the content provider which will populate the viewer.
|
||||
AsyncDataViewer contentProvider = new AsyncDataViewer(tableViewer, generator);
|
||||
tableViewer.setContentProvider(contentProvider);
|
||||
tableViewer.setInput(new Object());
|
||||
|
||||
// Open the shell and service the display dispatch loop until user
|
||||
// closes the shell.
|
||||
shell.open();
|
||||
while (!shell.isDisposed()) {
|
||||
if (!display.readAndDispatch())
|
||||
display.sleep();
|
||||
}
|
||||
|
||||
// The IDataGenerator.shutdown() method is asynchronous, this requires
|
||||
// using a query again in order to wait for its completion.
|
||||
Query<Object> shutdownQuery = new Query<Object>() {
|
||||
@Override
|
||||
protected void execute(DataRequestMonitor<Object> rm) {
|
||||
generator.shutdown(rm);
|
||||
}
|
||||
};
|
||||
ImmediateExecutor.getInstance().execute(shutdownQuery);
|
||||
try {
|
||||
shutdownQuery.get();
|
||||
} catch (Exception e) {}
|
||||
|
||||
// Shut down the display.
|
||||
font.dispose();
|
||||
display.dispose();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,311 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2008 Wind River Systems 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.examples.dsf.dataviewer.answers;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.dd.dsf.concurrent.ConfinedToDsfExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.Immutable;
|
||||
import org.eclipse.dd.dsf.concurrent.ThreadSafe;
|
||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.DefaultDsfExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.DsfExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.DsfRunnable;
|
||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||
import org.eclipse.dd.examples.dsf.DsfExamplesPlugin;
|
||||
|
||||
/**
|
||||
* DSF Executor-based implementation of the data generator.
|
||||
* <p>
|
||||
* This generator uses a queue of client requests and processes these
|
||||
* requests periodically using a DSF executor. The main feature of this
|
||||
* generator is that it uses the executor as its only synchronization object.
|
||||
* This means that all the fields with the exception of the executor can only
|
||||
* be accessed while running in the executor thread.
|
||||
* </p>
|
||||
*/
|
||||
@ThreadSafe
|
||||
public class DataGeneratorWithExecutor implements IDataGenerator {
|
||||
|
||||
// Request objects are used to serialize the interface calls into objects
|
||||
// which can then be pushed into a queue.
|
||||
@Immutable
|
||||
abstract class Request {
|
||||
final RequestMonitor fRequestMonitor;
|
||||
|
||||
Request(RequestMonitor rm) {
|
||||
fRequestMonitor = rm;
|
||||
}
|
||||
}
|
||||
|
||||
@Immutable
|
||||
class CountRequest extends Request {
|
||||
CountRequest(DataRequestMonitor<Integer> rm) {
|
||||
super(rm);
|
||||
}
|
||||
}
|
||||
|
||||
@Immutable
|
||||
class ItemRequest extends Request {
|
||||
final int fIndex;
|
||||
ItemRequest(int index, DataRequestMonitor<String> rm) {
|
||||
super(rm);
|
||||
fIndex = index;
|
||||
}
|
||||
}
|
||||
|
||||
// The executor used to access all internal data of the generator.
|
||||
private DsfExecutor fExecutor;
|
||||
|
||||
// Main request queue of the data generator. The getValue(), getCount(),
|
||||
// and shutdown() methods write into the queue, while the serviceQueue()
|
||||
// method reads from it.
|
||||
// The executor used to access all internal data of the generator.
|
||||
@ConfinedToDsfExecutor("fExecutor")
|
||||
private List<Request> fQueue = new LinkedList<Request>();
|
||||
|
||||
// List of listeners is not synchronized, it also has to be accessed
|
||||
// using the executor.
|
||||
@ConfinedToDsfExecutor("fExecutor")
|
||||
private List<Listener> fListeners = new LinkedList<Listener>();
|
||||
|
||||
// Current number of elements in this generator.
|
||||
@ConfinedToDsfExecutor("fExecutor")
|
||||
private int fCount = MIN_COUNT;
|
||||
|
||||
// Counter used to determine when to reset the element count.
|
||||
@ConfinedToDsfExecutor("fExecutor")
|
||||
private int fCountResetTrigger = 0;
|
||||
|
||||
// Elements which were modified since the last reset.
|
||||
@ConfinedToDsfExecutor("fExecutor")
|
||||
private Set<Integer> fChangedIndexes = new HashSet<Integer>();
|
||||
|
||||
// Flag used to ensure that requests are processed sequentially.
|
||||
@ConfinedToDsfExecutor("fExecutor")
|
||||
private boolean fServiceQueueInProgress = false;
|
||||
|
||||
public DataGeneratorWithExecutor() {
|
||||
// Create the executor
|
||||
fExecutor = new DefaultDsfExecutor("Supplier Executor");
|
||||
|
||||
// Schedule a runnable to make the random changes.
|
||||
fExecutor.scheduleAtFixedRate(
|
||||
new DsfRunnable() {
|
||||
public void run() {
|
||||
randomChanges();
|
||||
}
|
||||
},
|
||||
RANDOM_CHANGE_INTERVAL,
|
||||
RANDOM_CHANGE_INTERVAL,
|
||||
TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
public void shutdown(final RequestMonitor rm) {
|
||||
try {
|
||||
fExecutor.execute( new DsfRunnable() {
|
||||
public void run() {
|
||||
// Empty the queue of requests and fail them.
|
||||
for (Request request : fQueue) {
|
||||
request.fRequestMonitor.setStatus(
|
||||
new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down"));
|
||||
request.fRequestMonitor.done();
|
||||
}
|
||||
fQueue.clear();
|
||||
|
||||
// Kill executor.
|
||||
fExecutor.shutdown();
|
||||
rm.done();
|
||||
}
|
||||
});
|
||||
} catch (RejectedExecutionException e) {
|
||||
rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down"));
|
||||
rm.done();
|
||||
}
|
||||
}
|
||||
|
||||
public void getCount(final DataRequestMonitor<Integer> rm) {
|
||||
try {
|
||||
fExecutor.execute( new DsfRunnable() {
|
||||
public void run() {
|
||||
fQueue.add(new CountRequest(rm));
|
||||
serviceQueue();
|
||||
}
|
||||
});
|
||||
} catch (RejectedExecutionException e) {
|
||||
rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down"));
|
||||
rm.done();
|
||||
}
|
||||
}
|
||||
|
||||
public void getValue(final int index, final DataRequestMonitor<String> rm) {
|
||||
try {
|
||||
fExecutor.execute( new DsfRunnable() {
|
||||
public void run() {
|
||||
fQueue.add(new ItemRequest(index, rm));
|
||||
serviceQueue();
|
||||
}
|
||||
});
|
||||
} catch (RejectedExecutionException e) {
|
||||
rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down"));
|
||||
rm.done();
|
||||
}
|
||||
}
|
||||
|
||||
public void addListener(final Listener listener) {
|
||||
try {
|
||||
fExecutor.execute( new DsfRunnable() {
|
||||
public void run() {
|
||||
fListeners.add(listener);
|
||||
}
|
||||
});
|
||||
} catch (RejectedExecutionException e) {}
|
||||
}
|
||||
|
||||
public void removeListener(final Listener listener) {
|
||||
try {
|
||||
fExecutor.execute( new DsfRunnable() {
|
||||
public void run() {
|
||||
fListeners.remove(listener);
|
||||
}
|
||||
});
|
||||
} catch (RejectedExecutionException e) {}
|
||||
}
|
||||
|
||||
// Main processing function of this generator.
|
||||
@ConfinedToDsfExecutor("fExecutor")
|
||||
private void serviceQueue() {
|
||||
|
||||
for (Iterator<Request> requestItr = fQueue.iterator(); requestItr.hasNext();) {
|
||||
Request request = requestItr.next();
|
||||
if (request.fRequestMonitor.isCanceled()) {
|
||||
request.fRequestMonitor.setStatus(
|
||||
new Status(IStatus.CANCEL, DsfExamplesPlugin.PLUGIN_ID, "Request canceled"));
|
||||
request.fRequestMonitor.done();
|
||||
requestItr.remove();
|
||||
}
|
||||
}
|
||||
|
||||
// If a queue servicing is already scheduled, do nothing.
|
||||
if (fServiceQueueInProgress) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (fQueue.size() != 0) {
|
||||
// If there are requests to service, remove one from the queue and
|
||||
// schedule a runnable to process the request after a processing
|
||||
// delay.
|
||||
fServiceQueueInProgress = true;
|
||||
final Request request = fQueue.remove(0);
|
||||
fExecutor.schedule(
|
||||
new DsfRunnable() {
|
||||
public void run() {
|
||||
if (request instanceof CountRequest) {
|
||||
processCountRequest((CountRequest)request);
|
||||
} else if (request instanceof ItemRequest) {
|
||||
processItemRequest((ItemRequest)request);
|
||||
}
|
||||
|
||||
// Reset the processing flag and process next
|
||||
// request.
|
||||
fServiceQueueInProgress = false;
|
||||
serviceQueue();
|
||||
}
|
||||
},
|
||||
PROCESSING_DELAY, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
@ConfinedToDsfExecutor("fExecutor")
|
||||
private void processCountRequest(CountRequest request) {
|
||||
@SuppressWarnings("unchecked") // Suppress warning about lost type info.
|
||||
DataRequestMonitor<Integer> rm = (DataRequestMonitor<Integer>)request.fRequestMonitor;
|
||||
|
||||
rm.setData(fCount);
|
||||
rm.done();
|
||||
}
|
||||
|
||||
@ConfinedToDsfExecutor("fExecutor")
|
||||
private void processItemRequest(ItemRequest request) {
|
||||
@SuppressWarnings("unchecked") // Suppress warning about lost type info.
|
||||
DataRequestMonitor<String> rm = (DataRequestMonitor<String>)request.fRequestMonitor;
|
||||
|
||||
if (fChangedIndexes.contains(request.fIndex)) {
|
||||
rm.setData("Changed: " + request.fIndex);
|
||||
} else {
|
||||
rm.setData(Integer.toString(request.fIndex));
|
||||
}
|
||||
rm.done();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method simulates changes in the supplier's data set.
|
||||
*/
|
||||
@ConfinedToDsfExecutor("fExecutor")
|
||||
private void randomChanges() {
|
||||
// Once every number of changes, reset the count, the rest of the
|
||||
// times just change certain values.
|
||||
if (++fCountResetTrigger % RANDOM_COUNT_CHANGE_INTERVALS == 0){
|
||||
randomCountReset();
|
||||
} else {
|
||||
randomDataChange();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates new size for provider's data set.
|
||||
*/
|
||||
@ConfinedToDsfExecutor("fExecutor")
|
||||
private void randomCountReset() {
|
||||
// Calculate the new count.
|
||||
Random random = new java.util.Random();
|
||||
fCount = MIN_COUNT + Math.abs(random.nextInt()) % (MAX_COUNT - MIN_COUNT);
|
||||
|
||||
// Reset the changed values.
|
||||
fChangedIndexes.clear();
|
||||
|
||||
// Notify listeners
|
||||
for (Listener listener : fListeners) {
|
||||
listener.countChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidates a random range of indexes.
|
||||
*/
|
||||
@ConfinedToDsfExecutor("fExecutor")
|
||||
private void randomDataChange() {
|
||||
// Calculate the indexes to change.
|
||||
Random random = new java.util.Random();
|
||||
Set<Integer> set = new HashSet<Integer>();
|
||||
for (int i = 0; i < fCount * RANDOM_CHANGE_SET_PERCENTAGE / 100; i++) {
|
||||
set.add( new Integer(Math.abs(random.nextInt()) % fCount) );
|
||||
}
|
||||
|
||||
// Add the indexes to an overall set of changed indexes.
|
||||
fChangedIndexes.addAll(set);
|
||||
|
||||
// Notify listeners
|
||||
for (Listener listener : fListeners) {
|
||||
listener.valuesChanged(set);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,238 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2008 Wind River Systems 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.examples.dsf.dataviewer.answers;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.ListenerList;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||
import org.eclipse.dd.examples.dsf.DsfExamplesPlugin;
|
||||
|
||||
/**
|
||||
* Thread-based implementation of the data generator.
|
||||
* <p>
|
||||
* This generator is based around a queue of client requests and a thread which
|
||||
* reads the requests from the queue and processes them. The distinguishing
|
||||
* feature of this generator is that it uses a a blocking queue as the main
|
||||
* synchronization object. However, fListeners, fShutdown, and fChangedIndexes
|
||||
* fields also need to be thread-safe and so they implement their own
|
||||
* synchronization.
|
||||
* </p>
|
||||
*/
|
||||
public class DataGeneratorWithThread extends Thread implements IDataGenerator {
|
||||
|
||||
// Request objects are used to serialize the interface calls into objects
|
||||
// which can then be pushed into a queue.
|
||||
abstract class Request {
|
||||
final RequestMonitor fRequestMonitor;
|
||||
|
||||
Request(RequestMonitor rm) {
|
||||
fRequestMonitor = rm;
|
||||
}
|
||||
}
|
||||
|
||||
class CountRequest extends Request {
|
||||
CountRequest(DataRequestMonitor<Integer> rm) {
|
||||
super(rm);
|
||||
}
|
||||
}
|
||||
|
||||
class ItemRequest extends Request {
|
||||
final int fIndex;
|
||||
ItemRequest(int index, DataRequestMonitor<String> rm) {
|
||||
super(rm);
|
||||
fIndex = index;
|
||||
}
|
||||
}
|
||||
|
||||
class ShutdownRequest extends Request {
|
||||
ShutdownRequest(RequestMonitor rm) {
|
||||
super(rm);
|
||||
}
|
||||
}
|
||||
|
||||
// Main request queue of the data generator. The getValue(), getCount(),
|
||||
// and shutdown() methods write into the queue, while the run() method
|
||||
// reads from it.
|
||||
private final BlockingQueue<Request> fQueue = new LinkedBlockingQueue<Request>();
|
||||
|
||||
// ListenerList class provides thread safety.
|
||||
private ListenerList fListeners = new ListenerList();
|
||||
|
||||
// Current number of elements in this generator.
|
||||
private int fCount = MIN_COUNT;
|
||||
|
||||
// Counter used to determine when to reset the element count.
|
||||
private int fCountResetTrigger = 0;
|
||||
|
||||
// Elements which were modified since the last reset.
|
||||
private Set<Integer> fChangedIndexes = Collections.synchronizedSet(new HashSet<Integer>());
|
||||
|
||||
// Used to determine when to make changes in data.
|
||||
private long fLastChangeTime = System.currentTimeMillis();
|
||||
|
||||
// Flag indicating when the generator has been shut down.
|
||||
private AtomicBoolean fShutdown = new AtomicBoolean(false);
|
||||
|
||||
public DataGeneratorWithThread() {
|
||||
// Immediately kick off the request processing thread.
|
||||
start();
|
||||
}
|
||||
|
||||
public void shutdown(RequestMonitor rm) {
|
||||
// Mark the generator as shut down. After the fShutdown flag is set,
|
||||
// all new requests should be shut down.
|
||||
if (!fShutdown.getAndSet(true)) {
|
||||
fQueue.add(new ShutdownRequest(rm));
|
||||
} else {
|
||||
//
|
||||
rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down"));
|
||||
rm.done();
|
||||
}
|
||||
}
|
||||
|
||||
public void getCount(DataRequestMonitor<Integer> rm) {
|
||||
if (!fShutdown.get()) {
|
||||
fQueue.add(new CountRequest(rm));
|
||||
} else {
|
||||
rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down"));
|
||||
rm.done();
|
||||
}
|
||||
}
|
||||
|
||||
public void getValue(int index, DataRequestMonitor<String> rm) {
|
||||
if (!fShutdown.get()) {
|
||||
fQueue.add(new ItemRequest(index, rm));
|
||||
} else {
|
||||
rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down"));
|
||||
rm.done();
|
||||
}
|
||||
}
|
||||
|
||||
public void addListener(Listener listener) {
|
||||
fListeners.add(listener);
|
||||
}
|
||||
|
||||
public void removeListener(Listener listener) {
|
||||
fListeners.remove(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
while(true) {
|
||||
// Get the next request from the queue. The time-out
|
||||
// ensures that that the random changes get processed.
|
||||
final Request request = fQueue.poll(100, TimeUnit.MILLISECONDS);
|
||||
|
||||
// If a request was dequeued, process it.
|
||||
if (request != null) {
|
||||
// Simulate a processing delay.
|
||||
Thread.sleep(PROCESSING_DELAY);
|
||||
|
||||
if (request instanceof CountRequest) {
|
||||
processCountRequest((CountRequest)request);
|
||||
} else if (request instanceof ItemRequest) {
|
||||
processItemRequest((ItemRequest)request);
|
||||
} else if (request instanceof ShutdownRequest) {
|
||||
// If shutting down, just break out of the while(true)
|
||||
// loop and thread will exit.
|
||||
request.fRequestMonitor.done();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Simulate data changes.
|
||||
randomChanges();
|
||||
}
|
||||
}
|
||||
catch (InterruptedException x) {}
|
||||
}
|
||||
|
||||
private void processCountRequest(CountRequest request) {
|
||||
@SuppressWarnings("unchecked") // Suppress warning about lost type info.
|
||||
DataRequestMonitor<Integer> rm = (DataRequestMonitor<Integer>)request.fRequestMonitor;
|
||||
|
||||
rm.setData(fCount);
|
||||
rm.done();
|
||||
}
|
||||
|
||||
private void processItemRequest(ItemRequest request) {
|
||||
@SuppressWarnings("unchecked") // Suppress warning about lost type info.
|
||||
DataRequestMonitor<String> rm = (DataRequestMonitor<String>)request.fRequestMonitor;
|
||||
|
||||
if (fChangedIndexes.contains(request.fIndex)) {
|
||||
rm.setData("Changed: " + request.fIndex);
|
||||
} else {
|
||||
rm.setData(Integer.toString(request.fIndex));
|
||||
}
|
||||
rm.done();
|
||||
}
|
||||
|
||||
|
||||
private void randomChanges() {
|
||||
// Check if enough time is elapsed.
|
||||
if (System.currentTimeMillis() > fLastChangeTime + RANDOM_CHANGE_INTERVAL) {
|
||||
fLastChangeTime = System.currentTimeMillis();
|
||||
|
||||
// Once every number of changes, reset the count, the rest of the
|
||||
// times just change certain values.
|
||||
if (++fCountResetTrigger % RANDOM_COUNT_CHANGE_INTERVALS == 0){
|
||||
randomCountReset();
|
||||
} else {
|
||||
randomDataChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void randomCountReset() {
|
||||
// Calculate the new count.
|
||||
Random random = new java.util.Random();
|
||||
fCount = MIN_COUNT + Math.abs(random.nextInt()) % (MAX_COUNT - MIN_COUNT);
|
||||
|
||||
// Reset the changed values.
|
||||
fChangedIndexes.clear();
|
||||
|
||||
// Notify listeners
|
||||
for (Object listener : fListeners.getListeners()) {
|
||||
((Listener)listener).countChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void randomDataChange() {
|
||||
// Calculate the indexes to change.
|
||||
Random random = new java.util.Random();
|
||||
Set<Integer> set = new HashSet<Integer>();
|
||||
for (int i = 0; i < fCount * RANDOM_CHANGE_SET_PERCENTAGE / 100; i++) {
|
||||
set.add( new Integer(Math.abs(random.nextInt()) % fCount) );
|
||||
}
|
||||
|
||||
// Add the indexes to an overall set of changed indexes.
|
||||
fChangedIndexes.addAll(set);
|
||||
|
||||
// Notify listeners
|
||||
for (Object listener : fListeners.getListeners()) {
|
||||
((Listener)listener).valuesChanged(set);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2008 Wind River Systems 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.examples.dsf.dataviewer.answers;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.ThreadSafe;
|
||||
|
||||
/**
|
||||
* Data generator is simple source of data used to populate the example table
|
||||
* view. It contains two asynchronous methods for retrieving the data
|
||||
* parameters: the count and the value for a given index. It also allows the
|
||||
* view to receive events indicating when the data supplied by the generator
|
||||
* is changed.
|
||||
*/
|
||||
@ThreadSafe
|
||||
public interface IDataGenerator {
|
||||
|
||||
// Constants which control the data generator behavior.
|
||||
// Changing the count range can stress the scalability of the system, while
|
||||
// changing of the process delay and random change interval can stress
|
||||
// its performance.
|
||||
final static int MIN_COUNT = 100;
|
||||
final static int MAX_COUNT = 200;
|
||||
final static int PROCESSING_DELAY = 10;
|
||||
final static int RANDOM_CHANGE_INTERVAL = 10000;
|
||||
final static int RANDOM_COUNT_CHANGE_INTERVALS = 3;
|
||||
final static int RANDOM_CHANGE_SET_PERCENTAGE = 10;
|
||||
|
||||
|
||||
// Listener interface that the view needs to implement to react
|
||||
// to the changes in data.
|
||||
public interface Listener {
|
||||
void countChanged();
|
||||
void valuesChanged(Set<Integer> indexes);
|
||||
}
|
||||
|
||||
// Data access methods.
|
||||
void getCount(DataRequestMonitor<Integer> rm);
|
||||
void getValue(int index, DataRequestMonitor<String> rm);
|
||||
|
||||
// Method used to shutdown the data generator including any threads that
|
||||
// it may use.
|
||||
void shutdown(RequestMonitor rm);
|
||||
|
||||
// Methods for registering change listeners.
|
||||
void addListener(Listener listener);
|
||||
void removeListener(Listener listener);
|
||||
}
|
|
@ -0,0 +1,182 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008 Wind River Systems 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.examples.dsf.dataviewer.answers;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.ImmediateExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.Query;
|
||||
import org.eclipse.jface.viewers.IStructuredContentProvider;
|
||||
import org.eclipse.jface.viewers.TableViewer;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Font;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
/**
|
||||
* Data viewer based on a table, which reads data using synchronous methods.
|
||||
* <p>
|
||||
* This viewer implements the {@link IStructuredContentProvider} interface
|
||||
* which is used by the JFace TableViewer class to populate a Table. This
|
||||
* interface contains one principal methods for reading data {@link #getElements(Object)},
|
||||
* which synchronously returns an array of elements. In order to implement this
|
||||
* method using the asynchronous data generator, this provider uses the
|
||||
* {@link Query} object.
|
||||
* </p>
|
||||
*/
|
||||
public class SyncDataViewer
|
||||
implements IStructuredContentProvider, IDataGenerator.Listener
|
||||
{
|
||||
// The viewer and generator that this content provider using.
|
||||
final private TableViewer fViewer;
|
||||
final private IDataGenerator fDataGenerator;
|
||||
|
||||
public SyncDataViewer(TableViewer viewer, IDataGenerator generator) {
|
||||
fViewer = viewer;
|
||||
fDataGenerator = generator;
|
||||
fDataGenerator.addListener(this);
|
||||
}
|
||||
|
||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||
// Not used
|
||||
}
|
||||
|
||||
|
||||
public Object[] getElements(Object inputElement) {
|
||||
|
||||
// Create the query object for reading data count.
|
||||
Query<Integer> countQuery = new Query<Integer>() {
|
||||
@Override
|
||||
protected void execute(DataRequestMonitor<Integer> rm) {
|
||||
fDataGenerator.getCount(rm);
|
||||
}
|
||||
};
|
||||
|
||||
// Submit the query to be executed. A query implements a runnable
|
||||
// interface and it has to be executed in order to do its work.
|
||||
ImmediateExecutor.getInstance().execute(countQuery);
|
||||
int count = 0;
|
||||
|
||||
// Block until the query completes, which will happen when the request
|
||||
// monitor of the execute() method is marked done.
|
||||
try {
|
||||
count = countQuery.get();
|
||||
} catch (Exception e) {
|
||||
// InterruptedException and ExecutionException can be thrown here.
|
||||
// ExecutionException containing a CoreException will be thrown
|
||||
// if an error status is set to the Query's request monitor.
|
||||
return new Object[0];
|
||||
}
|
||||
|
||||
// Create the array that will be filled with elements.
|
||||
// For each index in the array execute a query to get the element at
|
||||
// that index.
|
||||
final Object[] elements = new Object[count];
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
final int index = i;
|
||||
Query<String> valueQuery = new Query<String>() {
|
||||
@Override
|
||||
protected void execute(DataRequestMonitor<String> rm) {
|
||||
fDataGenerator.getValue(index, rm);
|
||||
}
|
||||
};
|
||||
ImmediateExecutor.getInstance().execute(valueQuery);
|
||||
try {
|
||||
elements[i] = valueQuery.get();
|
||||
} catch (Exception e) {
|
||||
elements[i] = "error";
|
||||
}
|
||||
}
|
||||
return elements;
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
fDataGenerator.removeListener(this);
|
||||
}
|
||||
|
||||
public void countChanged() {
|
||||
// For any event from the generator, refresh the whole viewer.
|
||||
refreshViewer();
|
||||
}
|
||||
|
||||
public void valuesChanged(Set<Integer> indexes) {
|
||||
// For any event from the generator, refresh the whole viewer.
|
||||
refreshViewer();
|
||||
}
|
||||
|
||||
private void refreshViewer() {
|
||||
getElements(null);
|
||||
|
||||
// This method may be called on any thread, switch to the display
|
||||
// thread before calling the viewer.
|
||||
Display display = fViewer.getControl().getDisplay();
|
||||
display.asyncExec( new Runnable() {
|
||||
public void run() {
|
||||
if (!fViewer.getControl().isDisposed()) {
|
||||
fViewer.refresh();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// Create the shell to hold the viewer.
|
||||
Display display = new Display();
|
||||
Shell shell = new Shell(display, SWT.SHELL_TRIM);
|
||||
shell.setLayout(new GridLayout());
|
||||
GridData data = new GridData(GridData.FILL_BOTH);
|
||||
shell.setLayoutData(data);
|
||||
Font font = new Font(display, "Courier", 10, SWT.NORMAL);
|
||||
|
||||
// Create the table viewer.
|
||||
TableViewer tableViewer = new TableViewer(shell, SWT.BORDER);
|
||||
tableViewer.getControl().setLayoutData(data);
|
||||
|
||||
// Create the data generator.
|
||||
final IDataGenerator generator = new DataGeneratorWithExecutor();
|
||||
|
||||
// Create the content provider which will populate the viewer.
|
||||
SyncDataViewer contentProvider = new SyncDataViewer(tableViewer, generator);
|
||||
tableViewer.setContentProvider(contentProvider);
|
||||
tableViewer.setInput(new Object());
|
||||
|
||||
// Open the shell and service the display dispatch loop until user
|
||||
// closes the shell.
|
||||
shell.open();
|
||||
while (!shell.isDisposed()) {
|
||||
if (!display.readAndDispatch())
|
||||
display.sleep();
|
||||
}
|
||||
|
||||
// The IDataGenerator.shutdown() method is asynchronous, this requires
|
||||
// using a query again in order to wait for its completion.
|
||||
Query<Object> shutdownQuery = new Query<Object>() {
|
||||
@Override
|
||||
protected void execute(DataRequestMonitor<Object> rm) {
|
||||
generator.shutdown(rm);
|
||||
}
|
||||
};
|
||||
ImmediateExecutor.getInstance().execute(shutdownQuery);
|
||||
try {
|
||||
shutdownQuery.get();
|
||||
} catch (Exception e) {}
|
||||
|
||||
// Shut down the display.
|
||||
font.dispose();
|
||||
display.dispose();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008 Wind River Systems 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.examples.dsf.requestmonitor;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.ImmediateExecutor;
|
||||
|
||||
/**
|
||||
* Example of using a DataRequestMonitor to retrieve a result from an
|
||||
* asynchronous method.
|
||||
*/
|
||||
public class Async2Plus2 {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Executor executor = ImmediateExecutor.getInstance();
|
||||
DataRequestMonitor<Integer> rm =
|
||||
new DataRequestMonitor<Integer>(executor, null) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
System.out.println("2 + 2 = " + getData());
|
||||
}
|
||||
};
|
||||
asyncAdd(2, 2, rm);
|
||||
}
|
||||
|
||||
static void asyncAdd(int value1, int value2, DataRequestMonitor<Integer> rm) {
|
||||
rm.setData(value1 + value2);
|
||||
rm.done();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008 Wind River Systems 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.examples.dsf.requestmonitor;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import org.eclipse.dd.dsf.concurrent.ImmediateExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||
|
||||
/**
|
||||
* "Hello world" example which uses an asynchronous method to print out
|
||||
* the result.
|
||||
* <p>
|
||||
* The main method uses an immediate executor, which executes runnables
|
||||
* as soon as they are submitted, in creating its request monitor.
|
||||
*
|
||||
*/
|
||||
public class AsyncHelloWorld {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Executor executor = ImmediateExecutor.getInstance();
|
||||
RequestMonitor rm = new RequestMonitor(executor, null);
|
||||
asyncHelloWorld(rm);
|
||||
}
|
||||
|
||||
static void asyncHelloWorld(RequestMonitor rm) {
|
||||
System.out.println("Hello world");
|
||||
// TODO Exercise 1: - Call the second async. "Hello world 2" method.
|
||||
// Hint: Calling an asynchronous method requires passing to it a
|
||||
// request monitor. A new request monitor can be constructed with
|
||||
// a parent RequestMonitor as an argument argument. The parent gets
|
||||
// completed automatically when the lower level request monitor is
|
||||
// completed.
|
||||
rm.done();
|
||||
}
|
||||
|
||||
// TODO: Exercise 1 - Add a second async. "Hello world 2" method.
|
||||
}
|
|
@ -0,0 +1,111 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008 Wind River Systems 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.examples.dsf.requestmonitor;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import org.eclipse.dd.dsf.concurrent.CountingRequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.ImmediateExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||
|
||||
/**
|
||||
* Example of using a CountingRequestMonitor to wait for multiple
|
||||
* asynchronous calls to complete.
|
||||
*/
|
||||
public class AsyncQuicksort {
|
||||
|
||||
static Executor fgExecutor = ImmediateExecutor.getInstance();
|
||||
|
||||
public static void main(String[] args) {
|
||||
final int[] array = {5, 7, 8, 3, 2, 1, 9, 5, 4};
|
||||
|
||||
System.out.println("To sort: " + Arrays.toString(array));
|
||||
asyncQuicksort(
|
||||
array, 0, array.length - 1,
|
||||
new RequestMonitor(fgExecutor, null) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
System.out.println("Sorted: " + Arrays.toString(array));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static void asyncQuicksort(final int[] array, final int left,
|
||||
final int right, final RequestMonitor rm)
|
||||
{
|
||||
if (right > left) {
|
||||
int pivot = left;
|
||||
// TODO: Exercise 2 - Convert the call to partition into an
|
||||
// asynchronous call to asyncPartition().
|
||||
// Hint: The rest of the code below should be executed inside
|
||||
// the DataRequestMonitor.handleCompleted() overriding method.
|
||||
int newPivot = partition(array, left, right, pivot);
|
||||
printArray(array, left, right, newPivot);
|
||||
|
||||
CountingRequestMonitor countingRm = new CountingRequestMonitor(fgExecutor, rm);
|
||||
asyncQuicksort(array, left, newPivot - 1, countingRm);
|
||||
asyncQuicksort(array, newPivot + 1, right, countingRm);
|
||||
countingRm.setDoneCount(2);
|
||||
} else {
|
||||
rm.done();
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Exercise 2 - Convert partition to an asynchronous method.
|
||||
// Hint: a DataRequestMonitor<Integer> should be used to carry the
|
||||
// return value to the caller.
|
||||
static int partition(int[] array, int left, int right, int pivot)
|
||||
{
|
||||
int pivotValue = array[pivot];
|
||||
array[pivot] = array[right];
|
||||
array[right] = pivotValue;
|
||||
int store = left;
|
||||
for (int i = left; i < right; i++) {
|
||||
if (array[i] <= pivotValue) {
|
||||
int tmp = array[store];
|
||||
array[store] = array[i];
|
||||
array[i] = tmp;
|
||||
store++;
|
||||
}
|
||||
}
|
||||
array[right] = array[store];
|
||||
array[store] = pivotValue;
|
||||
|
||||
// TODO: Request Monitors Exercise 2 - Return the data to caller using
|
||||
// a request monitor.
|
||||
return store;
|
||||
}
|
||||
|
||||
static void printArray(int[] array, int left, int right, int pivot) {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
for (int i = 0; i < array.length; i++ ) {
|
||||
if (i == left) {
|
||||
buffer.append('>');
|
||||
} else if (i == pivot) {
|
||||
buffer.append('-');
|
||||
} else {
|
||||
buffer.append(' ');
|
||||
}
|
||||
buffer.append(array[i]);
|
||||
|
||||
if (i == right) {
|
||||
buffer.append('<');
|
||||
} else if (i == pivot) {
|
||||
buffer.append('-');
|
||||
} else {
|
||||
buffer.append(' ');
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println(buffer);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008 Wind River Systems 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.examples.dsf.requestmonitor.answers;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.ImmediateExecutor;
|
||||
|
||||
/**
|
||||
* Example of using a DataRequestMonitor to retrieve a result from an
|
||||
* asynchronous method.
|
||||
*/
|
||||
public class Async2Plus2 {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Executor executor = ImmediateExecutor.getInstance();
|
||||
DataRequestMonitor<Integer> rm =
|
||||
new DataRequestMonitor<Integer>(executor, null) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
System.out.println("2 + 2 = " + getData());
|
||||
}
|
||||
};
|
||||
asyncAdd(2, 2, rm);
|
||||
}
|
||||
|
||||
static void asyncAdd(int value1, int value2, DataRequestMonitor<Integer> rm) {
|
||||
rm.setData(value1 + value2);
|
||||
rm.done();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008 Wind River Systems 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.examples.dsf.requestmonitor.answers;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import org.eclipse.dd.dsf.concurrent.ImmediateExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||
|
||||
/**
|
||||
* "Hello world" example which uses an asynchronous method to print out
|
||||
* the result.
|
||||
* <p>
|
||||
* The main method uses an immediate executor, which executes runnables
|
||||
* as soon as they are submitted, in creating its request monitor.
|
||||
*
|
||||
*/
|
||||
public class AsyncHelloWorld {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Executor executor = ImmediateExecutor.getInstance();
|
||||
RequestMonitor rm = new RequestMonitor(executor, null);
|
||||
asyncHelloWorld(rm);
|
||||
}
|
||||
|
||||
static void asyncHelloWorld(RequestMonitor rm) {
|
||||
System.out.println("Hello world");
|
||||
RequestMonitor rm2 = new RequestMonitor(ImmediateExecutor.getInstance(), rm);
|
||||
asyncHelloWorld2(rm2);
|
||||
}
|
||||
|
||||
static void asyncHelloWorld2(RequestMonitor rm) {
|
||||
System.out.println("Hello world 2");
|
||||
rm.done();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2008 Wind River Systems 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Wind River Systems - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.examples.dsf.requestmonitor.answers;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import org.eclipse.dd.dsf.concurrent.CountingRequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.dd.dsf.concurrent.ImmediateExecutor;
|
||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||
|
||||
/**
|
||||
* Example of using a CountingRequestMonitor to wait for multiple
|
||||
* asynchronous calls to complete.
|
||||
*/
|
||||
public class AsyncQuicksort {
|
||||
|
||||
static Executor fgExecutor = ImmediateExecutor.getInstance();
|
||||
|
||||
public static void main(String[] args) {
|
||||
final int[] array = {5, 7, 8, 3, 2, 1, 9, 5, 4};
|
||||
|
||||
System.out.println("To sort: " + Arrays.toString(array));
|
||||
asyncQuicksort(
|
||||
array, 0, array.length - 1,
|
||||
new RequestMonitor(fgExecutor, null) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
System.out.println("Sorted: " + Arrays.toString(array));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static void asyncQuicksort(final int[] array, final int left,
|
||||
final int right, final RequestMonitor rm)
|
||||
{
|
||||
if (right > left) {
|
||||
int pivot = left;
|
||||
asyncPartition(
|
||||
array, left, right, pivot,
|
||||
new DataRequestMonitor<Integer>(fgExecutor, rm) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
int newPivot = getData();
|
||||
printArray(array, left, right, newPivot);
|
||||
|
||||
CountingRequestMonitor countingRm = new CountingRequestMonitor(fgExecutor, rm);
|
||||
asyncQuicksort(array, left, newPivot - 1, countingRm);
|
||||
asyncQuicksort(array, newPivot + 1, right, countingRm);
|
||||
countingRm.setDoneCount(2);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
rm.done();
|
||||
}
|
||||
}
|
||||
|
||||
static void asyncPartition(int[] array, int left, int right, int pivot, DataRequestMonitor<Integer> rm)
|
||||
{
|
||||
int pivotValue = array[pivot];
|
||||
array[pivot] = array[right];
|
||||
array[right] = pivotValue;
|
||||
int store = left;
|
||||
for (int i = left; i < right; i++) {
|
||||
if (array[i] <= pivotValue) {
|
||||
int tmp = array[store];
|
||||
array[store] = array[i];
|
||||
array[i] = tmp;
|
||||
store++;
|
||||
}
|
||||
}
|
||||
array[right] = array[store];
|
||||
array[store] = pivotValue;
|
||||
|
||||
// Java 5 automatically converts the int type of the store variable
|
||||
// to an Integer object.
|
||||
rm.setData(store);
|
||||
rm.done();
|
||||
}
|
||||
|
||||
static void printArray(int[] array, int left, int right, int pivot) {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
for (int i = 0; i < array.length; i++ ) {
|
||||
if (i == left) {
|
||||
buffer.append('>');
|
||||
} else if (i == pivot) {
|
||||
buffer.append('-');
|
||||
} else {
|
||||
buffer.append(' ');
|
||||
}
|
||||
buffer.append(array[i]);
|
||||
|
||||
if (i == right) {
|
||||
buffer.append('<');
|
||||
} else if (i == pivot) {
|
||||
buffer.append('-');
|
||||
} else {
|
||||
buffer.append(' ');
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println(buffer);
|
||||
}
|
||||
}
|
|
@ -20,9 +20,15 @@
|
|||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
|
@ -20,9 +20,15 @@
|
|||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
155
plugins/org.eclipse.dd.gdb.ui/.settings/.api_filters
Normal file
155
plugins/org.eclipse.dd.gdb.ui/.settings/.api_filters
Normal file
|
@ -0,0 +1,155 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component id="org.eclipse.dd.gdb.ui" version="2">
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/ui/launching/GdbLocalRunLaunchConfigurationTabGroup.java" type="org.eclipse.dd.gdb.internal.ui.launching.GdbLocalRunLaunchConfigurationTabGroup">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.ui.launching.GdbLocalRunLaunchConfigurationTabGroup"/>
|
||||
<message_argument value="org.eclipse.dd.gdb.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="META-INF/MANIFEST.MF">
|
||||
<filter id="923795461">
|
||||
<message_arguments>
|
||||
<message_argument value="1.1.0.qualifier"/>
|
||||
<message_argument value="1.0.0.v20080609"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/ui/launching/GDBSolibBlock.java" type="org.eclipse.dd.gdb.internal.ui.launching.GDBSolibBlock">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.ui.launching.GDBSolibBlock"/>
|
||||
<message_argument value="org.eclipse.dd.gdb.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/ui/launching/GdbAttachLaunchConfigurationTabGroup.java" type="org.eclipse.dd.gdb.internal.ui.launching.GdbAttachLaunchConfigurationTabGroup">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.ui.launching.GdbAttachLaunchConfigurationTabGroup"/>
|
||||
<message_argument value="org.eclipse.dd.gdb.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/ui/launching/IMILaunchConfigurationComponent.java" type="org.eclipse.dd.gdb.internal.ui.launching.IMILaunchConfigurationComponent">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.ui.launching.IMILaunchConfigurationComponent"/>
|
||||
<message_argument value="org.eclipse.dd.gdb.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/ui/launching/CMainTab.java" type="org.eclipse.dd.gdb.internal.ui.launching.CMainTab">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.ui.launching.CMainTab"/>
|
||||
<message_argument value="org.eclipse.dd.gdb.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/ui/launching/TCPSettingsBlock.java" type="org.eclipse.dd.gdb.internal.ui.launching.TCPSettingsBlock">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.ui.launching.TCPSettingsBlock"/>
|
||||
<message_argument value="org.eclipse.dd.gdb.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/ui/launching/GdbServerDebuggerPage.java" type="org.eclipse.dd.gdb.internal.ui.launching.GdbServerDebuggerPage">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.ui.launching.GdbServerDebuggerPage"/>
|
||||
<message_argument value="org.eclipse.dd.gdb.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/ui/launching/SolibSearchPathBlock.java" type="org.eclipse.dd.gdb.internal.ui.launching.SolibSearchPathBlock">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.ui.launching.SolibSearchPathBlock"/>
|
||||
<message_argument value="org.eclipse.dd.gdb.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/ui/launching/LaunchUIMessages.java" type="org.eclipse.dd.gdb.internal.ui.launching.LaunchUIMessages">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.ui.launching.LaunchUIMessages"/>
|
||||
<message_argument value="org.eclipse.dd.gdb.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/ui/launching/GdbRemoteRunLaunchConfigurationTabGroup.java" type="org.eclipse.dd.gdb.internal.ui.launching.GdbRemoteRunLaunchConfigurationTabGroup">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.ui.launching.GdbRemoteRunLaunchConfigurationTabGroup"/>
|
||||
<message_argument value="org.eclipse.dd.gdb.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/ui/launching/CLaunchConfigurationTab.java" type="org.eclipse.dd.gdb.internal.ui.launching.CLaunchConfigurationTab">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.ui.launching.CLaunchConfigurationTab"/>
|
||||
<message_argument value="org.eclipse.dd.gdb.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/ui/launching/SerialPortSettingsBlock.java" type="org.eclipse.dd.gdb.internal.ui.launching.SerialPortSettingsBlock">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.ui.launching.SerialPortSettingsBlock"/>
|
||||
<message_argument value="org.eclipse.dd.gdb.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/ui/launching/AbstractCDebuggerTab.java" type="org.eclipse.dd.gdb.internal.ui.launching.AbstractCDebuggerTab">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.ui.launching.AbstractCDebuggerTab"/>
|
||||
<message_argument value="org.eclipse.dd.gdb.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/ui/launching/GdbDebuggerPage.java" type="org.eclipse.dd.gdb.internal.ui.launching.GdbDebuggerPage">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.ui.launching.GdbDebuggerPage"/>
|
||||
<message_argument value="org.eclipse.dd.gdb.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/ui/launching/CDebuggerTab.java" type="org.eclipse.dd.gdb.internal.ui.launching.CDebuggerTab">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.ui.launching.CDebuggerTab"/>
|
||||
<message_argument value="org.eclipse.dd.gdb.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/ui/launching/LaunchImages.java" type="org.eclipse.dd.gdb.internal.ui.launching.LaunchImages">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.ui.launching.LaunchImages"/>
|
||||
<message_argument value="org.eclipse.dd.gdb.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/ui/launching/ProcessPrompter.java" type="org.eclipse.dd.gdb.internal.ui.launching.ProcessPrompter">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.ui.launching.ProcessPrompter"/>
|
||||
<message_argument value="org.eclipse.dd.gdb.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/ui/launching/ICDTLaunchHelpContextIds.java" type="org.eclipse.dd.gdb.internal.ui.launching.ICDTLaunchHelpContextIds">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.ui.launching.ICDTLaunchHelpContextIds"/>
|
||||
<message_argument value="org.eclipse.dd.gdb.ui_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
</component>
|
|
@ -23,4 +23,8 @@ Require-Bundle: org.eclipse.ui,
|
|||
org.eclipse.core.variables
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||
Export-Package: org.eclipse.dd.gdb.internal.ui.launching
|
||||
Export-Package: org.eclipse.dd.gdb.internal.ui.actions;x-internal:=true,
|
||||
org.eclipse.dd.gdb.internal.ui.breakpoints;x-internal:=true,
|
||||
org.eclipse.dd.gdb.internal.ui.launching;x-internal:=true,
|
||||
org.eclipse.dd.gdb.internal.ui.viewmodel;x-internal:=true,
|
||||
org.eclipse.dd.gdb.internal.ui.viewmodel.launch;x-internal:=true
|
||||
|
|
|
@ -39,7 +39,6 @@ import org.eclipse.dd.gdb.internal.provisional.actions.IConnect;
|
|||
import org.eclipse.dd.gdb.internal.provisional.launching.LaunchMessages;
|
||||
import org.eclipse.dd.gdb.internal.ui.GdbUIPlugin;
|
||||
import org.eclipse.dd.mi.service.IMIProcesses;
|
||||
import org.eclipse.dd.mi.service.ProcessInfo;
|
||||
import org.eclipse.debug.core.DebugPlugin;
|
||||
import org.eclipse.debug.core.IStatusHandler;
|
||||
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
* Contributors:
|
||||
* Ericsson - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.dd.mi.service;
|
||||
package org.eclipse.dd.gdb.internal.ui.actions;
|
||||
|
||||
import org.eclipse.cdt.core.IProcessInfo;
|
||||
import org.eclipse.dd.dsf.concurrent.Immutable;
|
||||
|
||||
@Immutable
|
||||
public class ProcessInfo implements IProcessInfo, Comparable<ProcessInfo> {
|
||||
class ProcessInfo implements IProcessInfo, Comparable<ProcessInfo> {
|
||||
private final int pid;
|
||||
private final String name;
|
||||
|
|
@ -20,9 +20,15 @@
|
|||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
115
plugins/org.eclipse.dd.gdb/.settings/.api_filters
Normal file
115
plugins/org.eclipse.dd.gdb/.settings/.api_filters
Normal file
|
@ -0,0 +1,115 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component id="org.eclipse.dd.gdb" version="2">
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/provisional/launching/GDBDebugger.java" type="org.eclipse.dd.gdb.internal.provisional.launching.GDBDebugger">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.provisional.launching.GDBDebugger"/>
|
||||
<message_argument value="org.eclipse.dd.gdb_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/provisional/IGDBLaunchConfigurationConstants.java" type="org.eclipse.dd.gdb.internal.provisional.IGDBLaunchConfigurationConstants">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.provisional.IGDBLaunchConfigurationConstants"/>
|
||||
<message_argument value="org.eclipse.dd.gdb_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/provisional/launching/LaunchMessages.java" type="org.eclipse.dd.gdb.internal.provisional.launching.LaunchMessages">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.provisional.launching.LaunchMessages"/>
|
||||
<message_argument value="org.eclipse.dd.gdb_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/provisional/launching/GdbLaunchDelegate.java" type="org.eclipse.dd.gdb.internal.provisional.launching.GdbLaunchDelegate">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.provisional.launching.GdbLaunchDelegate"/>
|
||||
<message_argument value="org.eclipse.dd.gdb_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControlDMContext.java" type="org.eclipse.dd.gdb.internal.provisional.service.command.GDBControlDMContext">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.provisional.service.command.GDBControlDMContext"/>
|
||||
<message_argument value="org.eclipse.dd.gdb_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/provisional/launching/ShutdownSequence.java" type="org.eclipse.dd.gdb.internal.provisional.launching.ShutdownSequence">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.provisional.launching.ShutdownSequence"/>
|
||||
<message_argument value="org.eclipse.dd.gdb_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/provisional/breakpoints/CBreakpointGdbThreadsFilterExtension.java" type="org.eclipse.dd.gdb.internal.provisional.breakpoints.CBreakpointGdbThreadsFilterExtension">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.provisional.breakpoints.CBreakpointGdbThreadsFilterExtension"/>
|
||||
<message_argument value="org.eclipse.dd.gdb_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="META-INF/MANIFEST.MF">
|
||||
<filter id="923795461">
|
||||
<message_arguments>
|
||||
<message_argument value="1.1.0.qualifier"/>
|
||||
<message_argument value="1.0.0.v20080609"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/provisional/launching/GDBServerDebugger.java" type="org.eclipse.dd.gdb.internal.provisional.launching.GDBServerDebugger">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.provisional.launching.GDBServerDebugger"/>
|
||||
<message_argument value="org.eclipse.dd.gdb_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControl.java" type="org.eclipse.dd.gdb.internal.provisional.service.command.GDBControl">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.provisional.service.command.GDBControl"/>
|
||||
<message_argument value="org.eclipse.dd.gdb_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/provisional/launching/FinalLaunchSequence.java" type="org.eclipse.dd.gdb.internal.provisional.launching.FinalLaunchSequence">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.provisional.launching.FinalLaunchSequence"/>
|
||||
<message_argument value="org.eclipse.dd.gdb_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/provisional/launching/GdbLaunch.java" type="org.eclipse.dd.gdb.internal.provisional.launching.GdbLaunch">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.provisional.launching.GdbLaunch"/>
|
||||
<message_argument value="org.eclipse.dd.gdb_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/provisional/launching/ServicesLaunchSequence.java" type="org.eclipse.dd.gdb.internal.provisional.launching.ServicesLaunchSequence">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.provisional.launching.ServicesLaunchSequence"/>
|
||||
<message_argument value="org.eclipse.dd.gdb_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
<resource path="src/org/eclipse/dd/gdb/internal/provisional/service/GDBRunControl.java" type="org.eclipse.dd.gdb.internal.provisional.service.GDBRunControl">
|
||||
<filter id="305365105">
|
||||
<message_arguments>
|
||||
<message_argument value="org.eclipse.dd.gdb.internal.provisional.service.GDBRunControl"/>
|
||||
<message_argument value="org.eclipse.dd.gdb_1.1.0"/>
|
||||
</message_arguments>
|
||||
</filter>
|
||||
</resource>
|
||||
</component>
|
|
@ -15,9 +15,9 @@ Require-Bundle: org.eclipse.core.runtime,
|
|||
org.eclipse.core.variables
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-RequiredExecutionEnvironment: J2SE-1.5
|
||||
Export-Package: org.eclipse.dd.gdb.internal.provisional,
|
||||
org.eclipse.dd.gdb.internal.provisional.actions,
|
||||
org.eclipse.dd.gdb.internal.provisional.breakpoints,
|
||||
org.eclipse.dd.gdb.internal.provisional.launching,
|
||||
org.eclipse.dd.gdb.internal.provisional.service,
|
||||
org.eclipse.dd.gdb.internal.provisional.service.command
|
||||
Export-Package: org.eclipse.dd.gdb.internal.provisional;x-internal:=true,
|
||||
org.eclipse.dd.gdb.internal.provisional.actions;x-internal:=true,
|
||||
org.eclipse.dd.gdb.internal.provisional.breakpoints;x-internal:=true,
|
||||
org.eclipse.dd.gdb.internal.provisional.launching;x-internal:=true,
|
||||
org.eclipse.dd.gdb.internal.provisional.service;x-internal:=true,
|
||||
org.eclipse.dd.gdb.internal.provisional.service.command;x-internal:=true
|
||||
|
|
|
@ -51,6 +51,7 @@ public class IGDBLaunchConfigurationConstants {
|
|||
/**
|
||||
* Launch configuration attribute key. Boolean value to set the non-stop mode
|
||||
* Debuger/gdb/MI property.
|
||||
* @since 1.1
|
||||
*/
|
||||
public static final String ATTR_DEBUGGER_NON_STOP = GdbPlugin.PLUGIN_ID + ".NON_STOP"; //$NON-NLS-1$
|
||||
|
||||
|
@ -66,6 +67,7 @@ public class IGDBLaunchConfigurationConstants {
|
|||
|
||||
/**
|
||||
* Launch configuration attribute key. Boolean value to set the 'use shared library symbols for application' flag of the debugger.
|
||||
* @since 1.1
|
||||
*/
|
||||
public static final String ATTR_DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP = GdbPlugin.PLUGIN_ID + ".USE_SOLIB_SYMBOLS_FOR_APP"; //$NON-NLS-1$
|
||||
|
||||
|
@ -91,6 +93,7 @@ public class IGDBLaunchConfigurationConstants {
|
|||
|
||||
/**
|
||||
* Launch configuration attribute value. The key is ATTR_DEBUGGER_NON_STOP.
|
||||
* @since 1.1
|
||||
*/
|
||||
public static final boolean DEBUGGER_NON_STOP_DEFAULT = false;
|
||||
|
||||
|
@ -106,6 +109,7 @@ public class IGDBLaunchConfigurationConstants {
|
|||
|
||||
/**
|
||||
* Launch configuration attribute value. The key is ATTR_DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP.
|
||||
* @since 1.1
|
||||
*/
|
||||
public static final boolean DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP_DEFAULT = false;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@ package org.eclipse.dd.gdb.internal.provisional.actions;
|
|||
|
||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public interface IConnect {
|
||||
/**
|
||||
* Returns whether this element can currently attempt to
|
||||
|
|
|
@ -20,9 +20,15 @@
|
|||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
|
@ -13,7 +13,7 @@ Require-Bundle: org.eclipse.core.runtime,
|
|||
org.eclipse.cdt.debug.core,
|
||||
org.eclipse.cdt.core
|
||||
Export-Package:
|
||||
org.eclipse.dd.mi.internal,
|
||||
org.eclipse.dd.mi.internal;x-internal:=true,
|
||||
org.eclipse.dd.mi.service,
|
||||
org.eclipse.dd.mi.service.command,
|
||||
org.eclipse.dd.mi.service.command.commands,
|
||||
|
|
|
@ -913,6 +913,10 @@ public class ExpressionService extends AbstractDsfService implements IExpression
|
|||
// MIVariableManager separately traps this event
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @since 1.1
|
||||
*/
|
||||
public void flushCache(IDMContext context) {
|
||||
fExpressionCache.reset(context);
|
||||
// We must also mark all variable objects as out-of-date
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.eclipse.dd.dsf.debug.service.IRunControl.IContainerDMContext;
|
|||
/**
|
||||
* An execution group context object. In the GDB/MI protocol, thread groups
|
||||
* are represented by a string identifier, which is the basis for this context.
|
||||
* @since 1.1
|
||||
*/
|
||||
public interface IMIExecutionGroupDMContext extends IContainerDMContext
|
||||
{
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.eclipse.dd.dsf.debug.service.IProcesses.IProcessDMContext;
|
|||
/**
|
||||
* A process context object. In the GDB/MI protocol, processes are represented
|
||||
* by an string identifier, which is the basis for this context.
|
||||
* @since 1.1
|
||||
*/
|
||||
public interface IMIProcessDMContext extends IProcessDMContext {
|
||||
/**
|
||||
|
|
|
@ -16,6 +16,7 @@ import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandC
|
|||
|
||||
/**
|
||||
* This interface provides a method for creating execution contexts.
|
||||
* @since 1.1
|
||||
*/
|
||||
public interface IMIProcesses extends IProcesses
|
||||
{
|
||||
|
|
|
@ -254,14 +254,16 @@ public class MIBreakpoints extends AbstractDsfService implements IBreakpoints
|
|||
// IServiceEventListener
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
* When a watchpoint goes out of scope, it is automatically removed from
|
||||
* the back-end. To keep our internal state synchronized, we have to
|
||||
* remove it from our breakpoints map.
|
||||
*/
|
||||
/**
|
||||
* This method is left for API compatibility only.
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(MIWatchpointScopeEvent e) {
|
||||
// PP:
|
||||
// When a watchpoint goes out of scope, it is automatically removed from
|
||||
// the back-end. To keep our internal state synchronized, we have to
|
||||
// remove it from our breakpoints map.
|
||||
IBreakpointsTargetDMContext bpContext = DMContexts.getAncestorOfType(e.getDMContext(), IBreakpointsTargetDMContext.class);
|
||||
if (bpContext != null) {
|
||||
Map<Integer, MIBreakpointDMData> contextBps = fBreakpoints.get(bpContext);
|
||||
|
@ -271,11 +273,21 @@ public class MIBreakpoints extends AbstractDsfService implements IBreakpoints
|
|||
}
|
||||
}
|
||||
|
||||
// Not used, kept for API compatibility. ICommandControlShutdownDMEvent is used instead
|
||||
/**
|
||||
* This method is left for API compatibility only.
|
||||
* ICommandControlShutdownDMEvent is used instead
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(MIGDBExitEvent e) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(ICommandControlShutdownDMEvent e) {
|
||||
}
|
||||
|
|
|
@ -1228,12 +1228,23 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
|
|||
// Session exit
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
// Not used, kept for API compatibility. ICommandControlShutdownDMEvent is used instead
|
||||
// Not used, kept for API compatibility.
|
||||
/**
|
||||
* This method is left for API compatibility only.
|
||||
* ICommandControlShutdownDMEvent is used instead.
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(MIGDBExitEvent e) {
|
||||
terminated();
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(ICommandControlShutdownDMEvent e) {
|
||||
// bug 243899: The call to terminate results in an exception,
|
||||
|
|
|
@ -274,6 +274,10 @@ public class MIMemory extends AbstractDsfService implements IMemory, ICachingSer
|
|||
// Event handlers
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(IRunControl.IContainerResumedDMEvent e) {
|
||||
fMemoryCache.setTargetAvailable(e.getDMContext(), false);
|
||||
|
@ -282,12 +286,20 @@ public class MIMemory extends AbstractDsfService implements IMemory, ICachingSer
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(IRunControl.IContainerSuspendedDMEvent e) {
|
||||
fMemoryCache.setTargetAvailable(e.getDMContext(), true);
|
||||
fMemoryCache.reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(ExpressionChangedEvent e) {
|
||||
|
||||
|
@ -319,6 +331,24 @@ public class MIMemory extends AbstractDsfService implements IMemory, ICachingSer
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is left for API compatibility only.
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(IRunControl.IResumedDMEvent e) {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is left for API compatibility only.
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(IRunControl.ISuspendedDMEvent e) {
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// SortedLinkedlist
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
@ -907,6 +937,10 @@ public class MIMemory extends AbstractDsfService implements IMemory, ICachingSer
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @since 1.1
|
||||
*/
|
||||
public void flushCache(IDMContext context) {
|
||||
fMemoryCache.reset();
|
||||
}
|
||||
|
|
|
@ -218,6 +218,10 @@ public class MIModules extends AbstractDsfService implements IModules, ICachingS
|
|||
rm.done();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @since 1.1
|
||||
*/
|
||||
public void flushCache(IDMContext context) {
|
||||
fModulesCache.reset();
|
||||
}
|
||||
|
|
|
@ -45,6 +45,9 @@ import org.eclipse.dd.mi.service.command.output.MIThreadListIdsInfo;
|
|||
import org.osgi.framework.BundleContext;
|
||||
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public class MIProcesses extends AbstractDsfService implements IMIProcesses, ICachingService {
|
||||
|
||||
// Below is the context hierarchy that is implemented between the
|
||||
|
@ -606,6 +609,10 @@ public class MIProcesses extends AbstractDsfService implements IMIProcesses, ICa
|
|||
rm.done();
|
||||
}
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(IResumedDMEvent e) {
|
||||
if (e instanceof IContainerResumedDMEvent) {
|
||||
|
@ -618,6 +625,10 @@ public class MIProcesses extends AbstractDsfService implements IMIProcesses, ICa
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(ISuspendedDMEvent e) {
|
||||
if (e instanceof IContainerSuspendedDMEvent) {
|
||||
|
@ -628,13 +639,19 @@ public class MIProcesses extends AbstractDsfService implements IMIProcesses, ICa
|
|||
}
|
||||
}
|
||||
|
||||
// Event handler when a thread starts
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(IStartedDMEvent e) {
|
||||
fContainerCommandCache.reset();
|
||||
}
|
||||
|
||||
// Event handler when a thread exits
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(IExitedDMEvent e) {
|
||||
fContainerCommandCache.reset();
|
||||
|
|
|
@ -399,6 +399,10 @@ public class MIRegisters extends AbstractDsfService implements IRegisters, ICach
|
|||
* need to be flushed. These handlers maintain the state of the caches.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(IRunControl.IResumedDMEvent e) {
|
||||
fRegisterValueCache.setContextAvailable(e.getDMContext(), false);
|
||||
|
@ -407,6 +411,10 @@ public class MIRegisters extends AbstractDsfService implements IRegisters, ICach
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(
|
||||
IRunControl.ISuspendedDMEvent e) {
|
||||
|
@ -414,6 +422,10 @@ public class MIRegisters extends AbstractDsfService implements IRegisters, ICach
|
|||
fRegisterValueCache.reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(final IRegisters.IRegisterChangedDMEvent e) {
|
||||
fRegisterValueCache.reset();
|
||||
|
@ -623,6 +635,10 @@ public class MIRegisters extends AbstractDsfService implements IRegisters, ICach
|
|||
rm.done();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @since 1.1
|
||||
*/
|
||||
public void flushCache(IDMContext context) {
|
||||
fRegisterNameCache.reset(context);
|
||||
fRegisterValueCache.reset(context);
|
||||
|
|
|
@ -321,9 +321,10 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa
|
|||
return new MIExecutionDMC(getSession().getId(), container, threadId);
|
||||
}
|
||||
|
||||
//
|
||||
// Running event handling
|
||||
//
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(final MIRunningEvent e) {
|
||||
IDMEvent<?> event = null;
|
||||
|
@ -339,9 +340,10 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa
|
|||
getSession().dispatchEvent(event, getProperties());
|
||||
}
|
||||
|
||||
//
|
||||
// Suspended event handling
|
||||
//
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(final MIStoppedEvent e) {
|
||||
IDMEvent<?> event = null;
|
||||
|
@ -357,10 +359,12 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa
|
|||
getSession().dispatchEvent(event, getProperties());
|
||||
}
|
||||
|
||||
//
|
||||
// Thread Created event handling
|
||||
// When a new thread is created - OOB Event fired ~"[New Thread 1077300144 (LWP 7973)]\n"
|
||||
//
|
||||
/**
|
||||
* Thread Created event handling
|
||||
* When a new thread is created - OOB Event fired ~"[New Thread 1077300144 (LWP 7973)]\n"
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(final MIThreadCreatedEvent e) {
|
||||
IContainerDMContext containerDmc = e.getDMContext();
|
||||
|
@ -368,10 +372,12 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa
|
|||
getSession().dispatchEvent(new StartedDMEvent(executionCtx, e), getProperties());
|
||||
}
|
||||
|
||||
//
|
||||
// Thread exit event handling
|
||||
// When a new thread is destroyed - OOB Event fired "
|
||||
//
|
||||
/**
|
||||
* Thread exit event handling
|
||||
* When a new thread is destroyed - OOB Event fired "
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(final MIThreadExitEvent e) {
|
||||
IContainerDMContext containerDmc = e.getDMContext();
|
||||
|
@ -379,6 +385,10 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa
|
|||
getSession().dispatchEvent(new ExitedDMEvent(executionCtx, e), getProperties());
|
||||
}
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(ContainerResumedEvent e) {
|
||||
fSuspended = false;
|
||||
|
@ -393,7 +403,10 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(ContainerSuspendedEvent e) {
|
||||
fMICommandCache.setContextAvailable(e.getDMContext(), true);
|
||||
|
@ -405,25 +418,42 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa
|
|||
fStepping = false;
|
||||
}
|
||||
|
||||
// Not used, kept for API compatibility. ICommandControlShutdownDMEvent is used instead
|
||||
/**
|
||||
* Not used, kept for API compatibility. ICommandControlShutdownDMEvent is used instead
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(MIGDBExitEvent e) {
|
||||
fTerminated = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
* @since 1.1
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(ICommandControlShutdownDMEvent e) {
|
||||
fTerminated = true;
|
||||
}
|
||||
|
||||
|
||||
// Event handler when New thread is created
|
||||
/**
|
||||
* Event handler when New thread is created
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(StartedDMEvent e) {
|
||||
|
||||
}
|
||||
|
||||
// Event handler when a thread is destroyed
|
||||
/**
|
||||
* Event handler when a thread is destroyed
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(ExitedDMEvent e) {
|
||||
fMICommandCache.reset(e.getDMContext());
|
||||
|
@ -645,12 +675,13 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa
|
|||
rm.done();
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Run selected execution thread to a given line number.
|
||||
*/
|
||||
// Later add support for Address and function.
|
||||
// skipBreakpoints is not used at the moment. Implement later
|
||||
public void runToLine(IExecutionDMContext context, String fileName, String lineNo, boolean skipBreakpoints, final DataRequestMonitor<MIInfo> rm){
|
||||
// Later add support for Address and function.
|
||||
// skipBreakpoints is not used at the moment. Implement later
|
||||
|
||||
assert context != null;
|
||||
|
||||
IMIExecutionDMContext dmc = DMContexts.getAncestorOfType(context, IMIExecutionDMContext.class);
|
||||
|
@ -678,6 +709,10 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @since 1.1
|
||||
*/
|
||||
public void flushCache(IDMContext context) {
|
||||
fMICommandCache.reset(context);
|
||||
}
|
||||
|
|
|
@ -69,6 +69,7 @@ import org.osgi.framework.BundleContext;
|
|||
* consistent with the events. The purpose of this pattern is to allow clients
|
||||
* that listen to service events and track service state, to be perfectly in
|
||||
* sync with the service state.
|
||||
* @since 1.1
|
||||
*/
|
||||
public class MIRunControlNS extends AbstractDsfService implements IRunControl, ICachingService
|
||||
{
|
||||
|
@ -667,17 +668,29 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl, I
|
|||
// Event handlers
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(final MIRunningEvent e) {
|
||||
getSession().dispatchEvent(new ResumedEvent(e.getDMContext(), e), getProperties());
|
||||
}
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(final MIStoppedEvent e) {
|
||||
getSession().dispatchEvent(new SuspendedEvent(e.getDMContext(), e), getProperties());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(final MIThreadCreatedEvent e) {
|
||||
IContainerDMContext containerDmc = e.getDMContext();
|
||||
|
@ -688,6 +701,10 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl, I
|
|||
getSession().dispatchEvent(new StartedDMEvent(executionCtx, e), getProperties());
|
||||
}
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(final MIThreadExitEvent e) {
|
||||
IContainerDMContext containerDmc = e.getDMContext();
|
||||
|
@ -698,6 +715,10 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl, I
|
|||
getSession().dispatchEvent(new ExitedDMEvent(executionCtx, e), getProperties());
|
||||
}
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(ResumedEvent e) {
|
||||
IExecutionDMContext ctx = e.getDMContext();
|
||||
|
@ -706,6 +727,10 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl, I
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(SuspendedEvent e) {
|
||||
IExecutionDMContext ctx = e.getDMContext();
|
||||
|
@ -714,6 +739,10 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl, I
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(StartedDMEvent e) {
|
||||
IExecutionDMContext executionCtx = e.getDMContext();
|
||||
|
@ -724,11 +753,19 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl, I
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(ExitedDMEvent e) {
|
||||
fThreadRunStates.remove(e.getDMContext());
|
||||
}
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(ICommandControlShutdownDMEvent e) {
|
||||
fTerminated = true;
|
||||
|
|
|
@ -641,7 +641,10 @@ public class MIStack extends AbstractDsfService
|
|||
}
|
||||
}
|
||||
|
||||
// IServiceEventListener
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(IResumedDMEvent e) {
|
||||
fMICommandCache.setContextAvailable(e.getDMContext(), false);
|
||||
|
@ -651,12 +654,23 @@ public class MIStack extends AbstractDsfService
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
* @since 1.1
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(ISuspendedDMEvent e) {
|
||||
fMICommandCache.setContextAvailable(e.getDMContext(), true);
|
||||
fMICommandCache.reset();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
* @since 1.1
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(IMIDMEvent e) {
|
||||
if (e.getMIEvent() instanceof MIStoppedEvent) {
|
||||
|
@ -664,6 +678,19 @@ public class MIStack extends AbstractDsfService
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is left for API compatibility only.
|
||||
* @nooverride This method is not intended to be re-implemented or extended by clients.
|
||||
* @noreference This method is not intended to be referenced by clients.
|
||||
*/
|
||||
@DsfServiceEventHandler
|
||||
public void eventDispatched(MIRunControl.ContainerSuspendedEvent e) {
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @since 1.1
|
||||
*/
|
||||
public void flushCache(IDMContext context) {
|
||||
fMICommandCache.reset(context);
|
||||
}
|
||||
|
|
|
@ -1678,6 +1678,9 @@ public class MIVariableManager implements ICommandControl {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public void markAllOutOfDate() {
|
||||
MIRootVariableObject root;
|
||||
while ((root = updatedRootList.poll()) != null) {
|
||||
|
|
|
@ -86,6 +86,9 @@ public abstract class AbstractCLIProcess extends Process
|
|||
|
||||
private int fPrompt = 1; // 1 --> Primary prompt "(gdb)"; 2 --> Secondary Prompt ">"
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
@ConfinedToDsfExecutor("fSession#getExecutor")
|
||||
public AbstractCLIProcess(ICommandControlService commandControl) throws IOException {
|
||||
fSession = commandControl.getSession();
|
||||
|
@ -118,12 +121,19 @@ public abstract class AbstractCLIProcess extends Process
|
|||
fMIOutLogPipe = miOutLogPipe;
|
||||
fMIInLogPipe = miInLogPipe;
|
||||
}
|
||||
|
||||
public AbstractCLIProcess(AbstractMIControl commandControl) throws IOException {
|
||||
this ( (ICommandControlService)commandControl );
|
||||
}
|
||||
|
||||
protected DsfSession getSession() { return fSession; }
|
||||
|
||||
@Deprecated
|
||||
protected AbstractMIControl getCommandControl() { return (AbstractMIControl)fCommandControl; }
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
protected ICommandControlService getCommandControlService() { return fCommandControl; }
|
||||
|
||||
protected boolean isDisposed() { return fDisposed; }
|
||||
|
|
|
@ -118,6 +118,9 @@ public abstract class AbstractMIControl extends AbstractDsfService
|
|||
fUseThreadAndFrameOptions = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public AbstractMIControl(DsfSession session, String id, boolean useThreadAndFrameOptions) {
|
||||
super(session);
|
||||
fId = id;
|
||||
|
@ -359,10 +362,16 @@ public abstract class AbstractMIControl extends AbstractDsfService
|
|||
|
||||
abstract public MIControlDMContext getControlDMContext();
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public boolean isActive() {
|
||||
return !fStoppedCommandProcessing;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public String getId() {
|
||||
return fId;
|
||||
}
|
||||
|
|
|
@ -60,6 +60,9 @@ public class CLIEventProcessor
|
|||
|
||||
private final DsfServicesTracker fServicesTracker;
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public CLIEventProcessor(ICommandControlService connection, ICommandControlDMContext controlDmc) {
|
||||
fCommandControl = connection;
|
||||
fControlDmc = controlDmc;
|
||||
|
@ -71,7 +74,7 @@ public class CLIEventProcessor
|
|||
}
|
||||
|
||||
@Deprecated
|
||||
public CLIEventProcessor(ICommandControlService connection, IContainerDMContext containerDmc, MIInferiorProcess inferior) {
|
||||
public CLIEventProcessor(AbstractMIControl connection, IContainerDMContext containerDmc, MIInferiorProcess inferior) {
|
||||
this(connection, DMContexts.getAncestorOfType(containerDmc, ICommandControlDMContext.class));
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ import org.eclipse.dd.mi.service.command.events.MISignalChangedEvent;
|
|||
|
||||
/**
|
||||
* GDB debugger output listener.
|
||||
* @since 1.1
|
||||
*/
|
||||
@ConfinedToDsfExecutor("fConnection#getExecutor")
|
||||
public class CLIEventProcessor_7_0
|
||||
|
|
|
@ -50,6 +50,9 @@ public class MIControlDMContext extends AbstractDMContext
|
|||
return fCommandControlFilter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public String getCommandControlId() {
|
||||
return fCommandControlId;
|
||||
}
|
||||
|
|
|
@ -140,19 +140,25 @@ public class MIInferiorProcess extends Process
|
|||
* @param inferiorExecCtx The execution context controlling the execution
|
||||
* state of the inferior process.
|
||||
* @param gdbOutputStream The output stream to use to write user IO into.
|
||||
* @since 1.1
|
||||
*/
|
||||
@ConfinedToDsfExecutor("fSession#getExecutor")
|
||||
public MIInferiorProcess(ICommandControlService commandControl, IExecutionDMContext inferiorExecCtx, OutputStream gdbOutputStream) {
|
||||
this(commandControl, inferiorExecCtx, gdbOutputStream, null);
|
||||
}
|
||||
|
||||
public MIInferiorProcess(AbstractMIControl commandControl, IExecutionDMContext inferiorExecCtx, OutputStream gdbOutputStream) {
|
||||
this(commandControl, inferiorExecCtx, gdbOutputStream, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated {@link #MIInferiorProcess(ICommandControlService, IExecutionDMContext, OutputStream)}
|
||||
* should be used instead.
|
||||
* @since 1.1
|
||||
*/
|
||||
@ConfinedToDsfExecutor("fSession#getExecutor")
|
||||
@Deprecated
|
||||
public MIInferiorProcess(ICommandControlService commandControl, OutputStream gdbOutputStream) {
|
||||
public MIInferiorProcess(AbstractMIControl commandControl, OutputStream gdbOutputStream) {
|
||||
this(commandControl, null, gdbOutputStream, null);
|
||||
}
|
||||
|
||||
|
@ -164,19 +170,25 @@ public class MIInferiorProcess extends Process
|
|||
* @param inferiorExecCtx The execution context controlling the execution
|
||||
* state of the inferior process.
|
||||
* @param p The terminal to use to write user IO into.
|
||||
* @since 1.1
|
||||
*/
|
||||
@ConfinedToDsfExecutor("fSession#getExecutor")
|
||||
public MIInferiorProcess(ICommandControlService commandControl, IExecutionDMContext inferiorExecCtx, PTY p) {
|
||||
this(commandControl, inferiorExecCtx, null, p);
|
||||
}
|
||||
|
||||
public MIInferiorProcess(AbstractMIControl commandControl, IExecutionDMContext inferiorExecCtx, PTY p) {
|
||||
this(commandControl, inferiorExecCtx, null, p);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Should use {@link #MIInferiorProcess(ICommandControlService, IExecutionDMContext, PTY)}
|
||||
* instead.
|
||||
* @since 1.1
|
||||
*/
|
||||
@ConfinedToDsfExecutor("fSession#getExecutor")
|
||||
@Deprecated
|
||||
public MIInferiorProcess(ICommandControlService commandControl, PTY p) {
|
||||
public MIInferiorProcess(AbstractMIControl commandControl, PTY p) {
|
||||
this(commandControl, null, null, p);
|
||||
}
|
||||
|
||||
|
@ -245,9 +257,15 @@ public class MIInferiorProcess extends Process
|
|||
return fSession;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
@Deprecated
|
||||
protected AbstractMIControl getCommandControl() { return (AbstractMIControl)fCommandControl; }
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
protected ICommandControlService getCommandControlService() { return fCommandControl; }
|
||||
|
||||
protected boolean isDisposed() { return fDisposed; }
|
||||
|
@ -419,18 +437,30 @@ public class MIInferiorProcess extends Process
|
|||
return fInputStreamPiped;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public OutputStream getPipedErrorStream() {
|
||||
return fErrorStreamPiped;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public PTY getPTY() {
|
||||
return fPty;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public String getPid() {
|
||||
return fInferiorPid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public void setPid(String pid) {
|
||||
fInferiorPid = pid;
|
||||
}
|
||||
|
|
|
@ -67,6 +67,7 @@ import org.eclipse.dd.mi.service.command.output.MIValue;
|
|||
* MI debugger output listener that listens for the parsed MI output, and
|
||||
* generates corresponding MI events. The generated MI events are then
|
||||
* received by other services and clients.
|
||||
* @since 1.1
|
||||
*/
|
||||
public class MIRunControlEventProcessor_7_0
|
||||
implements IEventListener, ICommandListener
|
||||
|
|
|
@ -23,6 +23,9 @@ public class CLIAttach extends CLICommand<MIInfo> {
|
|||
super(ctx, "attach " + Integer.toString(pid)); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public CLIAttach(ICommandControlDMContext ctx, String pid) {
|
||||
super(ctx, "attach " + pid); //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.eclipse.dd.mi.service.command.output.MIInfo;
|
|||
|
||||
/**
|
||||
* This command disconnects from a remote target.
|
||||
* @since 1.1
|
||||
*/
|
||||
public class CLIDetach extends CLICommand<MIInfo> {
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
package org.eclipse.dd.mi.service.command.commands;
|
||||
|
||||
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext;
|
||||
import org.eclipse.dd.mi.service.command.MIControlDMContext;
|
||||
import org.eclipse.dd.mi.service.command.output.MIInfo;
|
||||
|
||||
/**
|
||||
|
@ -24,7 +25,14 @@ import org.eclipse.dd.mi.service.command.output.MIInfo;
|
|||
*/
|
||||
public class CLIExecAbort extends CLICommand<MIInfo>
|
||||
{
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public CLIExecAbort(ICommandControlDMContext ctx) {
|
||||
super(ctx, "kill"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public CLIExecAbort(MIControlDMContext ctx) {
|
||||
this ((ICommandControlDMContext)ctx);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
package org.eclipse.dd.mi.service.command.commands;
|
||||
|
||||
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext;
|
||||
import org.eclipse.dd.mi.service.command.MIControlDMContext;
|
||||
import org.eclipse.dd.mi.service.command.output.MIInfo;
|
||||
|
||||
/**
|
||||
|
@ -21,7 +22,14 @@ import org.eclipse.dd.mi.service.command.output.MIInfo;
|
|||
*
|
||||
*/
|
||||
public class CLISource extends CLICommand<MIInfo> {
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public CLISource(ICommandControlDMContext ctx, String file) {
|
||||
super(ctx, "source " + file); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public CLISource(MIControlDMContext ctx, String file) {
|
||||
this ((ICommandControlDMContext)ctx, file);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -137,6 +137,9 @@ public class MICommand<V extends MIInfo> implements ICommand<V> {
|
|||
/*
|
||||
* Returns the constructed command potentially using the --thread/--frame options.
|
||||
*/
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public String constructCommand(String threadId, int frameId) {
|
||||
StringBuffer command = new StringBuffer(getOperation());
|
||||
|
||||
|
@ -234,6 +237,9 @@ public class MICommand<V extends MIInfo> implements ICommand<V> {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public boolean supportsThreadAndFrameOptions() { return true; }
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,6 +16,7 @@ import org.eclipse.dd.dsf.debug.service.IExpressions.IExpressionDMContext;
|
|||
import org.eclipse.dd.dsf.debug.service.IStack.IFrameDMContext;
|
||||
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext;
|
||||
import org.eclipse.dd.mi.service.IMIExecutionDMContext;
|
||||
import org.eclipse.dd.mi.service.command.MIControlDMContext;
|
||||
import org.eclipse.dd.mi.service.command.output.MIDataEvaluateExpressionInfo;
|
||||
import org.eclipse.dd.mi.service.command.output.MIOutput;
|
||||
|
||||
|
@ -30,9 +31,17 @@ import org.eclipse.dd.mi.service.command.output.MIOutput;
|
|||
*/
|
||||
public class MIDataEvaluateExpression<V extends MIDataEvaluateExpressionInfo> extends MICommand<V>
|
||||
{
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public MIDataEvaluateExpression(ICommandControlDMContext ctx, String expr) {
|
||||
super(ctx, "-data-evaluate-expression", new String[]{expr}); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public MIDataEvaluateExpression(MIControlDMContext ctx, String expr) {
|
||||
this ((ICommandControlDMContext)ctx, expr);
|
||||
}
|
||||
|
||||
|
||||
public MIDataEvaluateExpression(IMIExecutionDMContext execDmc, String expr) {
|
||||
super(execDmc, "-data-evaluate-expression", new String[]{expr}); //$NON-NLS-1$
|
||||
|
|
|
@ -18,6 +18,7 @@ import org.eclipse.dd.mi.service.command.output.MIInfo;
|
|||
* -environment-cd PATHDIR
|
||||
*
|
||||
* Set GDB's working directory.
|
||||
* @since 1.1
|
||||
*
|
||||
*/
|
||||
public class MIEnvironmentCD extends MICommand <MIInfo>
|
||||
|
|
|
@ -29,6 +29,9 @@ public class MIExecContinue extends MICommand<MIInfo>
|
|||
this(dmc, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public MIExecContinue(IExecutionDMContext dmc, boolean allThreads) {
|
||||
super(dmc, "-exec-continue"); //$NON-NLS-1$
|
||||
if (allThreads) {
|
||||
|
|
|
@ -34,6 +34,9 @@ public class MIExecInterrupt extends MICommand<MIInfo>
|
|||
this(dmc, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public MIExecInterrupt(IExecutionDMContext dmc, boolean allThreads) {
|
||||
super(dmc, "-exec-interrupt"); //$NON-NLS-1$
|
||||
if (allThreads) {
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
package org.eclipse.dd.mi.service.command.commands;
|
||||
|
||||
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext;
|
||||
import org.eclipse.dd.mi.service.command.MIControlDMContext;
|
||||
import org.eclipse.dd.mi.service.command.output.MIInfo;
|
||||
|
||||
|
||||
|
@ -25,11 +26,25 @@ import org.eclipse.dd.mi.service.command.output.MIInfo;
|
|||
*/
|
||||
public class MIFileExecAndSymbols extends MICommand<MIInfo>
|
||||
{
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public MIFileExecAndSymbols(ICommandControlDMContext dmc, String file) {
|
||||
super(dmc, "-file-exec-and-symbols", null, new String[] {file}); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public MIFileExecAndSymbols(MIControlDMContext dmc, String file) {
|
||||
this ((ICommandControlDMContext)dmc, file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public MIFileExecAndSymbols(ICommandControlDMContext dmc) {
|
||||
super(dmc, "-file-exec-and-symbols"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public MIFileExecAndSymbols(MIControlDMContext dmc) {
|
||||
this ((ICommandControlDMContext)dmc);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
package org.eclipse.dd.mi.service.command.commands;
|
||||
|
||||
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext;
|
||||
import org.eclipse.dd.mi.service.command.MIControlDMContext;
|
||||
import org.eclipse.dd.mi.service.command.output.MIInfo;
|
||||
|
||||
|
||||
|
@ -26,11 +27,25 @@ import org.eclipse.dd.mi.service.command.output.MIInfo;
|
|||
*/
|
||||
public class MIFileExecFile extends MICommand<MIInfo>
|
||||
{
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public MIFileExecFile(ICommandControlDMContext dmc, String file) {
|
||||
super(dmc, "-file-exec-file", null, new String[] {file}); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public MIFileExecFile(MIControlDMContext dmc, String file) {
|
||||
this ((ICommandControlDMContext)dmc, file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public MIFileExecFile(ICommandControlDMContext dmc) {
|
||||
super(dmc, "-file-exec-file"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public MIFileExecFile(MIControlDMContext dmc) {
|
||||
this ((ICommandControlDMContext)dmc);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
package org.eclipse.dd.mi.service.command.commands;
|
||||
|
||||
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext;
|
||||
import org.eclipse.dd.mi.service.command.MIControlDMContext;
|
||||
import org.eclipse.dd.mi.service.command.output.MIInfo;
|
||||
|
||||
|
||||
|
@ -25,11 +26,25 @@ import org.eclipse.dd.mi.service.command.output.MIInfo;
|
|||
*/
|
||||
public class MIFileSymbolFile extends MICommand<MIInfo>
|
||||
{
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public MIFileSymbolFile(ICommandControlDMContext dmc, String file) {
|
||||
super(dmc, "-file-symbol-file", null, new String[] {file}); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public MIFileSymbolFile(MIControlDMContext dmc, String file) {
|
||||
this ((ICommandControlDMContext)dmc, file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public MIFileSymbolFile(ICommandControlDMContext dmc) {
|
||||
super(dmc, "-file-symbol-file"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public MIFileSymbolFile(MIControlDMContext dmc) {
|
||||
this ((ICommandControlDMContext)dmc);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandC
|
|||
* -gdb-set args ARGS
|
||||
*
|
||||
* Set the inferior program arguments, to be used in the next `-exec-run'.
|
||||
* @since 1.1
|
||||
*
|
||||
*/
|
||||
public class MIGDBSetArgs extends MIGDBSet
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
package org.eclipse.dd.mi.service.command.commands;
|
||||
|
||||
import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext;
|
||||
import org.eclipse.dd.mi.service.command.MIControlDMContext;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -19,7 +20,14 @@ import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandC
|
|||
*/
|
||||
public class MIGDBSetAutoSolib extends MIGDBSet
|
||||
{
|
||||
/**
|
||||
* @since 1.1
|
||||
*/
|
||||
public MIGDBSetAutoSolib(ICommandControlDMContext ctx, boolean isSet) {
|
||||
super(ctx, new String[] {"auto-solib-add", isSet ? "on" : "off"});//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
|
||||
}
|
||||
|
||||
public MIGDBSetAutoSolib(MIControlDMContext ctx, boolean isSet) {
|
||||
this ((ICommandControlDMContext)ctx, isSet);
|
||||
}
|
||||
}
|
|
@ -19,6 +19,7 @@ import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandC
|
|||
* Set breakpoints applicability mode.
|
||||
* global == a breakpoint applies to all processes.
|
||||
* process == a breakpoint applies to a single process.
|
||||
* @since 1.1
|
||||
*/
|
||||
public class MIGDBSetBreakpointApply extends MIGDBSet
|
||||
{
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandC
|
|||
/**
|
||||
*
|
||||
* -gdb-set non-stop [on | off]
|
||||
* @since 1.1
|
||||
*
|
||||
*/
|
||||
public class MIGDBSetNonStop extends MIGDBSet
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue