[Opensim-dev] Robust dynamic connector plugins...
James Hughes
jamesh at bluewallgroup.com
Tue Oct 23 21:36:40 UTC 2012
I am pushing my work for dynamic plugins to a branch for evaluation.
This is a working prototype and currently works only with Robust at this
stage.
Here is the list of current features...
*dynamic/modular configuration - The application will look in the
default ini for its configuration section. If none is found, it will
look in a named directory for its modular config file. If no file is
found, it will, then, look in a url provided in the module for a
"bootstrap" ini that will be downloaded and written to the specified ini.
*remote repositories - Remote repositories may be managed from the
console. A repository may be added, enabled, disabled or removed. When a
registered repository is enabled, suitable plugins for the application
will be listed when searching for available plugins.
*dynamic plugins - Registering a repository and searching for available
plugins will list possible candidates for extending the application. The
plugins may be added and removed from the application. After adding a
plugin to the application, it may enabled or disabled. It's meta data
may also be viewed. Plugins contained in the local ./bin directory are
immediately available, but should not be included in the
ServiceConnectors list.
Other possibilities include managing plugins by categories and
management by version,
I needed to add an interface for the mono-addins extension type and to
be able to send the plugins our main IConfigSource. It should be
possible to use the existing IServiceConnector for this, but it would
make several changes to the existing framework - such as eliminating the
ServiceConnectors line in the Robust.ini and eliminating the
parametrized constructor in existing work. I opted to add the interface
instead, at least for the prototype. For my work, I would have no
problems breaking the current framework to use the single interface, but
I won't make that call on my own. And I have no issues with using the
specific interface for dynamic plugins either. It works OK, The only
drawback that I have encountered so-far is this: you cannot add a
dynamic plugin to the ServiceConnectors list in the ini or they will try
to load twice.
The work was done in two stages. First was the support for modular
configuration. The virtual methods added to ServerConnector are related
to this.
The second stage was adding the support for plugins.
I have been merging master with this as of f7dcd3300837f Fri Oct 19
03:12:58 2012 +0100 .
** Testing:
get the code: OpenSim repo - connector_plugin branch
Build the code as usual and run an instance of Robust on a convenient
port. Note RegistryLocation and ConfigDirectory in the [Startup] section
of your Robust.ini and set them appropriately.
see the commands with "help repository" and "help plugin"
I have setup an example repository that can be used for testing. Add it
with...
repo add http://bluewallvirtual.com/plugins
Then, look for available plugins with...
plugin list available
Then, add a plugin...
plugin add 0
Then, you can enable the plugin to have it get the bootstrap ini...
plugin enable 0
At this point, the plugin will be disabled by configuration, so disable
it in the console...
plugin disable 0
Now find your new configuration file and edit it for your needs. When
you have finished editing your ini enable the plugin...
plugin enable 0
Now you should be able to use it. You can also see the meta data...
plugin info 0
You can check the state of your installed plugins...
plugin list installed
Your plugin will show: 0) [ ] ...
plugin disable 0
plugin list installed
Your plugin will show: 0) [X] ...
You can remove the plugin...
plugin remove 0
Source for the example plugins is at http://github.com/BlueWall
Config file: http://bluewallvirtual.com/configs/SlipStream.Example.xml
To make a repository...
1) Prepare a place to serve your configs and repository on your web server
2) Edit the meta data and the ConfigURL property in SlipStreamConnector.cs
3) Build your plugin in the addon-modules directory like a region module
4) Pack the dll: mautil p bin/MyPlugin.dll
5) Copy all packed files to a directory, then cd to that directory
6) Build the repo: mautil rb ./
7) Copy the directory contents to your repository on your web server
8) Copy config xml to your config url on your web server
Clean your registry by deleting the directory pointed to in
"RegistryLocation" in your Robust.ini. You're all set.
Hopefully this covers enough ground to get started. I think there would
be no issues with existing code moving it to master after some
discussion, then we could get more people to look at it and iron out any
wrinkles. When it is stable, then we can use the framework in the region
server (which is about 85-90% there) to have dynamic region modules too
in our next release.
Thanks!
-BlueWall
More information about the Opensim-dev
mailing list