#include <Libs/PluginFramework/ctkPluginFrameworkLauncher.h>
Sets up and starts the CTK Plugin Framework.
This is a convenience class to start an instance of the CTK Plugin Framework and to install and start plugins.
Definition at line 45 of file ctkPluginFrameworkLauncher.h.
◆ addSearchPath()
static void ctkPluginFrameworkLauncher::addSearchPath |
( |
const QString & |
searchPath, |
|
|
bool |
addToPathEnv = true |
|
) |
| |
|
static |
◆ appendPathEnv()
static void ctkPluginFrameworkLauncher::appendPathEnv |
( |
const QString & |
path | ) |
|
|
static |
This is a utility method to append a path to the PATH environment variable on Windows platforms.
This method does nothing on non-Windows platforms.
- Parameters
-
path | The path to be appended to PATH |
◆ getPluginContext()
Get the plugin context for the Plugin Framework.
- Returns
- The context associated to the Plugin Framework, or
null
if the framework has not been initialized yet.
◆ getPluginFramework()
static QSharedPointer<ctkPluginFramework> ctkPluginFrameworkLauncher::getPluginFramework |
( |
| ) |
|
|
static |
Get the Plugin Framework:
- Returns
- The initialized Plugin Framework, or
null
if the framework has not been initialized yet.
◆ getPluginPath()
static QString ctkPluginFrameworkLauncher::getPluginPath |
( |
const QString & |
symbolicName | ) |
|
|
static |
Get the full path (including the file name) to the plugin with the given symbolic name.
The paths given by calls to addSearchPath(const QString&, bool) are searched for a shared library with a base name equaling symbolicName
.
- Parameters
-
symbolicName | The symbolic name of the plugin to find. |
- Returns
- The full path (including the file name) to the plugin (shared library) or a null QString if the plugin was not found.
◆ getPluginSymbolicNames()
static QStringList ctkPluginFrameworkLauncher::getPluginSymbolicNames |
( |
const QString & |
searchPath | ) |
|
|
static |
Get a list of symbolic names for the plugins in searchPath
.
The symbolic names are deduced from the shared libraries found in searchPath
, which may not represent loadable CTK plugins.
- Parameters
-
searchPath | The path to look for plugins. |
- Returns
- A list of potential plugin symbolic names.
◆ install()
static long ctkPluginFrameworkLauncher::install |
( |
const QString & |
symbolicName, |
|
|
ctkPluginContext * |
context = 0 |
|
) |
| |
|
static |
Install the plugin with the given symbolic name using the provided ctkPluginContext
.
This method instantiates and initializes an instance of a ctkPluginFramework object, if no plugin context is provided and if there is no framework already initialized.
The plugin is searched in the paths previously given by calls to addSearchPath(const QString&, bool) and in the default CTK plugin installation path.
- Parameters
-
symbolicName | The symbolic name of the plugin to install. |
context | The plugin context used for installing the plugin. |
- Returns
- The plugin id if the plugin was found and successfully installed,
-1
otherwise.
◆ resolve() [1/2]
static void ctkPluginFrameworkLauncher::resolve |
( |
| ) |
|
|
static |
◆ resolve() [2/2]
static void ctkPluginFrameworkLauncher::resolve |
( |
const QSharedPointer< ctkPlugin > & |
plugin | ) |
|
|
static |
Resolve the given plug-in.
This method tries to resolv the given plug-in. In case of an error, a framework event of type ctkPluginFrameworkEvent::PLUGIN_ERROR is send.
- Parameters
-
plugin | The plug-in to be resolved. |
◆ run() [1/2]
static QVariant ctkPluginFrameworkLauncher::run |
( |
const QVariant & |
argument | ) |
|
|
static |
Runs the application for which the platform was started. The platform must be running.
The given argument is passed to the application being run. If it is null
then the command line arguments used in starting the platform, and not consumed by the platform code, are passed to the application as a String[]
.
- Parameters
-
argument | the argument passed to the application. May be null |
- Returns
- the result of running the application
- Exceptions
-
std::exception | if anything goes wrong |
◆ run() [2/2]
static QVariant ctkPluginFrameworkLauncher::run |
( |
QRunnable * |
endSplashHandler = NULL , |
|
|
const QVariant & |
argument = QVariant() |
|
) |
| |
|
static |
Launches the platform and runs a single application. The application is either identified in the given arguments (e.g., -application <app id>) or in the eclipse.application
System property. This convenience method starts up the platform, runs the indicated application, and then shuts down the platform. The platform must not be running already.
- Parameters
-
endSplashHandler | the block of code to run to tear down the splash screen or null if no tear down is required |
argument | the argument passed to the application. Default is QVariant(). |
- Returns
- the result of running the application
- Exceptions
-
Exception | if anything goes wrong |
◆ setFrameworkProperties()
static void ctkPluginFrameworkLauncher::setFrameworkProperties |
( |
const ctkProperties & |
props | ) |
|
|
static |
Specify the set of framework properties to be used when initializing the Plugin Framework.
If the framework has already been initialized by a call to install or start, the new properties do not have any effect until the framework is restarted.
- Parameters
-
props | The initial Plugin Framework properties. |
◆ shutdown()
static void ctkPluginFrameworkLauncher::shutdown |
( |
| ) |
|
|
static |
Shuts down the Platform. The state of the Platform is not automatically saved before shutting down.
On return, the Platform will no longer be running (but could be re-launched with another call to startup). If relaunching, care must be taken to reinitialize any System properties which the platform uses (e.g., osgi.instance.area) as some policies in the platform do not allow resetting of such properties on subsequent runs.
Any objects handed out by running Platform, including Platform runnables obtained via getRunnable, will be permanently invalid. The effects of attempting to invoke methods on invalid objects is undefined.
- Exceptions
-
std::exception | if anything goes wrong |
◆ start()
This method instantiates, initializes, and starts an instance of a ctkPluginFramework object, if no plugin context is provided and if there is no framework already running. It then installs and starts the plugin with the given symbolic name (if not empty).
If a symbolic name is given, the plugin is searched in the paths previously given by calls to addSearchPath(const QString&, bool) and in the default CTK plugin installation path and is started using the given options
.
If a plugin context is provided, this context is used to install the plugin, otherwise the Plugin Framework context is used.
- Parameters
-
symbolicName | The symbolic name of the plugin to install. |
options | The options used to start the plugin. |
context | The plugin context to use for installing the plugin. |
- Returns
true
if the plugin was found and successfully installed, false
otherwise.
- See also
- ctkPlugin::StartOptions
◆ startup()
static ctkPluginContext* ctkPluginFrameworkLauncher::startup |
( |
QRunnable * |
endSplashHandler | ) |
|
|
static |
Starts the platform and sets it up to run a single application. The application is either identified in the given arguments (e.g., -application <app id>) or in the eclipse.application
System property. The platform must not be running already.
The given runnable (if not null
) is used to tear down the splash screen if required.
- Parameters
-
args | the arguments passed to the application |
- Returns
- BundleContext the context of the system bundle
- Exceptions
-
Exception | if anything goes wrong |
◆ stop()
static bool ctkPluginFrameworkLauncher::stop |
( |
const QString & |
symbolicName = QString() , |
|
|
ctkPlugin::StopOptions |
options = 0 , |
|
|
ctkPluginContext * |
context = 0 |
|
) |
| |
|
static |
This method either stops the plug-in with the given symbolicName
using the supplied stop options options
or the complete framework (if symbolicName
is empty).
If a plugin context is provided, this context is used to find the plug-in, otherwise the Plugin Framework context is used.
- Parameters
-
symbolicName | The symbolic name of the plugin to stop. |
options | The options used to stop the plugin. |
context | The plugin context to use for finding the plugin. |
- Returns
true
if the plugin was found and successfully stopped or the complete framework was successfully stopped, false
otherwise.
- See also
- ctkPlugin::StopOptions
◆ PROP_ALLOW_APPRELAUNCH
const QString ctkPluginFrameworkLauncher::PROP_ALLOW_APPRELAUNCH |
|
static |
◆ PROP_APPLICATION_LAUNCHDEFAULT
const QString ctkPluginFrameworkLauncher::PROP_APPLICATION_LAUNCHDEFAULT |
|
static |
◆ PROP_ARCH
const QString ctkPluginFrameworkLauncher::PROP_ARCH |
|
static |
◆ PROP_CONFIG_AREA
const QString ctkPluginFrameworkLauncher::PROP_CONFIG_AREA |
|
static |
◆ PROP_CONFIG_AREA_DEFAULT
const QString ctkPluginFrameworkLauncher::PROP_CONFIG_AREA_DEFAULT |
|
static |
◆ PROP_CONSOLE
const QString ctkPluginFrameworkLauncher::PROP_CONSOLE |
|
static |
◆ PROP_CONSOLE_LOG
const QString ctkPluginFrameworkLauncher::PROP_CONSOLE_LOG |
|
static |
◆ PROP_DEBUG
const QString ctkPluginFrameworkLauncher::PROP_DEBUG |
|
static |
◆ PROP_DEV
const QString ctkPluginFrameworkLauncher::PROP_DEV |
|
static |
◆ PROP_EXITCODE
const QString ctkPluginFrameworkLauncher::PROP_EXITCODE |
|
static |
◆ PROP_EXITDATA
const QString ctkPluginFrameworkLauncher::PROP_EXITDATA |
|
static |
◆ PROP_HOME_LOCATION_AREA
const QString ctkPluginFrameworkLauncher::PROP_HOME_LOCATION_AREA |
|
static |
◆ PROP_IGNOREAPP
const QString ctkPluginFrameworkLauncher::PROP_IGNOREAPP |
|
static |
◆ PROP_INSTALL_AREA
const QString ctkPluginFrameworkLauncher::PROP_INSTALL_AREA |
|
static |
◆ PROP_INSTANCE_AREA
const QString ctkPluginFrameworkLauncher::PROP_INSTANCE_AREA |
|
static |
◆ PROP_INSTANCE_AREA_DEFAULT
const QString ctkPluginFrameworkLauncher::PROP_INSTANCE_AREA_DEFAULT |
|
static |
◆ PROP_NOSHUTDOWN
const QString ctkPluginFrameworkLauncher::PROP_NOSHUTDOWN |
|
static |
◆ PROP_OS
const QString ctkPluginFrameworkLauncher::PROP_OS |
|
static |
◆ PROP_OSGI_RELAUNCH
const QString ctkPluginFrameworkLauncher::PROP_OSGI_RELAUNCH |
|
static |
◆ PROP_PLUGINS
const QString ctkPluginFrameworkLauncher::PROP_PLUGINS |
|
static |
◆ PROP_PLUGINS_START_OPTIONS
const QString ctkPluginFrameworkLauncher::PROP_PLUGINS_START_OPTIONS |
|
static |
◆ PROP_SHARED_CONFIG_AREA
const QString ctkPluginFrameworkLauncher::PROP_SHARED_CONFIG_AREA |
|
static |
◆ PROP_USER_AREA
const QString ctkPluginFrameworkLauncher::PROP_USER_AREA |
|
static |
◆ PROP_USER_AREA_DEFAULT
const QString ctkPluginFrameworkLauncher::PROP_USER_AREA_DEFAULT |
|
static |
◆ PROP_USER_DIR
const QString ctkPluginFrameworkLauncher::PROP_USER_DIR |
|
static |
◆ PROP_USER_HOME
const QString ctkPluginFrameworkLauncher::PROP_USER_HOME |
|
static |
The documentation for this class was generated from the following file: