org.obe.spi.service
Interface ToolAgentFactory

All Superinterfaces:
WorkflowService

public interface ToolAgentFactory
extends WorkflowService

Standard interface for a tool agent factory. The tool agent factory is used to retrieve tool agents at run-time. Workflow tool IDs are mapped to a specific agent at run-time.

Author:
Adrian Price

Field Summary
static java.lang.String SERVICE_NAME
           
 
Method Summary
 void createTool(ToolAgentMetaData tool)
          Registers a tool.
 void deleteTool(java.lang.String id)
          Unregisters a tool.
 ToolAgent findToolAgent(Application toolDef, Parameter[] parameters)
          Finds a tool agent.
 ToolAgentMetaData[] findToolMetaData()
          Finds meta-data for all tools.
 ToolAgentMetaData findToolMetaData(Application toolDef)
          Finds meta-data for a tool.
 ToolAgentMetaData findToolType(java.lang.String className, java.lang.String locale)
          Returns information about the specified too type.
 ToolAgentMetaData[] findToolTypes(java.lang.String locale)
          Finds all tool types known to the repository.
 void updateTool(ToolAgentMetaData tool)
          Updates a tool.
 
Methods inherited from interface org.obe.spi.WorkflowService
exit, getServiceManager, getServiceName, init
 

Field Detail

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
See Also:
Constant Field Values
Method Detail

createTool

public void createTool(ToolAgentMetaData tool)
                throws RepositoryException
Registers a tool.

Parameters:
tool - The tool definition.
Throws:
ObjectAlreadyExistsException - if the tool ID is already registered.
RepositoryException - if the tool could not be registered some other reason.

deleteTool

public void deleteTool(java.lang.String id)
                throws RepositoryException
Unregisters a tool.

Parameters:
id - The tool ID.
Throws:
ObjectNotFoundException - if the tool ID is not registered.
RepositoryException - if the tool could not be unregistered for some other reason.

updateTool

public void updateTool(ToolAgentMetaData tool)
                throws RepositoryException
Updates a tool.

Parameters:
tool - The tool definition.
Throws:
ObjectNotFoundException - if the tool ID is not registered.
RepositoryException - if the tool could not be updated for some other reason.

findToolTypes

public ToolAgentMetaData[] findToolTypes(java.lang.String locale)
                                  throws RepositoryException
Finds all tool types known to the repository. This method is intended to support design-time clients and management applications.

Parameters:
locale - The locale in which the results should be formatted.
Returns:
All tool types.
Throws:
RepositoryException - if an error occurred.

findToolType

public ToolAgentMetaData findToolType(java.lang.String className,
                                      java.lang.String locale)
                               throws RepositoryException
Returns information about the specified too type. This method is intended to support design-time clients and management applications.

Parameters:
className - The tool type (i.e., the fully qualified name of the implementation class).
locale - The locale in which the results should be formatted.
Returns:
Information about the specified tool type.
Throws:
ObjectNotFoundException - if the tool type is unknown.
RepositoryException - if some other error occurred.

findToolMetaData

public ToolAgentMetaData[] findToolMetaData()
                                     throws RepositoryException
Finds meta-data for all tools. This method is intended to support design-time clients and management applications.

Returns:
The list of all tools.
Throws:
RepositoryException - if an error occurred.

findToolMetaData

public ToolAgentMetaData findToolMetaData(Application toolDef)
                                   throws RepositoryException
Finds meta-data for a tool. This method is intended to support design-time clients and management applications.

Parameters:
toolDef - The XPDL tool definition.
Returns:
Meta-data about the requested tool.
Throws:
ObjectNotFoundException - if the tool is not registered.
RepositoryException - if some other error occurred.

findToolAgent

public ToolAgent findToolAgent(Application toolDef,
                               Parameter[] parameters)
                        throws RepositoryException
Finds a tool agent. This method is called by the engine at run-time when it needs to execute the tool invocation.

Parameters:
toolDef - The XPDL tool definition.
parameters - The parameters to pass to a stateful (non-threadsafe) tool agent's constructor. N.B. Stateless tool agents ignore this parameter but it must always be passed because the caller does not know whether the tool itself is threadsafe.
Returns:
A tool agent to invoke the specified tool.
Throws:
ObjectNotFoundException - if no suitable tool agent is registered.
RepositoryException - if some other error occurred.


SourceForge.net Logo OBE-1.0 Copyright (c) 2002-2006 Adrian Price. All Rights Reserved.