1 /******************************************************************************* 2 * Copyright (c) 2005, 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 Corporation - initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.debug.internal.ui.viewers.provisional; 12 13 import org.eclipse.core.runtime.IProgressMonitor; 14 import org.eclipse.core.runtime.IStatus; 15 16 /** 17 * Common interface for requests made on elements in an asynchronous viewer. Results 18 * of a request are reported to a request monitor asynchronously (usually a 19 * specialization of this interface). An request may be cancelled by the client 20 * making the request, or by the adapter fulfilling the request. 21 * Adapters may report failure by setting an appropriate status on this monitor. When a request 22 * is complete, an adapter must call <code>done()</code> on the monitor, no matter 23 * if the update succeeded or failed. The <code>done()</code> method does not need to be 24 * called if a request is canceled. 25 * <p> 26 * Operations accepting a request monitor are expected to poll the 27 * monitor (using <code>isCanceled</code>) periodically and abort at their 28 * earliest convenience. 29 * </p> 30 * <p> 31 * This interface is not intended to be implemented by clients. 32 * </p> 33 * @since 3.2 34 */ 35 public interface IAsynchronousRequestMonitor extends IProgressMonitor { 36 37 /** 38 * Sets the status of this request, possibly <code>null</code>. 39 * When a request fails, the status indicates why the request failed. 40 * A <code>null</code> status is considered to be successful. 41 * 42 * @param status request status 43 */ 44 public void setStatus(IStatus status); 45 46 /** 47 * Returns the status of this request, or <code>null</code>. 48 * 49 * @return request status or <code>null</code> 50 */ 51 public IStatus getStatus(); 52 } 53