Tcl Library Source Code

Documentation
Login
EuroTcl/OpenACS 11 - 12 JULY 2024, VIENNA


[ Main Table Of Contents | Table Of Contents | Keyword Index | Categories | Modules | Applications ]

NAME

pluginmgr - Manage a plugin

Table Of Contents

SYNOPSIS

package require Tcl 8.5 9
package require pluginmgr ?0.4?

::pluginmgr objectName ?option value...?
::pluginmgr::paths objectName name...
objectName method ?arg arg ...?
objectName clone
objectName configure
objectName configure option
objectName configure -option value...
objectName cget -option
objectName destroy
objectName do arg...
objectName interpreter
objectName plugin
objectName load string
objectName unload
objectName list
objectName path path
objectName paths

DESCRIPTION

This package provides commands and objects for the generic management of plugins which can be loaded into an application.

To avoid the implementation of yet another system to locate Tcl code the system provides by this package is built on top of the regular package management system. Each plugin is considered as a package and a simple invokation of package require is enough to locate and load it, if it exists. The only time we will need additional paths is when a plugin manager is part of a wrapped application and has to be able to search for plugins existing outside of that application. For this situation the package provides a command to create a general set of such paths based on names for the plugin manager and/or application in question.

The main contribution of this package is a generic framework which allows the easy declaration of

  1. How to translate a plugin name to the name of the package implementing it, and vice versa.

  2. The list of commands a plugin has to provide as API, and also of more complex checks as code.

  3. The list of commands expected by the plugin from the environment.

This then allows the easy generation of plugin managers customized to particular types of plugins for an application.

It should be noted that all plugin code is considered untrusted and will always be executed within a safe interpreter. The interpreter is enabled enough to allow plugins the loading of all additional packages they may need.

PUBLIC API

PACKAGE COMMANDS

OBJECT COMMAND

All commands created by the command ::pluginmgr (See section PACKAGE COMMANDS) have the following general form and may be used to invoke various operations on their plugin manager object.

OBJECT METHODS

OBJECT CONFIGURATION

All plugin manager objects understand the following configuration options:

Bugs, Ideas, Feedback

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category pluginmgr of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.

When proposing code changes, please provide unified diffs, i.e the output of diff -u.

Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar.

KEYWORDS

plugin management, plugin search

CATEGORY

Programming tools

COPYRIGHT

Copyright © 2005 Andreas Kupries