leonarduk.com

Breadcrumbs

Home Knowledge bank Technical Skills Java Threads- use FutureTask
Java Threads- use FutureTask PDF Print E-mail
Written by Steve Leonard   
Friday, 17 April 2009 12:21

Found a great new class in JAva 5 for dealing with repeated calls to expensive methods: FutureTask.

http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/FutureTask.html

This can be used to wrap around a Callable class to ensure that multiple references to a single callable object will all wait till the call method is complete.