com.partnersoft.gadgets
Class LoopingThreadManager

java.lang.Object
  extended by com.partnersoft.gadgets.LoopingThreadManager

public class LoopingThreadManager
extends java.lang.Object

Manages a set of looping threads.

This is done internally, with a single start and stop method for the whole. You supply Runnable objects along with a Duration to indicate how often they should repeat. It combines those with the same Duration to reduce the total number of threads used and presumably reduce contention for resources that the Runnable access.

Copyright 2008 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis

Constructor Summary
LoopingThreadManager()
           
 
Method Summary
 void addTask(Duration interval, java.lang.Runnable runnable)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoopingThreadManager

public LoopingThreadManager()
Method Detail

addTask

public void addTask(Duration interval,
                    java.lang.Runnable runnable)

start

public void start()

stop

public void stop()