comparison servlet/src/digilib/servlet/DigilibJobCenter.java @ 546:e7c29b587829 digilibPDF

more work on util.concurrent compliant structure
author casties
date Fri, 22 Oct 2010 19:04:49 +0200
parents 5ff500d6812a
children
comparison
equal deleted inserted replaced
545:88ec23c2b2fb 546:e7c29b587829
18 /** Wrapper around ExecutionService. 18 /** Wrapper around ExecutionService.
19 * 19 *
20 * @author casties 20 * @author casties
21 * 21 *
22 */ 22 */
23 public class DigilibJobCenter { 23 public class DigilibJobCenter<V> {
24 /** general logger for this class */ 24 /** general logger for this class */
25 private static Logger logger = Logger.getLogger("digilib.jobcenter"); 25 private static Logger logger = Logger.getLogger("digilib.jobcenter");
26 /** ExecutorService */ 26 /** ExecutorService */
27 private ExecutorService executor; 27 private ExecutorService executor;
28 /** max number of running threads */ 28 /** max number of running threads */
49 /** Submit job to execute 49 /** Submit job to execute
50 * 50 *
51 * @param job 51 * @param job
52 * @return Future to control the job 52 * @return Future to control the job
53 */ 53 */
54 public Future<DocuImage> submit(Callable<DocuImage> job) { 54 public Future<V> submit(Callable<V> job) {
55 return executor.submit(job); 55 return executor.submit(job);
56 } 56 }
57 57
58 /** Returns if the service is not overloaded. 58 /** Returns if the service is not overloaded.
59 * 59 *