|
There seems to be a structural problem within WMSCoverageReader that prevents multi threaded rendering of one WMSLayer instance.
I try to achieve some kind of tiling using a swing viewer. So I have exactly one MapContent instance with one WMSLayer object within it. Now multiple threads are painting the tiles. The problem arises within getMap in WMSCoverageReader. ... ReferencedEnvelope gridEnvelope = initMapRequest(requestedEnvelope, width, height, backgroundColor);
// issue the request and wrap response in a grid coverage InputStream is = null; try { if(LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Issuing request: " + mapRequest.getFinalURL()); }
GetMapResponse response = wms.issueRequest(mapRequest);
initMapRequest sets the instance variable mapRequest, which is used to fire the web request itself (wms.issueRequest). Because of multiple threads are using one instance of WMSLayer they using one instance of WMSCoverageReader.
This introduces multithreading collisions (One thread uses the mapRequest of another). After using the mapRequest (initialized from initMapRequest) directly, the problems went away.
|