1 /******************************************************************************* 2 * Copyright (c) 2000, 2005 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.core.filebuffers; 12 13 /** 14 * A file buffer manager (see 15 * {@link org.eclipse.core.filebuffers.IFileBufferManager}uses a 16 * <code>ISynchronizationContext</code> in order to execute commands 17 * encapsulated as {@link java.lang.Runnable}. The synchronization context 18 * executes the <code>Runnables</code> according to a specific 19 * synchronization/execution policy. This could be that the given 20 * <code>Runnable</code> is executed in a specific thread or environment or 21 * adhere to specific timing constraints. The concrete characteristics of the 22 * policy is to be specified by the context implementer. 23 * <p> 24 * This interface can be implemented by clients. Clients use 25 * {@link org.eclipse.core.filebuffers.IFileBufferManager#setSynchronizationContext(ISynchronizationContext)} 26 * to install a particular synchronization context with a file buffer manager. 27 * 28 * @since 3.0 29 */ 30 public interface ISynchronizationContext { 31 32 /** 33 * Executes the given runnable according to the specified 34 * synchronization/execution policy. 35 * 36 * 37 * @param runnable the runnable to be executed 38 */ 39 void run(Runnable runnable); 40 } 41