|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unitesk.atp.tool.PluginManagerClass
public class PluginManagerClass
Plugin manager default implementation.
Field Summary | |
---|---|
protected Properties |
config
The set of application properties. |
protected MessageBox |
mbox
The message box for application messages. |
protected String |
name
Plugin manager name. |
protected DynamicVariablesTable |
table
The table of plugins initialized from resource file. |
Constructor Summary | |
---|---|
PluginManagerClass()
Default constructor. |
|
PluginManagerClass(String name,
MessageBox mbox,
Properties config,
InputStream in)
Constructs plugin manager with the specified parameters. |
Method Summary | |
---|---|
protected void |
createPluginsTable()
Creates plugins table and set table field. |
MessageBox |
getMessageBox()
Returns message box. |
String |
getName()
Get plugin manager name. |
Object |
getPlugin(String name)
Returns the plugin with the specified name. |
String |
getPluginProperty(Object plugin,
String name)
Gets the value of a plugin property with the specified name for the specified plugin. |
String |
getPluginProperty(Object plugin,
String name,
String value)
Gets the value of a plugin property with the specified name for the specified plugin or default value if this property is not defined. |
String |
getPluginPropertyName(Object plugin,
String name)
Gets the qualified property name for plugin property name of the specified plugin. |
String |
getProperty(String name)
Get property value for the specified property name. |
String |
getProperty(String name,
String value)
Get property value for the specified property name. |
protected void |
help(List pluginNames)
Prints help messages for plugins. |
protected void |
initConfig()
|
protected void |
initMessageBox()
|
protected void |
initName()
|
protected void |
initPluginsTable()
|
protected void |
loadPlugins(InputStream in)
Loads plugins from the specified input stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String name
protected MessageBox mbox
protected Properties config
initConfig()
method.
protected DynamicVariablesTable table
initPluginsTable()
method.
Constructor Detail |
---|
public PluginManagerClass(String name, MessageBox mbox, Properties config, InputStream in) throws IOException, ClassNotFoundException
name
- the plugin manager namembox
- the plugin manager message box.
If it is null
no message box will be
available for plugins.config
- the set of properties. It can be null
.in
- the input stream to read plugin table from.
IOException
ClassNotFoundException
public PluginManagerClass()
initName()
, initConfig()
,
initMessageBox()
, initPluginsTable()
.
These methods should be overriden by inheritor if it use this
constructor.
Method Detail |
---|
protected void initName()
protected void initConfig()
protected void initMessageBox()
protected void initPluginsTable()
public String getName()
getName
in interface PluginManager
public MessageBox getMessageBox()
getMessageBox
in interface PluginManager
public Object getPlugin(String name)
getPlugin
in interface PluginManager
name
- The plugin name.
null
.public final String getProperty(String name)
config
properties set then in system properties.
name
- the specified property name.
null
if no such property
specified.public final String getProperty(String name, String value)
config
properties set then in system properties.
name
- the specified property name.value
- the default property value.
value
if no such property
specified.public String getPluginPropertyName(Object plugin, String name)
getPluginPropertyName
in interface PluginManager
plugin
- The specified plugin.name
- The name of plugin
property.
property.name
of plugin with name plugin
of manager manager
qualified property name is
manager.plugin.property.name
.DynamicVariablesTable.getPropertyName(Object,String)
public String getPluginProperty(Object plugin, String name)
getPluginProperty
in interface PluginManager
plugin
- The specified plugin.name
- The name of plugin
property.
DynamicVariablesTable.getProperty(Object,String)
public String getPluginProperty(Object plugin, String name, String value)
getPluginProperty
in interface PluginManager
plugin
- The specified plugin.name
- The name of plugin
property.value
- The default value is used if for the specified plugin
there is no property with the specified name.
DynamicVariablesTable.getProperty(Object,String,String)
protected void createPluginsTable()
table
field.
protected void loadPlugins(InputStream in) throws IOException, ClassNotFoundException
createPluginsTable()
.
in
- the input stream to load plugins from.
IOException
- if the was I/O error while reading input stream.
ClassNotFoundException
- if class specified in plugin table was not fount.
NullPointerException
- if in
is null
.protected void help(List pluginNames)
pluginNames
- the list of plugin names
If pluginNames is null
or pluginNames.size() is 0
prints the list of available plugins
otherwise - help message for each plugin
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |