public abstract class ConsolePlugin extends Object implements Console.PropertyListener
To be recognized as a plugin, a subclass should be annotated with @Plugin.
The annotation can also be used to provide information about the plugin and some
configuration parameters.
A subclass should define a default constructor that will be called by the framework
to create a singleton instance. The life cycle hooks are initialize(),
start(), stop(), and shutdown(). When the graphical
console starts, all plugins annotated with loadAtStart=true (default)
are loaded, their initialize() methods are called, then their start()
methods are called. When the console shuts down, stop() and shutdown()
methods are called. In addition, the graphical console might provide a way for
the user to call start() and stop() methods interactively.
The services are implemented
by forwarding methods calls to the ConsolePluginServices instance set
for this plugin by the framework.
| Constructor and Description |
|---|
ConsolePlugin() |
| Modifier and Type | Method and Description |
|---|---|
Console |
getConsole()
Provides access to the graphical console subsystem.
|
ConsolePluginServices |
getServices()
Provides access to plugin services.
|
void |
initialize()
Called by the framework when the plugin is loaded.
|
void |
propertiesChanged(Object source,
Map<String,Object> changes)
Called by the framework when plugin properties are modified.
|
void |
setServicesProvider(ConsolePluginServices provider)
This method is called by the framework to initialize this plugin.
|
void |
shutdown()
Called by the framework when the graphical console is shut down.
|
void |
start()
Called by the framework when the console starts, after all plugins have been
loaded and initialized.
|
void |
stop()
Called by the framework when the console shuts down, before the call to
shutdown(). |
public final void setServicesProvider(ConsolePluginServices provider)
provider - ConsolePluginServices to be used by this plugin.UnsupportedOperationException - if called by client code.public void initialize()
public void start()
public void stop()
shutdown().
May also be called interactively through the graphical console GUI. In that
case, the method will not be called on the console shutdown unless the start()
method is invoked again.public void shutdown()
public void propertiesChanged(Object source, Map<String,Object> changes)
propertiesChanged in interface Console.PropertyListenersource - Source of notification.changes - For the changed properties, map of keys to their new values.public Console getConsole()
public ConsolePluginServices getServices()
ConsolePluginServices associated with this plugin.Copyright © 2016 LSST. All rights reserved.