package com.hammurapi.common.concurrent;

import java.util.concurrent.ExecutorService;

/**
 * Something that can be invoked.
 * @author Pavel Vlasov
 *
 * @param <R> Return type.
 */
public interface Invocable<C, R, K, E extends Exception> {
	
	/**
	 * 
	 * @param invocation Invocation
	 * @param executorService Executor service for performing asynchronous processing.
	 * @return
	 */
	R invoke(C context, Invocation<K> invocation, ExecutorService executorService) throws E;
	
	Class<R> getReturnType();
	
	Class<?>[] getParameterTypes();

}
