@Override protected boolean isSlicerError(MultiStatus slicerStatus) { return slicerStatus.matches(IStatus.ERROR | IStatus.CANCEL); }
@Override protected boolean isSlicerError(MultiStatus slicerStatus) { return slicerStatus.matches(IStatus.WARNING | IStatus.ERROR | IStatus.CANCEL); }
public boolean isValidXML() { return (status == null || !status.matches(IStatus.ERROR | IStatus.CANCEL)); }
public boolean isValidXML() { return (status == null || !status.matches(IStatus.ERROR | IStatus.CANCEL)); }
/** * Called by the JobManager to notify the group when the last job belonging * to the group has finished execution. Must be called from JobManager#updateJobGroup. * * @param groupResult the combined status of the job group * @GuardedBy("JobManager.lock") * @GuardedBy("jobGroupStateLock") */ final void endJobGroup(MultiStatus groupResult) { synchronized (jobGroupStateLock) { if (seedJobsRemainingCount > 0 && !groupResult.matches(IStatus.CANCEL)) throw new IllegalStateException("Invalid initial jobs remaining count"); //$NON-NLS-1$ state = JobGroup.NONE; result = groupResult; results.clear(); cancelingDueToError = false; failedJobsCount = 0; canceledJobsCount = 0; seedJobsRemainingCount = seedJobsCount; jobGroupStateLock.notifyAll(); } }
/** * Called by the JobManager to notify the group when the last job belonging * to the group has finished execution. Must be called from JobManager#updateJobGroup. * * @param groupResult the combined status of the job group * @GuardedBy("JobManager.lock") * @GuardedBy("jobGroupStateLock") */ final void endJobGroup(MultiStatus groupResult) { synchronized (jobGroupStateLock) { if (seedJobsRemainingCount > 0 && !groupResult.matches(IStatus.CANCEL)) throw new IllegalStateException("Invalid initial jobs remaining count"); //$NON-NLS-1$ state = JobGroup.NONE; result = groupResult; results.clear(); cancelingDueToError = false; failedJobsCount = 0; canceledJobsCount = 0; seedJobsRemainingCount = seedJobsCount; jobGroupStateLock.notifyAll(); } }
IStatus prepare(IProgressMonitor monitor) { monitor.subTask(Messages.preparing); MultiStatus status = new MultiStatus(EngineActivator.ID, IStatus.OK, null, null); for (Touchpoint touchpoint : touchpoints) { try { status.add(touchpoint.prepare(profile)); } catch (RuntimeException e) { // "touchpoint.prepare" calls user code and might throw an unchecked exception // we catch the error here to gather information on where the problem occurred. status.add(new Status(IStatus.ERROR, EngineActivator.ID, NLS.bind(Messages.touchpoint_prepare_error, touchpoint.getClass().getName()), e)); } catch (LinkageError e) { // Catch linkage errors as these are generally recoverable but let other Errors propagate (see bug 222001) status.add(new Status(IStatus.ERROR, EngineActivator.ID, NLS.bind(Messages.touchpoint_prepare_error, touchpoint.getClass().getName()), e)); } } if (status.matches(IStatus.ERROR)) { MultiStatus result = new MultiStatus(EngineActivator.ID, IStatus.ERROR, NLS.bind(Messages.session_prepare_error, profile.getProfileId()), null); result.merge(status); return result; } return status; }
IStatus prepare(IProgressMonitor monitor) { monitor.subTask(Messages.preparing); MultiStatus status = new MultiStatus(EngineActivator.ID, IStatus.OK, null, null); for (Touchpoint touchpoint : touchpoints) { try { status.add(touchpoint.prepare(profile)); } catch (RuntimeException e) { // "touchpoint.prepare" calls user code and might throw an unchecked exception // we catch the error here to gather information on where the problem occurred. status.add(new Status(IStatus.ERROR, EngineActivator.ID, NLS.bind(Messages.touchpoint_prepare_error, touchpoint.getClass().getName()), e)); } catch (LinkageError e) { // Catch linkage errors as these are generally recoverable but let other Errors propagate (see bug 222001) status.add(new Status(IStatus.ERROR, EngineActivator.ID, NLS.bind(Messages.touchpoint_prepare_error, touchpoint.getClass().getName()), e)); } } if (status.matches(IStatus.ERROR)) { MultiStatus result = new MultiStatus(EngineActivator.ID, IStatus.ERROR, NLS.bind(Messages.session_prepare_error, profile.getProfileId()), null); result.merge(status); return result; } return status; }
IStatus commit(IProgressMonitor monitor) { monitor.subTask(Messages.committing); MultiStatus status = new MultiStatus(EngineActivator.ID, IStatus.OK, null, null); phaseActionRecordsPairs.clear(); for (Touchpoint touchpoint : touchpoints) { try { IStatus result = touchpoint.commit(profile); if (!result.isOK()) status.add(result); } catch (RuntimeException e) { // "touchpoint.commit" calls user code and might throw an unchecked exception // we catch the error here to gather information on where the problem occurred. status.add(new Status(IStatus.ERROR, EngineActivator.ID, NLS.bind(Messages.touchpoint_commit_error, touchpoint.getClass().getName()), e)); } catch (LinkageError e) { // Catch linkage errors as these are generally recoverable but let other Errors propagate (see bug 222001) status.add(new Status(IStatus.ERROR, EngineActivator.ID, NLS.bind(Messages.touchpoint_commit_error, touchpoint.getClass().getName()), e)); } } if (status.matches(IStatus.ERROR)) { MultiStatus result = new MultiStatus(EngineActivator.ID, IStatus.ERROR, NLS.bind(Messages.session_commit_error, profile.getProfileId()), null); result.merge(status); return result; } return status; }
IStatus commit(IProgressMonitor monitor) { monitor.subTask(Messages.committing); MultiStatus status = new MultiStatus(EngineActivator.ID, IStatus.OK, null, null); phaseActionRecordsPairs.clear(); for (Touchpoint touchpoint : touchpoints) { try { IStatus result = touchpoint.commit(profile); if (!result.isOK()) status.add(result); } catch (RuntimeException e) { // "touchpoint.commit" calls user code and might throw an unchecked exception // we catch the error here to gather information on where the problem occurred. status.add(new Status(IStatus.ERROR, EngineActivator.ID, NLS.bind(Messages.touchpoint_commit_error, touchpoint.getClass().getName()), e)); } catch (LinkageError e) { // Catch linkage errors as these are generally recoverable but let other Errors propagate (see bug 222001) status.add(new Status(IStatus.ERROR, EngineActivator.ID, NLS.bind(Messages.touchpoint_commit_error, touchpoint.getClass().getName()), e)); } } if (status.matches(IStatus.ERROR)) { MultiStatus result = new MultiStatus(EngineActivator.ID, IStatus.ERROR, NLS.bind(Messages.session_commit_error, profile.getProfileId()), null); result.merge(status); return result; } return status; }
if (operandTouchpoint != null) { mergeStatus(status, initializeTouchpointParameters(profile, operand, operandTouchpoint, new NullProgressMonitor())); if (status.matches(IStatus.ERROR | IStatus.CANCEL)) return; if (touchpoint != null) { mergeStatus(status, initializeTouchpointParameters(profile, operand, touchpoint, new NullProgressMonitor())); if (status.matches(IStatus.ERROR)) return;
if (operandTouchpoint != null) { mergeStatus(status, initializeTouchpointParameters(profile, operand, operandTouchpoint, new NullProgressMonitor())); if (status.matches(IStatus.ERROR | IStatus.CANCEL)) return; if (touchpoint != null) { mergeStatus(status, initializeTouchpointParameters(profile, operand, touchpoint, new NullProgressMonitor())); if (status.matches(IStatus.ERROR)) return;
void perform(MultiStatus status, EngineSession session, Operand[] operands, IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, prePerformWork + mainPerformWork + postPerformWork); session.recordPhaseEnter(this); broadcastPhaseEvent(session, operands, PhaseEvent.TYPE_START); prePerform(status, session, subMonitor.newChild(prePerformWork)); if (status.matches(IStatus.ERROR | IStatus.CANCEL)) return; session.recordPhaseStart(this); subMonitor.setWorkRemaining(mainPerformWork + postPerformWork); mainPerform(status, session, operands, subMonitor.newChild(mainPerformWork)); if (status.matches(IStatus.ERROR | IStatus.CANCEL)) return; session.recordPhaseEnd(this); subMonitor.setWorkRemaining(postPerformWork); postPerform(status, session, subMonitor.newChild(postPerformWork)); phaseParameters.clear(); if (status.matches(IStatus.ERROR | IStatus.CANCEL)) return; broadcastPhaseEvent(session, operands, PhaseEvent.TYPE_END); session.recordPhaseExit(this); subMonitor.done(); }
void perform(MultiStatus status, EngineSession session, Operand[] operands, IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, prePerformWork + mainPerformWork + postPerformWork); session.recordPhaseEnter(this); broadcastPhaseEvent(session, operands, PhaseEvent.TYPE_START); prePerform(status, session, subMonitor.newChild(prePerformWork)); if (status.matches(IStatus.ERROR | IStatus.CANCEL)) return; session.recordPhaseStart(this); subMonitor.setWorkRemaining(mainPerformWork + postPerformWork); mainPerform(status, session, operands, subMonitor.newChild(mainPerformWork)); if (status.matches(IStatus.ERROR | IStatus.CANCEL)) return; session.recordPhaseEnd(this); subMonitor.setWorkRemaining(postPerformWork); postPerform(status, session, subMonitor.newChild(postPerformWork)); phaseParameters.clear(); if (status.matches(IStatus.ERROR | IStatus.CANCEL)) return; broadcastPhaseEvent(session, operands, PhaseEvent.TYPE_END); session.recordPhaseExit(this); subMonitor.done(); }
phase.actionManager = null; if (status.matches(IStatus.CANCEL)) { MultiStatus result = new MultiStatus(EngineActivator.ID, IStatus.CANCEL, Messages.Engine_Operation_Canceled_By_User, null); result.merge(status); return result; } else if (status.matches(IStatus.ERROR)) { MultiStatus result = new MultiStatus(EngineActivator.ID, IStatus.ERROR, phase.getProblemMessage(), null); result.add(new Status(IStatus.ERROR, EngineActivator.ID, session.getContextString(), null));
if (result.matches(IStatus.ERROR)) throw new ResourceException(result); return result;
if (result.matches(IStatus.ERROR)) throw new ResourceException(result); return result;
if (result.matches(IStatus.ERROR)) throw new ResourceException(result); return result;
if (!status.matches(IStatus.ERROR)) { PlatformUI.getWorkbench().getProgressService().run(true, true, new WorkbenchRunnableAdapter(new IWorkspaceRunnable() { public void run(IProgressMonitor monitor) {
if (result.isOK() || result.matches(IStatus.INFO | IStatus.WARNING)) { if (DebugHelper.DEBUG_ENGINE) DebugHelper.debug(ENGINE, "Preparing to commit engine operation for profile=" + profile.getProfileId()); //$NON-NLS-1$ result.merge(session.prepare(monitor)); if (result.matches(IStatus.ERROR | IStatus.CANCEL)) { if (DebugHelper.DEBUG_ENGINE) DebugHelper.debug(ENGINE, "Rolling back engine operation for profile=" + profile.getProfileId() + ". Reason was: " + result.toString()); //$NON-NLS-1$ //$NON-NLS-2$