|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.grogra.pf.registry.Plugin
public class Plugin
An instance of Plugin
is the representation of a plugin and
can response to lifetime events of the plugin. It may also opt to disable
the plugin when the application boots. This may be used, e.g., if the
environment does not provide some features required by the plugin.
Normally, instances of this class Plugin
are used to represent
a plugin. If a plugin needs a specific implementation of methods of
Plugin
, it has to provide a specialized subclass and declare
this in the root element of the plugin.xml file as in
<plugin id="de.grogra.foo" version="0.9.7" class="de.grogra.foo.MyPlugin" xmlns="http://grogra.de/registry"> ... </plugin>
Constructor Summary | |
---|---|
Plugin()
|
Method Summary | |
---|---|
boolean |
checkConfigure()
This method returns true iff it is has not yet been
invoked before for the same plugin and the same user (extending
over all application invocations). |
I18NBundle |
getI18NBundle()
Returns the resource bundle which represents the contents of the plugin.properties file. |
PluginDescriptor |
getPluginDescriptor()
Returns the plugin descriptor of this plugin. |
Registry |
getRegistry()
Returns the Registry which is linked with this instance. |
boolean |
initialize()
Initializes the plugin during booting of application. |
void |
shutdown()
This method is invoked when an active plugin is deactivated, i.e., when the whole application is terminated. |
void |
startup()
This method is invoked when the plugin is activated, i.e., when the first class defined by the plugin is loaded (except for the Plugin class itself). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Plugin()
Method Detail |
---|
public boolean checkConfigure()
true
iff it is has not yet been
invoked before for the same plugin and the same user (extending
over all application invocations). To be more precise, the method sets
a plugin-specific flag in the preferences of the user and checks
whether this flag has not yet been set before.
true
iff this method is invoked for the first timepublic final I18NBundle getI18NBundle()
public final PluginDescriptor getPluginDescriptor()
public final Registry getRegistry()
RegistryContext
Registry
which is linked with this instance.
getRegistry
in interface RegistryContext
public boolean initialize()
false
, the plugin is disabled
throughout the lifetime of the application.
The default implementation simply returns true
.
Subclasses may override this method if they have to check
some preconditions which are required by their plugin.
true
iff plugin shall be enabledpublic void shutdown()
/hooks/shutdown/name
, where
name
is the name of the plugin.
public void startup()
/hooks/startup/name
, where
name
is the name of the plugin.
The method initialize()
has been invoked before. Only if this
invocation has returned true
, the plugin may be activated.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |