)
throws SQLException
{
try {
ClassFactoryContext cfc = (ClassFactoryContext) ContextService.getContext( ClassFactoryContext.CONTEXT_ID );
ClassFactory classFactory = cfc.getClassFactory();
String toolClassName = findToolClassName( toolName, optionalArgs );
OptionalTool tool = null;
Class<?> toolClass;
try {
toolClass = classFactory.loadApplicationClass( toolClassName );
}
catch (ClassNotFoundException cnfe) { throw wrap( cnfe ); }
if (!OptionalTool.class.isAssignableFrom(toolClass)) {
throw badCustomTool(toolClassName);