org.jwarp.service.work
Class ToolManager

java.lang.Object
  |
  +--org.jwarp.service.work.ToolManager
All Implemented Interfaces:
IConfigurable, IToolManager

public class ToolManager
extends java.lang.Object
implements IToolManager

This class implements actually two manager interfaces. First the IJobManager interface is implemented for scheduling jobs. Second the IWorkManager interface is implemented for handling and dispatching the jobs to actually running threads/tools.


Field Summary
(package private)  LogWriter log
           
(package private)  java.util.Hashtable tools
           
 
Constructor Summary
ToolManager()
          Creates a new work manager instance.
 
Method Summary
 void addLibrary(ILibrary lib)
          Add a new library to the tool repository.
 void addTool(IToolFactory tool)
          Add a new tool to the tools repository.
 void configure(org.jdom.Element config)
          Creates a new work manager object
 IToolFactory getTool(java.lang.String name)
          Get the tool registered under the name given.
 java.util.Iterator getTools()
          Returns an iterator for all tools currentlx registered.
 ITool makeTool(java.lang.String name, Parameter[] params)
          Make a new tool, ready for execution
 void removeTool(IToolFactory tool)
          Remove a tool from the repository.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tools

java.util.Hashtable tools

log

LogWriter log
Constructor Detail

ToolManager

public ToolManager()
Creates a new work manager instance.
Method Detail

configure

public void configure(org.jdom.Element config)
Creates a new work manager object
Specified by:
configure in interface IConfigurable
Following copied from interface: org.jwarp.service.configuration.IConfigurable
Parameters:
configuration - the class configurations.

addTool

public void addTool(IToolFactory tool)
Add a new tool to the tools repository.
Specified by:
addTool in interface IToolManager
Parameters:
tool - The new tool

addLibrary

public void addLibrary(ILibrary lib)
Add a new library to the tool repository.
Specified by:
addLibrary in interface IToolManager
Parameters:
lib - The new library

removeTool

public void removeTool(IToolFactory tool)
Remove a tool from the repository. Jobs scheduled yet for the tool will raise a ToolExecutionException when they are started.
Specified by:
removeTool in interface IToolManager
Parameters:
tool - The tool

getTool

public IToolFactory getTool(java.lang.String name)
Get the tool registered under the name given.
Specified by:
getTool in interface IToolManager
Parameters:
name - The tool's name
Returns:
The tool or null

getTools

public java.util.Iterator getTools()
Returns an iterator for all tools currentlx registered.
Specified by:
getTools in interface IToolManager
Returns:
All tool's iterator

makeTool

public ITool makeTool(java.lang.String name,
                      Parameter[] params)
               throws NotFoundException
Make a new tool, ready for execution
Specified by:
makeTool in interface IToolManager

©   O R C A   S y s t e m s