com.unitesk.atp.tool
Class Tool

java.lang.Object
  extended by com.unitesk.atp.tool.PluginManagerClass
      extended by com.unitesk.atp.tool.Tool
All Implemented Interfaces:
PluginManager
Direct Known Subclasses:
Tool

public abstract class Tool
extends PluginManagerClass

The framework of an application with plugins.

Version:
$Id: Tool.java,v 1.4 2005/07/31 19:58:29 all-x Exp $
Author:
Alexey Demakov

Field Summary
protected  String default_mbox_class
           
protected  String default_plugins_file_name
           
protected  String default_properties_file_name
           
protected  String mbox_class_property_name
           
protected  String plugins_file_name
           
protected  String plugins_file_property_name
           
protected  FileStatus plugins_file_status
           
protected  String properties_file_name
           
protected  String properties_file_property_name
           
protected  FileStatus properties_file_status
           
protected  String version
           
 
Fields inherited from class com.unitesk.atp.tool.PluginManagerClass
config, mbox, name, table
 
Constructor Summary
Tool()
           
 
Method Summary
static InputStream findFile(String name)
          Finds file or resource.
 String getVersion()
          Returns tool version.
protected  void initConfig()
          
protected  void initMessageBox()
          Initializes tool message box by instance of class with name specified by property <tool>.mbox.class.
protected abstract  void initName()
          In addition to PluginManagerClass.name initialization this method should initialize version
protected  void initPluginsTable()
          Initializes tool plugins table from file with name specified by property <tool>.plugins.table.
protected  void usage()
          Prints message describing tool usage.
 
Methods inherited from class com.unitesk.atp.tool.PluginManagerClass
createPluginsTable, getMessageBox, getName, getPlugin, getPluginProperty, getPluginProperty, getPluginPropertyName, getProperty, getProperty, help, loadPlugins
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

protected String version

properties_file_property_name

protected String properties_file_property_name

default_properties_file_name

protected String default_properties_file_name

properties_file_name

protected String properties_file_name

properties_file_status

protected FileStatus properties_file_status

plugins_file_property_name

protected String plugins_file_property_name

default_plugins_file_name

protected String default_plugins_file_name

plugins_file_name

protected String plugins_file_name

plugins_file_status

protected FileStatus plugins_file_status

mbox_class_property_name

protected String mbox_class_property_name

default_mbox_class

protected String default_mbox_class
Constructor Detail

Tool

public Tool()
Method Detail

getVersion

public final String getVersion()
Returns tool version.


initName

protected abstract void initName()
In addition to PluginManagerClass.name initialization this method should initialize version

Overrides:
initName in class PluginManagerClass

initConfig

protected void initConfig()

Overrides:
initConfig in class PluginManagerClass

initMessageBox

protected void initMessageBox()
Initializes tool message box by instance of class with name specified by property <tool>.mbox.class. Default: PrintStreamMessageBox. Class should have constructor without parameters.

Overrides:
initMessageBox in class PluginManagerClass

initPluginsTable

protected void initPluginsTable()
Initializes tool plugins table from file with name specified by property <tool>.plugins.table. Default: <tool>.plugins. If file not found sends warning message and creates empty table.

Overrides:
initPluginsTable in class PluginManagerClass

usage

protected final void usage()
Prints message describing tool usage.


findFile

public static InputStream findFile(String name)
Finds file or resource. If there is the specified file in working directory - returns input stream for it. Otherwise treats parameter as name of resource and returns input stream for resource or null if the resource could not be found. The following order of class loaders is used to find the resource:
  1. Current thread's class loader.
  2. Class loader of this class.
  3. System class loader

Parameters:
name - The name of file.
Returns:
input stream for reading file or resource.


Copyright © 2001-2006 ISP RAS, RedVerst Group. All Rights Reserved.