1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-18 14:35:23 +02:00

[224279] Fixed handling of request monitor in queries when session is disposed.

This commit is contained in:
Pawel Piech 2008-03-27 03:09:58 +00:00
parent 26ae2918f0
commit ad5efaa543
2 changed files with 143 additions and 281 deletions

View file

@ -66,9 +66,8 @@ public class SyncRegisterDataAccess {
String serviceId = DsfServices.createServiceFilter(IRegisters.class, fSession.getId()); String serviceId = DsfServices.createServiceFilter(IRegisters.class, fSession.getId());
if (fServiceTracker == null) { if (fServiceTracker == null) {
try { try {
fServiceTracker = new ServiceTracker( fServiceTracker = new ServiceTracker(DsfDebugUIPlugin.getBundleContext(), DsfDebugUIPlugin
DsfDebugUIPlugin.getBundleContext(), .getBundleContext().createFilter(serviceId), null);
DsfDebugUIPlugin.getBundleContext().createFilter(serviceId), null);
fServiceTracker.open(); fServiceTracker.open();
} catch (InvalidSyntaxException e) { } catch (InvalidSyntaxException e) {
return null; return null;
@ -104,30 +103,19 @@ public class SyncRegisterDataAccess {
final DsfSession session = DsfSession.getSession(fDmc.getSessionId()); final DsfSession session = DsfSession.getSession(fDmc.getSessionId());
if (session == null) { if (session == null) {
cancel(false); cancel(false);
rm.done();
return; return;
} }
IRegisters service = getService(); IRegisters service = getService();
if (service == null) { if (service == null) {
rm.setStatus(new Status(IStatus.ERROR, DsfDebugUIPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_STATE, "Service not available", null)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, DsfDebugUIPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_STATE,
"Service not available", null)); //$NON-NLS-1$
rm.done(); rm.done();
return; return;
} }
service.getBitFieldData(fDmc, new DataRequestMonitor<IBitFieldDMData>(session.getExecutor(), rm) { service.getBitFieldData(fDmc, new DataRequestMonitor<IBitFieldDMData>(session.getExecutor(), rm) {
@Override
protected void handleCompleted() {
/*
* We're in another dispatch, so we must guard against
* executor shutdown again.
*/
if (!DsfSession.isSessionActive(session.getId())) {
GetBitFieldValueQuery.this.cancel(false);
return;
}
super.handleCompleted();
}
@Override @Override
protected void handleSuccess() { protected void handleSuccess() {
/* /*
@ -154,9 +142,11 @@ public class SyncRegisterDataAccess {
* session is stale, then bail out. * session is stale, then bail out.
*/ */
IBitFieldDMContext dmc = getBitFieldDMC(element); IBitFieldDMContext dmc = getBitFieldDMC(element);
if (dmc == null) return null; if (dmc == null)
return null;
DsfSession session = DsfSession.getSession(dmc.getSessionId()); DsfSession session = DsfSession.getSession(dmc.getSessionId());
if (session == null) return null; if (session == null)
return null;
/* /*
* Create the query to request the value from service. Note: no need to * Create the query to request the value from service. Note: no need to
@ -184,7 +174,9 @@ public class SyncRegisterDataAccess {
public class SetBitFieldValueQuery extends Query<Object> { public class SetBitFieldValueQuery extends Query<Object> {
private IBitFieldDMContext fDmc; private IBitFieldDMContext fDmc;
private String fValue; private String fValue;
private String fFormatId; private String fFormatId;
public SetBitFieldValueQuery(IBitFieldDMContext dmc, String value, String formatId) { public SetBitFieldValueQuery(IBitFieldDMContext dmc, String value, String formatId) {
@ -203,6 +195,7 @@ public class SyncRegisterDataAccess {
final DsfSession session = DsfSession.getSession(fDmc.getSessionId()); final DsfSession session = DsfSession.getSession(fDmc.getSessionId());
if (session == null) { if (session == null) {
cancel(false); cancel(false);
rm.done();
return; return;
} }
@ -211,7 +204,8 @@ public class SyncRegisterDataAccess {
*/ */
IRegisters service = getService(); IRegisters service = getService();
if (service == null) { if (service == null) {
rm.setStatus(new Status(IStatus.ERROR, DsfDebugUIPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_STATE, "Service unavailable", null)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, DsfDebugUIPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_STATE,
"Service unavailable", null)); //$NON-NLS-1$
rm.done(); rm.done();
return; return;
} }
@ -219,24 +213,8 @@ public class SyncRegisterDataAccess {
/* /*
* Write the bit field using a string/format style. * Write the bit field using a string/format style.
*/ */
service.writeBitField( service.writeBitField(fDmc, fValue, fFormatId, new DataRequestMonitor<IBitFieldDMData>(session
fDmc, .getExecutor(), rm) {
fValue,
fFormatId,
new DataRequestMonitor<IBitFieldDMData>(session.getExecutor(), rm) {
@Override
protected void handleCompleted() {
/*
* We're in another dispatch, so we must guard
* against executor shutdown again.
*/
if (!DsfSession.isSessionActive(session.getId())) {
SetBitFieldValueQuery.this.cancel(false);
return;
}
super.handleCompleted();
}
@Override @Override
protected void handleSuccess() { protected void handleSuccess() {
/* /*
@ -245,8 +223,7 @@ public class SyncRegisterDataAccess {
rm.setData(new Object()); rm.setData(new Object());
rm.done(); rm.done();
} }
} });
);
} }
} }
@ -257,9 +234,11 @@ public class SyncRegisterDataAccess {
* session is stale, then bail out. * session is stale, then bail out.
*/ */
IBitFieldDMContext dmc = getBitFieldDMC(element); IBitFieldDMContext dmc = getBitFieldDMC(element);
if (dmc == null) return; if (dmc == null)
return;
DsfSession session = DsfSession.getSession(dmc.getSessionId()); DsfSession session = DsfSession.getSession(dmc.getSessionId());
if (session == null) return; if (session == null)
return;
/* /*
* Create the query to write the value to the service. Note: no need to * Create the query to write the value to the service. Note: no need to
@ -311,6 +290,7 @@ public class SyncRegisterDataAccess {
final DsfSession session = DsfSession.getSession(fDmc.getSessionId()); final DsfSession session = DsfSession.getSession(fDmc.getSessionId());
if (session == null) { if (session == null) {
cancel(false); cancel(false);
rm.done();
return; return;
} }
@ -319,7 +299,8 @@ public class SyncRegisterDataAccess {
*/ */
IRegisters service = getService(); IRegisters service = getService();
if (service == null) { if (service == null) {
rm.setStatus(new Status(IStatus.ERROR, DsfDebugUIPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_STATE, "Service unavailable", null)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, DsfDebugUIPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_STATE,
"Service unavailable", null)); //$NON-NLS-1$
rm.done(); rm.done();
return; return;
} }
@ -327,23 +308,7 @@ public class SyncRegisterDataAccess {
/* /*
* Write the bit field using the mnemonic style. * Write the bit field using the mnemonic style.
*/ */
service.writeBitField( service.writeBitField(fDmc, fMnemonic, new DataRequestMonitor<IBitFieldDMData>(session.getExecutor(), rm) {
fDmc,
fMnemonic,
new DataRequestMonitor<IBitFieldDMData>(session.getExecutor(), rm) {
@Override
protected void handleCompleted() {
/*
* We're in another dispatch, so we must guard
* against executor shutdown again.
*/
if (!DsfSession.isSessionActive(session.getId())) {
SetBitFieldValueMnemonicQuery.this.cancel(false);
return;
}
super.handleCompleted();
}
@Override @Override
protected void handleSuccess() { protected void handleSuccess() {
/* /*
@ -352,8 +317,7 @@ public class SyncRegisterDataAccess {
rm.setData(new Object()); rm.setData(new Object());
rm.done(); rm.done();
} }
} });
);
} }
} }
@ -364,9 +328,11 @@ public class SyncRegisterDataAccess {
* session is stale, then bail out. * session is stale, then bail out.
*/ */
IBitFieldDMContext dmc = getBitFieldDMC(element); IBitFieldDMContext dmc = getBitFieldDMC(element);
if (dmc == null) return; if (dmc == null)
return;
DsfSession session = DsfSession.getSession(dmc.getSessionId()); DsfSession session = DsfSession.getSession(dmc.getSessionId());
if (session == null) return; if (session == null)
return;
/* /*
* Create the query to write the value to the service. Note: no need to * Create the query to write the value to the service. Note: no need to
@ -441,30 +407,19 @@ public class SyncRegisterDataAccess {
final DsfSession session = DsfSession.getSession(fDmc.getSessionId()); final DsfSession session = DsfSession.getSession(fDmc.getSessionId());
if (session == null) { if (session == null) {
cancel(false); cancel(false);
rm.done();
return; return;
} }
IRegisters service = getService(); IRegisters service = getService();
if (service == null) { if (service == null) {
rm.setStatus(new Status(IStatus.ERROR, DsfDebugUIPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_STATE, "Service not available", null)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, DsfDebugUIPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_STATE,
"Service not available", null)); //$NON-NLS-1$
rm.done(); rm.done();
return; return;
} }
service.getRegisterGroupData(fDmc, new DataRequestMonitor<IRegisterGroupDMData>(session.getExecutor(), rm) { service.getRegisterGroupData(fDmc, new DataRequestMonitor<IRegisterGroupDMData>(session.getExecutor(), rm) {
@Override
protected void handleCompleted() {
/*
* We're in another dispatch, so we must guard against
* executor shutdown again.
*/
if (!DsfSession.isSessionActive(session.getId())) {
GetRegisterGroupValueQuery.this.cancel(false);
return;
}
super.handleCompleted();
}
@Override @Override
protected void handleSuccess() { protected void handleSuccess() {
/* /*
@ -483,9 +438,11 @@ public class SyncRegisterDataAccess {
* session is stale, then bail out. * session is stale, then bail out.
*/ */
IRegisterGroupDMContext dmc = getRegisterGroupDMC(element); IRegisterGroupDMContext dmc = getRegisterGroupDMC(element);
if (dmc == null) return null; if (dmc == null)
return null;
DsfSession session = DsfSession.getSession(dmc.getSessionId()); DsfSession session = DsfSession.getSession(dmc.getSessionId());
if (session == null) return null; if (session == null)
return null;
/* /*
* Create the query to request the value from service. Note: no need to * Create the query to request the value from service. Note: no need to
@ -530,30 +487,19 @@ public class SyncRegisterDataAccess {
final DsfSession session = DsfSession.getSession(fDmc.getSessionId()); final DsfSession session = DsfSession.getSession(fDmc.getSessionId());
if (session == null) { if (session == null) {
cancel(false); cancel(false);
rm.done();
return; return;
} }
IRegisters service = getService(); IRegisters service = getService();
if (service == null) { if (service == null) {
rm.setStatus(new Status(IStatus.ERROR, DsfDebugUIPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_STATE, "Service not available", null)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, DsfDebugUIPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_STATE,
"Service not available", null)); //$NON-NLS-1$
rm.done(); rm.done();
return; return;
} }
service.getRegisterData(fDmc, new DataRequestMonitor<IRegisterDMData>(session.getExecutor(), rm) { service.getRegisterData(fDmc, new DataRequestMonitor<IRegisterDMData>(session.getExecutor(), rm) {
@Override
protected void handleCompleted() {
/*
* We're in another dispatch, so we must guard against
* executor shutdown again.
*/
if (!DsfSession.isSessionActive(session.getId())) {
GetRegisterValueQuery.this.cancel(false);
return;
}
super.handleCompleted();
}
@Override @Override
protected void handleSuccess() { protected void handleSuccess() {
/* /*
@ -572,9 +518,11 @@ public class SyncRegisterDataAccess {
* session is stale, then bail out. * session is stale, then bail out.
*/ */
IRegisterDMContext dmc = getRegisterDMC(element); IRegisterDMContext dmc = getRegisterDMC(element);
if (dmc == null) return null; if (dmc == null)
return null;
DsfSession session = DsfSession.getSession(dmc.getSessionId()); DsfSession session = DsfSession.getSession(dmc.getSessionId());
if (session == null) return null; if (session == null)
return null;
/* /*
* Create the query to request the value from service. Note: no need to * Create the query to request the value from service. Note: no need to
@ -602,7 +550,9 @@ public class SyncRegisterDataAccess {
public class SetRegisterValueQuery extends Query<Object> { public class SetRegisterValueQuery extends Query<Object> {
private IRegisterDMContext fDmc; private IRegisterDMContext fDmc;
private String fValue; private String fValue;
private String fFormatId; private String fFormatId;
public SetRegisterValueQuery(IRegisterDMContext dmc, String value, String formatId) { public SetRegisterValueQuery(IRegisterDMContext dmc, String value, String formatId) {
@ -621,6 +571,7 @@ public class SyncRegisterDataAccess {
final DsfSession session = DsfSession.getSession(fDmc.getSessionId()); final DsfSession session = DsfSession.getSession(fDmc.getSessionId());
if (session == null) { if (session == null) {
cancel(false); cancel(false);
rm.done();
return; return;
} }
@ -629,7 +580,8 @@ public class SyncRegisterDataAccess {
*/ */
IRegisters service = getService(); IRegisters service = getService();
if (service == null) { if (service == null) {
rm.setStatus(new Status(IStatus.ERROR, DsfDebugUIPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_STATE, "Service unavailable", null)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, DsfDebugUIPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_STATE,
"Service unavailable", null)); //$NON-NLS-1$
rm.done(); rm.done();
return; return;
} }
@ -641,24 +593,8 @@ public class SyncRegisterDataAccess {
/* /*
* Write the bit field using a string/format style. * Write the bit field using a string/format style.
*/ */
service.writeRegister( service.writeRegister(fDmc, fValue, fFormatId, new DataRequestMonitor<IBitFieldDMData>(session
fDmc, .getExecutor(), rm) {
fValue,
fFormatId,
new DataRequestMonitor<IBitFieldDMData>(session.getExecutor(), rm) {
@Override
protected void handleCompleted() {
/*
* We're in another dispatch, so we must guard
* against executor shutdown again.
*/
if (!DsfSession.isSessionActive(session.getId())) {
SetRegisterValueQuery.this.cancel(false);
return;
}
super.handleCompleted();
}
@Override @Override
protected void handleSuccess() { protected void handleSuccess() {
/* /*
@ -667,22 +603,22 @@ public class SyncRegisterDataAccess {
rm.setData(new Object()); rm.setData(new Object());
rm.done(); rm.done();
} }
} });
);
} }
} }
public void writeRegister(Object element, String value, public void writeRegister(Object element, String value, String formatId) {
String formatId) {
/* /*
* Get the DMC and the session. If element is not an register DMC, or * Get the DMC and the session. If element is not an register DMC, or
* session is stale, then bail out. * session is stale, then bail out.
*/ */
IRegisterDMContext dmc = getRegisterDMC(element); IRegisterDMContext dmc = getRegisterDMC(element);
if (dmc == null) return; if (dmc == null)
return;
DsfSession session = DsfSession.getSession(dmc.getSessionId()); DsfSession session = DsfSession.getSession(dmc.getSessionId());
if (session == null) return; if (session == null)
return;
/* /*
* Create the query to write the value to the service. Note: no need to * Create the query to write the value to the service. Note: no need to
@ -730,6 +666,7 @@ public class SyncRegisterDataAccess {
final DsfSession session = DsfSession.getSession(fDmc.getSessionId()); final DsfSession session = DsfSession.getSession(fDmc.getSessionId());
if (session == null) { if (session == null) {
cancel(false); cancel(false);
rm.done();
return; return;
} }
@ -738,7 +675,8 @@ public class SyncRegisterDataAccess {
*/ */
IRegisters service = getService(); IRegisters service = getService();
if (service == null) { if (service == null) {
rm.setStatus(new Status(IStatus.ERROR, DsfDebugUIPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_STATE, "Service unavailable", null)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, DsfDebugUIPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_STATE,
"Service unavailable", null)); //$NON-NLS-1$
rm.done(); rm.done();
return; return;
} }
@ -746,22 +684,7 @@ public class SyncRegisterDataAccess {
/* /*
* Write the bit field using a string/format style. * Write the bit field using a string/format style.
*/ */
service.getAvailableFormats( service.getAvailableFormats(fDmc, new DataRequestMonitor<String[]>(session.getExecutor(), rm) {
fDmc,
new DataRequestMonitor<String[]>(session.getExecutor(), rm) {
@Override
protected void handleCompleted() {
/*
* We're in another dispatch, so we must
* guard against executor shutdown again.
*/
if (!DsfSession.isSessionActive(session.getId())) {
GetSupportFormatsValueQuery.this.cancel(false);
return;
}
super.handleCompleted();
}
@Override @Override
protected void handleSuccess() { protected void handleSuccess() {
/* /*
@ -770,8 +693,7 @@ public class SyncRegisterDataAccess {
rm.setData(new Object()); rm.setData(new Object());
rm.done(); rm.done();
} }
} });
);
} }
} }
@ -788,9 +710,11 @@ public class SyncRegisterDataAccess {
dmc = DMContexts.getAncestorOfType(regdmc, IFormattedDataDMContext.class); dmc = DMContexts.getAncestorOfType(regdmc, IFormattedDataDMContext.class);
} }
if (dmc == null) return null; if (dmc == null)
return null;
DsfSession session = DsfSession.getSession(dmc.getSessionId()); DsfSession session = DsfSession.getSession(dmc.getSessionId());
if (session == null) return null; if (session == null)
return null;
/* /*
* Create the query to write the value to the service. Note: no need to * Create the query to write the value to the service. Note: no need to
@ -818,6 +742,7 @@ public class SyncRegisterDataAccess {
public class GetFormattedValueValueQuery extends Query<Object> { public class GetFormattedValueValueQuery extends Query<Object> {
private IFormattedDataDMContext fDmc; private IFormattedDataDMContext fDmc;
private String fFormatId; private String fFormatId;
public GetFormattedValueValueQuery(IFormattedDataDMContext dmc, String formatId) { public GetFormattedValueValueQuery(IFormattedDataDMContext dmc, String formatId) {
@ -835,6 +760,7 @@ public class SyncRegisterDataAccess {
final DsfSession session = DsfSession.getSession(fDmc.getSessionId()); final DsfSession session = DsfSession.getSession(fDmc.getSessionId());
if (session == null) { if (session == null) {
cancel(false); cancel(false);
rm.done();
return; return;
} }
@ -843,30 +769,21 @@ public class SyncRegisterDataAccess {
*/ */
IRegisters service = getService(); IRegisters service = getService();
if (service == null) { if (service == null) {
rm .setStatus(new Status(IStatus.ERROR, DsfDebugUIPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_STATE, "Service unavailable", null)); //$NON-NLS-1$ rm.setStatus(new Status(IStatus.ERROR, DsfDebugUIPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_STATE,
"Service unavailable", null)); //$NON-NLS-1$
rm.done(); rm.done();
return; return;
} }
/* /*
* Convert to the proper formatting DMC then go get the formatted value. * Convert to the proper formatting DMC then go get the formatted
* value.
*/ */
FormattedValueDMContext formDmc = service.getFormattedValueContext(fDmc, fFormatId); FormattedValueDMContext formDmc = service.getFormattedValueContext(fDmc, fFormatId);
service.getFormattedExpressionValue(formDmc, new DataRequestMonitor<FormattedValueDMData>( session.getExecutor(), rm) { service.getFormattedExpressionValue(formDmc, new DataRequestMonitor<FormattedValueDMData>(session
@Override .getExecutor(), rm) {
protected void handleCompleted() {
/*
* We're in another dispatch, so we must guard against executor shutdown again.
*/
if (!DsfSession.isSessionActive(session.getId())) {
GetFormattedValueValueQuery.this.cancel(false);
return;
}
super.handleCompleted();
}
@Override @Override
protected void handleSuccess() { protected void handleSuccess() {
/* /*
@ -892,9 +809,11 @@ public class SyncRegisterDataAccess {
dmc = DMContexts.getAncestorOfType(regdmc, IFormattedDataDMContext.class); dmc = DMContexts.getAncestorOfType(regdmc, IFormattedDataDMContext.class);
} }
if (dmc == null) return null; if (dmc == null)
return null;
DsfSession session = DsfSession.getSession(dmc.getSessionId()); DsfSession session = DsfSession.getSession(dmc.getSessionId());
if (session == null) return null; if (session == null)
return null;
/* /*
* Create the query to write the value to the service. Note: no need to * Create the query to write the value to the service. Note: no need to
@ -932,9 +851,11 @@ public class SyncRegisterDataAccess {
dmc = DMContexts.getAncestorOfType(bitfielddmc, IFormattedDataDMContext.class); dmc = DMContexts.getAncestorOfType(bitfielddmc, IFormattedDataDMContext.class);
} }
if (dmc == null) return null; if (dmc == null)
return null;
DsfSession session = DsfSession.getSession(dmc.getSessionId()); DsfSession session = DsfSession.getSession(dmc.getSessionId());
if (session == null) return null; if (session == null)
return null;
/* /*
* Create the query to write the value to the service. Note: no need to * Create the query to write the value to the service. Note: no need to

View file

@ -115,6 +115,7 @@ public class SyncVariableDataAccess {
final DsfSession session = DsfSession.getSession(fDmc.getSessionId()); final DsfSession session = DsfSession.getSession(fDmc.getSessionId());
if (session == null) { if (session == null) {
cancel(false); cancel(false);
rm.done();
return; return;
} }
@ -126,20 +127,6 @@ public class SyncVariableDataAccess {
} }
service.getExpressionData(fDmc, new DataRequestMonitor<IExpressionDMData>(session.getExecutor(), rm) { service.getExpressionData(fDmc, new DataRequestMonitor<IExpressionDMData>(session.getExecutor(), rm) {
@Override
protected void handleCompleted() {
/*
* We're in another dispatch, so we must guard against
* executor shutdown again.
*/
if (!DsfSession.isSessionActive(session.getId())) {
GetVariableValueQuery.this.cancel(false);
rm.done();
return;
}
super.handleCompleted();
}
@Override @Override
protected void handleSuccess() { protected void handleSuccess() {
/* /*
@ -214,6 +201,7 @@ public class SyncVariableDataAccess {
final DsfSession session = DsfSession.getSession(fDmc.getSessionId()); final DsfSession session = DsfSession.getSession(fDmc.getSessionId());
if (session == null) { if (session == null) {
cancel(false); cancel(false);
rm.done();
return; return;
} }
@ -235,19 +223,6 @@ public class SyncVariableDataAccess {
fValue, fValue,
fFormatId, fFormatId,
new DataRequestMonitor<IExpressionDMData>(session.getExecutor(), rm) { new DataRequestMonitor<IExpressionDMData>(session.getExecutor(), rm) {
@Override
protected void handleCompleted() {
/*
* We're in another dispatch, so we must guard
* against executor shutdown again.
*/
if (!DsfSession.isSessionActive(session.getId())) {
SetVariableValueQuery.this.cancel(false);
return;
}
super.handleCompleted();
}
@Override @Override
protected void handleSuccess() { protected void handleSuccess() {
/* /*
@ -325,6 +300,7 @@ public class SyncVariableDataAccess {
final DsfSession session = DsfSession.getSession(fDmc.getSessionId()); final DsfSession session = DsfSession.getSession(fDmc.getSessionId());
if (session == null) { if (session == null) {
cancel(false); cancel(false);
rm.done();
return; return;
} }
@ -344,19 +320,6 @@ public class SyncVariableDataAccess {
service.getAvailableFormats( service.getAvailableFormats(
fDmc, fDmc,
new DataRequestMonitor<String[]>(session.getExecutor(), rm) { new DataRequestMonitor<String[]>(session.getExecutor(), rm) {
@Override
protected void handleCompleted() {
/*
* We're in another dispatch, so we must
* guard against executor shutdown again.
*/
if (!DsfSession.isSessionActive(session.getId())) {
GetSupportFormatsValueQuery.this.cancel(false);
return;
}
super.handleCompleted();
}
@Override @Override
protected void handleSuccess() { protected void handleSuccess() {
/* /*
@ -424,6 +387,7 @@ public class SyncVariableDataAccess {
final DsfSession session = DsfSession.getSession(fDmc.getSessionId()); final DsfSession session = DsfSession.getSession(fDmc.getSessionId());
if (session == null) { if (session == null) {
cancel(false); cancel(false);
rm.done();
return; return;
} }
@ -444,18 +408,6 @@ public class SyncVariableDataAccess {
FormattedValueDMContext formDmc = service.getFormattedValueContext(fDmc, fFormatId); FormattedValueDMContext formDmc = service.getFormattedValueContext(fDmc, fFormatId);
service.getFormattedExpressionValue(formDmc, new DataRequestMonitor<FormattedValueDMData>(session.getExecutor(), rm) { service.getFormattedExpressionValue(formDmc, new DataRequestMonitor<FormattedValueDMData>(session.getExecutor(), rm) {
@Override
protected void handleCompleted() {
/*
* We're in another dispatch, so we must guard against executor shutdown again.
*/
if (!DsfSession.isSessionActive(session.getId())) {
GetFormattedValueValueQuery.this.cancel(false);
return;
}
super.handleCompleted();
}
@Override @Override
protected void handleSuccess() { protected void handleSuccess() {
/* /*
@ -520,6 +472,7 @@ public class SyncVariableDataAccess {
final DsfSession session = DsfSession.getSession(fDmc.getSessionId()); final DsfSession session = DsfSession.getSession(fDmc.getSessionId());
if (session == null) { if (session == null) {
cancel(false); cancel(false);
rm.done();
return; return;
} }
@ -534,18 +487,6 @@ public class SyncVariableDataAccess {
} }
service.canWriteExpression(fDmc, new DataRequestMonitor<Boolean>(session.getExecutor(), rm) { service.canWriteExpression(fDmc, new DataRequestMonitor<Boolean>(session.getExecutor(), rm) {
@Override
protected void handleCompleted() {
/*
* We're in another dispatch, so we must guard against executor shutdown again.
*/
if (!DsfSession.isSessionActive(session.getId())) {
CanWriteExpressionQuery.this.cancel(false);
return;
}
super.handleCompleted();
}
@Override @Override
protected void handleSuccess() { protected void handleSuccess() {
/* /*