Global variable

Hi all,

I'd like to share a common BerkeleyDB environment among some custom nodes . Is it possible to share such common variable ?

If yes, how & when should I init/dispose this variable.

Many thanks !

What exactly do you mean by "sharing a common variable"? Is it just a simple Java variable? Plugin activators are a common place to store settings common to several nodes in a plugin. Have a look at e.g. the CDK or the R plugin.

The global variable would be a shared berkeley environment to store some data. Each distinct node in Knime would use this environment to create a temporary database. But I need to

1. create some kind of dialog to ask the user where the berkeley environment should store those data

2. initialize this environment on startup

3. dispose this environment on close

 

What I understand from your answer is I need to create another eclipse-oriented-plugin ? I do not know enough about the plugins for eclipse , is there any tutorial on the web I should read to write this plugin.

Many thanks

 

Pierre

No, you don't need an additonal plugin. You have to add an activator to your plugin. It has methods that are called once when the plugin is started and once when it is stopped. It also offers ways to store global settings, e.g. the path to the BDB. Again, have a look at our CDK or R plugin, they have activators that do very similar stuff. I don't know of any tutorial about this (which doesn't mean, there are none) but it is likely be described in the Eclipse documentation.

Thanks, looking at those sources was helpul