001package org.javasimon.callback.async; 002 003import java.util.concurrent.Callable; 004 005/** 006 * Executor is similar to {@link java.util.concurrent.Executor} 007 * or {@link java.util.concurrent.ExecutorService} but simpler (only one method to implement). 008 * 009 * @param <T> 010 * @author gerald 011 * @see Executors Implementations 012 */ 013public interface Executor<T> { 014 015 /** 016 * Main method of the executor. 017 * 018 * @param callable Piece of code to execute 019 * @return Result of the execution 020 * @throws Throwable Raised when execution failed 021 */ 022 T execute(Callable<T> callable) throws Throwable; 023}