When the core server starts up, first all plugins have their {@link #startPlugin(PluginDefinition,ExtensionDescriptor,Element)}method called. Any plugins which throw an exception at this point are discarded and will not be available for the remaining lifetime of the server.
Any plugins that successfully initialised are then checked to see if the have been used before. If they haven't then the {@link #installPlugin()} methodis invoked. Here the plugin may perform any one-off tasks such as adding default resources.
Next, the {@link #activatePlugin()} method is called.
When the server shuts down, the {@link #canStopPlugin()} method is called,if this is true
then the {@link #stopPlugin()} method is called.
Plugins are defined in the Extension Description for the extension they are part of. Information required for plugin includes the fully qualified class name of this interface implementation, sort order, names and descriptions and dependencies.
The javac plug-in mechanism allows a user to specify one or more plug-ins on the javac command line, to be started soon after the compilation has begun. Plug-ins are identified by a user-friendly name. Each plug-in that is started will be passed an array of strings, which may be used to provide the plug-in with values for any desired options or other arguments.
Plug-ins are located via a {@link ServiceLoader}, using the same class path as annotation processors (i.e. {@link StandardLocation#ANNOTATION_PROCESSOR_PATH ANNOTATION_PROCESSOR_PATH} or{@code -processorpath}).
It is expected that a typical plug-in will simply register a {@link TaskListener} to be informed of events during the executionof the compilation, and that the rest of the work will be done by the task listener. @since 1.8
This add-on will be called after the default bean generation has finished. @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) @since JAXB RI 2.0 EA
This add-on will be called after the default bean generation has finished. @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) @since JAXB RI 2.0 EA
init()
(destroy()
) method is called when the underlying module is initialized (destroyed).
@see de.odysseus.calyxo.control.PluginContext
@author Christoph Beck
To create a plugin do the following:
myplugin.MyPlugin
.MyPlugin.jar
. plugin
directory of your TV-Browser installation. Up until Hudson 1.150 or something, subclasses of {@link Plugin} required@plugin javadoc annotation, but that is no longer a requirement. @author Kohsuke Kawaguchi @since 1.42
All plug-in must extend this class (directly or not) and implement its methods to be usable by the software. @author Schnell Michaël @version 1.0
com.company.plugins.imagedb
in case of an image database.listImages()
com.company.plugins.imagedb.impl
. The impl-name is not required, but should be kept as a convention. In the future there might exist tools that depend on it, or work better with it. If you have multiple implementations, create several sub-packages within the impl folder. In our example case, this could be the implementations impl.simple
(for a simple test implementation), impl.distributed
(for our distributed image storage) and impl.compatiblity
(for the old DB API)impl
folder.addPluginsFrom()
and getPlugin()
).A plugin implements some specific functionality to extend the log4j framework. Each plugin is associated with a specific LoggerRepository, which it then uses/acts upon. The functionality of the plugin is up to the developer.
Examples of plugins are Receiver and Watchdog. Receiver plugins allow for remote logging events to be received and processed by a repository as if the event was sent locally. Watchdog plugins allow for a repository to be reconfigured when some "watched" configuration data changes. @author Mark Womack (mwomack@apache.org) @author Nicko Cadell @author Paul Smith (psmith@apache.org)
A plugin implements some specific functionality to extend the log4j framework. Each plugin is associated with a specific LoggerRepository, which it then uses/acts upon. The functionality of the plugin is up to the developer.
Examples of plugins are Receiver and Watchdog. Receiver plugins allow for remote logging events to be received and processed by a repository as if the event was sent locally. Watchdog plugins allow for a repository to be reconfigured when some "watched" configuration data changes.
@author Mark Womack
<plugin>
element contains informations required for a plugin.
@version $Revision$ $Date$
A PlugIn is a configuration wrapper for a module-specific resource or service that needs to be notified about application startup and application shutdown events (corresponding to when the container calls init
and destroy
on the corresponding {@link ActionServlet} instance). PlugIn
objectscan be configured in the struts-config.xml
file, without the need to subclass {@link ActionServlet} simply to perform applicationlifecycle activities.
Implementations of this interface must supply a zero-argument constructor for use by {@link ActionServlet}. Configuration can be accomplished by providing standard JavaBeans property setter methods, which will all have been called before the init()
method is invoked.
This interface can be applied to any class, including an Action subclass.
@version $Rev: 421119 $ $Date: 2005-05-14 01:09:32 -0400 (Sat, 14 May 2005)$ @since Struts 1.1Because plug-ins form part of the model, yet use the model to initialize themselves, an untenable circular dependency exists. To overcome this problem, each concrete plug-in instance is wrapped inside a virtual proxy that delays plug-in initialization until somebody attempts to actually use the plug-in. Since code interested in interacting with a subset of the plug-ins will often need to query all of them to locate the ones it needs, certain identifier-methods are proxied through before the object's {@link #setBRJS setBRJS()} method has been invoked, which plug-in authors must be aware of.
Another consequence of wrapping all plug-ins in a virtual proxy is that the instanceof
operator and the Object.getClass()
method do not work as expected. The {@link #instanceOf instanceOf()} and {@link #getPluginClass} methods are provided to overcome these deficiencies.
The use of {@link PluginBase} is recommended for actual Implementation
MyPluginClass.getInstance()
will always return an initialized instance of MyPluginClass
. Constructors and life cycle methods
If the plugin.xml of a plug-in indicates <?eclipse version="3.0"?> and its prerequisite list includes org.eclipse.core.runtime
, the default constructor of the plug-in class is used and {@link #start(BundleContext)} and {@link #stop(BundleContext)} arecalled as life cycle methods.
If the plugin.xml of a plug-in indicates <?eclipse version="3.0"?> and its prerequisite list includes org.eclipse.core.runtime.compatibility
, the {@link #Plugin(IPluginDescriptor)}constructor is used and {@link #startup()} and {@link #shutdown()} are called as life cycle methods.Note that in this situation, start() is called before startup() and stop() is called after shutdown.
If the plugin.xml of your plug-in does not indicate <?eclipse version="3.0"?> it is therefore not a 3.0 plug-in. Consequently the {@link #Plugin(IPluginDescriptor)} is used and {@link #startup()} and {@link #shutdown()} are called as life cycle methods.
Since Eclipse 3.0 APIs of the Plugin class can be called only when the Plugin is in an active state, i.e., after it was started up and before it is shutdown. In particular, it means that Plugin APIs should not be called from overrides of {@link #Plugin()}.
A Plugin
represents an extension to Gradle. A plugin applies some configuration to a target object. Usually, this target object is a {@link org.gradle.api.Project}, but plugins can be applied to any type of objects.
[pluginDir] |-- plugin.xml |-- classes/ |-- lib/The classes and lib directory are optional. Any files in the classes directory will be added to the classpath of the plugin, as well as any JAR files in the lib directory. The plugin.xml file is required, and specifies the className of the Plugin implementation. The XML file should resemble the following XML:
<?xml version="1.0" encoding="UTF-8"?> <plugin> <class>org.example.YourPlugin</class> <name>Example Plugin</name> <description>This is an example plugin.</description> <author>Foo Inc.</author> <version>1.0</version> <minServerVersion>3.0.0</minServerVersion> <licenseType>gpl</licenseType> </plugin>Each plugin will be loaded in its own class loader, unless the plugin is configured with a parent plugin. Please see the Plugin Developer Guide (available with the Openfire documentation) for additional details about plugin development. @author Matt Tucker
Plugins have a lifecycle. In general, the lifecycle is this:
Plugins are called, and initialized, in the same order they are specified in the configuration.
The clientXXX, modelXXX, and sqlMapXXX methods are called by the code generators. If you replace the default code generators with other implementations, these methods may not be called. @author Jeff Butler @see PluginAdapter
org.sonar.api.Extension
interface to browse available extension points. The manifest property Plugin-Class
must declare the name of the implementation class. It is automatically set by sonar-packaging-maven-plugin when building plugins.
Structured after the model used by Maven. @author Alan Stewart @since 1.1
It specifies the latest version of the plugin as it would be installed IF the plugin were installed without specifying a version number. NOTE that this is NOT the same as being the most recent version of the plugin that is available. There may be newer milestone versions available OR newer versions that are only compatible with newer runtimes. Therefore this model provides two API for retrieving new versions:
This model represents both a published plugin as well as an in-place plugin. In-place plugins usually only have one child version (i.e the only version that is available), and this version is considered the latest version.
@author Nieraj Singh @author Andrew EisenbergUsing the 'id' attribute, plugins can be loaded by the {@link Plugins} class. Once a plugin is loaded, a corresponding {@link TransferSettings} object must be created and initialized. From the connection object, a {@link TransferManager} can then be used toupload/download files to the repository.
Per naming convention, plugins must end by the name Plugin and extend this class. Furthermore, all plugin classes must reside in a package org.syncany.plugins.plugin-id, where plugin-id is the identifier specified by {@link #getId()}.
@author Philipp C. Heckel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|