org.oddjob.util
Interface ThreadManager

All Known Implementing Classes:
SimpleThreadManager

public interface ThreadManager

The thread manager keeps track of active threads. It can be used to ensure that all threads are complete before a job terminates.


Method Summary
 String[] activeDescriptions()
          Return a array of the descriptions of all active threads.
 void close()
          Close the ThreadManager and free resource.
 void run(Runnable runnable, String description)
          Run a job with the default ClassLoader
 

Method Detail

run

void run(Runnable runnable,
         String description)
Run a job with the default ClassLoader

Parameters:
runnable - The job.
description - The description.

activeDescriptions

String[] activeDescriptions()
Return a array of the descriptions of all active threads. The description of the thread making the request is excluded. This is because method is used to see if a server can stop, so a server can run a job which stops itself.

Returns:
A list of descriptions.

close

void close()
Close the ThreadManager and free resource. This may involve interrupting Threads or similar to ensure nothing is still running.