Hey guys,

I had to fix what I believe to be a bug in the WFS client to get it
working under OSGI (Apache Felix), and I wanted to share what I found
...  

 

I had to change the way that
org.geotools.data.wfs.protocol.wfs.WFSExtensions looks up the
WFSResponseParserFactory service.  Currently, the code is going straight
to the javax.imageio.spi.ServiceRegistry.  Looking around the code,
however, it seemed that other places were using the
org.geotools.factory.FactoryCreator class, which is a bit more clever
when it comes to mulit-classloader environments (such as OSGI).  I
modified the core logic into the getServiceProviders method to the
following:

 

                    FactoryRegistry factReg = new FactoryCreator( new
Class[]{WFSResponseParserFactory.class});

                    factReg.scanForPlugins();

                    Iterator<WFSResponseParserFactory> providers =
factReg.getServiceProviders(WFSResponseParserFactory.class, true);

                    registry = new HashSet<WFSResponseParserFactory>();

                    while (providers.hasNext()) {

                        WFSResponseParserFactory provider =
providers.next();

                        registry.add(provider);

                    }

 

This seems to solve the problem.  If you folks are happy with this
solution, I can create an issue and attach the new file (or a diff).

 

One other question with regards to the WFS library - in the code it's
under a module called "unsupported", but I don't seem to see anything on
the wiki regarding this module as unsupported.  Is this in fact an
unsupported module?  And if so, what does that mean exactly?

 

Thanks,

Nathan Mittler 

 

-
This message is intended only for the addressee and may contain information 
that is company confidential or privileged.  Any technical data in this message 
may be exported only in accordance with the U.S. International Traffic in Arms 
Regulations (22 CFR Parts 120-130) or the Export Administration Regulations (15 
CFR Parts 730-774). Unauthorized use is strictly prohibited and may be 
unlawful. If you are not the intended recipient, or the person responsible for 
delivering to the intended recipient, you should not read, copy, disclose or 
otherwise use this message. If you have received this email in error, please 
delete it, and advise the sender immediately. 
-                                                                               
                                                                                
                                                                                
        
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to