001package com.hammurapi.common.concurrent; 002 003import java.util.concurrent.ExecutorService; 004 005/** 006 * Something that can be invoked. 007 * @author Pavel Vlasov 008 * 009 * @param <R> Return type. 010 */ 011public interface Invocable<C, R, K, E extends Exception> { 012 013 /** 014 * 015 * @param invocation Invocation 016 * @param executorService Executor service for performing asynchronous processing. 017 * @return 018 */ 019 R invoke(C context, Invocation<K> invocation, ExecutorService executorService) throws E; 020 021 Class<R> getReturnType(); 022 023 Class<?>[] getParameterTypes(); 024 025}