[josm-dev] wmsplugin improvements

Henrik Niehaus henrik.niehaus at gmx.de
Tue Sep 9 13:17:03 BST 2008


Hi,

yesterday I was using a WMS-Server, which randomly returned HTTP 500
(Internal Server Error). Unfortunately the wmsplugin failed quietly, so
I couldn't see, what was happening. So I made some improvements:

1. The wms grabber tries to download the image 5 times. If it fails the
5th time, a dummy image will be generated and rendered in the layer.
It's red with the black string "IOException occured", so that the user
knows, that this tile
failed to load and will not show up.

2. Check the Content-Type of the server response. If it isn't an image,
there must have been an exception. In this case the plugin prints the
response body to sysout. This happens after the 5th failed attempt to
download the image.

3. The grabbers are executed by an ExecutorService (FixedThreadPool with
size of 10), so that the number of
running threads is limited.

What do you think of these improvements?

Cheers
Henrik





More information about the josm-dev mailing list