net.sourceforge.pain.plugin
Class Plugin
java.lang.Object
net.sourceforge.pain.plugin.Plugin
- public abstract class Plugin
- extends java.lang.Object
Base class for all plugin impls
Plugin is a set of classes that provides custom functionality to
server and should not be reloaded every time logic classes are reloaded
Sample of plugins: text commands or socials to events mapping (this mapping should not
be reloaded every time logic is reloaded), plugins that has SQL connections to
some stat database, shutdown timer plugin (emits shutdown evet by timer and
should not be reloaded on logic reloading)
Plugins should not have direct references to logic classes (plugins
should use events).
Logic is allowed to have direct references to plugins.
Field Summary |
protected java.util.Set |
childs
child plugin names, should not be modified from other package! |
protected java.lang.String |
pluginName
plugin name is a package suffix after net.sf.pain.plugin. prefix
(see CodebaseLaunchar settings) |
Method Summary |
protected abstract void |
deinit()
|
java.util.Set |
getDependedPlugins()
|
java.lang.String |
getPluginName()
|
protected abstract void |
init()
|
java.lang.Object |
invoke(int key,
java.lang.Object[] args)
This method is used from static PAIN code. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
pluginName
protected java.lang.String pluginName
- plugin name is a package suffix after net.sf.pain.plugin. prefix
(see CodebaseLaunchar settings)
childs
protected final java.util.Set childs
- child plugin names, should not be modified from other package!
Plugin
public Plugin()
init
protected abstract void init()
throws java.lang.Exception
- Throws:
java.lang.Exception
deinit
protected abstract void deinit()
invoke
public java.lang.Object invoke(int key,
java.lang.Object[] args)
- This method is used from static PAIN code. Static code should not to have any direct links to reloadable plugins
- Parameters:
key
- args
-
toString
public java.lang.String toString()
getDependedPlugins
public final java.util.Set getDependedPlugins()
getPluginName
public final java.lang.String getPluginName()