[Geoserver-devel] h2 datastore

Hi all,

So as many know i have been working with an H2 datastore for the wfs 1.1 cite stuff. Hooking it up in geoserver lead to a requirement to be able to store the datastore files in the data directory. To do this i needed to supplement the data store factory with knowledge about the geoserver data directory.

I had a couple of options to do this:

1. Use the DataStoreInfo.getParams hack

This involves naming the parameter something that ends in "url" and setting its value to "file:/...".

2. Plug into the Geotools factory service provider stuff to allow data store factories to be loaded from spring.

1 is a pretty brittle hack, and it bleeds into the configuration page which I think make it confusing. So i did not go with it.

2 was a dismal failure. I managed to plug into the geotools, but it lead to a circular dependency at start up time. I had neither the smarts or patience to debugg the geotools factory loading process so i forgot about that.

So what I did do was come up with another GeoServer extension point:

org.geoserver.data.DataStoreFactoryInitializer (data module)

it basically gets invoked when ever a data store factory is instantiated (from DataStoreUtils) to do any post initialization, and it works!!

I know that I should have probably discussed this before committing, but i am on a tight deadline for the wfs 1.1 xlink cite deliverable, and its a pretty non-invasive solution, so i dont forsee any huge issues with it.

Please review, its commits 8634 and 8635. If there are any problem I can modify / back out or whatever.

-Justin

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

Justin Deoliveira wrote:

So what I did do was come up with another GeoServer extension point:

org.geoserver.data.DataStoreFactoryInitializer (data module)

it basically gets invoked when ever a data store factory is instantiated (from DataStoreUtils) to do any post initialization, and it works!!

I know that I should have probably discussed this before committing, but i am on a tight deadline for the wfs 1.1 xlink cite deliverable, and its a pretty non-invasive solution, so i dont forsee any huge issues with it.

Please review, its commits 8634 and 8635. If there are any problem I can modify / back out or whatever.
  

I am interested in this as it points out a "hole" in the DataStoreFactory api; ie the need for a hook for extra. What exactly did you need to do? Set a few bean properties on the Factory?

Jody