*/
package org.opendaylight.yangtools.util;
+import com.google.common.util.concurrent.ForwardingBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.util.concurrent.ForwardingBlockingQueue;
-
/**
* Utility methods for dealing with {@link ExecutorService}s.
*/
private static final class WaitInQueueExecutionHandler implements RejectedExecutionHandler {
@Override
public void rejectedExecution(final Runnable r, final ThreadPoolExecutor executor) {
- if( executor.isShutdown() ) {
+ if (executor.isShutdown() ) {
throw new RejectedExecutionException( "Executor has been shutdown." );
}
executor.shutdown();
try {
- if(!executor.awaitTermination(timeout, unit)) {
+ if (!executor.awaitTermination(timeout, unit)) {
executor.shutdownNow();
}
- } catch( InterruptedException e ) {
+ } catch (InterruptedException e) {
executor.shutdownNow();
}
}