private void unlockDocument(IJobManager jobMgr, ISchedulingRule rule) { if (rule != null) { jobMgr.endRule(rule); } else synchronized (fDocumentAccessorLock) { fDocumentLocked= false; fDocumentAccessorLock.notifyAll(); } }
private void unlockDocument(IJobManager jobMgr, ISchedulingRule rule) { if (rule != null) { jobMgr.endRule(rule); } else synchronized (fDocumentAccessorLock) { fDocumentLocked= false; fDocumentAccessorLock.notifyAll(); } }
/** * Returns true if the check in for this thread failed, in which case the * check out and other end of operation code should not run. * <p> * The failure flag is reset immediately after calling this method. Subsequent * calls to this method will indicate no failure (unless a new failure has occurred). * @return <code>true</code> if the checkIn failed, and <code>false</code> otherwise. */ public boolean checkInFailed(ISchedulingRule rule) { if (checkInFailed.get() != null) { //clear the failure flag for this thread checkInFailed.set(null); //must still end the rule even in the case of failure if (!workspace.isTreeLocked()) jobManager.endRule(rule); return true; } return false; }
/** * Returns true if the check in for this thread failed, in which case the * check out and other end of operation code should not run. * <p> * The failure flag is reset immediately after calling this method. Subsequent * calls to this method will indicate no failure (unless a new failure has occurred). * @return <code>true</code> if the checkIn failed, and <code>false</code> otherwise. */ public boolean checkInFailed(ISchedulingRule rule) { if (checkInFailed.get() != null) { //clear the failure flag for this thread checkInFailed.set(null); //must still end the rule even in the case of failure if (!workspace.isTreeLocked()) jobManager.endRule(rule); return true; } return false; }
/** * Returns true if the check in for this thread failed, in which case the * check out and other end of operation code should not run. * <p> * The failure flag is reset immediately after calling this method. Subsequent * calls to this method will indicate no failure (unless a new failure has occurred). * @return <code>true</code> if the checkIn failed, and <code>false</code> otherwise. */ public boolean checkInFailed(ISchedulingRule rule) { if (checkInFailed.get() != null) { //clear the failure flag for this thread checkInFailed.set(null); //must still end the rule even in the case of failure if (!workspace.isTreeLocked()) jobManager.endRule(rule); return true; } return false; }
public void dispose() { if (mProfileRule != null) { Platform.getJobManager().endRule(mProfileRule); mProfileRule = null; } super.dispose(); }
public void dispose() { if (profileRule != null) { Platform.getJobManager().endRule(profileRule); profileRule = null; } super.dispose(); }
/** * This method should be called at the end of the workspace startup, even if the startup failed. * It must be preceded by a call to <code>startup</code>. It releases the primary workspace lock * and ends applying the workspace rule to this thread. */ void postWorkspaceStartup() { try { lock.release(); } finally { //end rule in finally in case lock.release throws an exception jobManager.endRule(workspace.getRoot()); } } }
/** * This method should be called at the end of the workspace startup, even if the startup failed. * It must be preceded by a call to <code>startup</code>. It releases the primary workspace lock * and ends applying the workspace rule to this thread. */ void postWorkspaceStartup() { try { lock.release(); } finally { //end rule in finally in case lock.release throws an exception jobManager.endRule(workspace.getRoot()); } } }
/** * This method should be called at the end of the workspace startup, even if the startup failed. * It must be preceded by a call to <code>startup</code>. It releases the primary workspace lock * and ends applying the workspace rule to this thread. */ void postWorkspaceStartup() { try { lock.release(); } finally { //end rule in finally in case lock.release throws an exception jobManager.endRule(workspace.getRoot()); } } }
@Override public void run() { IJobManager manager = Job.getJobManager(); try { manager.beginRule(rule, getEventLoopMonitor()); context.run(false, false, runnable); } catch (InvocationTargetException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); } catch (InterruptedException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); } catch (OperationCanceledException e) { status = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage(), e); } finally { manager.endRule(rule); } }
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRoot(); Job.getJobManager().beginRule(rule, monitor); try { try { this.createdProjects = doCreateMavenProjects(monitor); if(workingSets != null) { WorkingSets.addToWorkingSets(createdProjects, workingSets); } } catch(CoreException e) { throw new InvocationTargetException(e); } } finally { Job.getJobManager().endRule(rule); } }
/** * Inform that an operation has finished. */ public synchronized void checkOut(ISchedulingRule rule) { decrementPreparedOperations(); rebalanceNestedOperations(); //reset state if this is the end of a top level operation if (preparedOperations == 0) hasBuildChanges = false; //don't let cancelation of this operation affect other operations operationCanceled = false; try { lock.release(); } finally { //end rule in finally in case lock.release throws an exception jobManager.endRule(rule); } }
/** * Inform that an operation has finished. */ public synchronized void checkOut(ISchedulingRule rule) { decrementPreparedOperations(); rebalanceNestedOperations(); //reset state if this is the end of a top level operation if (preparedOperations == 0) hasBuildChanges = false; //don't let cancelation of this operation affect other operations operationCanceled = false; try { lock.release(); } finally { //end rule in finally in case lock.release throws an exception jobManager.endRule(rule); } }
/** * Inform that an operation has finished. */ public synchronized void checkOut(ISchedulingRule rule) { decrementPreparedOperations(); rebalanceNestedOperations(); //reset state if this is the end of a top level operation if (preparedOperations == 0) hasBuildChanges = false; //don't let cancelation of this operation affect other operations operationCanceled = false; try { lock.release(); } finally { //end rule in finally in case lock.release throws an exception jobManager.endRule(rule); } }
protected void commit(final IFileBuffer[] fileBuffers, final IProgressMonitor progressMonitor) throws CoreException { IProgressMonitor monitor= Progress.getMonitor(progressMonitor); ISchedulingRule rule= computeCommitRule(fileBuffers); Job.getJobManager().beginRule(rule, progressMonitor); try { doCommit(fileBuffers, progressMonitor); } finally { Job.getJobManager().endRule(rule); monitor.done(); } }
private void performOperation(IFileBuffer fileBuffer, IFileBufferOperation operation, IProgressMonitor progressMonitor) throws CoreException, OperationCanceledException { ISchedulingRule rule= fileBuffer.computeCommitRule(); IJobManager manager= Job.getJobManager(); try { manager.beginRule(rule, progressMonitor); String name= fileBuffer.getLocation().lastSegment(); progressMonitor.beginTask(name, 100); try { IProgressMonitor subMonitor= Progress.getSubMonitor(progressMonitor, 100); operation.run(fileBuffer, subMonitor); subMonitor.done(); } finally { progressMonitor.done(); } } finally { manager.endRule(rule); } }
public void run() { IWorkspace workspace= ResourcesPlugin.getWorkspace(); ISchedulingRule rule= workspace.getRuleFactory().modifyRule(workspace.getRoot()); try { Platform.getJobManager().beginRule(rule, null); if (validateResources((FileSearchQuery) fPage.getInput().getQuery())) { ReplaceDialog2 dialog= new ReplaceDialog2(fSite.getShell(), fElements, fPage); dialog.open(); } } catch (OperationCanceledException e) { } finally { Platform.getJobManager().endRule(rule); } }
protected void commit(final IFileBuffer[] fileBuffers, final IProgressMonitor progressMonitor) throws CoreException { SubMonitor subMonitor= SubMonitor.convert(progressMonitor, 2); ISchedulingRule rule= computeCommitRule(fileBuffers); Job.getJobManager().beginRule(rule, subMonitor.split(1)); try { doCommit(fileBuffers, subMonitor.split(1)); } finally { Job.getJobManager().endRule(rule); } }
private void performOperation(IFileBuffer fileBuffer, IFileBufferOperation operation, IProgressMonitor progressMonitor) throws CoreException, OperationCanceledException { SubMonitor subMonitor= SubMonitor.convert(progressMonitor, 100); ISchedulingRule rule= fileBuffer.computeCommitRule(); IJobManager manager= Job.getJobManager(); manager.beginRule(rule, subMonitor.split(1)); String name= fileBuffer.getLocation().lastSegment(); subMonitor.setTaskName(name); operation.run(fileBuffer, subMonitor.split(99)); manager.endRule(rule); }