org.apache.servicemix.executors.impl
Class ExecutorFactoryImpl

java.lang.Object
  extended by org.apache.servicemix.executors.impl.ExecutorFactoryImpl
All Implemented Interfaces:
ExecutorFactory

public class ExecutorFactoryImpl
extends Object
implements ExecutorFactory

Default implementation of the ExecutorFactory. Configuration can be done hierachically. When an executor is created with an id of foo.bar, the factory will look for a configuration in the following way:

Author:
Guillaume Nodet

Constructor Summary
ExecutorFactoryImpl()
           
 
Method Summary
 Executor createExecutor(String id)
          Create a new executor for the given Id.
protected  ThreadPoolExecutor createService(String id, ExecutorConfig config)
           
protected  ExecutorConfig getConfig(String id)
           
 Map<String,ExecutorConfig> getConfigs()
           
 ExecutorConfig getDefaultConfig()
           
 void setConfigs(Map<String,ExecutorConfig> configs)
           
 void setDefaultConfig(ExecutorConfig defaultConfig)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecutorFactoryImpl

public ExecutorFactoryImpl()
Method Detail

createExecutor

public Executor createExecutor(String id)
Description copied from interface: ExecutorFactory
Create a new executor for the given Id. The id may be used to provide per executor configuration.

Specified by:
createExecutor in interface ExecutorFactory
Parameters:
id - the id of the executor to create
Returns:
a configured Executor

getConfig

protected ExecutorConfig getConfig(String id)

createService

protected ThreadPoolExecutor createService(String id,
                                           ExecutorConfig config)

getConfigs

public Map<String,ExecutorConfig> getConfigs()
Returns:
the configs

setConfigs

public void setConfigs(Map<String,ExecutorConfig> configs)
Parameters:
configs - the configs to set

getDefaultConfig

public ExecutorConfig getDefaultConfig()
Returns:
the defaultConfig

setDefaultConfig

public void setDefaultConfig(ExecutorConfig defaultConfig)
Parameters:
defaultConfig - the defaultConfig to set


Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.