From: Justin D. <jde...@op...> - 2008-12-24 17:26:48
|
Hi Andrea, This may not be relevant but have you considered attempting to implement your own FactoryIteratorProvider instance backed directly onto the Sextante plugin model. And then register it with FactoryIteratorProviders.addFactoryIteratorProvider(..). I tried this approach for spring before, loading factory plugins directly from a spring context. It worked but i had some issues using it in GeoServer. May be worth a shot. -Justin Andrea Aime wrote: > Hi, > I'm trying to integrate Sextante own pluin structure > with GeoTools own and... I'm having quite some difficulties. > > Long story short, Sextante has its own algorithm plugin > system based on a convention over configuration approach, > every class contained in a "sextante_*" jar ending with > *Algorithm is considered to be an algorithm. > I can get the list of algorithms from the Sextante utility > class, and wrap them into a GeoTools compliant ProcessFactory. > > And then I just want to add all of these process factories > to the GeoTools SPI using GeoTools.addProcessFactoryIterator. > That does not seem difficult, but it does not work at all. > > This seems to happen because the SPI subsystem expects > to have a different factory class returned each time > by the iterator, whilst I do have a single class, > whose instances wrap a different Sextante algorithm each time. > The net result of this discrepancy is that the SPI won't > accept more than one factory class around, and thus I > end up with only one Sextante process instead of the 200+ > I was expecting. > > It seems the problem is structural, and I definitely won't > create a different wrapper for each item in the growing set > of Sextante algorithms... > It seems to me I will have to abandon this road and > deal with these discrepancies in GeoServer explicitly. > Unless someone has any good idea to share? > > Cheers > Andrea > > PS: in GeoServer we use this "parametrized class" approach > quite a bit for output formats and the like, and works > quite well (e.g., all XML output formats are actually > created using a handful of classes configured with different > paramters). I'm a bit suprised the GeoTools SPI > requires a different class for each factory (hopefully I'm > just mis-diagnosing the situation?) > -- Justin Deoliveira OpenGeo - http://opengeo.org Enterprise support for open source geospatial. |