org.apache.avalon.cornerstone.blocks.threads
Class AbstractThreadManager

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.cornerstone.blocks.threads.AbstractThreadManager
All Implemented Interfaces:
Configurable, LogEnabled, ThreadManager
Direct Known Subclasses:
DefaultThreadManager, ResourceLimitingThreadManager

public abstract class AbstractThreadManager
extends AbstractLogEnabled
implements ThreadManager, Configurable

Abstract implementation of ThreadManager.

Author:
Avalon Development Team

Field Summary
 
Fields inherited from interface org.apache.avalon.cornerstone.services.threads.ThreadManager
ROLE
 
Constructor Summary
AbstractThreadManager()
           
 
Method Summary
 void configure(Configuration configuration)
          Setup thread pools based on configuration data.
protected abstract  void configureThreadPool(Map threadPools, Configuration configuration)
           
 org.apache.excalibur.thread.ThreadPool getDefaultThreadPool()
          Retrieve the default thread pool.
 org.apache.excalibur.thread.ThreadPool getThreadPool(String name)
          Retrieve a thread pool by name.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractThreadManager

public AbstractThreadManager()
Method Detail

configure

public void configure(Configuration configuration)
               throws ConfigurationException
Setup thread pools based on configuration data.

Specified by:
configure in interface Configurable
Parameters:
configuration - the configuration data
Throws:
ConfigurationException - if an error occurs
Configuration Schema:
schema="http://relaxng.org/ns/structure/1.0"

configureThreadPool

protected abstract void configureThreadPool(Map threadPools,
                                            Configuration configuration)
                                     throws ConfigurationException
Throws:
ConfigurationException

getThreadPool

public org.apache.excalibur.thread.ThreadPool getThreadPool(String name)
                                                     throws IllegalArgumentException
Retrieve a thread pool by name.

Specified by:
getThreadPool in interface ThreadManager
Parameters:
name - the name of thread pool
Returns:
the threadpool
Throws:
IllegalArgumentException - if the name of thread pool is invalid or named pool does not exist

getDefaultThreadPool

public org.apache.excalibur.thread.ThreadPool getDefaultThreadPool()
Retrieve the default thread pool.

Specified by:
getDefaultThreadPool in interface ThreadManager
Returns:
the thread pool


Copyright © Apache Software Foundation. All Rights Reserved.