public abstract class ConsolePlugin extends Object
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 console starts, to initialize this plugin..
|
void |
propertiesChanged(Object source,
Map<String,Object> changes)
Called by the framework when plugin properties are modified.
|
boolean |
restore(ComponentDescriptor storageBean,
boolean lastRound)
Called by the framework to restore this plugin configuration.
|
ComponentDescriptor |
save()
Called by the framework when this plugin configuration needs to be saved.
|
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 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)
source - Source of notification.changes - For the changed properties, map of keys to their new values.public ComponentDescriptor save()
public boolean restore(ComponentDescriptor storageBean, boolean lastRound)
storageBean - JavaBean that holds configuration information.lastRound - True if this is the last call to this method, regardless of the return value.False if this method should be called again in the next round.public Console getConsole()
public ConsolePluginServices getServices()
ConsolePluginServices associated with this plugin.Copyright © 2023 LSST. All rights reserved.