mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-18 22:45:23 +02:00
[179293] Further refactoring of the handle*() methods of the RequestMoniotr.
This commit is contained in:
parent
0ab189a725
commit
c60f80ccc0
1 changed files with 9 additions and 8 deletions
|
@ -163,9 +163,12 @@ public class RequestMonitor {
|
||||||
public void cancel() {
|
public void cancel() {
|
||||||
Object[] listeners = null;
|
Object[] listeners = null;
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
fCanceled = true;
|
// Check to make sure the request monitor wasn't previously canceled.
|
||||||
if (fCancelListeners != null) {
|
if (!fCanceled) {
|
||||||
listeners = fCancelListeners.getListeners();
|
fCanceled = true;
|
||||||
|
if (fCancelListeners != null) {
|
||||||
|
listeners = fCancelListeners.getListeners();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,7 +295,8 @@ public class RequestMonitor {
|
||||||
*/
|
*/
|
||||||
@ConfinedToDsfExecutor("fExecutor")
|
@ConfinedToDsfExecutor("fExecutor")
|
||||||
protected void handleFailure() {
|
protected void handleFailure() {
|
||||||
assert !getStatus().isOK();
|
assert !isSuccess();
|
||||||
|
|
||||||
if (isCanceled()) {
|
if (isCanceled()) {
|
||||||
handleCancel();
|
handleCancel();
|
||||||
} else {
|
} else {
|
||||||
|
@ -300,9 +304,7 @@ public class RequestMonitor {
|
||||||
DsfPlugin.getDefault().getLog().log(new Status(
|
DsfPlugin.getDefault().getLog().log(new Status(
|
||||||
IStatus.ERROR, DsfPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Request monitor: '" + this + "' resulted in a cancel status: " + getStatus() + ", even though the request is not set to cancel.", null)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
IStatus.ERROR, DsfPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Request monitor: '" + this + "' resulted in a cancel status: " + getStatus() + ", even though the request is not set to cancel.", null)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
}
|
}
|
||||||
if (getStatus().getSeverity() > IStatus.INFO) {
|
handleErrorOrWarning();
|
||||||
handleErrorOrWarning();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,7 +385,6 @@ public class RequestMonitor {
|
||||||
* rejects the runnable that is submitted invoke this request monitor.
|
* rejects the runnable that is submitted invoke this request monitor.
|
||||||
* This usually happens only when the executor is shutting down.
|
* This usually happens only when the executor is shutting down.
|
||||||
*/
|
*/
|
||||||
@ThreadSafe
|
|
||||||
protected void handleRejectedExecutionException() {
|
protected void handleRejectedExecutionException() {
|
||||||
MultiStatus logStatus = new MultiStatus(DsfPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Request for monitor: '" + toString() + "' resulted in a rejected execution exception.", null); //$NON-NLS-1$ //$NON-NLS-2$
|
MultiStatus logStatus = new MultiStatus(DsfPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Request for monitor: '" + toString() + "' resulted in a rejected execution exception.", null); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
logStatus.merge(getStatus());
|
logStatus.merge(getStatus());
|
||||||
|
|
Loading…
Add table
Reference in a new issue