Reviewing patch as I wait for a build, I could not apply it in eclipse 
as it looked like you used maven to create it?

Your patch was not quite as I imagined - it was still limited to the 
available datastores .. here is the complete example for your code review:
>     public static synchronized DataStore getDataStore(Map params) 
> throws IOException {
>         Iterator ps = 
> getServiceRegistry().getServiceProviders(DataStoreFactorySpi.class);
>         DataStoreFactorySpi fac;
>         while (ps.hasNext()) {
>             fac = (DataStoreFactorySpi) ps.next();
>             boolean canProcess = false;
>             try {
>                 canProcess = fac.canProcess(params);
>             } catch (Throwable t) {
>                 LOGGER.log( Level.WARNING, "Could not acquire 
> "+fac.getDisplayName()+":"+t, t );                
>                 // Protect against DataStores that don't carefully 
> code canProcess
>                 continue;
>             }
>             if (canProcess) {
>                 if( fac.isAvailable()){
>                     return fac.createDataStore(params);
>                 }
>                 else {
>                     throw new IOException( fac.getDisplayName()+" 
> should be used, but is not availble. Have you installed the required 
> drivers or jar files?");
>                 }
>             }
>         }
>         return null;
>     }
What this does:
- works on *all* factories regardless of if they "are available" or not
- records if the factory canProcess the request
- if the factory canProcess the request but is not avaialble a solid 
FactoryException is made
- if the factory canProcess the request and isAvaialble it is used to 
call create


Jody

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to