Java Reference
In-Depth Information
Listing 7.12. Encapsulating Nonstandard Cancellation in a Task with
Newtaskfor
.
LogWriter
in
Listing 7.13
shows a simple logging service in which the logging activity
is moved to a separate logger thread. Instead of having the thread that produces the message
write it directly to the output stream,
LogWriter
hands it off to the logger thread via a