Well Cory, that tip saved the day, thanks! That bugfix is how I think the MemoryService should behave between sessions. A bonus for that bug was that I now know a lot more about Catalog =) So, all problems solved, life is good again...
Jonas On Sun, 2006-04-02 at 00:48 -0800, [EMAIL PROTECTED] wrote: > Quoting Jonas Johansson <[EMAIL PROTECTED]>: > > Sorry for asking so many questions... > > I am trying to remove my IService (which is a MemoryServiceImpl) in the > > stop() method of my plug-in using the method > > CatalogPlugin.getDefault().getLocalCatalog().remove(iService); > > But the MemoryServiceImpl still shows up in the catalog in the next > > session. What am I doing wrong here? More detail below. > > > > I got the IService in the first place by calling: > > IGeoResource geoResource = > > CatalogPlugin.getDefault().getLocalCatalog().createTemporaryResource(bufferType); > > iService = geoResource.parent(new NullProgressMonitor()); > > > > In the stop() method I do: > > CatalogPlugin.getDefault().getLocalCatalog().remove(iService); > > > > While debugging, it appears that the Catalog is at least trying to > > remove the IService but I don't understand exactly what happens in the > > internals of Catalog. No exception is thrown as far as I can see, so I > > don't see what is going wrong here. So why does it still show up in the > > next session if it was removed? > > Hi Jonas, > > Questions are good :) > > I believe this issue has been resolved on trunk. As for the memory service > persisting in the catalog, my guess would be that the layer itself hasn't been > removed and its instantiation on startup automatically adds it to the catalog > again. > > For sample code, see the dispose() method in the MapEditor: > http://svn.geotools.org/udig/trunk/plugins/net.refractions.udig.project.ui/src/net/refractions/udig/project/ui/internal/MapEditor.java > > Original bug here: > http://jira.codehaus.org/browse/UDIG-700 > > Cheers, > Cory. > > _______________________________________________ > User-friendly Desktop Internet GIS (uDig) > http://udig.refractions.net > http://lists.refractions.net/mailman/listinfo/udig-devel _______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel