1 /******************************************************************************* 2 * Copyright (c) 2003, 2006 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM - Initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.core.runtime; 12 13 /** 14 * An extension to the IProgressMonitor interface for monitors that want to 15 * support feedback when an activity is blocked due to concurrent activity in 16 * another thread. 17 * <p> 18 * When a monitor that supports this extension is passed to an operation, the 19 * operation should call <code>setBlocked</code> whenever it knows that it 20 * must wait for a lock that is currently held by another thread. The operation 21 * should continue to check for and respond to cancelation requests while 22 * blocked. When the operation is no longer blocked, it must call <code>clearBlocked</code> 23 * to clear the blocked state. 24 * <p> 25 * This interface can be used without OSGi running. 26 * </p><p> 27 * Clients may implement this interface. 28 * </p> 29 * @see IProgressMonitor 30 * @since 3.0 31 */ 32 public interface IProgressMonitorWithBlocking extends IProgressMonitor { 33 /** 34 * Indicates that this operation is blocked by some background activity. If 35 * a running operation ever calls <code>setBlocked</code>, it must 36 * eventually call <code>clearBlocked</code> before the operation 37 * completes. 38 * <p> 39 * If the caller is blocked by a currently executing job, this method will return 40 * an <code>IJobStatus</code> indicating the job that is currently blocking 41 * the caller. If this blocking job is not known, this method will return a plain 42 * informational <code>IStatus</code> object. 43 * </p> 44 * 45 * @param reason an optional status object whose message describes the 46 * reason why this operation is blocked, or <code>null</code> if this 47 * information is not available. 48 * @see #clearBlocked() 49 * @see org.eclipse.core.runtime.jobs.IJobStatus 50 */ 51 public void setBlocked(IStatus reason); 52 53 /** 54 * Clears the blocked state of the running operation. If a running 55 * operation ever calls <code>setBlocked</code>, it must eventually call 56 * <code>clearBlocked</code> before the operation completes. 57 * 58 * @see #setBlocked(IStatus) 59 */ 60 public void clearBlocked(); 61 62 } 63