[josm-dev] Add nodes and ways via remoteControl

Bodo Meissner bodo at bodo-m.de
Sat Aug 21 18:14:33 BST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 20.08.2010 09:05, schrieb Sebastian Klein:

> Bodo Meissner wrote:

>> My latest changes to implement remote control for wmsplugin
>> made it impossible to change the default for an individual command. I
>> think I should change this.
>> I guess this will be an incompatible change, that means people who
>> update only remotecontrol but not wmsplugin will probably get a hard
>> error.
> 
> There will always be people who have an old version of remotecontrol and
> now install wmsplugin

This is the simple case. wmsplugin checks for a minimum version of remotecontrol and does not try to use it if it's too old.

> and vice versa.

This is the complicated case because I cannot know up to which version remotecontrol will be compatible with the current version of wmsplugin.
The current wmsplugin will try to use an incompatible newer version of remotecontrol and probably get an exception.
> 
> Imho a hard error (especially "class not found") is not an option. Wms
> should not give an error since it uses reflection to find and execute
> the handler register method of remotecontrol.

When I experimented with remotecontrol and wmsplugin I sometimes got NoSuchMethodException and JOSM suggested to disable the plugin, but sometimes JOSM simply hung.
I don't know how to avoid this hanging.

>> I will also implement a function to request the API version of the
>> remotecontrol plugin. So in future wmsplugin will not use
>> remotecontrol if it is too new.

I should have implemented a getVersion method with my first change, but now it's too late.
So I can avoid compatibility problems in future transitions but not for the next change.

> On the other hand remotecontrol should be able to handle multiple
> versions of the handler protocol or give a warning to the console, if
> the handler cannot be accepted for some reason.

My intention is that wmsplugin will use reflection to call the getVersion method. This will avoid any ClassNotFoundException when remotecontrol is not installed. Of course wmsplugin will call this method only if remotecontrol is loaded.
When remotecontrol returns a compatible version, wmsplugin will register its remote request handler, otherwise it will display a message that it cannot use remotecontrol.

> Sounds awfully complicated, but that's what you signed up for. :)

I think my solution is not that complicated but it will produce one incompatibility for the next transition as described above.


Bodo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkxwCXkACgkQnMz9fgzDSqfcUwCfcDzHEHlVK3nhnXc5W+1ZJDxs
J6AAn0srz+bT5ONZThG3k12IXNrosHCs
=BuIE
-----END PGP SIGNATURE-----



More information about the josm-dev mailing list