mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
[206932] Made ICommandControl independent from the IDsfService class.
This commit is contained in:
parent
19e920c433
commit
706d77cc0c
13 changed files with 63 additions and 66 deletions
|
@ -28,6 +28,7 @@ import org.eclipse.dd.dsf.concurrent.IDsfStatusConstants;
|
|||
import org.eclipse.dd.dsf.datamodel.DMContexts;
|
||||
import org.eclipse.dd.dsf.datamodel.IDMContext;
|
||||
import org.eclipse.dd.dsf.debug.internal.DsfDebugPlugin;
|
||||
import org.eclipse.dd.dsf.service.DsfSession;
|
||||
|
||||
/**
|
||||
* This is a utility class for caching results of MI Commands. Return MIInfo
|
||||
|
@ -106,6 +107,10 @@ public class CommandCache implements ICommandListener
|
|||
public IStatus getStatus() { return fStatus; }
|
||||
}
|
||||
|
||||
private DsfSession fSession;
|
||||
|
||||
private ICommandControl fCommandControl;
|
||||
|
||||
/*
|
||||
* This class contains 5 significant lists.
|
||||
*
|
||||
|
@ -139,11 +144,8 @@ public class CommandCache implements ICommandListener
|
|||
* created. When the coalesced commands completes the results will be decomposed
|
||||
* when back into individual results from this command.
|
||||
*/
|
||||
|
||||
private Set<IDMContext> fUnavailableContexts = new HashSet<IDMContext>();
|
||||
|
||||
private ICommandControl fCommandControl;
|
||||
|
||||
private Map<IDMContext, HashMap<CommandInfo, CommandResultInfo>> fCachedContexts = new HashMap<IDMContext, HashMap<CommandInfo, CommandResultInfo>>();
|
||||
|
||||
private ArrayList<CommandInfo> fPendingQCommandsSent = new ArrayList<CommandInfo>();
|
||||
|
@ -152,7 +154,8 @@ public class CommandCache implements ICommandListener
|
|||
|
||||
private ArrayList<CommandInfo> fPendingQWaitingForCoalescedCompletion = new ArrayList<CommandInfo>();
|
||||
|
||||
public CommandCache(ICommandControl control) {
|
||||
public CommandCache(DsfSession session, ICommandControl control) {
|
||||
fSession = session;
|
||||
fCommandControl = control;
|
||||
|
||||
/*
|
||||
|
@ -232,7 +235,7 @@ public class CommandCache implements ICommandListener
|
|||
* well as its cache status.
|
||||
*/
|
||||
public <V extends ICommandResult> void execute(ICommand<V> command, DataRequestMonitor<V> rm) {
|
||||
assert fCommandControl.getExecutor().isInExecutorThread();
|
||||
assert fSession.getExecutor().isInExecutorThread();
|
||||
|
||||
// Cast the generic ?'s to concrete types in the cache implementation.
|
||||
@SuppressWarnings("unchecked")
|
||||
|
@ -315,7 +318,7 @@ public class CommandCache implements ICommandListener
|
|||
|
||||
fCommandControl.queueCommand(
|
||||
finalCachedCmd.getCommand(),
|
||||
new DataRequestMonitor<ICommandResult>(fCommandControl.getExecutor(), null) {
|
||||
new DataRequestMonitor<ICommandResult>(fSession.getExecutor(), null) {
|
||||
@Override
|
||||
public void handleCompleted() {
|
||||
|
||||
|
|
|
@ -11,13 +11,12 @@
|
|||
package org.eclipse.dd.dsf.debug.service.command;
|
||||
|
||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.dd.dsf.service.IDsfService;
|
||||
|
||||
/**
|
||||
* API for sending commands to the debugger and for receiving command results
|
||||
* and asynchronous events.
|
||||
*/
|
||||
public interface ICommandControl extends IDsfService{
|
||||
public interface ICommandControl {
|
||||
|
||||
/**
|
||||
* Adds the specified command to the queue of commands to be processed.
|
||||
|
|
|
@ -73,7 +73,7 @@ public class DsfServicesTracker {
|
|||
|
||||
private BundleContext fBundleContext;
|
||||
private Map<ServiceKey,ServiceReference> fServiceReferences = new HashMap<ServiceKey,ServiceReference>();
|
||||
private Map<ServiceReference,IDsfService> fServices = new HashMap<ServiceReference,IDsfService>();
|
||||
private Map<ServiceReference,Object> fServices = new HashMap<ServiceReference,Object>();
|
||||
private String fServiceFilter;
|
||||
|
||||
/**
|
||||
|
@ -125,7 +125,7 @@ public class DsfServicesTracker {
|
|||
* @param serviceClass class of the desired service
|
||||
* @return instance of the desired service, null if not found
|
||||
*/
|
||||
public <V extends IDsfService> V getService(Class<V> serviceClass) {
|
||||
public <V> V getService(Class<V> serviceClass) {
|
||||
return getService(serviceClass, null);
|
||||
}
|
||||
|
||||
|
@ -140,7 +140,7 @@ public class DsfServicesTracker {
|
|||
* @return instance of the desired service, null if not found
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public <V extends IDsfService> V getService(Class<V> serviceClass, String filter) {
|
||||
public <V> V getService(Class<V> serviceClass, String filter) {
|
||||
ServiceReference serviceRef = getServiceReference(serviceClass, filter);
|
||||
if (serviceRef == null) {
|
||||
return null;
|
||||
|
|
|
@ -122,7 +122,7 @@ public class PDAServicesShutdownSequence extends Sequence {
|
|||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void shutdownService(Class clazz, final RequestMonitor requestMonitor) {
|
||||
IDsfService service = fTracker.getService(clazz);
|
||||
IDsfService service = (IDsfService)fTracker.getService(clazz);
|
||||
if (service != null) {
|
||||
service.shutdown(new RequestMonitor(getExecutor(), requestMonitor) {
|
||||
@Override
|
||||
|
|
|
@ -189,7 +189,7 @@ public class PDAExpressions extends AbstractDsfService implements IExpressions {
|
|||
private void doInitialize(final RequestMonitor rm) {
|
||||
fCommandControl = getServicesTracker().getService(PDACommandControl.class);
|
||||
fStack = getServicesTracker().getService(IStack.class);
|
||||
fCommandCache = new CommandCache(fCommandControl);
|
||||
fCommandCache = new CommandCache(getSession(), fCommandControl);
|
||||
|
||||
getSession().addServiceEventListener(this, null);
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ public class PDAStack extends AbstractDsfService implements IStack {
|
|||
fRunControl = getServicesTracker().getService(IRunControl.class);
|
||||
|
||||
// Create the commands cache
|
||||
fCommandCache = new CommandCache(fCommandControl);
|
||||
fCommandCache = new CommandCache(getSession(), fCommandControl);
|
||||
|
||||
// Register to listen for run control events, to clear cache accordingly.
|
||||
getSession().addServiceEventListener(this, null);
|
||||
|
|
|
@ -160,7 +160,7 @@ public class ShutdownSequence extends Sequence {
|
|||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void shutdownService(Class clazz, final RequestMonitor requestMonitor) {
|
||||
IDsfService service = fTracker.getService(clazz);
|
||||
IDsfService service = (IDsfService)fTracker.getService(clazz);
|
||||
if (service != null) {
|
||||
service.shutdown(new RequestMonitor(getExecutor(), requestMonitor) {
|
||||
@Override
|
||||
|
|
|
@ -452,7 +452,7 @@ public class ExpressionService extends AbstractDsfService implements IExpression
|
|||
|
||||
// Create the meta command cache which will use the variable manager
|
||||
// to actually send MI commands to the back-end
|
||||
fExpressionCache = new CommandCache(varManager);
|
||||
fExpressionCache = new CommandCache(getSession(), varManager);
|
||||
|
||||
requestMonitor.done();
|
||||
}
|
||||
|
@ -467,7 +467,7 @@ public class ExpressionService extends AbstractDsfService implements IExpression
|
|||
@Override
|
||||
public void shutdown(RequestMonitor requestMonitor) {
|
||||
unregister();
|
||||
varManager.shutdown();
|
||||
varManager.dispose();
|
||||
getSession().removeServiceEventListener(this);
|
||||
super.shutdown(requestMonitor);
|
||||
}
|
||||
|
|
|
@ -438,7 +438,7 @@ public class MIMemory extends AbstractDsfService implements IMemory {
|
|||
|
||||
public MIMemoryCache() {
|
||||
// Create the command cache
|
||||
fCommandCache = new CommandCache(getServicesTracker().getService(ICommandControl.class));
|
||||
fCommandCache = new CommandCache(getSession(), getServicesTracker().getService(ICommandControl.class));
|
||||
// Create the memory block cache
|
||||
fMemoryBlockList = new SortedMemoryBlockList();
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ public class MIModules extends AbstractDsfService implements IModules {
|
|||
|
||||
private void doInitialize(RequestMonitor requestMonitor) {
|
||||
// Cache for holding Modules data
|
||||
fModulesCache = new CommandCache(getServicesTracker().getService(ICommandControl.class));
|
||||
fModulesCache = new CommandCache(getSession(), getServicesTracker().getService(ICommandControl.class));
|
||||
/*
|
||||
* Make ourselves known so clients can use us.
|
||||
*/
|
||||
|
|
|
@ -171,8 +171,8 @@ public class MIRegisters extends AbstractDsfService implements IRegisters {
|
|||
/*
|
||||
* Create the lower level register cache.
|
||||
*/
|
||||
fRegisterValueCache = new CommandCache(getServicesTracker().getService(ICommandControl.class));
|
||||
fRegisterNameCache = new CommandCache(getServicesTracker().getService(ICommandControl.class));
|
||||
fRegisterValueCache = new CommandCache(getSession(), getServicesTracker().getService(ICommandControl.class));
|
||||
fRegisterNameCache = new CommandCache(getSession(), getServicesTracker().getService(ICommandControl.class));
|
||||
|
||||
/*
|
||||
* Signup so we see events. We use these events to decide how to manage
|
||||
|
|
|
@ -285,7 +285,7 @@ public class MIRunControl extends AbstractDsfService implements IRunControl
|
|||
|
||||
private void doInitialize(final RequestMonitor rm) {
|
||||
fConnection = getServicesTracker().getService(ICommandControl.class);
|
||||
fMICommandCache = new CommandCache(fConnection);
|
||||
fMICommandCache = new CommandCache(getSession(), fConnection);
|
||||
getSession().addServiceEventListener(this, null);
|
||||
|
||||
//register(new String[]{IRunControl.class.getName(), MIRunControl.class.getName()}, new Hashtable<String,String>());
|
||||
|
|
|
@ -41,7 +41,6 @@ import org.eclipse.dd.dsf.debug.service.command.ICommandControl;
|
|||
import org.eclipse.dd.dsf.debug.service.command.ICommandListener;
|
||||
import org.eclipse.dd.dsf.debug.service.command.ICommandResult;
|
||||
import org.eclipse.dd.dsf.debug.service.command.IEventListener;
|
||||
import org.eclipse.dd.dsf.service.AbstractDsfService;
|
||||
import org.eclipse.dd.dsf.service.DsfServiceEventHandler;
|
||||
import org.eclipse.dd.dsf.service.DsfServicesTracker;
|
||||
import org.eclipse.dd.dsf.service.DsfSession;
|
||||
|
@ -81,7 +80,6 @@ import org.eclipse.dd.mi.service.command.output.MIVarListChildrenInfo;
|
|||
import org.eclipse.dd.mi.service.command.output.MIVarSetFormatInfo;
|
||||
import org.eclipse.dd.mi.service.command.output.MIVarShowAttributesInfo;
|
||||
import org.eclipse.dd.mi.service.command.output.MIVarUpdateInfo;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
/**
|
||||
* Manages a list of variable objects as created through GDB/MI commands.
|
||||
|
@ -195,7 +193,7 @@ import org.osgi.framework.BundleContext;
|
|||
* with a specified format, therefore allowing us to never use -var-set-format, and
|
||||
* consequently, to easily keep the display format of all variable objects to natural.
|
||||
*/
|
||||
public class MIVariableManager extends AbstractDsfService implements ICommandControl {
|
||||
public class MIVariableManager implements ICommandControl {
|
||||
|
||||
|
||||
/**
|
||||
|
@ -353,7 +351,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
updatesPending.add(rm);
|
||||
} else {
|
||||
currentState = STATE_UPDATING;
|
||||
getRootToUpdate().update(new DataRequestMonitor<Boolean>(getExecutor(), rm) {
|
||||
getRootToUpdate().update(new DataRequestMonitor<Boolean>(fSession.getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
currentState = STATE_READY;
|
||||
|
@ -412,7 +410,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
} else {
|
||||
fCommandControl.queueCommand(
|
||||
new MIVarShowAttributes(fControlDmc, getGdbName()),
|
||||
new DataRequestMonitor<MIVarShowAttributesInfo>(getExecutor(), rm) {
|
||||
new DataRequestMonitor<MIVarShowAttributesInfo>(fSession.getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
editable = getData().isEditable();
|
||||
|
@ -457,14 +455,14 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
IExpressionDMContext addrCxt = fExpressionService.createExpression(exprCxt, "&(" + exprCxt.getExpression() + ")"); //$NON-NLS-1$//$NON-NLS-2$
|
||||
|
||||
final FormattedValueDMContext formatCxt = new FormattedValueDMContext(
|
||||
fExpressionService.getSession().getId(),
|
||||
fSession.getId(),
|
||||
addrCxt,
|
||||
dmc.getFormatID()
|
||||
);
|
||||
|
||||
getVariable(
|
||||
addrCxt,
|
||||
new DataRequestMonitor<MIVariableObject>(getExecutor(), rm) {
|
||||
new DataRequestMonitor<MIVariableObject>(fSession.getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
getData().getValue(formatCxt, rm);
|
||||
|
@ -483,7 +481,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
}
|
||||
|
||||
if (locked) {
|
||||
operationsPending.add(new RequestMonitor(getExecutor(), rm) {
|
||||
operationsPending.add(new RequestMonitor(fSession.getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
getValue(dmc, rm);
|
||||
|
@ -500,7 +498,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
// We must first set the new format and then evaluate the variable
|
||||
fCommandControl.queueCommand(
|
||||
new MIVarSetFormat(fControlDmc, getGdbName(), dmc.getFormatID()),
|
||||
new DataRequestMonitor<MIVarSetFormatInfo>(getExecutor(), rm) {
|
||||
new DataRequestMonitor<MIVarSetFormatInfo>(fSession.getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
|
@ -536,7 +534,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
private void evaluate(final DataRequestMonitor<FormattedValueDMData> rm) {
|
||||
fCommandControl.queueCommand(
|
||||
new MIVarEvaluateExpression(fControlDmc, getGdbName()),
|
||||
new DataRequestMonitor<MIVarEvaluateExpressionInfo>(getExecutor(), rm) {
|
||||
new DataRequestMonitor<MIVarEvaluateExpressionInfo>(fSession.getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
|
@ -573,7 +571,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
if (!getCurrentFormat().equals(IFormattedValues.NATURAL_FORMAT)) {
|
||||
fCommandControl.queueCommand(
|
||||
new MIVarSetFormat(fControlDmc, getGdbName(), IFormattedValues.NATURAL_FORMAT),
|
||||
new DataRequestMonitor<MIVarSetFormatInfo>(getExecutor(), null) {
|
||||
new DataRequestMonitor<MIVarSetFormatInfo>(fSession.getExecutor(), null) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
|
@ -639,13 +637,13 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
// Also no need to lock the object, since getting the children won't affect other operations
|
||||
fCommandControl.queueCommand(
|
||||
new MIVarListChildren(fControlDmc, getGdbName()),
|
||||
new DataRequestMonitor<MIVarListChildrenInfo>(getExecutor(), rm) {
|
||||
new DataRequestMonitor<MIVarListChildrenInfo>(fSession.getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
MIVar[] children = getData().getMIVars();
|
||||
final List<ExpressionInfo> realChildren = new ArrayList<ExpressionInfo>();
|
||||
|
||||
final CountingRequestMonitor countingRm = new CountingRequestMonitor(getExecutor(), rm) {
|
||||
final CountingRequestMonitor countingRm = new CountingRequestMonitor(fSession.getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
// Store the children in our variable object cache
|
||||
|
@ -676,7 +674,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
numSubRequests++;
|
||||
|
||||
final DataRequestMonitor<String> childPathRm =
|
||||
new DataRequestMonitor<String>(getExecutor(), countingRm) {
|
||||
new DataRequestMonitor<String>(fSession.getExecutor(), countingRm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
String childFullExpression = getData();
|
||||
|
@ -727,7 +725,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
// get the children of this child to get the real children
|
||||
childVar.getChildren(
|
||||
exprDmc,
|
||||
new DataRequestMonitor<ExpressionInfo[]>(getExecutor(), countingRm) {
|
||||
new DataRequestMonitor<ExpressionInfo[]>(fSession.getExecutor(), countingRm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
ExpressionInfo[] vars = getData();
|
||||
|
@ -756,7 +754,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
// can get from -var-info-path-expression starting from GDB 6.7
|
||||
fCommandControl.queueCommand(
|
||||
new MIVarInfoPathExpression(fControlDmc, child.getVarName()),
|
||||
new DataRequestMonitor<MIVarInfoPathExpressionInfo>(getExecutor(), childPathRm) {
|
||||
new DataRequestMonitor<MIVarInfoPathExpressionInfo>(fSession.getExecutor(), childPathRm) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
|
@ -883,7 +881,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
// No need to be in ready state or to lock the object
|
||||
fCommandControl.queueCommand(
|
||||
new MIVarAssign(fControlDmc, getGdbName(), value),
|
||||
new DataRequestMonitor<MIVarAssignInfo>(getExecutor(), rm) {
|
||||
new DataRequestMonitor<MIVarAssignInfo>(fSession.getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
// We must also mark all variable objects
|
||||
|
@ -960,7 +958,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
|
||||
fCommandControl.queueCommand(
|
||||
new MIVarCreate(exprCtx, exprCtx.getExpression()),
|
||||
new DataRequestMonitor<MIVarCreateInfo>(getExecutor(), rm) {
|
||||
new DataRequestMonitor<MIVarCreateInfo>(fSession.getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
|
@ -1016,7 +1014,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
// Creation failed, inform anyone waiting.
|
||||
while (updatesPending.size() > 0) {
|
||||
RequestMonitor rm = updatesPending.poll();
|
||||
rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, INVALID_HANDLE,
|
||||
rm.setStatus(new Status(IStatus.ERROR, MIPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_HANDLE,
|
||||
"Unable to create variable object", null)); //$NON-NLS-1$
|
||||
rm.done();
|
||||
}
|
||||
|
@ -1057,7 +1055,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
// var-set-format command. This is done in the getValue() method
|
||||
fCommandControl.queueCommand(
|
||||
new MIVarUpdate(fControlDmc, getGdbName()),
|
||||
new DataRequestMonitor<MIVarUpdateInfo>(getExecutor(), rm) {
|
||||
new DataRequestMonitor<MIVarUpdateInfo>(fSession.getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
currentState = STATE_READY;
|
||||
|
@ -1127,7 +1125,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
if (getGdbName() != null) {
|
||||
fCommandControl.queueCommand(
|
||||
new MIVarDelete(fControlDmc, getGdbName()),
|
||||
new DataRequestMonitor<MIVarDeleteInfo>(getExecutor(), null));
|
||||
new DataRequestMonitor<MIVarDeleteInfo>(fSession.getExecutor(), null));
|
||||
// Nothing to do in the requestMonitor, since the object was already
|
||||
// removed from our list before calling this method.
|
||||
|
||||
|
@ -1199,7 +1197,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
// from the StackService command cache after the first time.
|
||||
fStackService.getStackDepth(
|
||||
execCtx, 0,
|
||||
new DataRequestMonitor<Integer>(getExecutor(), rm) {
|
||||
new DataRequestMonitor<Integer>(fSession.getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
fFrameId = new Integer(getData() - frameCtx.getLevel());
|
||||
|
@ -1294,6 +1292,8 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
}
|
||||
}
|
||||
|
||||
private final DsfSession fSession;
|
||||
|
||||
/** Provides access to the GDB/MI back-end */
|
||||
private final ICommandControl fCommandControl;
|
||||
// The stack service needs to be used to get information such
|
||||
|
@ -1326,7 +1326,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
* The service tracker that can be used to find other services
|
||||
*/
|
||||
public MIVariableManager(DsfSession session, DsfServicesTracker tracker) {
|
||||
super(session);
|
||||
fSession = session;
|
||||
lruVariableList = new LRUVariableCache();
|
||||
fCommandControl = tracker.getService(ICommandControl.class);
|
||||
fStackService = tracker.getService(IStack.class);
|
||||
|
@ -1334,11 +1334,11 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
fControlDmc = ((AbstractMIControl)fCommandControl).getControlDMContext();
|
||||
|
||||
// Register to receive service events for this session.
|
||||
getSession().addServiceEventListener(this, null);
|
||||
fSession.addServiceEventListener(this, null);
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
getSession().removeServiceEventListener(this);
|
||||
public void dispose() {
|
||||
fSession.removeServiceEventListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1360,7 +1360,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
final VariableObjectId id = new VariableObjectId();
|
||||
id.generateId(
|
||||
exprCtx,
|
||||
new RequestMonitor(getExecutor(), rm) {
|
||||
new RequestMonitor(fSession.getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
getVariable(id, exprCtx, rm);
|
||||
|
@ -1381,7 +1381,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
// We have found a varObject, but it may not be updated yet.
|
||||
// Updating the object will also tell us if it is out-of-scope
|
||||
// and if we should re-create it.
|
||||
varObj.update(new DataRequestMonitor<Boolean>(getExecutor(), rm) {
|
||||
varObj.update(new DataRequestMonitor<Boolean>(fSession.getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
|
||||
|
@ -1441,7 +1441,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
// Note that this will replace any old entry with the same id.
|
||||
lruVariableList.put(id, newVarObj);
|
||||
|
||||
newVarObj.create(exprCtx, new RequestMonitor(getExecutor(), rm) {
|
||||
newVarObj.create(exprCtx, new RequestMonitor(fSession.getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleCompleted() {
|
||||
if (isSuccess()) {
|
||||
|
@ -1479,7 +1479,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
|
||||
getVariable(
|
||||
ctx,
|
||||
new DataRequestMonitor<MIVariableObject>(getExecutor(), rm) {
|
||||
new DataRequestMonitor<MIVariableObject>(fSession.getExecutor(), rm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
getData().writeValue(expressionValue, formatId, rm);
|
||||
|
@ -1502,7 +1502,7 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
|
||||
getVariable(
|
||||
exprCtx,
|
||||
new DataRequestMonitor<MIVariableObject>(getExecutor(), drm) {
|
||||
new DataRequestMonitor<MIVariableObject>(fSession.getExecutor(), drm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
drm.setData(
|
||||
|
@ -1521,11 +1521,11 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
|
||||
getVariable(
|
||||
exprCtx,
|
||||
new DataRequestMonitor<MIVariableObject>(getExecutor(), drm) {
|
||||
new DataRequestMonitor<MIVariableObject>(fSession.getExecutor(), drm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
getData().getAttributes(
|
||||
new DataRequestMonitor<Boolean>(getExecutor(), drm) {
|
||||
new DataRequestMonitor<Boolean>(fSession.getExecutor(), drm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
drm.setData(new ExprMetaGetAttributesInfo(getData()));
|
||||
|
@ -1544,12 +1544,12 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
|
||||
getVariable(
|
||||
exprCtx,
|
||||
new DataRequestMonitor<MIVariableObject>(getExecutor(), drm) {
|
||||
new DataRequestMonitor<MIVariableObject>(fSession.getExecutor(), drm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
getData().getValue(
|
||||
valueCtx,
|
||||
new DataRequestMonitor<FormattedValueDMData>(getExecutor(), drm) {
|
||||
new DataRequestMonitor<FormattedValueDMData>(fSession.getExecutor(), drm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
drm.setData(
|
||||
|
@ -1567,12 +1567,12 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
|
||||
getVariable(
|
||||
exprCtx,
|
||||
new DataRequestMonitor<MIVariableObject>(getExecutor(), drm) {
|
||||
new DataRequestMonitor<MIVariableObject>(fSession.getExecutor(), drm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
getData().getChildren(
|
||||
exprCtx,
|
||||
new DataRequestMonitor<ExpressionInfo[]>(getExecutor(), drm) {
|
||||
new DataRequestMonitor<ExpressionInfo[]>(fSession.getExecutor(), drm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
drm.setData(new ExprMetaGetChildrenInfo(getData()));
|
||||
|
@ -1589,11 +1589,11 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
|
||||
getVariable(
|
||||
exprCtx,
|
||||
new DataRequestMonitor<MIVariableObject>(getExecutor(), drm) {
|
||||
new DataRequestMonitor<MIVariableObject>(fSession.getExecutor(), drm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
getData().getChildrenCount(
|
||||
new DataRequestMonitor<Integer>(getExecutor(), drm) {
|
||||
new DataRequestMonitor<Integer>(fSession.getExecutor(), drm) {
|
||||
@Override
|
||||
protected void handleSuccess() {
|
||||
drm.setData(new ExprMetaGetChildCountInfo(getData()));
|
||||
|
@ -1650,11 +1650,6 @@ public class MIVariableManager extends AbstractDsfService implements ICommandCon
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BundleContext getBundleContext() {
|
||||
return MIPlugin.getBundleContext();
|
||||
}
|
||||
|
||||
private void markAllOutOfDate() {
|
||||
MIRootVariableObject root;
|
||||
while ((root = updatedRootList.poll()) != null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue