1 /* 2 * Copyright (C) 2009 Google Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.google.common.util.concurrent; 18 19 import java.util.concurrent.ExecutionException; 20 import java.util.concurrent.Future; 21 import java.util.concurrent.TimeUnit; 22 import java.util.concurrent.TimeoutException; 23 24 /** 25 * A {@code Future} whose {@code get} calls cannot be interrupted. If a thread 26 * is interrupted during such a call, the call continues to block until the 27 * result is available or the timeout elapses, and only then re-interrupts the 28 * thread. Obtain an instance of this type using {@link 29 * Futures#makeUninterruptible(Future)}. 30 * 31 * @author Kevin Bourrillion 32 * @since 2009.09.15 <b>tentative</b> 33 */ 34 public interface UninterruptibleFuture<V> extends Future<V> { 35 /*@Override*/ V get() throws ExecutionException; 36 37 /*@Override*/ V get(long timeout, TimeUnit unit) 38 throws ExecutionException, TimeoutException; 39 } 40