public abstract class AbstractPlugin extends SwingWorker<Void,Void> implements Plugin
SwingWorker
due to their unpredictable nature, so the support for
executing off the UI thread is built-in. That does not mean that plugin
is forced to utilize worker thread if it's operation is fast enough as to
not block the UI, though in general it is recommended a plugin does utilize
worker facilities. To run off the EDT a plugin must define its logic inside
SwingWorker.doInBackground()
(by overriding empty implementation), plus
optionally SwingWorker.done()
, and call SwingWorker.execute()
from main plugin
interface entry point. If a plugin is not utilizing non-blocking UI thread
(wants to run ON the EDT), then it should derive from AbstractPluginAdapter
instead simply implementing its logic directly in its interface entry point.SwingWorker.StateValue
Modifier and Type | Field and Description |
---|---|
protected Properties |
configuration |
Constructor and Description |
---|
AbstractPlugin() |
Modifier and Type | Method and Description |
---|---|
void |
initialize(Properties configuration)
Typically called immediately after instantiation to allow the plugin
proper initialization and certainly before its invocation.
|
addPropertyChangeListener, cancel, doInBackground, done, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgress
protected Properties configuration
public void initialize(Properties configuration)
Plugin
ConfigParameters.IMAGE_EXPORT_PLUGIN
is used to define the image upload strategy by specifying plugin's full
class path. Configuration settings for that plugin can be named freely
but must be prefixed with the plugin setting itself followed by
ConfigLoader.PARAM_SEPARATOR
. Another example: say fooPlug is
the setting for com.foo.Plug. Configuration setting bar for fooPlug
would would be defined as fooPlug.bar if dot is ConfigLoader.PARAM_SEPARATOR
.initialize
in interface Plugin
configuration
- plugin settings defined in the configuration fileCopyright © 2012-2013 Bambi Software Foundation. All Rights Reserved.