Java Reference
In-Depth Information
Avoid finalizers.
Summary
End-of-lifecycle issues for tasks, threads, services, and applications can add complexity to
their design and implementation. Java does not provide a preemptive mechanism for cancel-
ling activities or terminating threads. Instead, it provides a cooperative interruption mechan-
ism that can be used to facilitate cancellation, but it is up to you to construct protocols for
cancellation and use them consistently. Using FutureTask and the Executor framework
simplifies building cancellable tasks and services.
Search WWH ::




Custom Search