FutureTalker V1.3
by Matthew Ford
2005/04/11

Package au.com.forward.futureTalker

Add listeners to Callable (see www.forward.com.au for an article on how to use this package.)

See:
          Description

Interface Summary
IFutureListener<T> Listener interface for FutureTalker
 

Class Summary
FutureTalker<V> This class allows you to add listeners to your FutureTask.
TaskUtilities A collection of utilites for coding tasks so that they can be interrupted.
 

Package au.com.forward.futureTalker Description

Add listeners to Callable (see www.forward.com.au for an article on how to use this package.)

The FutureTalker class allows you to add IFutureListeners to your tasks. These listeners will be called when the task completes or terminates with an error or is cancelled.

FutureTalker also contains two static utility methods,

  1. ifInterruptedStop which throws an InterruptedException InterruptedException if the current thread has its interrupt flag set.

  2. shutdownNow which shuts down a ThreadPoolExecutor and then rejects FutureTalkers and cancels Futures which were waiting to be executed.

TaskUtilities contains a number of methods which return interruptable InputStreams, OutputStreams, Readers and Writers for FileInputStreams, FileOutputStreams, RandomAccessFiles and System.in, System.out and System.err

Similar coding can be used for Sockets and Pipes. See InterruptibleChannel for the classes availale.

Licence Agreement

FutureTalker package Copyright (c) 2004 Forward Computing and Control Pty. Ltd.
NSW. Australia,  www.forward.com.au
All rights reserved.

Redistribution of the source and/or compiled .class of this package, with or without
modification, is permitted subject to the limitation of libability below.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


©2004, Forward Computing and Control Pty. Ltd
ACN 003 669 994   NSW Australia
All Rights Reserved.